diff --git a/acinclude.m4 b/acinclude.m4 index b91c6905538..e94304649fb 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1062,24 +1062,28 @@ AC_DEFUN([MYSQL_CHECK_BDB_VERSION], [ test -z "$db_patch" && db_patch=0 # This is ugly, but about as good as it can get - mysql_bdb= - if test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 3 - then - mysql_bdb=h - elif test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 9 - then - want_bdb_version="3.2.9a" # hopefully this will stay up-to-date - mysql_bdb=a - fi +# mysql_bdb= +# if test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 3 +# then +# mysql_bdb=h +# elif test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 9 +# then +# want_bdb_version="3.2.9a" # hopefully this will stay up-to-date +# mysql_bdb=a +# fi - if test -n "$mysql_bdb" && \ - grep "DB_VERSION_STRING.*:.*$mysql_bdb: " [$1] > /dev/null - then - bdb_version_ok=yes - else - bdb_version_ok="invalid version $db_major.$db_minor.$db_patch" - bdb_version_ok="$bdb_version_ok (must be version 3.2.3h or $want_bdb_version)" - fi +dbl RAM: +want_bdb_version="4.1.24" +bdb_version_ok=yes + +# if test -n "$mysql_bdb" && \ +# grep "DB_VERSION_STRING.*:.*$mysql_bdb: " [$1] > /dev/null +# then +# bdb_version_ok=yes +# else +# bdb_version_ok="invalid version $db_major.$db_minor.$db_patch" +# bdb_version_ok="$bdb_version_ok (must be version 3.2.3h or $want_bdb_version)" +# fi ]) AC_DEFUN([MYSQL_TOP_BUILDDIR], [ diff --git a/bdb/LICENSE b/bdb/LICENSE index 32cc483d68a..1cd727bfd98 100644 --- a/bdb/LICENSE +++ b/bdb/LICENSE @@ -1,5 +1,5 @@ /*- - * $Id: LICENSE,v 11.7 2000/11/01 20:35:49 bostic Exp $ + * $Id: LICENSE,v 11.9 2002/01/11 15:51:10 bostic Exp $ */ The following is the license that applies to this copy of the Berkeley DB @@ -10,7 +10,7 @@ Web at http://www.sleepycat.com. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /* - * Copyright (c) 1990-2000 + * Copyright (c) 1990-2002 * Sleepycat Software. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/bdb/btree/bt_compare.c b/bdb/btree/bt_compare.c index 91481c31366..cbe2a1a7170 100644 --- a/bdb/btree/bt_compare.c +++ b/bdb/btree/bt_compare.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -43,7 +43,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_compare.c,v 11.12 2000/10/26 19:00:28 krinsky Exp $"; +static const char revid[] = "$Id: bt_compare.c,v 11.17 2002/03/27 04:30:42 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -51,8 +51,8 @@ static const char revid[] = "$Id: bt_compare.c,v 11.12 2000/10/26 19:00:28 krins #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" /* * __bam_cmp -- @@ -92,7 +92,7 @@ __bam_cmp(dbp, dbt, h, indx, func, cmpp) case P_LBTREE: case P_LDUP: case P_LRECNO: - bk = GET_BKEYDATA(h, indx); + bk = GET_BKEYDATA(dbp, h, indx); if (B_TYPE(bk->type) == B_OVERFLOW) bo = (BOVERFLOW *)bk; else { @@ -125,7 +125,7 @@ __bam_cmp(dbp, dbt, h, indx, func, cmpp) return (0); } - bi = GET_BINTERNAL(h, indx); + bi = GET_BINTERNAL(dbp, h, indx); if (B_TYPE(bi->type) == B_OVERFLOW) bo = (BOVERFLOW *)(bi->data); else { @@ -136,7 +136,7 @@ __bam_cmp(dbp, dbt, h, indx, func, cmpp) } break; default: - return (__db_pgfmt(dbp, PGNO(h))); + return (__db_pgfmt(dbp->dbenv, PGNO(h))); } /* diff --git a/bdb/btree/bt_conv.c b/bdb/btree/bt_conv.c index fd30f375f7c..4264b62ffdd 100644 --- a/bdb/btree/bt_conv.c +++ b/bdb/btree/bt_conv.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_conv.c,v 11.6 2000/03/31 00:30:26 ubell Exp $"; +static const char revid[] = "$Id: bt_conv.c,v 11.13 2002/08/06 06:11:12 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -16,20 +16,21 @@ static const char revid[] = "$Id: bt_conv.c,v 11.6 2000/03/31 00:30:26 ubell Exp #endif #include "db_int.h" -#include "db_page.h" -#include "db_swap.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/db_swap.h" +#include "dbinc/btree.h" /* * __bam_pgin -- * Convert host-specific page layout from the host-independent format * stored on disk. * - * PUBLIC: int __bam_pgin __P((DB_ENV *, db_pgno_t, void *, DBT *)); + * PUBLIC: int __bam_pgin __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *)); */ int -__bam_pgin(dbenv, pg, pp, cookie) +__bam_pgin(dbenv, dummydbp, pg, pp, cookie) DB_ENV *dbenv; + DB *dummydbp; db_pgno_t pg; void *pp; DBT *cookie; @@ -38,12 +39,12 @@ __bam_pgin(dbenv, pg, pp, cookie) PAGE *h; pginfo = (DB_PGINFO *)cookie->data; - if (!pginfo->needswap) + if (!F_ISSET(pginfo, DB_AM_SWAP)) return (0); h = pp; return (TYPE(h) == P_BTREEMETA ? __bam_mswap(pp) : - __db_byteswap(dbenv, pg, pp, pginfo->db_pagesize, 1)); + __db_byteswap(dbenv, dummydbp, pg, pp, pginfo->db_pagesize, 1)); } /* @@ -51,11 +52,12 @@ __bam_pgin(dbenv, pg, pp, cookie) * Convert host-specific page layout to the host-independent format * stored on disk. * - * PUBLIC: int __bam_pgout __P((DB_ENV *, db_pgno_t, void *, DBT *)); + * PUBLIC: int __bam_pgout __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *)); */ int -__bam_pgout(dbenv, pg, pp, cookie) +__bam_pgout(dbenv, dummydbp, pg, pp, cookie) DB_ENV *dbenv; + DB *dummydbp; db_pgno_t pg; void *pp; DBT *cookie; @@ -64,12 +66,12 @@ __bam_pgout(dbenv, pg, pp, cookie) PAGE *h; pginfo = (DB_PGINFO *)cookie->data; - if (!pginfo->needswap) + if (!F_ISSET(pginfo, DB_AM_SWAP)) return (0); h = pp; return (TYPE(h) == P_BTREEMETA ? __bam_mswap(pp) : - __db_byteswap(dbenv, pg, pp, pginfo->db_pagesize, 0)); + __db_byteswap(dbenv, dummydbp, pg, pp, pginfo->db_pagesize, 0)); } /* @@ -93,6 +95,8 @@ __bam_mswap(pg) SWAP32(p); /* re_len */ SWAP32(p); /* re_pad */ SWAP32(p); /* root */ + p += 92 * sizeof(u_int32_t); /* unused */ + SWAP32(p); /* crypto_magic */ return (0); } diff --git a/bdb/btree/bt_curadj.c b/bdb/btree/bt_curadj.c index 011acd2f4a1..50d3d422e49 100644 --- a/bdb/btree/bt_curadj.c +++ b/bdb/btree/bt_curadj.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_curadj.c,v 11.20 2001/01/17 16:15:49 bostic Exp $"; +static const char revid[] = "$Id: bt_curadj.c,v 11.30 2002/07/03 19:03:48 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -16,9 +16,8 @@ static const char revid[] = "$Id: bt_curadj.c,v 11.20 2001/01/17 16:15:49 bostic #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" -#include "txn.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" static int __bam_opd_cursor __P((DB *, DBC *, db_pgno_t, u_int32_t, u_int32_t)); @@ -203,10 +202,9 @@ __bam_ca_di(my_dbc, pgno, indx, adjust) } MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); - if (found != 0 && DB_LOGGING(my_dbc)) { - if ((ret = __bam_curadj_log(dbenv, - my_dbc->txn, &lsn, 0, dbp->log_fileid, - DB_CA_DI, pgno, 0, 0, adjust, indx, 0)) != 0) + if (found != 0 && DBC_LOGGING(my_dbc)) { + if ((ret = __bam_curadj_log(dbp, my_dbc->txn, + &lsn, 0, DB_CA_DI, pgno, 0, 0, adjust, indx, 0)) != 0) return (ret); } @@ -234,8 +232,13 @@ __bam_opd_cursor(dbp, dbc, first, tpgno, ti) * Allocate a new cursor and create the stack. If duplicates * are sorted, we've just created an off-page duplicate Btree. * If duplicates aren't sorted, we've just created a Recno tree. + * + * Note that in order to get here at all, there shouldn't be + * an old off-page dup cursor--to augment the checking db_c_newopd + * will do, assert this. */ - if ((ret = __db_c_newopd(dbc, tpgno, &dbc_nopd)) != 0) + DB_ASSERT(orig_cp->opd == NULL); + if ((ret = __db_c_newopd(dbc, tpgno, orig_cp->opd, &dbc_nopd)) != 0) return (ret); cp = (BTREE_CURSOR *)dbc_nopd->internal; @@ -321,17 +324,16 @@ loop: MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); return (ret); if (my_txn != NULL && dbc->txn != my_txn) found = 1; - /* We released the MUTEX to get a cursor, start over. */ + /* We released the mutex to get a cursor, start over. */ goto loop; } MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); } MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); - if (found != 0 && DB_LOGGING(my_dbc)) { - if ((ret = __bam_curadj_log(dbenv, - my_dbc->txn, &lsn, 0, dbp->log_fileid, - DB_CA_DUP, fpgno, tpgno, 0, first, fi, ti)) != 0) + 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); } return (0); @@ -372,8 +374,16 @@ loop: MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { orig_cp = (BTREE_CURSOR *)dbc->internal; + /* + * A note on the orig_cp->opd != NULL requirement here: + * it's possible that there's a cursor that refers to + * the same duplicate set, but which has no opd cursor, + * because it refers to a different item and we took + * care of it while processing a previous record. + */ if (orig_cp->pgno != fpgno || orig_cp->indx != first || + orig_cp->opd == NULL || ((BTREE_CURSOR *)orig_cp->opd->internal)->indx != ti) continue; @@ -383,7 +393,7 @@ loop: MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); orig_cp->opd = NULL; orig_cp->indx = fi; /* - * We released the MUTEX to free a cursor, + * We released the mutex to free a cursor, * start over. */ goto loop; @@ -440,10 +450,9 @@ __bam_ca_rsplit(my_dbc, fpgno, tpgno) } MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); - if (found != 0 && DB_LOGGING(my_dbc)) { - if ((ret = __bam_curadj_log(dbenv, - my_dbc->txn, &lsn, 0, dbp->log_fileid, - DB_CA_RSPLIT, fpgno, tpgno, 0, 0, 0, 0)) != 0) + if (found != 0 && DBC_LOGGING(my_dbc)) { + if ((ret = __bam_curadj_log(dbp, my_dbc->txn, + &lsn, 0, DB_CA_RSPLIT, fpgno, tpgno, 0, 0, 0, 0)) != 0) return (ret); } return (0); @@ -512,9 +521,9 @@ __bam_ca_split(my_dbc, ppgno, lpgno, rpgno, split_indx, cleft) } MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); - if (found != 0 && DB_LOGGING(my_dbc)) { - if ((ret = __bam_curadj_log(dbenv, my_dbc->txn, - &lsn, 0, dbp->log_fileid, DB_CA_SPLIT, ppgno, rpgno, + if (found != 0 && DBC_LOGGING(my_dbc)) { + if ((ret = __bam_curadj_log(dbp, + my_dbc->txn, &lsn, 0, DB_CA_SPLIT, ppgno, rpgno, cleft ? lpgno : PGNO_INVALID, 0, split_indx, 0)) != 0) return (ret); } diff --git a/bdb/btree/bt_cursor.c b/bdb/btree/bt_cursor.c index 84ab7c80744..14d90e8873d 100644 --- a/bdb/btree/bt_cursor.c +++ b/bdb/btree/bt_cursor.c @@ -1,31 +1,29 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_cursor.c,v 11.88 2001/01/11 18:19:49 bostic Exp $"; +static const char revid[] = "$Id: bt_cursor.c,v 11.147 2002/08/13 20:46:07 ubell Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include -#include #include #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "btree.h" -#include "lock.h" -#include "qam.h" -#include "common_ext.h" +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/btree.h" +#include "dbinc/lock.h" +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 *)); @@ -33,15 +31,16 @@ 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)); +static int __bam_c_next __P((DBC *, int, int)); static int __bam_c_physdel __P((DBC *)); static int __bam_c_prev __P((DBC *)); static int __bam_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); -static void __bam_c_reset __P((BTREE_CURSOR *)); -static int __bam_c_search __P((DBC *, const DBT *, u_int32_t, int *)); +static int __bam_c_search __P((DBC *, + db_pgno_t, const DBT *, u_int32_t, int *)); static int __bam_c_writelock __P((DBC *)); -static int __bam_getboth_finddatum __P((DBC *, DBT *)); +static int __bam_getboth_finddatum __P((DBC *, DBT *, u_int32_t)); static int __bam_getbothc __P((DBC *, DBT *)); +static int __bam_get_prev __P((DBC *)); static int __bam_isopd __P((DBC *, db_pgno_t *)); /* @@ -53,48 +52,60 @@ static int __bam_isopd __P((DBC *, db_pgno_t *)); * don't -- we don't duplicate locks when we duplicate cursors if we are * running in a transaction environment as there's no point if locks are * never discarded. This means that the cursor may or may not hold a lock. + * In the case where we are decending the tree we always want to + * unlock the held interior page so we use ACQUIRE_COUPLE. */ #undef ACQUIRE -#define ACQUIRE(dbc, mode, lpgno, lock, fpgno, pagep, ret) {\ +#define ACQUIRE(dbc, mode, lpgno, lock, fpgno, pagep, ret) { \ + DB_MPOOLFILE *__mpf = (dbc)->dbp->mpf; \ if ((pagep) != NULL) { \ - ret = memp_fput((dbc)->dbp->mpf, pagep, 0); \ + ret = __mpf->put(__mpf, pagep, 0); \ + pagep = NULL; \ + } else \ + ret = 0; \ + if ((ret) == 0 && STD_LOCKING(dbc)) \ + ret = __db_lget(dbc, LCK_COUPLE, lpgno, mode, 0, &(lock));\ + if ((ret) == 0) \ + ret = __mpf->get(__mpf, &(fpgno), 0, &(pagep)); \ +} + +#undef ACQUIRE_COUPLE +#define ACQUIRE_COUPLE(dbc, mode, lpgno, lock, fpgno, pagep, ret) { \ + DB_MPOOLFILE *__mpf = (dbc)->dbp->mpf; \ + if ((pagep) != NULL) { \ + ret = __mpf->put(__mpf, pagep, 0); \ pagep = NULL; \ } else \ ret = 0; \ if ((ret) == 0 && STD_LOCKING(dbc)) \ ret = __db_lget(dbc, \ - (lock).off == LOCK_INVALID ? 0 : LCK_COUPLE, \ - lpgno, mode, 0, &lock); \ - else \ - (lock).off = LOCK_INVALID; \ + LCK_COUPLE_ALWAYS, lpgno, mode, 0, &(lock)); \ if ((ret) == 0) \ - ret = memp_fget((dbc)->dbp->mpf, &(fpgno), 0, &(pagep));\ + ret = __mpf->get(__mpf, &(fpgno), 0, &(pagep)); \ } /* Acquire a new page/lock for a cursor. */ #undef ACQUIRE_CUR -#define ACQUIRE_CUR(dbc, mode, ret) { \ - BTREE_CURSOR *__cp = (BTREE_CURSOR *)(dbc)->internal; \ - ACQUIRE(dbc, mode, \ - __cp->pgno, __cp->lock, __cp->pgno, __cp->page, ret); \ - if ((ret) == 0) \ - __cp->lock_mode = (mode); \ -} - -/* - * Acquire a new page/lock for a cursor, and move the cursor on success. - * The reason that this is a separate macro is because we don't want to - * set the pgno/indx fields in the cursor until we actually have the lock, - * otherwise the cursor adjust routines will adjust the cursor even though - * we're not really on the page. - */ -#undef ACQUIRE_CUR_SET -#define ACQUIRE_CUR_SET(dbc, mode, p, ret) { \ +#define ACQUIRE_CUR(dbc, mode, p, ret) { \ BTREE_CURSOR *__cp = (BTREE_CURSOR *)(dbc)->internal; \ ACQUIRE(dbc, mode, p, __cp->lock, p, __cp->page, ret); \ if ((ret) == 0) { \ - __cp->pgno = p; \ - __cp->indx = 0; \ + __cp->pgno = p; \ + __cp->lock_mode = (mode); \ + } \ +} + +/* + * Acquire a new page/lock for a cursor and release the previous. + * This is typically used when decending 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) { \ + BTREE_CURSOR *__cp = (BTREE_CURSOR *)(dbc)->internal; \ + ACQUIRE_COUPLE(dbc, mode, p, __cp->lock, p, __cp->page, ret); \ + if ((ret) == 0) { \ + __cp->pgno = p; \ __cp->lock_mode = (mode); \ } \ } @@ -112,7 +123,7 @@ static int __bam_isopd __P((DBC *, db_pgno_t *)); if (STD_LOCKING(dbc) && \ __cp->lock_mode != DB_LOCK_WRITE && \ ((ret) = __db_lget(dbc, \ - __cp->lock.off == LOCK_INVALID ? 0 : LCK_COUPLE, \ + LOCK_ISSET(__cp->lock) ? LCK_COUPLE : 0, \ __cp->pgno, DB_LOCK_WRITE, 0, &__cp->lock)) == 0) \ __cp->lock_mode = DB_LOCK_WRITE; \ } @@ -120,19 +131,19 @@ static int __bam_isopd __P((DBC *, db_pgno_t *)); /* Discard the current page/lock. */ #undef DISCARD #define DISCARD(dbc, ldiscard, lock, pagep, ret) { \ + DB_MPOOLFILE *__mpf = (dbc)->dbp->mpf; \ int __t_ret; \ if ((pagep) != NULL) { \ - ret = memp_fput((dbc)->dbp->mpf, pagep, 0); \ + ret = __mpf->put(__mpf, pagep, 0); \ pagep = NULL; \ } else \ ret = 0; \ - if ((lock).off != LOCK_INVALID) { \ - __t_ret = ldiscard ? \ - __LPUT((dbc), lock): __TLPUT((dbc), lock); \ - if (__t_ret != 0 && (ret) == 0) \ - ret = __t_ret; \ - (lock).off = LOCK_INVALID; \ - } \ + if (ldiscard) \ + __t_ret = __LPUT((dbc), lock); \ + else \ + __t_ret = __TLPUT((dbc), lock); \ + if (__t_ret != 0 && (ret) == 0) \ + ret = __t_ret; \ } /* Discard the current page/lock for a cursor. */ @@ -146,12 +157,12 @@ static int __bam_isopd __P((DBC *, db_pgno_t *)); /* If on-page item is a deleted record. */ #undef IS_DELETED -#define IS_DELETED(page, indx) \ - B_DISSET(GET_BKEYDATA(page, \ +#define IS_DELETED(dbp, page, indx) \ + B_DISSET(GET_BKEYDATA(dbp, page, \ (indx) + (TYPE(page) == P_LBTREE ? O_INDX : 0))->type) #undef IS_CUR_DELETED #define IS_CUR_DELETED(dbc) \ - IS_DELETED((dbc)->internal->page, (dbc)->internal->indx) + IS_DELETED((dbc)->dbp, (dbc)->internal->page, (dbc)->internal->indx) /* * Test to see if two cursors could point to duplicates of the same key. @@ -163,30 +174,14 @@ static int __bam_isopd __P((DBC *, db_pgno_t *)); */ #undef IS_DUPLICATE #define IS_DUPLICATE(dbc, i1, i2) \ - (((PAGE *)(dbc)->internal->page)->inp[i1] == \ - ((PAGE *)(dbc)->internal->page)->inp[i2]) + (P_INP((dbc)->dbp,((PAGE *)(dbc)->internal->page))[i1] == \ + P_INP((dbc)->dbp,((PAGE *)(dbc)->internal->page))[i2]) #undef IS_CUR_DUPLICATE #define IS_CUR_DUPLICATE(dbc, orig_pgno, orig_indx) \ (F_ISSET(dbc, DBC_OPD) || \ (orig_pgno == (dbc)->internal->pgno && \ IS_DUPLICATE(dbc, (dbc)->internal->indx, orig_indx))) -/* - * __bam_c_reset -- - * Initialize internal cursor structure. - */ -static void -__bam_c_reset(cp) - BTREE_CURSOR *cp; -{ - cp->csp = cp->sp; - cp->lock.off = LOCK_INVALID; - cp->lock_mode = DB_LOCK_NG; - cp->recno = RECNO_OOB; - cp->order = INVALID_ORDER; - cp->flags = 0; -} - /* * __bam_c_init -- * Initialize the access private portion of a cursor @@ -198,35 +193,26 @@ __bam_c_init(dbc, dbtype) DBC *dbc; DBTYPE dbtype; { - BTREE *t; - BTREE_CURSOR *cp; - DB *dbp; + DB_ENV *dbenv; int ret; - u_int32_t minkey; - dbp = dbc->dbp; + dbenv = dbc->dbp->dbenv; /* Allocate/initialize the internal structure. */ - if (dbc->internal == NULL) { - if ((ret = __os_malloc(dbp->dbenv, - sizeof(BTREE_CURSOR), NULL, &cp)) != 0) - return (ret); - dbc->internal = (DBC_INTERNAL *)cp; - - cp->sp = cp->csp = cp->stack; - cp->esp = cp->stack + sizeof(cp->stack) / sizeof(cp->stack[0]); - } else - cp = (BTREE_CURSOR *)dbc->internal; - __bam_c_reset(cp); + if (dbc->internal == NULL && (ret = + __os_malloc(dbenv, sizeof(BTREE_CURSOR), &dbc->internal)) != 0) + return (ret); /* Initialize methods. */ dbc->c_close = __db_c_close; dbc->c_count = __db_c_count; dbc->c_del = __db_c_del; dbc->c_dup = __db_c_dup; - dbc->c_get = __db_c_get; + dbc->c_get = dbc->c_real_get = __db_c_get; + dbc->c_pget = __db_c_pget; dbc->c_put = __db_c_put; if (dbtype == DB_BTREE) { + dbc->c_am_bulk = __bam_bulk; dbc->c_am_close = __bam_c_close; dbc->c_am_del = __bam_c_del; dbc->c_am_destroy = __bam_c_destroy; @@ -234,6 +220,7 @@ __bam_c_init(dbc, dbtype) dbc->c_am_put = __bam_c_put; dbc->c_am_writelock = __bam_c_writelock; } else { + dbc->c_am_bulk = __bam_bulk; dbc->c_am_close = __bam_c_close; dbc->c_am_del = __ram_c_del; dbc->c_am_destroy = __bam_c_destroy; @@ -242,18 +229,6 @@ __bam_c_init(dbc, dbtype) dbc->c_am_writelock = __bam_c_writelock; } - /* - * The btree leaf page data structures require that two key/data pairs - * (or four items) fit on a page, but other than that there's no fixed - * requirement. The btree off-page duplicates only require two items, - * to be exact, but requiring four for them as well seems reasonable. - * - * Recno uses the btree bt_ovflsize value -- it's close enough. - */ - t = dbp->bt_internal; - minkey = F_ISSET(dbc, DBC_OPD) ? 2 : t->bt_minkey; - cp->ovflsize = B_MINKEY_TO_OVFLSIZE(minkey, dbp->pgsize); - return (0); } @@ -267,12 +242,13 @@ int __bam_c_refresh(dbc) DBC *dbc; { + BTREE *t; BTREE_CURSOR *cp; DB *dbp; dbp = dbc->dbp; + t = dbp->bt_internal; cp = (BTREE_CURSOR *)dbc->internal; - __bam_c_reset(cp); /* * If our caller set the root page number, it's because the root was @@ -280,11 +256,32 @@ __bam_c_refresh(dbc) * pull it out of our internal information. */ if (cp->root == PGNO_INVALID) - cp->root = ((BTREE *)dbp->bt_internal)->bt_root; + cp->root = t->bt_root; + + 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]); + + /* + * The btree leaf page data structures require that two key/data pairs + * (or four items) fit on a page, but other than that there's no fixed + * requirement. The btree off-page duplicates only require two items, + * to be exact, but requiring four for them as well seems reasonable. + * + * Recno uses the btree bt_ovflsize value -- it's close enough. + */ + cp->ovflsize = B_MINKEY_TO_OVFLSIZE( + dbp, F_ISSET(dbc, DBC_OPD) ? 2 : t->bt_minkey, dbp->pgsize); + + cp->recno = RECNO_OOB; + cp->order = INVALID_ORDER; + cp->flags = 0; /* Initialize for record numbers. */ if (F_ISSET(dbc, DBC_OPD) || - dbc->dbtype == DB_RECNO || F_ISSET(dbp, DB_BT_RECNUM)) { + dbc->dbtype == DB_RECNO || F_ISSET(dbp, DB_AM_RECNUM)) { F_SET(cp, C_RECNUM); /* @@ -293,7 +290,7 @@ __bam_c_refresh(dbc) * mutable record numbers. */ if ((F_ISSET(dbc, DBC_OPD) && dbc->dbtype == DB_RECNO) || - F_ISSET(dbp, DB_BT_RECNUM | DB_RE_RENUMBER)) + F_ISSET(dbp, DB_AM_RECNUM | DB_AM_RENUMBER)) F_SET(cp, C_RENUMBER); } @@ -313,11 +310,12 @@ __bam_c_close(dbc, root_pgno, rmroot) BTREE_CURSOR *cp, *cp_opd, *cp_c; DB *dbp; DBC *dbc_opd, *dbc_c; + DB_MPOOLFILE *mpf; PAGE *h; - u_int32_t num; int cdb_lock, ret, t_ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; cp_opd = (dbc_opd = cp->opd) == NULL ? NULL : (BTREE_CURSOR *)dbc_opd->internal; @@ -408,10 +406,10 @@ __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(dbp->mpf, &cp->pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &cp->pgno, 0, &h)) != 0) goto err; - root_pgno = GET_BOVERFLOW(h, cp->indx + O_INDX)->pgno; - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) + root_pgno = GET_BOVERFLOW(dbp, h, cp->indx + O_INDX)->pgno; + if ((ret = mpf->put(mpf, h, 0)) != 0) goto err; dbc_c = dbc_opd; @@ -453,18 +451,14 @@ lock: cp_c = (BTREE_CURSOR *)dbc_c->internal; * info in __db_c_get--the OPD is also a WRITEDUP. */ if (CDB_LOCKING(dbp->dbenv)) { - DB_ASSERT(!F_ISSET(dbc, DBC_OPD) || F_ISSET(dbc, DBC_WRITEDUP)); - if (!F_ISSET(dbc, DBC_WRITER)) { - if ((ret = - lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, + if (F_ISSET(dbc, DBC_WRITEDUP | DBC_WRITECURSOR)) { + if ((ret = dbp->dbenv->lock_get( + dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) goto err; cdb_lock = 1; } - - cp_c->lock.off = LOCK_INVALID; - if ((ret = - memp_fget(dbp->mpf, &cp_c->pgno, 0, &cp_c->page)) != 0) + if ((ret = mpf->get(mpf, &cp_c->pgno, 0, &cp_c->page)) != 0) goto err; goto delete; @@ -480,9 +474,7 @@ lock: cp_c = (BTREE_CURSOR *)dbc_c->internal; * is responsible for acquiring any necessary locks before calling us. */ if (F_ISSET(dbc, DBC_OPD)) { - cp_c->lock.off = LOCK_INVALID; - if ((ret = - memp_fget(dbp->mpf, &cp_c->pgno, 0, &cp_c->page)) != 0) + if ((ret = mpf->get(mpf, &cp_c->pgno, 0, &cp_c->page)) != 0) goto err; goto delete; } @@ -542,13 +534,13 @@ 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(dbp->mpf, &root_pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &root_pgno, 0, &h)) != 0) goto err; - if ((num = NUM_ENT(h)) == 0) { + if (NUM_ENT(h) == 0) { if ((ret = __db_free(dbc, h)) != 0) goto err; } else { - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) + if ((ret = mpf->put(mpf, h, 0)) != 0) goto err; goto done; } @@ -566,8 +558,7 @@ delete: /* * the primary page. */ if (dbc_opd != NULL) { - cp->lock.off = LOCK_INVALID; - if ((ret = memp_fget(dbp->mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = mpf->get(mpf, &cp->pgno, 0, &cp->page)) != 0) goto err; if ((ret = __bam_c_physdel(dbc)) != 0) goto err; @@ -604,7 +595,7 @@ __bam_c_destroy(dbc) DBC *dbc; { /* Discard the structures. */ - __os_free(dbc->internal, sizeof(BTREE_CURSOR)); + __os_free(dbc->dbp->dbenv, dbc->internal); return (0); } @@ -622,11 +613,13 @@ __bam_c_count(dbc, recnop) { BTREE_CURSOR *cp; DB *dbp; + DB_MPOOLFILE *mpf; db_indx_t indx, top; db_recno_t recno; int ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; /* @@ -637,7 +630,7 @@ __bam_c_count(dbc, recnop) * new locks, we have to have a read lock to even get here. */ if (cp->opd == NULL) { - if ((ret = memp_fget(dbp->mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = mpf->get(mpf, &cp->pgno, 0, &cp->page)) != 0) return (ret); /* @@ -654,14 +647,14 @@ __bam_c_count(dbc, recnop) break; *recnop = recno; } else { - if ((ret = memp_fget(dbp->mpf, - &cp->opd->internal->root, 0, &cp->page)) != 0) + if ((ret = + mpf->get(mpf, &cp->opd->internal->root, 0, &cp->page)) != 0) return (ret); *recnop = RE_NREC(cp->page); } - ret = memp_fput(dbp->mpf, cp->page, 0); + ret = mpf->put(mpf, cp->page, 0); cp->page = NULL; return (ret); @@ -677,9 +670,11 @@ __bam_c_del(dbc) { BTREE_CURSOR *cp; DB *dbp; + DB_MPOOLFILE *mpf; int ret, t_ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; ret = 0; @@ -706,25 +701,27 @@ __bam_c_del(dbc) goto err; cp->page = cp->csp->page; } else { - ACQUIRE_CUR(dbc, DB_LOCK_WRITE, ret); + ACQUIRE_CUR(dbc, DB_LOCK_WRITE, cp->pgno, ret); if (ret != 0) goto err; } /* Log the change. */ - if (DB_LOGGING(dbc) && - (ret = __bam_cdel_log(dbp->dbenv, dbc->txn, &LSN(cp->page), 0, - dbp->log_fileid, PGNO(cp->page), &LSN(cp->page), cp->indx)) != 0) - goto err; + if (DBC_LOGGING(dbc)) { + if ((ret = __bam_cdel_log(dbp, dbc->txn, &LSN(cp->page), 0, + PGNO(cp->page), &LSN(cp->page), cp->indx)) != 0) + goto err; + } else + LSN_NOT_LOGGED(LSN(cp->page)); /* Set the intent-to-delete flag on the page. */ if (TYPE(cp->page) == P_LBTREE) - B_DSET(GET_BKEYDATA(cp->page, cp->indx + O_INDX)->type); + B_DSET(GET_BKEYDATA(dbp, cp->page, cp->indx + O_INDX)->type); else - B_DSET(GET_BKEYDATA(cp->page, cp->indx)->type); + B_DSET(GET_BKEYDATA(dbp, cp->page, cp->indx)->type); /* Mark the page dirty. */ - ret = memp_fset(dbp->mpf, cp->page, DB_MPOOL_DIRTY); + ret = mpf->set(mpf, cp->page, DB_MPOOL_DIRTY); err: /* * If we've been successful so far and the tree has record numbers, @@ -736,7 +733,7 @@ err: /* (void)__bam_stkrel(dbc, 0); } else if (cp->page != NULL && - (t_ret = memp_fput(dbp->mpf, cp->page, 0)) != 0 && ret == 0) + (t_ret = mpf->put(mpf, cp->page, 0)) != 0 && ret == 0) ret = t_ret; cp->page = NULL; @@ -771,7 +768,7 @@ __bam_c_dup(orig_dbc, new_dbc) * holding inside a transaction because all the locks are retained * until the transaction commits or aborts. */ - if (orig->lock.off != LOCK_INVALID && orig_dbc->txn == NULL) { + if (LOCK_ISSET(orig->lock) && orig_dbc->txn == NULL) { if ((ret = __db_lget(new_dbc, 0, new->pgno, new->lock_mode, 0, &new->lock)) != 0) return (ret); @@ -796,11 +793,13 @@ __bam_c_get(dbc, key, data, flags, pgnop) { BTREE_CURSOR *cp; DB *dbp; + DB_MPOOLFILE *mpf; db_pgno_t orig_pgno; db_indx_t orig_indx; int exact, newopd, ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; orig_pgno = cp->pgno; orig_indx = cp->indx; @@ -820,7 +819,7 @@ __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(dbp->mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = mpf->get(mpf, &cp->pgno, 0, &cp->page)) != 0) goto err; break; case DB_FIRST: @@ -829,9 +828,10 @@ __bam_c_get(dbc, key, data, flags, pgnop) goto err; break; case DB_GET_BOTH: + case DB_GET_BOTH_RANGE: /* * There are two ways to get here based on DBcursor->c_get - * with the DB_GET_BOTH flag set: + * with the DB_GET_BOTH/DB_GET_BOTH_RANGE flags set: * * 1. Searching a sorted off-page duplicate tree: do a tree * search. @@ -839,20 +839,34 @@ __bam_c_get(dbc, key, data, flags, pgnop) * 2. Searching btree: do a tree search. If it returns a * reference to off-page duplicate tree, return immediately * and let our caller deal with it. If the search doesn't - * return a reference to off-page duplicate tree, start an - * on-page search. + * return a reference to off-page duplicate tree, continue + * with an on-page search. */ if (F_ISSET(dbc, DBC_OPD)) { if ((ret = __bam_c_search( - dbc, data, DB_GET_BOTH, &exact)) != 0) - goto err; - if (!exact) { - ret = DB_NOTFOUND; + dbc, PGNO_INVALID, data, flags, &exact)) != 0) goto err; + if (flags == DB_GET_BOTH) { + if (!exact) { + ret = DB_NOTFOUND; + goto err; + } + break; } + + /* + * We didn't require an exact match, so the search may + * may have returned an entry past the end of the page, + * or we may be referencing a deleted record. If so, + * move to the next entry. + */ + if ((cp->indx == NUM_ENT(cp->page) || + IS_CUR_DELETED(dbc)) && + (ret = __bam_c_next(dbc, 1, 0)) != 0) + goto err; } else { if ((ret = __bam_c_search( - dbc, key, DB_GET_BOTH, &exact)) != 0) + dbc, PGNO_INVALID, key, flags, &exact)) != 0) return (ret); if (!exact) { ret = DB_NOTFOUND; @@ -863,7 +877,8 @@ __bam_c_get(dbc, key, data, flags, pgnop) newopd = 1; break; } - if ((ret = __bam_getboth_finddatum(dbc, data)) != 0) + if ((ret = + __bam_getboth_finddatum(dbc, data, flags)) != 0) goto err; } break; @@ -882,11 +897,11 @@ __bam_c_get(dbc, key, data, flags, pgnop) if ((ret = __bam_c_first(dbc)) != 0) goto err; } else - if ((ret = __bam_c_next(dbc, 1)) != 0) + if ((ret = __bam_c_next(dbc, 1, 0)) != 0) goto err; break; case DB_NEXT_DUP: - if ((ret = __bam_c_next(dbc, 1)) != 0) + if ((ret = __bam_c_next(dbc, 1, 0)) != 0) goto err; if (!IS_CUR_DUPLICATE(dbc, orig_pgno, orig_indx)) { ret = DB_NOTFOUND; @@ -900,7 +915,7 @@ __bam_c_get(dbc, key, data, flags, pgnop) goto err; } else do { - if ((ret = __bam_c_next(dbc, 1)) != 0) + if ((ret = __bam_c_next(dbc, 1, 0)) != 0) goto err; } while (IS_CUR_DUPLICATE(dbc, orig_pgno, orig_indx)); break; @@ -927,12 +942,14 @@ __bam_c_get(dbc, key, data, flags, pgnop) case DB_SET: case DB_SET_RECNO: newopd = 1; - if ((ret = __bam_c_search(dbc, key, flags, &exact)) != 0) + if ((ret = __bam_c_search(dbc, + PGNO_INVALID, key, flags, &exact)) != 0) goto err; break; case DB_SET_RANGE: newopd = 1; - if ((ret = __bam_c_search(dbc, key, flags, &exact)) != 0) + if ((ret = __bam_c_search(dbc, + PGNO_INVALID, key, flags, &exact)) != 0) goto err; /* @@ -942,7 +959,7 @@ __bam_c_get(dbc, key, data, flags, pgnop) * the next entry. */ if (cp->indx == NUM_ENT(cp->page) || IS_CUR_DELETED(dbc)) - if ((ret = __bam_c_next(dbc, 0)) != 0) + if ((ret = __bam_c_next(dbc, 0, 0)) != 0) goto err; break; default: @@ -957,8 +974,15 @@ __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 */ - if (flags == DB_SET) + /* + * 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: /* @@ -966,13 +990,596 @@ err: /* * moved, clear the delete flag, DBcursor->c_get never references * a deleted key, if it moved at all. */ - if (F_ISSET(cp, C_DELETED) - && (cp->pgno != orig_pgno || cp->indx != orig_indx)) + if (F_ISSET(cp, C_DELETED) && + (cp->pgno != orig_pgno || cp->indx != orig_indx)) F_CLR(cp, C_DELETED); return (ret); } +static int +__bam_get_prev(dbc) + DBC *dbc; +{ + BTREE_CURSOR *cp; + DBT key, data; + db_pgno_t pgno; + int ret; + + if ((ret = __bam_c_prev(dbc)) != 0) + return (ret); + + if (__bam_isopd(dbc, &pgno)) { + cp = (BTREE_CURSOR *)dbc->internal; + if ((ret = __db_c_newopd(dbc, pgno, cp->opd, &cp->opd)) != 0) + return (ret); + if ((ret = cp->opd->c_am_get(cp->opd, + &key, &data, DB_LAST, NULL)) != 0) + return (ret); + } + + return (0); +} + +/* + * __bam_bulk -- Return bulk data from a btree. + */ +static int +__bam_bulk(dbc, data, flags) + DBC *dbc; + DBT *data; + u_int32_t flags; +{ + BKEYDATA *bk; + BOVERFLOW *bo; + BTREE_CURSOR *cp; + PAGE *pg; + db_indx_t *inp, indx, pg_keyoff; + int32_t *endp, key_off, *offp, *saveoffp; + u_int8_t *dbuf, *dp, *np; + u_int32_t key_size, size, space; + int adj, is_key, need_pg, next_key, no_dup; + int pagesize, rec_key, ret; + + ret = 0; + key_off = 0; + size = 0; + pagesize = dbc->dbp->pgsize; + cp = (BTREE_CURSOR *)dbc->internal; + + /* + * dp tracks the beginging of the page in the buffer. + * np is the next place to copy things into the buffer. + * dbuf always stays at the beging of the buffer. + */ + dbuf = data->data; + np = dp = dbuf; + + /* Keep track of space that is left. There is a termination entry */ + space = data->ulen; + space -= sizeof(*offp); + + /* Build the offset/size table from the end up. */ + endp = (int32_t *)((u_int8_t *)dbuf + data->ulen); + endp--; + offp = endp; + + key_size = 0; + + /* + * Distinguish between BTREE and RECNO. + * There are no keys in RECNO. If MULTIPLE_KEY is specified + * then we return the record numbers. + * is_key indicates that multiple btree keys are returned. + * rec_key is set if we are returning record numbers. + * next_key is set if we are going after the next key rather than dup. + */ + if (dbc->dbtype == DB_BTREE) { + is_key = LF_ISSET(DB_MULTIPLE_KEY) ? 1: 0; + rec_key = 0; + next_key = is_key && LF_ISSET(DB_OPFLAGS_MASK) != DB_NEXT_DUP; + adj = 2; + } else { + is_key = 0; + rec_key = LF_ISSET(DB_MULTIPLE_KEY) ? 1 : 0; + next_key = LF_ISSET(DB_OPFLAGS_MASK) != DB_NEXT_DUP; + adj = 1; + } + no_dup = LF_ISSET(DB_OPFLAGS_MASK) == DB_NEXT_NODUP; + +next_pg: + indx = cp->indx; + pg = cp->page; + + inp = P_INP(dbc->dbp, pg); + /* The current page is not yet in the buffer. */ + need_pg = 1; + + /* + * Keep track of the offset of the current key on the page. + * If we are returning keys, set it to 0 first so we force + * the copy of the key to the buffer. + */ + pg_keyoff = 0; + if (is_key == 0) + pg_keyoff = inp[indx]; + + do { + if (IS_DELETED(dbc->dbp, pg, indx)) { + if (dbc->dbtype != DB_RECNO) + continue; + + cp->recno++; + /* + * If we are not returning recnos then we + * need to fill in every slot so the user + * can calculate the record numbers. + */ + if (rec_key != 0) + continue; + + space -= 2 * sizeof(*offp); + /* Check if space as underflowed. */ + if (space > data->ulen) + goto back_up; + + /* Just mark the empty recno slots. */ + *offp-- = 0; + *offp-- = 0; + continue; + } + + /* + * Check to see if we have a new key. + * If so, then see if we need to put the + * key on the page. If its already there + * then we just point to it. + */ + if (is_key && pg_keyoff != inp[indx]) { + bk = GET_BKEYDATA(dbc->dbp, pg, indx); + if (B_TYPE(bk->type) == B_OVERFLOW) { + bo = (BOVERFLOW *)bk; + size = key_size = bo->tlen; + if (key_size > space) + goto get_key_space; + if ((ret = __bam_bulk_overflow(dbc, + bo->tlen, bo->pgno, np)) != 0) + return (ret); + space -= key_size; + key_off = (int32_t)(np - dbuf); + np += key_size; + } else { + if (need_pg) { + dp = np; + size = pagesize - HOFFSET(pg); + if (space < size) { +get_key_space: + /* Nothing added, then error. */ + if (offp == endp) { + data->size = + ALIGN(size + + pagesize, + sizeof(u_int32_t)); + return (ENOMEM); + } + /* + * We need to back up to the + * last record put into the + * buffer so that it is + * CURRENT. + */ + if (indx != 0) + indx -= P_INDX; + else { + if ((ret = + __bam_get_prev( + dbc)) != 0) + return (ret); + indx = cp->indx; + pg = cp->page; + } + break; + } + /* + * Move the data part of the page + * to the buffer. + */ + memcpy(dp, + (u_int8_t *)pg + HOFFSET(pg), size); + need_pg = 0; + space -= size; + np += size; + } + key_size = bk->len; + key_off = (int32_t)(inp[indx] - HOFFSET(pg) + + dp - dbuf + SSZA(BKEYDATA, data)); + pg_keyoff = inp[indx]; + } + } + + /* + * Reserve space for the pointers and sizes. + * Either key/data pair or just for a data item. + */ + space -= (is_key ? 4 : 2) * sizeof(*offp); + if (rec_key) + space -= sizeof(*offp); + + /* Check to see if space has underflowed. */ + if (space > data->ulen) + goto back_up; + + /* + * Determine if the next record is in the + * buffer already or if it needs to be copied in. + * If we have an off page dup, then copy as many + * as will fit into the buffer. + */ + bk = GET_BKEYDATA(dbc->dbp, pg, indx + adj - 1); + if (B_TYPE(bk->type) == B_DUPLICATE) { + bo = (BOVERFLOW *)bk; + if (is_key) { + *offp-- = key_off; + *offp-- = key_size; + } + /* + * We pass the offset of the current key. + * On return we check to see if offp has + * moved to see if any data fit. + */ + saveoffp = offp; + if ((ret = __bam_bulk_duplicates(dbc, bo->pgno, + dbuf, is_key ? offp + P_INDX : NULL, + &offp, &np, &space, no_dup)) != 0) { + if (ret == ENOMEM) { + size = space; + /* If nothing was added, then error. */ + if (offp == saveoffp) { + offp += 2; + goto back_up; + } + goto get_space; + } + return (ret); + } + } else if (B_TYPE(bk->type) == B_OVERFLOW) { + bo = (BOVERFLOW *)bk; + size = bo->tlen; + if (size > space) + goto back_up; + if ((ret = + __bam_bulk_overflow(dbc, + bo->tlen, bo->pgno, np)) != 0) + return (ret); + space -= size; + if (is_key) { + *offp-- = key_off; + *offp-- = key_size; + } else if (rec_key) + *offp-- = cp->recno; + *offp-- = (int32_t)(np - dbuf); + np += size; + *offp-- = size; + } else { + if (need_pg) { + dp = np; + size = pagesize - HOFFSET(pg); + if (space < size) { +back_up: + /* + * Back up the index so that the + * last record in the buffer is CURRENT + */ + if (indx >= adj) + indx -= adj; + else { + if ((ret = + __bam_get_prev(dbc)) != 0 && + ret != DB_NOTFOUND) + return (ret); + indx = cp->indx; + pg = cp->page; + } + if (dbc->dbtype == DB_RECNO) + cp->recno--; +get_space: + /* + * See if we put anything in the + * buffer or if we are doing a DBP->get + * did we get all of the data. + */ + if (offp >= + (is_key ? &endp[-1] : endp) || + F_ISSET(dbc, DBC_TRANSIENT)) { + data->size = ALIGN(size + + data->ulen - space, + sizeof(u_int32_t)); + return (ENOMEM); + } + break; + } + memcpy(dp, (u_int8_t *)pg + HOFFSET(pg), size); + need_pg = 0; + space -= size; + np += size; + } + /* + * Add the offsets and sizes to the end of the buffer. + * First add the key info then the data info. + */ + if (is_key) { + *offp-- = key_off; + *offp-- = key_size; + } else if (rec_key) + *offp-- = cp->recno; + *offp-- = (int32_t)(inp[indx + adj - 1] - HOFFSET(pg) + + dp - dbuf + SSZA(BKEYDATA, data)); + *offp-- = bk->len; + } + if (dbc->dbtype == DB_RECNO) + cp->recno++; + else if (no_dup) { + while (indx + adj < NUM_ENT(pg) && + pg_keyoff == inp[indx + adj]) + indx += adj; + } + /* + * Stop when we either run off the page or we + * move to the next key and we are not returning mulitple keys. + */ + } while ((indx += adj) < NUM_ENT(pg) && + (next_key || pg_keyoff == inp[indx])); + + /* If we are off the page then try to the next page. */ + if (ret == 0 && next_key && indx >= NUM_ENT(pg)) { + cp->indx = indx; + ret = __bam_c_next(dbc, 0, 1); + if (ret == 0) + goto next_pg; + if (ret != DB_NOTFOUND) + return (ret); + } + + /* + * If we did a DBP->get we must error if we did not return + * all the data for the current key because there is + * no way to know if we did not get it all, nor any + * interface to fetch the balance. + */ + + if (ret == 0 && + F_ISSET(dbc, DBC_TRANSIENT) && pg_keyoff == inp[indx]) { + data->size = (data->ulen - space) + size; + return (ENOMEM); + } + /* + * Must leave the index pointing at the last record fetched. + * If we are not fetching keys, we may have stepped to the + * next key. + */ + if (next_key || pg_keyoff == inp[indx]) + cp->indx = indx; + else + cp->indx = indx - P_INDX; + + if (rec_key == 1) + *offp = (u_int32_t) RECNO_OOB; + else + *offp = (u_int32_t) -1; + return (0); +} + +/* + * __bam_bulk_overflow -- + * Dump overflow record into the buffer. + * The space requirements have already been checked. + * PUBLIC: int __bam_bulk_overflow + * PUBLIC: __P((DBC *, u_int32_t, db_pgno_t, u_int8_t *)); + */ +int +__bam_bulk_overflow(dbc, len, pgno, dp) + DBC *dbc; + u_int32_t len; + db_pgno_t pgno; + u_int8_t *dp; +{ + DBT dbt; + + memset(&dbt, 0, sizeof(dbt)); + F_SET(&dbt, DB_DBT_USERMEM); + dbt.ulen = len; + dbt.data = (void *)dp; + return (__db_goff(dbc->dbp, &dbt, len, pgno, NULL, NULL)); +} + +/* + * __bam_bulk_duplicates -- + * Put as many off page duplicates as will fit into the buffer. + * This routine will adjust the cursor to reflect the position in + * the overflow tree. + * PUBLIC: int __bam_bulk_duplicates __P((DBC *, + * PUBLIC: db_pgno_t, u_int8_t *, int32_t *, + * PUBLIC: int32_t **, u_int8_t **, u_int32_t *, int)); + */ +int +__bam_bulk_duplicates(dbc, pgno, dbuf, keyoff, offpp, dpp, spacep, no_dup) + DBC *dbc; + db_pgno_t pgno; + u_int8_t *dbuf; + int32_t *keyoff, **offpp; + u_int8_t **dpp; + u_int32_t *spacep; + int no_dup; +{ + DB *dbp; + BKEYDATA *bk; + BOVERFLOW *bo; + BTREE_CURSOR *cp; + DBC *opd; + DBT key, data; + PAGE *pg; + db_indx_t indx, *inp; + int32_t *offp; + u_int32_t size, space; + u_int8_t *dp, *np; + int first, need_pg, pagesize, ret, t_ret; + + ret = 0; + + dbp = dbc->dbp; + cp = (BTREE_CURSOR *)dbc->internal; + opd = cp->opd; + + if (opd == NULL) { + if ((ret = __db_c_newopd(dbc, pgno, NULL, &opd)) != 0) + return (ret); + cp->opd = opd; + if ((ret = opd->c_am_get(opd, + &key, &data, DB_FIRST, NULL)) != 0) + return (ret); + } + + pagesize = opd->dbp->pgsize; + cp = (BTREE_CURSOR *)opd->internal; + space = *spacep; + /* Get current offset slot. */ + offp = *offpp; + + /* + * np is the next place to put data. + * dp is the begining of the current page in the buffer. + */ + np = dp = *dpp; + first = 1; + indx = cp->indx; + + do { + /* Fetch the current record. No initial move. */ + if ((ret = __bam_c_next(opd, 0, 0)) != 0) + break; + pg = cp->page; + indx = cp->indx; + inp = P_INP(dbp, pg); + /* We need to copy the page to the buffer. */ + need_pg = 1; + + do { + if (IS_DELETED(dbp, pg, indx)) + goto contin; + bk = GET_BKEYDATA(dbp, pg, indx); + space -= 2 * sizeof(*offp); + /* Allocate space for key if needed. */ + if (first == 0 && keyoff != NULL) + space -= 2 * sizeof(*offp); + + /* Did space underflow? */ + if (space > *spacep) { + ret = ENOMEM; + if (first == 1) { + space = *spacep + -(int32_t)space; + if (need_pg) + space += pagesize - HOFFSET(pg); + } + break; + } + if (B_TYPE(bk->type) == B_OVERFLOW) { + bo = (BOVERFLOW *)bk; + size = bo->tlen; + if (size > space) { + ret = ENOMEM; + if (first == 1) { + space = *spacep + size; + } + break; + } + if (first == 0 && keyoff != NULL) { + *offp-- = keyoff[0]; + *offp-- = keyoff[-1]; + } + if ((ret = __bam_bulk_overflow(dbc, + bo->tlen, bo->pgno, np)) != 0) + return (ret); + space -= size; + *offp-- = (int32_t)(np - dbuf); + np += size; + } else { + if (need_pg) { + dp = np; + size = pagesize - HOFFSET(pg); + if (space < size) { + ret = ENOMEM; + /* Return space required. */ + if (first == 1) { + space = *spacep + size; + } + break; + } + memcpy(dp, + (u_int8_t *)pg + HOFFSET(pg), size); + need_pg = 0; + space -= size; + np += size; + } + if (first == 0 && keyoff != NULL) { + *offp-- = keyoff[0]; + *offp-- = keyoff[-1]; + } + size = bk->len; + *offp-- = (int32_t)(inp[indx] - HOFFSET(pg) + + dp - dbuf + SSZA(BKEYDATA, data)); + } + *offp-- = size; + first = 0; + if (no_dup) + break; +contin: + indx++; + if (opd->dbtype == DB_RECNO) + cp->recno++; + } while (indx < NUM_ENT(pg)); + if (no_dup) + break; + cp->indx = indx; + + } while (ret == 0); + + /* Return the updated information. */ + *spacep = space; + *offpp = offp; + *dpp = np; + + /* + * If we ran out of space back up the pointer. + * If we did not return any dups or reached the end, close the opd. + */ + if (ret == ENOMEM) { + if (opd->dbtype == DB_RECNO) { + if (--cp->recno == 0) + goto close_opd; + } else if (indx != 0) + cp->indx--; + else { + t_ret = __bam_c_prev(opd); + if (t_ret == DB_NOTFOUND) + goto close_opd; + if (t_ret != 0) + ret = t_ret; + } + } else if (keyoff == NULL && ret == DB_NOTFOUND) { + cp->indx--; + if (opd->dbtype == DB_RECNO) + --cp->recno; + } else if (indx == 0 || ret == DB_NOTFOUND) { +close_opd: + opd->c_close(opd); + ((BTREE_CURSOR *)dbc->internal)->opd = NULL; + } + if (ret == DB_NOTFOUND) + ret = 0; + + return (ret); +} + /* * __bam_getbothc -- * Search for a matching data item on a join. @@ -984,9 +1591,11 @@ __bam_getbothc(dbc, data) { BTREE_CURSOR *cp; DB *dbp; + DB_MPOOLFILE *mpf; int cmp, exact, ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; /* @@ -995,7 +1604,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(dbp->mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = mpf->get(mpf, &cp->pgno, 0, &cp->page)) != 0) return (ret); /* @@ -1017,11 +1626,12 @@ __bam_getbothc(dbc, data) return (DB_NOTFOUND); /* Discard the current page, we're going to do a full search. */ - if ((ret = memp_fput(dbp->mpf, cp->page, 0)) != 0) + if ((ret = mpf->put(mpf, cp->page, 0)) != 0) return (ret); cp->page = NULL; - return (__bam_c_search(dbc, data, DB_GET_BOTH, &exact)); + return (__bam_c_search(dbc, + PGNO_INVALID, data, DB_GET_BOTH, &exact)); } /* @@ -1038,7 +1648,7 @@ __bam_getbothc(dbc, data) return (DB_NOTFOUND); cp->indx += P_INDX; - return (__bam_getboth_finddatum(dbc, data)); + return (__bam_getboth_finddatum(dbc, data, DB_GET_BOTH)); } /* @@ -1046,9 +1656,10 @@ __bam_getbothc(dbc, data) * Find a matching on-page data item. */ static int -__bam_getboth_finddatum(dbc, data) +__bam_getboth_finddatum(dbc, data, flags) DBC *dbc; DBT *data; + u_int32_t flags; { BTREE_CURSOR *cp; DB *dbp; @@ -1060,17 +1671,14 @@ __bam_getboth_finddatum(dbc, data) /* * Called (sometimes indirectly) from DBC->get to search on-page data - * item(s) for a matching value. If the original flag was DB_GET_BOTH, - * the cursor argument is set to the first data item for the key. If - * the original flag was DB_GET_BOTHC, the cursor argument is set to - * the first data item that we can potentially return. In both cases, - * there may or may not be additional duplicate data items to search. + * item(s) for a matching value. If the original flag was DB_GET_BOTH + * or DB_GET_BOTH_RANGE, the cursor is set to the first undeleted data + * item for the key. If the original flag was DB_GET_BOTHC, the cursor + * argument is set to the first data item we can potentially return. + * In both cases, there may or may not be additional duplicate data + * items to search. * * If the duplicates are not sorted, do a linear search. - * - * If the duplicates are sorted, do a binary search. The reason for - * this is that large pages and small key/data pairs result in large - * numbers of on-page duplicates before they get pushed off-page. */ if (dbp->dup_compare == NULL) { for (;; cp->indx += P_INDX) { @@ -1085,41 +1693,62 @@ __bam_getboth_finddatum(dbc, data) !IS_DUPLICATE(dbc, cp->indx, cp->indx + P_INDX)) break; } - } else { - /* - * Find the top and bottom of the duplicate set. Binary search - * requires at least two items, don't loop if there's only one. - */ - for (base = top = cp->indx; - top < NUM_ENT(cp->page); top += P_INDX) - if (!IS_DUPLICATE(dbc, cp->indx, top)) - break; - if (base == (top - P_INDX)) { - if ((ret = __bam_cmp(dbp, data, - cp->page, cp->indx + O_INDX, - dbp->dup_compare, &cmp)) != 0) - return (ret); - return (cmp == 0 ? 0 : DB_NOTFOUND); - } + return (DB_NOTFOUND); + } - 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, - cp->indx + O_INDX, dbp->dup_compare, &cmp)) != 0) - return (ret); - if (cmp == 0) { - if (!IS_CUR_DELETED(dbc)) - return (0); - break; - } - if (cmp > 0) { - base = cp->indx + P_INDX; - --lim; - } + /* + * If the duplicates are sorted, do a binary search. The reason for + * this is that large pages and small key/data pairs result in large + * numbers of on-page duplicates before they get pushed off-page. + * + * Find the top and bottom of the duplicate set. Binary search + * requires at least two items, don't loop if there's only one. + */ + for (base = top = cp->indx; top < NUM_ENT(cp->page); top += P_INDX) + if (!IS_DUPLICATE(dbc, cp->indx, top)) + break; + if (base == (top - P_INDX)) { + if ((ret = __bam_cmp(dbp, data, + cp->page, cp->indx + O_INDX, dbp->dup_compare, &cmp)) != 0) + return (ret); + return (cmp == 0 || + (cmp < 0 && flags == DB_GET_BOTH_RANGE) ? 0 : DB_NOTFOUND); + } + + 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, + cp->indx + O_INDX, dbp->dup_compare, &cmp)) != 0) + return (ret); + if (cmp == 0) { + /* + * XXX + * No duplicate duplicates in sorted duplicate sets, + * so there can be only one. + */ + if (!IS_CUR_DELETED(dbc)) + return (0); + break; + } + if (cmp > 0) { + base = cp->indx + P_INDX; + --lim; } } - return (DB_NOTFOUND); + + /* No match found; if we're looking for an exact match, we're done. */ + if (flags == DB_GET_BOTH) + return (DB_NOTFOUND); + + /* + * Base is the smallest index greater than the data item, may be zero + * or a last + O_INDX index, and may be deleted. Find an undeleted + * item. + */ + cp->indx = base; + while (cp->indx < top && IS_CUR_DELETED(dbc)) + cp->indx += P_INDX; + return (cp->indx < top ? 0 : DB_NOTFOUND); } /* @@ -1136,19 +1765,22 @@ __bam_c_put(dbc, key, data, flags, pgnop) BTREE_CURSOR *cp; DB *dbp; DBT dbt; + DB_MPOOLFILE *mpf; + db_pgno_t root_pgno; u_int32_t iiop; - int cmp, exact, needkey, ret, stack; + int cmp, exact, ret, stack; void *arg; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; + root_pgno = cp->root; -split: needkey = ret = stack = 0; +split: ret = stack = 0; switch (flags) { case DB_AFTER: case DB_BEFORE: case DB_CURRENT: - needkey = 1; iiop = flags; /* @@ -1182,7 +1814,7 @@ split: needkey = ret = stack = 0; ACQUIRE_WRITE_LOCK(dbc, ret); if (ret != 0) goto err; - if ((ret = memp_fget(dbp->mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = mpf->get(mpf, &cp->pgno, 0, &cp->page)) != 0) goto err; break; case DB_KEYFIRST: @@ -1192,15 +1824,22 @@ split: needkey = ret = stack = 0; * Searching off-page, sorted duplicate tree: do a tree search * for the correct item; __bam_c_search returns the smallest * slot greater than the key, use it. + * + * See comment below regarding where we can start the search. */ if (F_ISSET(dbc, DBC_OPD)) { - if ((ret = - __bam_c_search(dbc, data, flags, &exact)) != 0) + if ((ret = __bam_c_search(dbc, + F_ISSET(cp, C_RECNUM) ? cp->root : root_pgno, + data, flags, &exact)) != 0) goto err; stack = 1; /* Disallow "sorted" duplicate duplicates. */ if (exact) { + if (IS_DELETED(dbp, cp->page, cp->indx)) { + iiop = DB_CURRENT; + break; + } ret = __db_duperr(dbp, flags); goto err; } @@ -1208,8 +1847,17 @@ split: needkey = ret = stack = 0; break; } - /* Searching a btree. */ - if ((ret = __bam_c_search(dbc, key, + /* + * Searching a btree. + * + * If we've done a split, we can start the search from the + * parent of the split page, which __bam_split returned + * for us in root_pgno, unless we're in a Btree with record + * numbering. In that case, we'll need the true root page + * in order to adjust the record count. + */ + if ((ret = __bam_c_search(dbc, + F_ISSET(cp, C_RECNUM) ? cp->root : root_pgno, key, flags == DB_KEYFIRST || dbp->dup_compare != NULL ? DB_KEYFIRST : DB_KEYLAST, &exact)) != 0) goto err; @@ -1264,8 +1912,8 @@ split: needkey = ret = stack = 0; */ for (;; cp->indx += P_INDX) { if ((ret = __bam_cmp(dbp, data, cp->page, - cp->indx + O_INDX, dbp->dup_compare, &cmp)) !=0) - return (ret); + cp->indx + O_INDX, dbp->dup_compare, &cmp)) != 0) + goto err; if (cmp < 0) { iiop = DB_BEFORE; break; @@ -1273,7 +1921,7 @@ split: needkey = ret = stack = 0; /* Disallow "sorted" duplicate duplicates. */ if (cmp == 0) { - if (IS_DELETED(cp->page, cp->indx)) { + if (IS_DELETED(dbp, cp->page, cp->indx)) { iiop = DB_CURRENT; break; } @@ -1282,8 +1930,8 @@ split: needkey = ret = stack = 0; } if (cp->indx + P_INDX >= NUM_ENT(cp->page) || - ((PAGE *)cp->page)->inp[cp->indx] != - ((PAGE *)cp->page)->inp[cp->indx + P_INDX]) { + P_INP(dbp, ((PAGE *)cp->page))[cp->indx] != + P_INP(dbp, ((PAGE *)cp->page))[cp->indx + P_INDX]) { iiop = DB_AFTER; break; } @@ -1306,7 +1954,7 @@ split: needkey = ret = stack = 0; flags == DB_BEFORE || flags == DB_CURRENT) { memset(&dbt, 0, sizeof(DBT)); if ((ret = __db_ret(dbp, cp->page, 0, &dbt, - &dbc->rkey.data, &dbc->rkey.ulen)) != 0) + &dbc->rkey->data, &dbc->rkey->ulen)) != 0) goto err; arg = &dbt; } else @@ -1327,7 +1975,7 @@ split: needkey = ret = stack = 0; goto err; /* Split the tree. */ - if ((ret = __bam_split(dbc, arg)) != 0) + if ((ret = __bam_split(dbc, arg, &root_pgno)) != 0) return (ret); goto split; @@ -1361,22 +2009,22 @@ done: /* * __bam_c_rget -- * Return the record number for a cursor. * - * PUBLIC: int __bam_c_rget __P((DBC *, DBT *, u_int32_t)); + * PUBLIC: int __bam_c_rget __P((DBC *, DBT *)); */ int -__bam_c_rget(dbc, data, flags) +__bam_c_rget(dbc, data) DBC *dbc; DBT *data; - u_int32_t flags; { BTREE_CURSOR *cp; DB *dbp; DBT dbt; + DB_MPOOLFILE *mpf; db_recno_t recno; int exact, ret; - COMPQUIET(flags, 0); dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; /* @@ -1384,24 +2032,24 @@ __bam_c_rget(dbc, data, flags) * Get a copy of the key. * Release the page, making sure we don't release it twice. */ - if ((ret = memp_fget(dbp->mpf, &cp->pgno, 0, &cp->page)) != 0) + if ((ret = mpf->get(mpf, &cp->pgno, 0, &cp->page)) != 0) return (ret); memset(&dbt, 0, sizeof(DBT)); if ((ret = __db_ret(dbp, cp->page, - cp->indx, &dbt, &dbc->rkey.data, &dbc->rkey.ulen)) != 0) + cp->indx, &dbt, &dbc->rkey->data, &dbc->rkey->ulen)) != 0) goto err; - ret = memp_fput(dbp->mpf, cp->page, 0); + ret = mpf->put(mpf, cp->page, 0); cp->page = NULL; if (ret != 0) return (ret); - if ((ret = __bam_search(dbc, &dbt, + if ((ret = __bam_search(dbc, PGNO_INVALID, &dbt, F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND, 1, &recno, &exact)) != 0) goto err; - ret = __db_retcopy(dbp, data, - &recno, sizeof(recno), &dbc->rdata.data, &dbc->rdata.ulen); + ret = __db_retcopy(dbp->dbenv, data, + &recno, sizeof(recno), &dbc->rdata->data, &dbc->rdata->ulen); /* Release the stack. */ err: __bam_stkrel(dbc, 0); @@ -1444,17 +2092,15 @@ __bam_c_first(dbc) DBC *dbc; { BTREE_CURSOR *cp; - DB *dbp; db_pgno_t pgno; int ret; - dbp = dbc->dbp; cp = (BTREE_CURSOR *)dbc->internal; ret = 0; /* Walk down the left-hand side of the tree. */ for (pgno = cp->root;;) { - ACQUIRE_CUR_SET(dbc, DB_LOCK_READ, pgno, ret); + ACQUIRE_CUR_COUPLE(dbc, DB_LOCK_READ, pgno, ret); if (ret != 0) return (ret); @@ -1462,7 +2108,7 @@ __bam_c_first(dbc) if (ISLEAF(cp->page)) break; - pgno = GET_BINTERNAL(cp->page, 0)->pgno; + pgno = GET_BINTERNAL(dbc->dbp, cp->page, 0)->pgno; } /* If we want a write lock instead of a read lock, get it now. */ @@ -1472,9 +2118,11 @@ __bam_c_first(dbc) 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) + if ((ret = __bam_c_next(dbc, 0, 0)) != 0) return (ret); return (0); @@ -1489,17 +2137,15 @@ __bam_c_last(dbc) DBC *dbc; { BTREE_CURSOR *cp; - DB *dbp; db_pgno_t pgno; int ret; - dbp = dbc->dbp; cp = (BTREE_CURSOR *)dbc->internal; ret = 0; /* Walk down the right-hand side of the tree. */ for (pgno = cp->root;;) { - ACQUIRE_CUR_SET(dbc, DB_LOCK_READ, pgno, ret); + ACQUIRE_CUR_COUPLE(dbc, DB_LOCK_READ, pgno, ret); if (ret != 0) return (ret); @@ -1507,8 +2153,8 @@ __bam_c_last(dbc) if (ISLEAF(cp->page)) break; - pgno = - GET_BINTERNAL(cp->page, NUM_ENT(cp->page) - O_INDX)->pgno; + 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. */ @@ -1535,18 +2181,16 @@ __bam_c_last(dbc) * Move to the next record. */ static int -__bam_c_next(dbc, initial_move) +__bam_c_next(dbc, initial_move, deleted_okay) DBC *dbc; - int initial_move; + int initial_move, deleted_okay; { BTREE_CURSOR *cp; - DB *dbp; db_indx_t adjust; db_lockmode_t lock_mode; db_pgno_t pgno; int ret; - dbp = dbc->dbp; cp = (BTREE_CURSOR *)dbc->internal; ret = 0; @@ -1566,7 +2210,7 @@ __bam_c_next(dbc, initial_move) F_ISSET(dbc, DBC_RMW) ? DB_LOCK_WRITE : DB_LOCK_READ; } if (cp->page == NULL) { - ACQUIRE_CUR(dbc, lock_mode, ret); + ACQUIRE_CUR(dbc, lock_mode, cp->pgno, ret); if (ret != 0) return (ret); } @@ -1587,12 +2231,13 @@ __bam_c_next(dbc, initial_move) = NEXT_PGNO(cp->page)) == PGNO_INVALID) return (DB_NOTFOUND); - ACQUIRE_CUR_SET(dbc, lock_mode, pgno, ret); + ACQUIRE_CUR(dbc, lock_mode, pgno, ret); if (ret != 0) return (ret); + cp->indx = 0; continue; } - if (IS_CUR_DELETED(dbc)) { + if (!deleted_okay && IS_CUR_DELETED(dbc)) { cp->indx += adjust; continue; } @@ -1610,13 +2255,11 @@ __bam_c_prev(dbc) DBC *dbc; { BTREE_CURSOR *cp; - DB *dbp; db_indx_t adjust; db_lockmode_t lock_mode; db_pgno_t pgno; int ret; - dbp = dbc->dbp; cp = (BTREE_CURSOR *)dbc->internal; ret = 0; @@ -1636,7 +2279,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, ret); + ACQUIRE_CUR(dbc, lock_mode, cp->pgno, ret); if (ret != 0) return (ret); } @@ -1648,7 +2291,7 @@ __bam_c_prev(dbc) PREV_PGNO(cp->page)) == PGNO_INVALID) return (DB_NOTFOUND); - ACQUIRE_CUR_SET(dbc, lock_mode, pgno, ret); + ACQUIRE_CUR(dbc, lock_mode, pgno, ret); if (ret != 0) return (ret); @@ -1671,8 +2314,9 @@ __bam_c_prev(dbc) * Move to a specified record. */ static int -__bam_c_search(dbc, key, flags, exactp) +__bam_c_search(dbc, root_pgno, key, flags, exactp) DBC *dbc; + db_pgno_t root_pgno; const DBT *key; u_int32_t flags; int *exactp; @@ -1681,7 +2325,7 @@ __bam_c_search(dbc, key, flags, exactp) BTREE_CURSOR *cp; DB *dbp; PAGE *h; - db_indx_t indx; + db_indx_t indx, *inp; db_pgno_t bt_lpgno; db_recno_t recno; u_int32_t sflags; @@ -1712,6 +2356,9 @@ __bam_c_search(dbc, key, flags, exactp) case DB_GET_BOTH: sflags = (F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND) | S_EXACT; goto search; + case DB_GET_BOTH_RANGE: + sflags = (F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND); + goto search; case DB_SET_RANGE: sflags = (F_ISSET(dbc, DBC_RMW) ? S_WRITE : S_READ) | S_DUPFIRST; @@ -1758,6 +2405,7 @@ fast_search: /* if (ret != 0) goto fast_miss; + inp = P_INP(dbp, h); /* * It's okay if the page type isn't right or it's empty, it * just means that the world changed. @@ -1796,7 +2444,7 @@ fast_search: /* if (flags == DB_KEYLAST) goto fast_hit; for (; - indx > 0 && h->inp[indx - P_INDX] == h->inp[indx]; + indx > 0 && inp[indx - P_INDX] == inp[indx]; indx -= P_INDX) ; goto fast_hit; @@ -1823,7 +2471,7 @@ try_begin: if (h->prev_pgno == PGNO_INVALID) { goto fast_hit; for (; indx < (db_indx_t)(NUM_ENT(h) - P_INDX) && - h->inp[indx] == h->inp[indx + P_INDX]; + inp[indx] == inp[indx + P_INDX]; indx += P_INDX) ; goto fast_hit; @@ -1852,8 +2500,8 @@ fast_miss: /* if (ret != 0) return (ret); -search: if ((ret = - __bam_search(dbc, key, sflags, 1, NULL, exactp)) != 0) +search: if ((ret = __bam_search(dbc, root_pgno, + key, sflags, 1, NULL, exactp)) != 0) return (ret); break; default: @@ -1870,12 +2518,15 @@ search: if ((ret = /* * If we inserted a key into the first or last slot of the tree, * remember where it was so we can do it more quickly next time. + * If there are duplicates and we are inserting into the last slot, + * the cursor will point _to_ the last item, not after it, which + * is why we subtract P_INDX below. */ if (TYPE(cp->page) == P_LBTREE && (flags == DB_KEYFIRST || flags == DB_KEYLAST)) t->bt_lpgno = (NEXT_PGNO(cp->page) == PGNO_INVALID && - cp->indx >= NUM_ENT(cp->page)) || + cp->indx >= NUM_ENT(cp->page) - P_INDX) || (PREV_PGNO(cp->page) == PGNO_INVALID && cp->indx == 0) ? cp->pgno : PGNO_INVALID; return (0); @@ -1893,11 +2544,13 @@ __bam_c_physdel(dbc) DB *dbp; DBT key; DB_LOCK lock; + DB_MPOOLFILE *mpf; PAGE *h; db_pgno_t pgno; int delete_page, empty_page, exact, level, ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; delete_page = empty_page = ret = 0; @@ -1911,7 +2564,7 @@ __bam_c_physdel(dbc) * space will never be reused unless the exact same key is specified. */ if (delete_page && - !F_ISSET(dbc, DBC_OPD) && F_ISSET(dbp, DB_BT_REVSPLIT)) + !F_ISSET(dbc, DBC_OPD) && F_ISSET(dbp, DB_AM_REVSPLITOFF)) delete_page = 0; /* @@ -1926,11 +2579,17 @@ __bam_c_physdel(dbc) * To delete a leaf page other than an empty root page, we need a * copy of a key from the page. Use the 0th page index since it's * the last key the page held. + * + * !!! + * Note that because __bam_c_physdel is always called from a cursor + * close, it should be safe to use the cursor's own "my_rkey" memory + * 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) { memset(&key, 0, sizeof(DBT)); if ((ret = __db_ret(dbp, cp->page, - 0, &key, &dbc->rkey.data, &dbc->rkey.ulen)) != 0) + 0, &key, &dbc->my_rkey.data, &dbc->my_rkey.ulen)) != 0) return (ret); } @@ -1940,7 +2599,7 @@ __bam_c_physdel(dbc) * !!! * The following operations to delete a page may deadlock. The easy * scenario is if we're deleting an item because we're closing cursors - * because we've already deadlocked and want to call txn_abort(). If + * because we've already deadlocked and want to call txn->abort. If * we fail due to deadlock, we'll leave a locked, possibly empty page * in the tree, which won't be empty long because we'll undo the delete * when we undo the transaction's modifications. @@ -1977,8 +2636,8 @@ __bam_c_physdel(dbc) */ for (level = LEAFLEVEL;; ++level) { /* Acquire a page and its parent, locked. */ - if ((ret = __bam_search( - dbc, &key, S_WRPAIR, level, NULL, &exact)) != 0) + if ((ret = __bam_search(dbc, PGNO_INVALID, + &key, S_WRPAIR, level, NULL, &exact)) != 0) return (ret); /* @@ -2031,19 +2690,19 @@ __bam_c_physdel(dbc) */ switch (TYPE(h)) { case P_IBTREE: - pgno = GET_BINTERNAL(h, 0)->pgno; + pgno = GET_BINTERNAL(dbp, h, 0)->pgno; break; case P_IRECNO: - pgno = GET_RINTERNAL(h, 0)->pgno; + pgno = GET_RINTERNAL(dbp, h, 0)->pgno; break; default: - return (__db_pgfmt(dbp, PGNO(h))); + 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(dbp->mpf, &pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) break; BT_STK_PUSH(dbp->dbenv, cp, h, 0, lock, DB_LOCK_WRITE, ret); if (ret != 0) @@ -2076,10 +2735,12 @@ __bam_c_getstack(dbc) BTREE_CURSOR *cp; DB *dbp; DBT dbt; + DB_MPOOLFILE *mpf; PAGE *h; int exact, ret, t_ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; /* @@ -2087,21 +2748,22 @@ __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(dbp->mpf, &cp->pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &cp->pgno, 0, &h)) != 0) return (ret); /* Get a copy of a key from the page. */ memset(&dbt, 0, sizeof(DBT)); if ((ret = __db_ret(dbp, - h, 0, &dbt, &dbc->rkey.data, &dbc->rkey.ulen)) != 0) + h, 0, &dbt, &dbc->rkey->data, &dbc->rkey->ulen)) != 0) goto err; /* Get a write-locked stack for the page. */ exact = 0; - ret = __bam_search(dbc, &dbt, S_KEYFIRST, 1, NULL, &exact); + ret = __bam_search(dbc, PGNO_INVALID, + &dbt, S_KEYFIRST, 1, NULL, &exact); err: /* Discard the key and the page. */ - if ((t_ret = memp_fput(dbp->mpf, h, 0)) != 0 && ret == 0) + if ((t_ret = mpf->put(mpf, h, 0)) != 0 && ret == 0) ret = t_ret; return (ret); @@ -2122,7 +2784,8 @@ __bam_isopd(dbc, pgnop) if (TYPE(dbc->internal->page) != P_LBTREE) return (0); - bo = GET_BOVERFLOW(dbc->internal->page, dbc->internal->indx + O_INDX); + bo = GET_BOVERFLOW(dbc->dbp, + dbc->internal->page, dbc->internal->indx + O_INDX); if (B_TYPE(bo->type) == B_DUPLICATE) { *pgnop = bo->pgno; return (1); diff --git a/bdb/btree/bt_delete.c b/bdb/btree/bt_delete.c index 9725887882a..8c76ead2922 100644 --- a/bdb/btree/bt_delete.c +++ b/bdb/btree/bt_delete.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -43,7 +43,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_delete.c,v 11.31 2001/01/17 18:48:46 bostic Exp $"; +static const char revid[] = "$Id: bt_delete.c,v 11.44 2002/07/03 19:03:49 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -53,88 +53,10 @@ static const char revid[] = "$Id: bt_delete.c,v 11.31 2001/01/17 18:48:46 bostic #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "btree.h" -#include "lock.h" - -/* - * __bam_delete -- - * Delete the items referenced by a key. - * - * PUBLIC: int __bam_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); - */ -int -__bam_delete(dbp, txn, key, flags) - DB *dbp; - DB_TXN *txn; - DBT *key; - u_int32_t flags; -{ - DBC *dbc; - DBT lkey; - DBT data; - u_int32_t f_init, f_next; - int ret, t_ret; - - PANIC_CHECK(dbp->dbenv); - DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->del"); - DB_CHECK_TXN(dbp, txn); - - /* Check for invalid flags. */ - if ((ret = - __db_delchk(dbp, key, flags, F_ISSET(dbp, DB_AM_RDONLY))) != 0) - return (ret); - - /* Allocate a cursor. */ - if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) - return (ret); - - DEBUG_LWRITE(dbc, txn, "bam_delete", key, NULL, 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. - */ - 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); - - /* - * If locking (and we haven't already acquired CDB locks), set the - * read-modify-write flag. - */ - f_init = DB_SET; - f_next = DB_NEXT_DUP; - if (STD_LOCKING(dbc)) { - f_init |= DB_RMW; - f_next |= DB_RMW; - } - - /* Walk through the set of key/data pairs, deleting as we go. */ - if ((ret = dbc->c_get(dbc, key, &data, f_init)) != 0) - goto err; - for (;;) { - if ((ret = dbc->c_del(dbc, 0)) != 0) - goto err; - if ((ret = dbc->c_get(dbc, &lkey, &data, f_next)) != 0) { - if (ret == DB_NOTFOUND) { - ret = 0; - break; - } - goto err; - } - } - -err: /* Discard the cursor. */ - if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) - ret = t_ret; - - return (ret); -} +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/btree.h" +#include "dbinc/lock.h" /* * __bam_ditem -- @@ -151,14 +73,18 @@ __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); switch (TYPE(h)) { case P_IBTREE: - bi = GET_BINTERNAL(h, indx); + bi = GET_BINTERNAL(dbp, h, indx); switch (B_TYPE(bi->type)) { case B_DUPLICATE: case B_KEYDATA: @@ -171,7 +97,7 @@ __bam_ditem(dbc, h, indx) return (ret); break; default: - return (__db_pgfmt(dbp, PGNO(h))); + return (__db_pgfmt(dbp->dbenv, PGNO(h))); } break; case P_IRECNO: @@ -195,7 +121,7 @@ __bam_ditem(dbc, h, indx) * won't work! */ if (indx + P_INDX < (u_int32_t)NUM_ENT(h) && - h->inp[indx] == h->inp[indx + P_INDX]) + inp[indx] == inp[indx + P_INDX]) return (__bam_adjindx(dbc, h, indx, indx + O_INDX, 0)); /* @@ -203,14 +129,14 @@ __bam_ditem(dbc, h, indx) * doesn't matter if we delete the key item before or * after the data item for the purposes of this one. */ - if (indx > 0 && h->inp[indx] == h->inp[indx - P_INDX]) + if (indx > 0 && inp[indx] == inp[indx - P_INDX]) return (__bam_adjindx(dbc, h, indx, indx - P_INDX, 0)); } /* FALLTHROUGH */ case P_LDUP: case P_LRECNO: - bk = GET_BKEYDATA(h, indx); + bk = GET_BKEYDATA(dbp, h, indx); switch (B_TYPE(bk->type)) { case B_DUPLICATE: nbytes = BOVERFLOW_SIZE; @@ -218,24 +144,24 @@ __bam_ditem(dbc, h, indx) case B_OVERFLOW: nbytes = BOVERFLOW_SIZE; if ((ret = __db_doff( - dbc, (GET_BOVERFLOW(h, indx))->pgno)) != 0) + dbc, (GET_BOVERFLOW(dbp, h, indx))->pgno)) != 0) return (ret); break; case B_KEYDATA: nbytes = BKEYDATA_SIZE(bk->len); break; default: - return (__db_pgfmt(dbp, PGNO(h))); + return (__db_pgfmt(dbp->dbenv, PGNO(h))); } break; default: - return (__db_pgfmt(dbp, PGNO(h))); + return (__db_pgfmt(dbp->dbenv, PGNO(h))); } /* Delete the item and mark the page dirty. */ if ((ret = __db_ditem(dbc, h, indx, nbytes)) != 0) return (ret); - if ((ret = memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->set(mpf, h, DB_MPOOL_DIRTY)) != 0) return (ret); return (0); @@ -255,33 +181,37 @@ __bam_adjindx(dbc, h, indx, indx_copy, is_insert) int is_insert; { DB *dbp; - db_indx_t copy; + DB_MPOOLFILE *mpf; + db_indx_t copy, *inp; int ret; dbp = dbc->dbp; + mpf = dbp->mpf; + inp = P_INP(dbp, h); /* Log the change. */ - if (DB_LOGGING(dbc) && - (ret = __bam_adj_log(dbp->dbenv, dbc->txn, &LSN(h), - 0, dbp->log_fileid, PGNO(h), &LSN(h), indx, indx_copy, - (u_int32_t)is_insert)) != 0) - return (ret); + if (DBC_LOGGING(dbc)) { + if ((ret = __bam_adj_log(dbp, dbc->txn, &LSN(h), 0, + PGNO(h), &LSN(h), indx, indx_copy, (u_int32_t)is_insert)) != 0) + return (ret); + } else + LSN_NOT_LOGGED(LSN(h)); /* Shuffle the indices and mark the page dirty. */ if (is_insert) { - copy = h->inp[indx_copy]; + copy = inp[indx_copy]; if (indx != NUM_ENT(h)) - memmove(&h->inp[indx + O_INDX], &h->inp[indx], + memmove(&inp[indx + O_INDX], &inp[indx], sizeof(db_indx_t) * (NUM_ENT(h) - indx)); - h->inp[indx] = copy; + inp[indx] = copy; ++NUM_ENT(h); } else { --NUM_ENT(h); if (indx != NUM_ENT(h)) - memmove(&h->inp[indx], &h->inp[indx + O_INDX], + memmove(&inp[indx], &inp[indx + O_INDX], sizeof(db_indx_t) * (NUM_ENT(h) - indx)); } - if ((ret = memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->set(mpf, h, DB_MPOOL_DIRTY)) != 0) return (ret); return (0); @@ -303,6 +233,7 @@ __bam_dpages(dbc, stack_epg) DB *dbp; DBT a, b; DB_LOCK c_lock, p_lock; + DB_MPOOLFILE *mpf; EPG *epg; PAGE *child, *parent; db_indx_t nitems; @@ -311,6 +242,7 @@ __bam_dpages(dbc, stack_epg) int done, ret, t_ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; /* @@ -328,8 +260,7 @@ __bam_dpages(dbc, stack_epg) */ ret = 0; for (epg = cp->sp; epg < stack_epg; ++epg) { - if ((t_ret = - memp_fput(dbp->mpf, epg->page, 0)) != 0 && ret == 0) + if ((t_ret = mpf->put(mpf, epg->page, 0)) != 0 && ret == 0) ret = t_ret; (void)__TLPUT(dbc, epg->lock); } @@ -364,7 +295,7 @@ __bam_dpages(dbc, stack_epg) pgno = PGNO(epg->page); nitems = NUM_ENT(epg->page); - if ((ret = memp_fput(dbp->mpf, epg->page, 0)) != 0) + if ((ret = mpf->put(mpf, epg->page, 0)) != 0) goto err_inc; (void)__TLPUT(dbc, epg->lock); @@ -394,7 +325,7 @@ __bam_dpages(dbc, stack_epg) err_inc: ++epg; err: for (; epg <= cp->csp; ++epg) { if (epg->page != NULL) - (void)memp_fput(dbp->mpf, epg->page, 0); + (void)mpf->put(mpf, epg->page, 0); (void)__TLPUT(dbc, epg->lock); } BT_STK_CLR(cp); @@ -415,14 +346,15 @@ err: for (; epg <= cp->csp; ++epg) { for (done = 0; !done;) { /* Initialize. */ parent = child = NULL; - p_lock.off = c_lock.off = LOCK_INVALID; + LOCK_INIT(p_lock); + LOCK_INIT(c_lock); /* Lock the root. */ pgno = root_pgno; if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &p_lock)) != 0) goto stop; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &parent)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &parent)) != 0) goto stop; if (NUM_ENT(parent) != 1) @@ -434,7 +366,7 @@ err: for (; epg <= cp->csp; ++epg) { * If this is overflow, then try to delete it. * The child may or may not still point at it. */ - bi = GET_BINTERNAL(parent, 0); + bi = GET_BINTERNAL(dbp, parent, 0); if (B_TYPE(bi->type) == B_OVERFLOW) if ((ret = __db_doff(dbc, ((BOVERFLOW *)bi->data)->pgno)) != 0) @@ -442,7 +374,7 @@ err: for (; epg <= cp->csp; ++epg) { pgno = bi->pgno; break; case P_IRECNO: - pgno = GET_RINTERNAL(parent, 0)->pgno; + pgno = GET_RINTERNAL(dbp, parent, 0)->pgno; break; default: goto stop; @@ -452,24 +384,24 @@ 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(dbp->mpf, &pgno, 0, &child)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &child)) != 0) goto stop; /* Log the change. */ - if (DB_LOGGING(dbc)) { + if (DBC_LOGGING(dbc)) { memset(&a, 0, sizeof(a)); a.data = child; a.size = dbp->pgsize; memset(&b, 0, sizeof(b)); - b.data = P_ENTRY(parent, 0); + b.data = P_ENTRY(dbp, parent, 0); b.size = TYPE(parent) == P_IRECNO ? RINTERNAL_SIZE : BINTERNAL_SIZE(((BINTERNAL *)b.data)->len); - if ((ret = - __bam_rsplit_log(dbp->dbenv, dbc->txn, &child->lsn, - 0, dbp->log_fileid, PGNO(child), &a, PGNO(parent), - RE_NREC(parent), &b, &parent->lsn)) != 0) + if ((ret = __bam_rsplit_log(dbp, dbc->txn, + &child->lsn, 0, PGNO(child), &a, PGNO(parent), + RE_NREC(parent), &b, &parent->lsn)) != 0) goto stop; - } + } else + LSN_NOT_LOGGED(child->lsn); /* * Make the switch. @@ -491,9 +423,9 @@ err: for (; epg <= cp->csp; ++epg) { RE_NREC_SET(parent, rcnt); /* Mark the pages dirty. */ - if ((ret = memp_fset(dbp->mpf, parent, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->set(mpf, parent, DB_MPOOL_DIRTY)) != 0) goto stop; - if ((ret = memp_fset(dbp->mpf, child, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->set(mpf, child, DB_MPOOL_DIRTY)) != 0) goto stop; /* Adjust the cursors. */ @@ -514,15 +446,13 @@ err: for (; epg <= cp->csp; ++epg) { if (0) { stop: done = 1; } - if (p_lock.off != LOCK_INVALID) - (void)__TLPUT(dbc, p_lock); + (void)__TLPUT(dbc, p_lock); if (parent != NULL && - (t_ret = memp_fput(dbp->mpf, parent, 0)) != 0 && ret == 0) + (t_ret = mpf->put(mpf, parent, 0)) != 0 && ret == 0) ret = t_ret; - if (c_lock.off != LOCK_INVALID) - (void)__TLPUT(dbc, c_lock); + (void)__TLPUT(dbc, c_lock); if (child != NULL && - (t_ret = memp_fput(dbp->mpf, child, 0)) != 0 && ret == 0) + (t_ret = mpf->put(mpf, child, 0)) != 0 && ret == 0) ret = t_ret; } diff --git a/bdb/btree/bt_method.c b/bdb/btree/bt_method.c index 5e3af27d033..aa27ed6bab9 100644 --- a/bdb/btree/bt_method.c +++ b/bdb/btree/bt_method.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1999, 2000 + * Copyright (c) 1999-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_method.c,v 11.20 2000/11/30 00:58:28 ubell Exp $"; +static const char revid[] = "$Id: bt_method.c,v 11.29 2002/04/21 13:17:04 margo Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -16,9 +16,9 @@ static const char revid[] = "$Id: bt_method.c,v 11.20 2000/11/30 00:58:28 ubell #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" -#include "qam.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" +#include "dbinc/qam.h" static int __bam_set_bt_compare __P((DB *, int (*)(DB *, const DBT *, const DBT *))); @@ -82,7 +82,8 @@ __bam_db_close(dbp) { BTREE *t; - t = dbp->bt_internal; + if ((t = dbp->bt_internal) == NULL) + return (0); /* Recno */ /* Close any backing source file descriptor. */ if (t->re_fp != NULL) @@ -90,9 +91,9 @@ __bam_db_close(dbp) /* Free any backing source file name. */ if (t->re_source != NULL) - __os_freestr(t->re_source); + __os_free(dbp->dbenv, t->re_source); - __os_free(t, sizeof(BTREE)); + __os_free(dbp->dbenv, t); dbp->bt_internal = NULL; return (0); @@ -127,7 +128,7 @@ __bam_set_flags(dbp, flagsp) if (LF_ISSET(DB_DUP | DB_DUPSORT)) { /* DB_DUP/DB_DUPSORT is incompatible with DB_RECNUM. */ - if (F_ISSET(dbp, DB_BT_RECNUM)) + if (F_ISSET(dbp, DB_AM_RECNUM)) goto incompat; if (LF_ISSET(DB_DUPSORT)) { @@ -145,12 +146,12 @@ __bam_set_flags(dbp, flagsp) if (F_ISSET(dbp, DB_AM_DUP)) goto incompat; - F_SET(dbp, DB_BT_RECNUM); + F_SET(dbp, DB_AM_RECNUM); LF_CLR(DB_RECNUM); } if (LF_ISSET(DB_REVSPLITOFF)) { - F_SET(dbp, DB_BT_REVSPLIT); + F_SET(dbp, DB_AM_REVSPLITOFF); LF_CLR(DB_REVSPLITOFF); } @@ -279,12 +280,12 @@ __ram_set_flags(dbp, flagsp) DB_ILLEGAL_METHOD(dbp, DB_OK_RECNO); if (LF_ISSET(DB_RENUMBER)) { - F_SET(dbp, DB_RE_RENUMBER); + F_SET(dbp, DB_AM_RENUMBER); LF_CLR(DB_RENUMBER); } if (LF_ISSET(DB_SNAPSHOT)) { - F_SET(dbp, DB_RE_SNAPSHOT); + F_SET(dbp, DB_AM_SNAPSHOT); LF_CLR(DB_SNAPSHOT); } @@ -310,7 +311,7 @@ __ram_set_re_delim(dbp, re_delim) t = dbp->bt_internal; t->re_delim = re_delim; - F_SET(dbp, DB_RE_DELIMITER); + F_SET(dbp, DB_AM_DELIMITER); return (0); } @@ -336,7 +337,7 @@ __ram_set_re_len(dbp, re_len) q = dbp->q_internal; q->re_len = re_len; - F_SET(dbp, DB_RE_FIXEDLEN); + F_SET(dbp, DB_AM_FIXEDLEN); return (0); } @@ -362,7 +363,7 @@ __ram_set_re_pad(dbp, re_pad) q = dbp->q_internal; q->re_pad = re_pad; - F_SET(dbp, DB_RE_PAD); + F_SET(dbp, DB_AM_PAD); return (0); } diff --git a/bdb/btree/bt_open.c b/bdb/btree/bt_open.c index 405c1880f5e..0b72391c267 100644 --- a/bdb/btree/bt_open.c +++ b/bdb/btree/bt_open.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -43,7 +43,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_open.c,v 11.42 2000/11/30 00:58:28 ubell Exp $"; +static const char revid[] = "$Id: bt_open.c,v 11.76 2002/09/04 19:06:42 margo Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -54,33 +54,38 @@ static const char revid[] = "$Id: bt_open.c,v 11.42 2000/11/30 00:58:28 ubell Ex #endif #include "db_int.h" -#include "db_page.h" -#include "db_swap.h" -#include "btree.h" -#include "db_shash.h" -#include "lock.h" -#include "log.h" -#include "mp.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/fop.h" + +static void __bam_init_meta __P((DB *, BTMETA *, db_pgno_t, DB_LSN *)); /* * __bam_open -- * Open a btree. * - * PUBLIC: int __bam_open __P((DB *, const char *, db_pgno_t, u_int32_t)); + * PUBLIC: int __bam_open __P((DB *, + * PUBLIC: DB_TXN *, const char *, db_pgno_t, u_int32_t)); */ int -__bam_open(dbp, name, base_pgno, flags) +__bam_open(dbp, txn, name, base_pgno, flags) DB *dbp; + DB_TXN *txn; const char *name; db_pgno_t base_pgno; u_int32_t flags; { BTREE *t; + COMPQUIET(name, NULL); t = dbp->bt_internal; /* Initialize the remaining fields/methods of the DB. */ - dbp->del = __bam_delete; dbp->key_range = __bam_key_range; dbp->stat = __bam_stat; @@ -99,8 +104,8 @@ __bam_open(dbp, name, base_pgno, flags) * Verify that the bt_minkey value specified won't cause the * calculation of ovflsize to underflow [#2406] for this pagesize. */ - if (B_MINKEY_TO_OVFLSIZE(t->bt_minkey, dbp->pgsize) > - B_MINKEY_TO_OVFLSIZE(DEFMINKEYPAGE, dbp->pgsize)) { + if (B_MINKEY_TO_OVFLSIZE(dbp, t->bt_minkey, dbp->pgsize) > + B_MINKEY_TO_OVFLSIZE(dbp, DEFMINKEYPAGE, dbp->pgsize)) { __db_err(dbp->dbenv, "bt_minkey value of %lu too high for page size of %lu", (u_long)t->bt_minkey, (u_long)dbp->pgsize); @@ -108,7 +113,7 @@ __bam_open(dbp, name, base_pgno, flags) } /* Start up the tree. */ - return (__bam_read_root(dbp, name, base_pgno, flags)); + return (__bam_read_root(dbp, txn, base_pgno, flags)); } /* @@ -143,6 +148,7 @@ __bam_metachk(dbp, name, btm) name, (u_long)vers); return (DB_OLD_VERSION); case 8: + case 9: break; default: __db_err(dbenv, @@ -187,13 +193,13 @@ __bam_metachk(dbp, name, btm) if (F_ISSET(&btm->dbmeta, BTM_RECNUM)) { if (dbp->type != DB_BTREE) goto wrong_type; - F_SET(dbp, DB_BT_RECNUM); + F_SET(dbp, DB_AM_RECNUM); if ((ret = __db_fcchk(dbenv, - "DB->open", dbp->flags, DB_AM_DUP, DB_BT_RECNUM)) != 0) + "DB->open", dbp->flags, DB_AM_DUP, DB_AM_RECNUM)) != 0) return (ret); } else - if (F_ISSET(dbp, DB_BT_RECNUM)) { + if (F_ISSET(dbp, DB_AM_RECNUM)) { __db_err(dbenv, "%s: DB_RECNUM specified to open method but not set in database", name); @@ -203,9 +209,9 @@ __bam_metachk(dbp, name, btm) if (F_ISSET(&btm->dbmeta, BTM_FIXEDLEN)) { if (dbp->type != DB_RECNO) goto wrong_type; - F_SET(dbp, DB_RE_FIXEDLEN); + F_SET(dbp, DB_AM_FIXEDLEN); } else - if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { + if (F_ISSET(dbp, DB_AM_FIXEDLEN)) { __db_err(dbenv, "%s: DB_FIXEDLEN specified to open method but not set in database", name); @@ -215,9 +221,9 @@ __bam_metachk(dbp, name, btm) if (F_ISSET(&btm->dbmeta, BTM_RENUMBER)) { if (dbp->type != DB_RECNO) goto wrong_type; - F_SET(dbp, DB_RE_RENUMBER); + F_SET(dbp, DB_AM_RENUMBER); } else - if (F_ISSET(dbp, DB_RE_RENUMBER)) { + if (F_ISSET(dbp, DB_AM_RENUMBER)) { __db_err(dbenv, "%s: DB_RENUMBER specified to open method but not set in database", name); @@ -266,116 +272,129 @@ wrong_type: /* * __bam_read_root -- - * Check (and optionally create) a tree. + * Read the root page and check a tree. * - * PUBLIC: int __bam_read_root __P((DB *, const char *, db_pgno_t, u_int32_t)); + * PUBLIC: int __bam_read_root __P((DB *, DB_TXN *, db_pgno_t, u_int32_t)); */ int -__bam_read_root(dbp, name, base_pgno, flags) +__bam_read_root(dbp, txn, base_pgno, flags) DB *dbp; - const char *name; + DB_TXN *txn; db_pgno_t base_pgno; u_int32_t flags; { BTMETA *meta; BTREE *t; DBC *dbc; - DB_LSN orig_lsn; DB_LOCK metalock; - PAGE *root; - int locked, ret, t_ret; + DB_MPOOLFILE *mpf; + int ret, t_ret; - ret = 0; - t = dbp->bt_internal; meta = NULL; - root = NULL; - locked = 0; + t = dbp->bt_internal; + LOCK_INIT(metalock); + mpf = dbp->mpf; + ret = 0; - /* - * Get a cursor. If DB_CREATE is specified, we may be creating - * the root page, and to do that safely in CDB we need a write - * cursor. In STD_LOCKING mode, we'll synchronize using the - * meta page lock instead. - */ - if ((ret = dbp->cursor(dbp, dbp->open_txn, - &dbc, LF_ISSET(DB_CREATE) && CDB_LOCKING(dbp->dbenv) ? - DB_WRITECURSOR : 0)) != 0) + /* Get a cursor. */ + if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0) return (ret); - /* Get, and optionally create the metadata page. */ + /* Get the metadata page. */ if ((ret = __db_lget(dbc, 0, base_pgno, DB_LOCK_READ, 0, &metalock)) != 0) goto err; - if ((ret = memp_fget( - dbp->mpf, &base_pgno, DB_MPOOL_CREATE, (PAGE **)&meta)) != 0) + if ((ret = mpf->get(mpf, &base_pgno, 0, (PAGE **)&meta)) != 0) goto err; /* - * If the magic number is correct, we're not creating the tree. - * Correct any fields that may not be right. Note, all of the - * local flags were set by DB->open. + * If the magic number is set, the tree has been created. Correct + * any fields that may not be right. Note, all of the local flags + * were set by DB->open. + * + * Otherwise, we'd better be in recovery or abort, in which case the + * metadata page will be created/initialized elsewhere. */ -again: if (meta->dbmeta.magic != 0) { - t->bt_maxkey = meta->maxkey; - t->bt_minkey = meta->minkey; - t->re_pad = meta->re_pad; - t->re_len = meta->re_len; + DB_ASSERT(meta->dbmeta.magic != 0 || + IS_RECOVERING(dbp->dbenv) || F_ISSET(dbp, DB_AM_RECOVER)); - t->bt_meta = base_pgno; - t->bt_root = meta->root; + t->bt_maxkey = meta->maxkey; + t->bt_minkey = meta->minkey; + t->re_pad = meta->re_pad; + t->re_len = meta->re_len; - (void)memp_fput(dbp->mpf, meta, 0); - meta = NULL; - goto done; - } - - /* In recovery if it's not there it will be created elsewhere.*/ - if (IS_RECOVERING(dbp->dbenv)) - goto done; - - /* If we're doing CDB; we now have to get the write lock. */ - if (CDB_LOCKING(dbp->dbenv)) { - /* - * We'd better have DB_CREATE set if we're actually doing - * the create. - */ - DB_ASSERT(LF_ISSET(DB_CREATE)); - if ((ret = lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, - &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) - goto err; - } + t->bt_meta = base_pgno; + t->bt_root = meta->root; /* - * If we are doing locking, relase the read lock and get a write lock. - * We want to avoid deadlock. + * !!! + * If creating a subdatabase, we've already done an insert when + * we put the subdatabase's entry into the master database, so + * our last-page-inserted value is wrongly initialized for the + * master database, not the subdatabase we're creating. I'm not + * sure where the *right* place to clear this value is, it's not + * intuitively obvious that it belongs here. */ - if (locked == 0 && STD_LOCKING(dbc)) { - if ((ret = __LPUT(dbc, metalock)) != 0) - goto err; - if ((ret = __db_lget(dbc, - 0, base_pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) - goto err; - locked = 1; - goto again; - } + t->bt_lpgno = PGNO_INVALID; + + /* We must initialize last_pgno, it could be stale. */ + if (!LF_ISSET(DB_RDONLY) && dbp->meta_pgno == PGNO_BASE_MD) { + mpf->last_pgno(mpf, &meta->dbmeta.last_pgno); + ret = mpf->put(mpf, meta, DB_MPOOL_DIRTY); + } else + ret = mpf->put(mpf, meta, 0); + meta = NULL; + +err: /* Put the metadata page back. */ + if (meta != NULL && (t_ret = mpf->put(mpf, meta, 0)) != 0 && ret == 0) + ret = t_ret; + if ((t_ret = __LPUT(dbc, metalock)) != 0 && ret == 0) + ret = t_ret; + + if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) + ret = t_ret; + return (ret); +} + +/* + * __bam_init_meta -- + * + * Initialize a btree meta-data page. The following fields may need + * to be updated later: last_pgno, root. + */ +static void +__bam_init_meta(dbp, meta, pgno, lsnp) + DB *dbp; + BTMETA *meta; + db_pgno_t pgno; + DB_LSN *lsnp; +{ + BTREE *t; - /* Initialize the tree structure metadata information. */ - orig_lsn = meta->dbmeta.lsn; memset(meta, 0, sizeof(BTMETA)); - meta->dbmeta.lsn = orig_lsn; - meta->dbmeta.pgno = base_pgno; + meta->dbmeta.lsn = *lsnp; + meta->dbmeta.pgno = pgno; meta->dbmeta.magic = DB_BTREEMAGIC; meta->dbmeta.version = DB_BTREEVERSION; meta->dbmeta.pagesize = dbp->pgsize; + if (F_ISSET(dbp, DB_AM_CHKSUM)) + 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); + meta->crypto_magic = meta->dbmeta.magic; + } meta->dbmeta.type = P_BTREEMETA; meta->dbmeta.free = PGNO_INVALID; + meta->dbmeta.last_pgno = pgno; if (F_ISSET(dbp, DB_AM_DUP)) F_SET(&meta->dbmeta, BTM_DUP); - if (F_ISSET(dbp, DB_RE_FIXEDLEN)) + if (F_ISSET(dbp, DB_AM_FIXEDLEN)) F_SET(&meta->dbmeta, BTM_FIXEDLEN); - if (F_ISSET(dbp, DB_BT_RECNUM)) + if (F_ISSET(dbp, DB_AM_RECNUM)) F_SET(&meta->dbmeta, BTM_RECNUM); - if (F_ISSET(dbp, DB_RE_RENUMBER)) + if (F_ISSET(dbp, DB_AM_RENUMBER)) F_SET(&meta->dbmeta, BTM_RENUMBER); if (F_ISSET(dbp, DB_AM_SUBDB)) F_SET(&meta->dbmeta, BTM_SUBDB); @@ -385,14 +404,165 @@ again: if (meta->dbmeta.magic != 0) { 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 = t->re_pad; +} - /* If necessary, log the meta-data and root page creates. */ - if ((ret = __db_log_page(dbp, - name, &orig_lsn, base_pgno, (PAGE *)meta)) != 0) +/* + * __bam_new_file -- + * Create the necessary pages to begin a new database file. + * + * This code appears more complex than it is because of the two cases (named + * and unnamed). The way to read the code is that for each page being created, + * there are three parts: 1) a "get page" chunk (which either uses malloc'd + * memory or calls mpf->get), 2) the initialization, and 3) the "put page" + * chunk which either does a fop write or an mpf->put. + * + * PUBLIC: int __bam_new_file __P((DB *, DB_TXN *, DB_FH *, const char *)); + */ +int +__bam_new_file(dbp, txn, fhp, name) + DB *dbp; + DB_TXN *txn; + DB_FH *fhp; + const char *name; +{ + BTMETA *meta; + DB_ENV *dbenv; + DB_LSN lsn; + DB_MPOOLFILE *mpf; + DB_PGINFO pginfo; + DBT pdbt; + PAGE *root; + db_pgno_t pgno; + int ret; + void *buf; + + dbenv = dbp->dbenv; + mpf = dbp->mpf; + root = NULL; + meta = NULL; + memset(&pdbt, 0, sizeof(pdbt)); + + /* Build meta-data page. */ + + if (name == NULL) { + pgno = PGNO_BASE_MD; + ret = mpf->get(mpf, &pgno, DB_MPOOL_CREATE, &meta); + } else { + pginfo.db_pagesize = dbp->pgsize; + pginfo.flags = + F_ISSET(dbp, (DB_AM_CHKSUM | DB_AM_ENCRYPT | DB_AM_SWAP)); + pginfo.type = dbp->type; + pdbt.data = &pginfo; + pdbt.size = sizeof(pginfo); + ret = __os_calloc(dbp->dbenv, 1, dbp->pgsize, &buf); + meta = (BTMETA *)buf; + } + if (ret != 0) + return (ret); + + LSN_NOT_LOGGED(lsn); + __bam_init_meta(dbp, meta, PGNO_BASE_MD, &lsn); + meta->root = 1; + meta->dbmeta.last_pgno = 1; + + if (name == NULL) + ret = mpf->put(mpf, meta, DB_MPOOL_DIRTY); + else { + if ((ret = __db_pgout(dbenv, PGNO_BASE_MD, meta, &pdbt)) != 0) + goto err; + ret = __fop_write(dbenv, + txn, name, DB_APP_DATA, fhp, 0, buf, dbp->pgsize, 1); + } + if (ret != 0) + goto err; + meta = NULL; + + /* Now build root page. */ + if (name == NULL) { + pgno = 1; + if ((ret = mpf->get(mpf, &pgno, DB_MPOOL_CREATE, &root)) != 0) + goto err; + } else { +#ifdef DIAGNOSTIC + memset(buf, dbp->pgsize, 0); +#endif + root = (PAGE *)buf; + } + + P_INIT(root, dbp->pgsize, 1, PGNO_INVALID, PGNO_INVALID, + LEAFLEVEL, dbp->type == DB_RECNO ? P_LRECNO : P_LBTREE); + LSN_NOT_LOGGED(root->lsn); + + if (name == NULL) + ret = mpf->put(mpf, root, DB_MPOOL_DIRTY); + else { + if ((ret = __db_pgout(dbenv, root->pgno, root, &pdbt)) != 0) + goto err; + ret = __fop_write(dbenv, txn, + name, DB_APP_DATA, fhp, dbp->pgsize, buf, dbp->pgsize, 1); + } + if (ret != 0) + goto err; + root = NULL; + +err: if (name != NULL) + __os_free(dbenv, buf); + else { + if (meta != NULL) + (void)mpf->put(mpf, meta, 0); + if (root != NULL) + (void)mpf->put(mpf, root, 0); + } + return (ret); +} + +/* + * __bam_new_subdb -- + * Create a metadata page and a root page for a new btree. + * + * PUBLIC: int __bam_new_subdb __P((DB *, DB *, DB_TXN *)); + */ +int +__bam_new_subdb(mdbp, dbp, txn) + DB *mdbp, *dbp; + DB_TXN *txn; +{ + BTMETA *meta; + DBC *dbc; + DB_ENV *dbenv; + DB_LOCK metalock; + DB_LSN lsn; + DB_MPOOLFILE *mpf; + PAGE *root; + int ret, t_ret; + + dbenv = mdbp->dbenv; + mpf = mdbp->mpf; + dbc = NULL; + meta = NULL; + root = NULL; + + if ((ret = mdbp->cursor(mdbp, txn, + &dbc, CDB_LOCKING(dbenv) ? DB_WRITECURSOR : 0)) != 0) + return (ret); + + /* Get, and optionally create the metadata page. */ + if ((ret = __db_lget(dbc, + 0, dbp->meta_pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) + goto err; + if ((ret = mpf->get(mpf, &dbp->meta_pgno, DB_MPOOL_CREATE, &meta)) != 0) + goto err; + + /* Build meta-data page. */ + lsn = meta->dbmeta.lsn; + __bam_init_meta(dbp, meta, dbp->meta_pgno, &lsn); + if ((ret = __db_log_page(mdbp, + txn, &meta->dbmeta.lsn, dbp->meta_pgno, (PAGE *)meta)) != 0) goto err; /* Create and initialize a root page. */ @@ -401,68 +571,35 @@ again: if (meta->dbmeta.magic != 0) { goto err; root->level = LEAFLEVEL; - if (dbp->open_txn != NULL && (ret = __bam_root_log(dbp->dbenv, - dbp->open_txn, &meta->dbmeta.lsn, 0, dbp->log_fileid, + if (DBENV_LOGGING(dbenv) && + (ret = __bam_root_log(mdbp, txn, &meta->dbmeta.lsn, 0, meta->dbmeta.pgno, root->pgno, &meta->dbmeta.lsn)) != 0) goto err; meta->root = root->pgno; - - DB_TEST_RECOVERY(dbp, DB_TEST_POSTLOGMETA, ret, name); - if ((ret = __db_log_page(dbp, - name, &root->lsn, root->pgno, root)) != 0) + if ((ret = + __db_log_page(mdbp, txn, &root->lsn, root->pgno, root)) != 0) goto err; - DB_TEST_RECOVERY(dbp, DB_TEST_POSTLOG, ret, name); - - t->bt_meta = base_pgno; - t->bt_root = root->pgno; /* Release the metadata and root pages. */ - if ((ret = memp_fput(dbp->mpf, meta, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->put(mpf, meta, DB_MPOOL_DIRTY)) != 0) goto err; meta = NULL; - if ((ret = memp_fput(dbp->mpf, root, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->put(mpf, root, DB_MPOOL_DIRTY)) != 0) goto err; root = NULL; - - /* - * Flush the metadata and root pages to disk. - * - * !!! - * It's not useful to return not-yet-flushed here -- convert it to - * an error. - */ - if ((ret = memp_fsync(dbp->mpf)) == DB_INCOMPLETE) { - __db_err(dbp->dbenv, "Metapage flush failed"); - ret = EINVAL; - } - DB_TEST_RECOVERY(dbp, DB_TEST_POSTSYNC, ret, name); - -done: /* - * !!! - * We already did an insert and so the last-page-inserted has been - * set. I'm not sure where the *right* place to clear this value - * is, it's not intuitively obvious that it belongs here. - */ - t->bt_lpgno = PGNO_INVALID; - err: -DB_TEST_RECOVERY_LABEL - /* Put any remaining pages back. */ if (meta != NULL) - if ((t_ret = memp_fput(dbp->mpf, meta, 0)) != 0 && - ret == 0) + if ((t_ret = mpf->put(mpf, meta, 0)) != 0 && ret == 0) ret = t_ret; if (root != NULL) - if ((t_ret = memp_fput(dbp->mpf, root, 0)) != 0 && - ret == 0) + if ((t_ret = mpf->put(mpf, root, 0)) != 0 && ret == 0) + ret = t_ret; + if (LOCK_ISSET(metalock)) + if ((t_ret = __LPUT(dbc, metalock)) != 0 && ret == 0) + ret = t_ret; + if (dbc != NULL) + if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; - - /* We can release the metapage lock when we are done. */ - if ((t_ret = __LPUT(dbc, metalock)) != 0 && ret == 0) - ret = t_ret; - - if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) - ret = t_ret; return (ret); } diff --git a/bdb/btree/bt_put.c b/bdb/btree/bt_put.c index 19a04526d1b..39bd2024e76 100644 --- a/bdb/btree/bt_put.c +++ b/bdb/btree/bt_put.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -43,7 +43,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_put.c,v 11.46 2001/01/17 18:48:46 bostic Exp $"; +static const char revid[] = "$Id: bt_put.c,v 11.69 2002/08/06 06:11:12 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -53,12 +53,16 @@ static const char revid[] = "$Id: bt_put.c,v 11.46 2001/01/17 18:48:46 bostic Ex #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.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_ovput __P((DBC *, u_int32_t, db_pgno_t, PAGE *, u_int32_t, DBT *)); +static u_int32_t + __bam_partsize __P((DB *, u_int32_t, DBT *, PAGE *, u_int32_t)); /* * __bam_iitem -- @@ -77,6 +81,7 @@ __bam_iitem(dbc, key, data, op, flags) BTREE_CURSOR *cp; DB *dbp; DBT bk_hdr, tdbt; + DB_MPOOLFILE *mpf; PAGE *h; db_indx_t indx; u_int32_t data_size, have_bytes, need_bytes, needed; @@ -85,6 +90,7 @@ __bam_iitem(dbc, key, data, op, flags) COMPQUIET(bk, NULL); dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; t = dbp->bt_internal; h = cp->page; @@ -95,7 +101,7 @@ __bam_iitem(dbc, key, data, op, flags) * Fixed-length records with partial puts: it's an error to specify * anything other simple overwrite. */ - if (F_ISSET(dbp, DB_RE_FIXEDLEN) && + if (F_ISSET(dbp, DB_AM_FIXEDLEN) && F_ISSET(data, DB_DBT_PARTIAL) && data->dlen != data->size) { data_size = data->size; goto len_err; @@ -110,16 +116,18 @@ __bam_iitem(dbc, key, data, op, flags) * the fixed-length record size. */ data_size = F_ISSET(data, DB_DBT_PARTIAL) ? - __bam_partsize(op, data, h, indx) : data->size; + __bam_partsize(dbp, op, data, h, indx) : data->size; padrec = 0; - if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { + if (F_ISSET(dbp, DB_AM_FIXEDLEN)) { if (data_size > t->re_len) { len_err: __db_err(dbp->dbenv, "Length improper for fixed length record %lu", (u_long)data_size); return (EINVAL); } - if (data_size < t->re_len) { + + /* Records that are deleted anyway needn't be padded out. */ + if (!LF_ISSET(BI_DELETED) && data_size < t->re_len) { padrec = 1; data_size = t->re_len; } @@ -146,8 +154,8 @@ len_err: __db_err(dbp->dbenv, */ if (op == DB_CURRENT && dbp->dup_compare != NULL) { if ((ret = __bam_cmp(dbp, data, h, - indx + (TYPE(h) == P_LBTREE ? O_INDX : 0), - dbp->dup_compare, &cmp)) != 0) + indx + (TYPE(h) == P_LBTREE ? O_INDX : 0), + dbp->dup_compare, &cmp)) != 0) return (ret); if (cmp != 0) { __db_err(dbp->dbenv, @@ -190,7 +198,7 @@ len_err: __db_err(dbp->dbenv, */ bigkey = 0; if (op == DB_CURRENT) { - bk = GET_BKEYDATA(h, + bk = GET_BKEYDATA(dbp, h, indx + (TYPE(h) == P_LBTREE ? O_INDX : 0)); if (B_TYPE(bk->type) == B_KEYDATA) have_bytes = BKEYDATA_PSIZE(bk->len); @@ -221,7 +229,7 @@ len_err: __db_err(dbp->dbenv, * The t->bt_maxkey test here may be insufficient -- do we have to * check in the btree split code, so we don't undo it there!?!? */ - if (P_FREESPACE(h) < needed || + if (P_FREESPACE(dbp, h) < needed || (t->bt_maxkey != 0 && NUM_ENT(h) > t->bt_maxkey)) return (DB_NEEDSPLIT); @@ -328,6 +336,11 @@ len_err: __db_err(dbp->dbenv, /* Add the data. */ if (bigdata) { + /* + * 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); @@ -347,7 +360,7 @@ len_err: __db_err(dbp->dbenv, if (ret != 0) return (ret); } - if ((ret = memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->set(mpf, h, DB_MPOOL_DIRTY)) != 0) return (ret); /* @@ -375,7 +388,7 @@ len_err: __db_err(dbp->dbenv, * up at least 25% of the space on the page. If it does, move it onto * its own page. */ - if (dupadjust && P_FREESPACE(h) <= dbp->pgsize / 2) { + if (dupadjust && P_FREESPACE(dbp, h) <= dbp->pgsize / 2) { if ((ret = __bam_dup_convert(dbc, h, indx - O_INDX)) != 0) return (ret); } @@ -390,11 +403,10 @@ len_err: __db_err(dbp->dbenv, /* * __bam_partsize -- * Figure out how much space a partial data item is in total. - * - * PUBLIC: u_int32_t __bam_partsize __P((u_int32_t, DBT *, PAGE *, u_int32_t)); */ -u_int32_t -__bam_partsize(op, data, h, indx) +static u_int32_t +__bam_partsize(dbp, op, data, h, indx) + DB *dbp; u_int32_t op, indx; DBT *data; PAGE *h; @@ -413,38 +425,18 @@ __bam_partsize(op, data, h, indx) * Otherwise, it's the data provided plus any already existing data * that we're not replacing. */ - bk = GET_BKEYDATA(h, indx + (TYPE(h) == P_LBTREE ? O_INDX : 0)); + bk = GET_BKEYDATA(dbp, h, indx + (TYPE(h) == P_LBTREE ? O_INDX : 0)); nbytes = B_TYPE(bk->type) == B_OVERFLOW ? ((BOVERFLOW *)bk)->tlen : bk->len; - /* - * There are really two cases here: - * - * Case 1: We are replacing some bytes that do not exist (i.e., they - * are past the end of the record). In this case the number of bytes - * we are replacing is irrelevant and all we care about is how many - * bytes we are going to add from offset. So, the new record length - * is going to be the size of the new bytes (size) plus wherever those - * new bytes begin (doff). - * - * Case 2: All the bytes we are replacing exist. Therefore, the new - * size is the oldsize (nbytes) minus the bytes we are replacing (dlen) - * plus the bytes we are adding (size). - */ - if (nbytes < data->doff + data->dlen) /* Case 1 */ - return (data->doff + data->size); - - return (nbytes + data->size - data->dlen); /* Case 2 */ + return (__db_partsize(nbytes, data)); } /* * __bam_build -- * Build the real record for a partial put, or short fixed-length record. - * - * PUBLIC: int __bam_build __P((DBC *, u_int32_t, - * PUBLIC: DBT *, PAGE *, u_int32_t, u_int32_t)); */ -int +static int __bam_build(dbc, op, dbt, h, indx, nbytes) DBC *dbc; u_int32_t op, indx, nbytes; @@ -454,9 +446,8 @@ __bam_build(dbc, op, dbt, h, indx, nbytes) BKEYDATA *bk, tbk; BOVERFLOW *bo; BTREE *t; - BTREE_CURSOR *cp; DB *dbp; - DBT copy; + DBT copy, *rdata; u_int32_t len, tlen; u_int8_t *p; int ret; @@ -464,26 +455,26 @@ __bam_build(dbc, op, dbt, h, indx, nbytes) COMPQUIET(bo, NULL); dbp = dbc->dbp; - cp = (BTREE_CURSOR *) dbc->internal; t = dbp->bt_internal; /* We use the record data return memory, it's only a short-term use. */ - if (dbc->rdata.ulen < nbytes) { + rdata = &dbc->my_rdata; + if (rdata->ulen < nbytes) { if ((ret = __os_realloc(dbp->dbenv, - nbytes, NULL, &dbc->rdata.data)) != 0) { - dbc->rdata.ulen = 0; - dbc->rdata.data = NULL; + nbytes, &rdata->data)) != 0) { + rdata->ulen = 0; + rdata->data = NULL; return (ret); } - dbc->rdata.ulen = nbytes; + rdata->ulen = nbytes; } /* * We use nul or pad bytes for any part of the record that isn't * specified; get it over with. */ - memset(dbc->rdata.data, - F_ISSET(dbp, DB_RE_FIXEDLEN) ? t->re_pad : 0, nbytes); + memset(rdata->data, + F_ISSET(dbp, DB_AM_FIXEDLEN) ? t->re_pad : 0, nbytes); /* * In the next clauses, we need to do three things: a) set p to point @@ -495,14 +486,15 @@ __bam_build(dbc, op, dbt, h, indx, nbytes) * the chase. */ if (!F_ISSET(dbt, DB_DBT_PARTIAL) || op != DB_CURRENT) { - p = (u_int8_t *)dbc->rdata.data + dbt->doff; + p = (u_int8_t *)rdata->data + dbt->doff; tlen = dbt->doff; goto user_copy; } /* Find the current record. */ if (indx < NUM_ENT(h)) { - bk = GET_BKEYDATA(h, indx + (TYPE(h) == P_LBTREE ? O_INDX : 0)); + bk = GET_BKEYDATA(dbp, h, indx + (TYPE(h) == P_LBTREE ? + O_INDX : 0)); bo = (BOVERFLOW *)bk; } else { bk = &tbk; @@ -516,12 +508,12 @@ __bam_build(dbc, op, dbt, h, indx, nbytes) */ memset(©, 0, sizeof(copy)); if ((ret = __db_goff(dbp, ©, bo->tlen, - bo->pgno, &dbc->rdata.data, &dbc->rdata.ulen)) != 0) + bo->pgno, &rdata->data, &rdata->ulen)) != 0) return (ret); /* Skip any leading data from the original record. */ tlen = dbt->doff; - p = (u_int8_t *)dbc->rdata.data + dbt->doff; + p = (u_int8_t *)rdata->data + dbt->doff; /* * Copy in any trailing data from the original record. @@ -542,10 +534,10 @@ __bam_build(dbc, op, dbt, h, indx, nbytes) } } else { /* Copy in any leading data from the original record. */ - memcpy(dbc->rdata.data, + memcpy(rdata->data, bk->data, dbt->doff > bk->len ? bk->len : dbt->doff); tlen = dbt->doff; - p = (u_int8_t *)dbc->rdata.data + dbt->doff; + p = (u_int8_t *)rdata->data + dbt->doff; /* Copy in any trailing data from the original record. */ len = dbt->doff + dbt->dlen; @@ -564,11 +556,11 @@ user_copy: tlen += dbt->size; /* Set the DBT to reference our new record. */ - dbc->rdata.size = F_ISSET(dbp, DB_RE_FIXEDLEN) ? t->re_len : tlen; - dbc->rdata.dlen = 0; - dbc->rdata.doff = 0; - dbc->rdata.flags = 0; - *dbt = dbc->rdata; + rdata->size = F_ISSET(dbp, DB_AM_FIXEDLEN) ? t->re_len : tlen; + rdata->dlen = 0; + rdata->doff = 0; + rdata->flags = 0; + *dbt = *rdata; return (0); } @@ -591,6 +583,7 @@ __bam_ritem(dbc, h, indx, data) db_indx_t cnt, lo, ln, min, off, prefix, suffix; int32_t nbytes; int ret; + db_indx_t *inp; u_int8_t *p, *t; dbp = dbc->dbp; @@ -600,10 +593,10 @@ __bam_ritem(dbc, h, indx, data) * to insert and whether it fits is handled in the caller. All we do * here is manage the page shuffling. */ - bk = GET_BKEYDATA(h, indx); + bk = GET_BKEYDATA(dbp, h, indx); /* Log the change. */ - if (DB_LOGGING(dbc)) { + if (DBC_LOGGING(dbc)) { /* * We might as well check to see if the two data items share * a common prefix and suffix -- it can save us a lot of log @@ -627,17 +620,18 @@ __bam_ritem(dbc, h, indx, data) orig.size = bk->len - (prefix + suffix); repl.data = (u_int8_t *)data->data + prefix; repl.size = data->size - (prefix + suffix); - if ((ret = __bam_repl_log(dbp->dbenv, dbc->txn, - &LSN(h), 0, dbp->log_fileid, PGNO(h), &LSN(h), - (u_int32_t)indx, (u_int32_t)B_DISSET(bk->type), + if ((ret = __bam_repl_log(dbp, dbc->txn, &LSN(h), 0, PGNO(h), + &LSN(h), (u_int32_t)indx, (u_int32_t)B_DISSET(bk->type), &orig, &repl, (u_int32_t)prefix, (u_int32_t)suffix)) != 0) return (ret); - } + } else + LSN_NOT_LOGGED(LSN(h)); /* * Set references to the first in-use byte on the page and the * first byte of the item being replaced. */ + inp = P_INP(dbp, h); p = (u_int8_t *)h + HOFFSET(h); t = (u_int8_t *)bk; @@ -648,19 +642,19 @@ __bam_ritem(dbc, h, indx, data) * the regions overlap. */ lo = BKEYDATA_SIZE(bk->len); - ln = BKEYDATA_SIZE(data->size); + ln = (db_indx_t)BKEYDATA_SIZE(data->size); if (lo != ln) { nbytes = lo - ln; /* Signed difference. */ if (p == t) /* First index is fast. */ - h->inp[indx] += nbytes; + inp[indx] += nbytes; else { /* Else, shift the page. */ memmove(p + nbytes, p, t - p); /* Adjust the indices' offsets. */ - off = h->inp[indx]; + off = inp[indx]; for (cnt = 0; cnt < NUM_ENT(h); ++cnt) - if (h->inp[cnt] <= off) - h->inp[cnt] += nbytes; + if (inp[cnt] <= off) + inp[cnt] += nbytes; } /* Clean up the page and adjust the item's reference. */ @@ -688,30 +682,31 @@ __bam_dup_convert(dbc, h, indx) PAGE *h; u_int32_t indx; { - BTREE_CURSOR *cp; BKEYDATA *bk; DB *dbp; DBT hdr; + DB_MPOOLFILE *mpf; PAGE *dp; - db_indx_t cnt, cpindx, dindx, first, sz; + db_indx_t cnt, cpindx, dindx, first, *inp, sz; int ret; dbp = dbc->dbp; - cp = (BTREE_CURSOR *)dbc->internal; + mpf = dbp->mpf; + inp = P_INP(dbp, h); /* * Count the duplicate records and calculate how much room they're * using on the page. */ - while (indx > 0 && h->inp[indx] == h->inp[indx - P_INDX]) + while (indx > 0 && inp[indx] == inp[indx - P_INDX]) indx -= P_INDX; for (cnt = 0, sz = 0, first = indx;; ++cnt, indx += P_INDX) { - if (indx >= NUM_ENT(h) || h->inp[first] != h->inp[indx]) + if (indx >= NUM_ENT(h) || inp[first] != inp[indx]) break; - bk = GET_BKEYDATA(h, indx); + bk = GET_BKEYDATA(dbp, h, indx); sz += B_TYPE(bk->type) == B_KEYDATA ? BKEYDATA_PSIZE(bk->len) : BOVERFLOW_PSIZE; - bk = GET_BKEYDATA(h, indx + O_INDX); + bk = GET_BKEYDATA(dbp, h, indx + O_INDX); sz += B_TYPE(bk->type) == B_KEYDATA ? BKEYDATA_PSIZE(bk->len) : BOVERFLOW_PSIZE; } @@ -766,7 +761,7 @@ __bam_dup_convert(dbc, h, indx) * deleted entries are discarded (if the deleted entry is * overflow, then free up those pages). */ - bk = GET_BKEYDATA(h, dindx + 1); + bk = GET_BKEYDATA(dbp, h, dindx + 1); hdr.data = bk; hdr.size = B_TYPE(bk->type) == B_KEYDATA ? BKEYDATA_SIZE(bk->len) : BOVERFLOW_SIZE; @@ -778,7 +773,7 @@ __bam_dup_convert(dbc, h, indx) */ if (B_TYPE(bk->type) == B_OVERFLOW && (ret = __db_doff(dbc, - (GET_BOVERFLOW(h, dindx + 1))->pgno)) != 0) + (GET_BOVERFLOW(dbp, h, dindx + 1))->pgno)) != 0) goto err; } else { if ((ret = __db_pitem( @@ -802,7 +797,7 @@ __bam_dup_convert(dbc, h, indx) /* Put in a new data item that points to the duplicates page. */ if ((ret = __bam_ovput(dbc, - B_DUPLICATE, dp->pgno, h, first + 1, NULL)) != 0) + B_DUPLICATE, dp->pgno, h, first + 1, NULL)) != 0) goto err; /* Adjust cursors for all the above movments. */ @@ -810,9 +805,9 @@ __bam_dup_convert(dbc, h, indx) PGNO(h), first + P_INDX, first + P_INDX - indx)) != 0) goto err; - return (memp_fput(dbp->mpf, dp, DB_MPOOL_DIRTY)); + return (mpf->put(mpf, dp, DB_MPOOL_DIRTY)); -err: (void)__db_free(dbc, dp); +err: (void)mpf->put(mpf, dp, 0); return (ret); } diff --git a/bdb/btree/bt_rec.c b/bdb/btree/bt_rec.c index 24dc9bc6a6e..b6443547aa5 100644 --- a/bdb/btree/bt_rec.c +++ b/bdb/btree/bt_rec.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_rec.c,v 11.35 2001/01/10 16:24:47 ubell Exp $"; +static const char revid[] = "$Id: bt_rec.c,v 11.57 2002/08/06 16:53:53 ubell Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,286 +18,16 @@ static const char revid[] = "$Id: bt_rec.c,v 11.35 2001/01/10 16:24:47 ubell Exp #endif #include "db_int.h" -#include "db_page.h" -#include "hash.h" -#include "btree.h" -#include "log.h" +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/btree.h" +#include "dbinc/lock.h" +#include "dbinc/log.h" #define IS_BTREE_PAGE(pagep) \ (TYPE(pagep) == P_IBTREE || \ TYPE(pagep) == P_LBTREE || TYPE(pagep) == P_LDUP) -/* - * __bam_pg_alloc_recover -- - * Recovery function for pg_alloc. - * - * PUBLIC: int __bam_pg_alloc_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_pg_alloc_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_pg_alloc_args *argp; - DB *file_dbp; - DBC *dbc; - DBMETA *meta; - DB_MPOOLFILE *mpf; - PAGE *pagep; - db_pgno_t pgno; - int cmp_n, cmp_p, level, modified, ret; - - REC_PRINT(__bam_pg_alloc_print); - REC_INTRO(__bam_pg_alloc_read, 0); - - /* - * Fix up the allocated page. 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. - * - * 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; - meta = NULL; - if ((ret = memp_fget(mpf, &pgno, 0, &meta)) != 0) { - /* The metadata page must always exist on redo. */ - if (DB_REDO(op)) { - (void)__db_pgerr(file_dbp, pgno); - goto out; - } else - goto done; - } - if ((ret = memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) { - /* - * We specify creation and check for it later, because this - * operation was supposed to create the page, and even in - * the undo case it's going to get linked onto the freelist - * which we're also fixing up. - */ - (void)__db_pgerr(file_dbp, argp->pgno); - goto err; - } - - /* Fix up the allocated page. */ - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - cmp_p = log_compare(&LSN(pagep), &argp->page_lsn); - - /* - * If an inital 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 (IS_ZERO_LSN(LSN(pagep))) - cmp_p = 0; - CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->page_lsn); - /* - * If we we rolled back this allocation previously during an - * archive restore, the page may have the LSN of the meta page - * at the point of the roll back. This will be no more - * than the LSN of the metadata page at the time of this allocation. - */ - if (DB_REDO(op) && - (cmp_p == 0 || - (IS_ZERO_LSN(argp->page_lsn) && - log_compare(&LSN(pagep), &argp->meta_lsn) <= 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; - } - P_INIT(pagep, file_dbp->pgsize, - argp->pgno, PGNO_INVALID, PGNO_INVALID, level, argp->ptype); - - pagep->lsn = *lsnp; - modified = 1; - } else if (cmp_n == 0 && DB_UNDO(op)) { - /* - * Undo the allocation, reinitialize the page and - * link its next pointer to the free list. - */ - P_INIT(pagep, file_dbp->pgsize, - argp->pgno, PGNO_INVALID, argp->next, 0, P_INVALID); - - pagep->lsn = argp->page_lsn; - modified = 1; - } - - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) { - goto err; - } - - /* - * If the page was newly created, put it on the limbo list. - */ - if (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 err; - } - - /* Fix up the metadata page. */ - 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); - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - LSN(meta) = *lsnp; - meta->free = argp->next; - modified = 1; - } else if (cmp_n == 0 && DB_UNDO(op)) { - /* Need to undo update described. */ - LSN(meta) = argp->meta_lsn; - - /* - * If the page has a zero LSN then its newly created - * and will go into limbo rather than directly on the - * free list. - */ - if (!IS_ZERO_LSN(argp->page_lsn)) - meta->free = argp->pgno; - modified = 1; - } - if ((ret = memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) - goto out; - /* - * This could be the metapage from a subdb which is read from disk - * to recover its creation. - */ - if (F_ISSET(file_dbp, DB_AM_SUBDB)) - switch (argp->type) { - case P_BTREEMETA: - case P_HASHMETA: - case P_QAMMETA: - file_dbp->sync(file_dbp, 0); - break; - } - -done: *lsnp = argp->prev_lsn; - ret = 0; - - if (0) { -err: - if (meta != NULL) - (void)memp_fput(mpf, meta, 0); - } -out: REC_CLOSE; -} - -/* - * __bam_pg_free_recover -- - * Recovery function for pg_free. - * - * PUBLIC: int __bam_pg_free_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_pg_free_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_pg_free_args *argp; - DB *file_dbp; - DBC *dbc; - DBMETA *meta; - DB_LSN copy_lsn; - DB_MPOOLFILE *mpf; - PAGE *pagep; - db_pgno_t pgno; - int cmp_n, cmp_p, modified, ret; - - COMPQUIET(info, NULL); - REC_PRINT(__bam_pg_free_print); - REC_INTRO(__bam_pg_free_read, 1); - - /* - * Fix up the freed page. 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. - * Create the page if necessary, we may be freeing an aborted - * create. - */ - if ((ret = memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - modified = 0; - __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); - if (DB_REDO(op) && - (cmp_p == 0 || - (IS_ZERO_LSN(copy_lsn) && - log_compare(&LSN(pagep), &argp->meta_lsn) <= 0))) { - /* Need to redo update described. */ - 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 undo update described. */ - memcpy(pagep, argp->header.data, argp->header.size); - - modified = 1; - } - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) - goto out; - - /* - * Fix up the metadata page. If we're redoing or undoing the operation - * we get the page and update its LSN and free pointer. - */ - pgno = PGNO_BASE_MD; - if ((ret = memp_fget(mpf, &pgno, 0, &meta)) != 0) { - /* The metadata page must always exist. */ - (void)__db_pgerr(file_dbp, pgno); - goto out; - } - - 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); - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo the deallocation. */ - meta->free = argp->pgno; - LSN(meta) = *lsnp; - modified = 1; - } else if (cmp_n == 0 && DB_UNDO(op)) { - /* Need to undo the deallocation. */ - meta->free = argp->next; - LSN(meta) = argp->meta_lsn; - modified = 1; - } - if ((ret = memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) - goto out; - -done: *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - /* * __bam_split_recover -- * Recovery function for split. @@ -320,7 +50,7 @@ __bam_split_recover(dbenv, dbtp, lsnp, op, info) PAGE *_lp, *lp, *np, *pp, *_rp, *rp, *sp; db_pgno_t pgno, root_pgno; u_int32_t ptype; - int cmp, l_update, p_update, r_update, rc, ret, rootsplit, t_ret; + int cmp, l_update, p_update, r_update, rc, ret, ret_l, rootsplit, t_ret; COMPQUIET(info, NULL); REC_PRINT(__bam_split_print); @@ -345,16 +75,16 @@ __bam_split_recover(dbenv, dbtp, lsnp, op, info) * so it's got to be aligned. Copying it into allocated memory is * the only way to guarantee this. */ - if ((ret = __os_malloc(dbenv, argp->pg.size, NULL, &sp)) != 0) + if ((ret = __os_malloc(dbenv, argp->pg.size, &sp)) != 0) goto out; memcpy(sp, argp->pg.data, argp->pg.size); pgno = PGNO(sp); root_pgno = argp->root_pgno; - rootsplit = pgno == root_pgno; - if (memp_fget(mpf, &argp->left, 0, &lp) != 0) + rootsplit = root_pgno != PGNO_INVALID; + if ((ret_l = mpf->get(mpf, &argp->left, 0, &lp)) != 0) lp = NULL; - if (memp_fget(mpf, &argp->right, 0, &rp) != 0) + if (mpf->get(mpf, &argp->right, 0, &rp) != 0) rp = NULL; if (DB_REDO(op)) { @@ -368,8 +98,8 @@ __bam_split_recover(dbenv, dbtp, lsnp, op, info) * same reason. */ if (rootsplit) { - if ((ret = memp_fget(mpf, &pgno, 0, &pp)) != 0) { - (void)__db_pgerr(file_dbp, pgno); + if ((ret = mpf->get(mpf, &pgno, 0, &pp)) != 0) { + __db_pgerr(file_dbp, pgno, ret); pp = NULL; goto out; } @@ -377,7 +107,7 @@ __bam_split_recover(dbenv, dbtp, lsnp, op, info) CHECK_LSN(op, cmp, &LSN(pp), &LSN(argp->pg.data)); p_update = cmp == 0; } else if (lp == NULL) { - (void)__db_pgerr(file_dbp, argp->left); + __db_pgerr(file_dbp, argp->left, ret_l); goto out; } @@ -400,10 +130,8 @@ __bam_split_recover(dbenv, dbtp, lsnp, op, info) goto check_next; /* Allocate and initialize new left/right child pages. */ - if ((ret = - __os_malloc(dbenv, file_dbp->pgsize, NULL, &_lp)) != 0 - || (ret = - __os_malloc(dbenv, file_dbp->pgsize, NULL, &_rp)) != 0) + if ((ret = __os_malloc(dbenv, file_dbp->pgsize, &_lp)) != 0 || + (ret = __os_malloc(dbenv, file_dbp->pgsize, &_rp)) != 0) goto out; if (rootsplit) { P_INIT(_lp, file_dbp->pgsize, argp->left, @@ -431,31 +159,31 @@ __bam_split_recover(dbenv, dbtp, lsnp, op, info) goto out; /* If the left child is wrong, update it. */ - if (lp == NULL && (ret = - memp_fget(mpf, &argp->left, DB_MPOOL_CREATE, &lp)) != 0) { - (void)__db_pgerr(file_dbp, argp->left); + if (lp == NULL && (ret = mpf->get( + mpf, &argp->left, DB_MPOOL_CREATE, &lp)) != 0) { + __db_pgerr(file_dbp, argp->left, ret); lp = NULL; goto out; } if (l_update) { memcpy(lp, _lp, file_dbp->pgsize); lp->lsn = *lsnp; - if ((ret = memp_fput(mpf, lp, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->put(mpf, lp, DB_MPOOL_DIRTY)) != 0) goto out; lp = NULL; } /* If the right child is wrong, update it. */ - if (rp == NULL && (ret = memp_fget(mpf, - &argp->right, DB_MPOOL_CREATE, &rp)) != 0) { - (void)__db_pgerr(file_dbp, argp->right); + if (rp == NULL && (ret = mpf->get( + mpf, &argp->right, DB_MPOOL_CREATE, &rp)) != 0) { + __db_pgerr(file_dbp, argp->right, ret); rp = NULL; goto out; } if (r_update) { memcpy(rp, _rp, file_dbp->pgsize); rp->lsn = *lsnp; - if ((ret = memp_fput(mpf, rp, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->put(mpf, rp, DB_MPOOL_DIRTY)) != 0) goto out; rp = NULL; } @@ -477,11 +205,11 @@ __bam_split_recover(dbenv, dbtp, lsnp, op, info) P_INIT(pp, file_dbp->pgsize, root_pgno, PGNO_INVALID, PGNO_INVALID, _lp->level + 1, ptype); - RE_NREC_SET(pp, - rc ? __bam_total(_lp) + __bam_total(_rp) : 0); + 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 = mpf->put(mpf, pp, DB_MPOOL_DIRTY)) != 0) goto out; pp = NULL; } @@ -494,8 +222,8 @@ check_next: /* * page must exist because we're redoing the operation. */ if (!rootsplit && !IS_ZERO_LSN(argp->nlsn)) { - if ((ret = memp_fget(mpf, &argp->npgno, 0, &np)) != 0) { - (void)__db_pgerr(file_dbp, argp->npgno); + if ((ret = mpf->get(mpf, &argp->npgno, 0, &np)) != 0) { + __db_pgerr(file_dbp, argp->npgno, ret); np = NULL; goto out; } @@ -505,7 +233,7 @@ check_next: /* PREV_PGNO(np) = argp->right; np->lsn = *lsnp; if ((ret = - memp_fput(mpf, np, DB_MPOOL_DIRTY)) != 0) + mpf->put(mpf, np, DB_MPOOL_DIRTY)) != 0) goto out; np = NULL; } @@ -518,13 +246,13 @@ 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 = mpf->get(mpf, &pgno, 0, &pp)) != 0) { pp = NULL; goto lrundo; } if (log_compare(lsnp, &LSN(pp)) == 0) { memcpy(pp, argp->pg.data, argp->pg.size); - if ((ret = memp_fput(mpf, pp, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->put(mpf, pp, DB_MPOOL_DIRTY)) != 0) goto out; pp = NULL; } @@ -542,7 +270,7 @@ lrundo: if ((rootsplit && lp != NULL) || rp != NULL) { log_compare(lsnp, &LSN(lp)) == 0) { lp->lsn = argp->llsn; if ((ret = - memp_fput(mpf, lp, DB_MPOOL_DIRTY)) != 0) + mpf->put(mpf, lp, DB_MPOOL_DIRTY)) != 0) goto out; lp = NULL; } @@ -550,7 +278,7 @@ lrundo: if ((rootsplit && lp != NULL) || rp != NULL) { log_compare(lsnp, &LSN(rp)) == 0) { rp->lsn = argp->rlsn; if ((ret = - memp_fput(mpf, rp, DB_MPOOL_DIRTY)) != 0) + mpf->put(mpf, rp, DB_MPOOL_DIRTY)) != 0) goto out; rp = NULL; } @@ -565,14 +293,14 @@ lrundo: if ((rootsplit && lp != NULL) || rp != NULL) { * if there's nothing to undo. */ if (!rootsplit && !IS_ZERO_LSN(argp->nlsn)) { - if ((ret = memp_fget(mpf, &argp->npgno, 0, &np)) != 0) { + if ((ret = mpf->get(mpf, &argp->npgno, 0, &np)) != 0) { np = NULL; goto done; } if (log_compare(lsnp, &LSN(np)) == 0) { PREV_PGNO(np) = argp->left; np->lsn = argp->nlsn; - if (memp_fput(mpf, np, DB_MPOOL_DIRTY)) + if (mpf->put(mpf, np, DB_MPOOL_DIRTY)) goto out; np = NULL; } @@ -583,22 +311,22 @@ done: *lsnp = argp->prev_lsn; ret = 0; out: /* Free any pages that weren't dirtied. */ - if (pp != NULL && (t_ret = memp_fput(mpf, pp, 0)) != 0 && ret == 0) + if (pp != NULL && (t_ret = mpf->put(mpf, pp, 0)) != 0 && ret == 0) ret = t_ret; - if (lp != NULL && (t_ret = memp_fput(mpf, lp, 0)) != 0 && ret == 0) + if (lp != NULL && (t_ret = mpf->put(mpf, lp, 0)) != 0 && ret == 0) ret = t_ret; - if (np != NULL && (t_ret = memp_fput(mpf, np, 0)) != 0 && ret == 0) + if (np != NULL && (t_ret = mpf->put(mpf, np, 0)) != 0 && ret == 0) ret = t_ret; - if (rp != NULL && (t_ret = memp_fput(mpf, rp, 0)) != 0 && ret == 0) + if (rp != NULL && (t_ret = mpf->put(mpf, rp, 0)) != 0 && ret == 0) ret = t_ret; /* Free any allocated space. */ if (_lp != NULL) - __os_free(_lp, file_dbp->pgsize); + __os_free(dbenv, _lp); if (_rp != NULL) - __os_free(_rp, file_dbp->pgsize); + __os_free(dbenv, _rp); if (sp != NULL) - __os_free(sp, argp->pg.size); + __os_free(dbenv, sp); REC_CLOSE; } @@ -627,23 +355,24 @@ __bam_rsplit_recover(dbenv, dbtp, lsnp, op, info) db_pgno_t pgno, root_pgno; int cmp_n, cmp_p, modified, ret; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_rsplit_print); REC_INTRO(__bam_rsplit_read, 1); /* Fix the root page. */ pgno = root_pgno = argp->root_pgno; - if ((ret = memp_fget(mpf, &pgno, 0, &pagep)) != 0) { + if ((ret = mpf->get(mpf, &pgno, 0, &pagep)) != 0) { /* The root page must always exist if we are going forward. */ if (DB_REDO(op)) { - __db_pgerr(file_dbp, pgno); + __db_pgerr(file_dbp, pgno, ret); goto out; } /* This must be the root of an OPD tree. */ DB_ASSERT(root_pgno != ((BTREE *)file_dbp->bt_internal)->bt_root); ret = 0; - goto done; + goto do_page; } modified = 0; cmp_n = log_compare(lsnp, &LSN(pagep)); @@ -666,22 +395,23 @@ __bam_rsplit_recover(dbenv, dbtp, lsnp, op, info) pagep->lsn = argp->rootlsn; modified = 1; } - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; +do_page: /* * Fix the page copied over the root page. It's possible that the * 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 = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) goto done; - (void)__db_pgerr(file_dbp, argp->pgno); + __db_pgerr(file_dbp, argp->pgno, ret); goto out; } modified = 0; - __ua_memcpy(©_lsn, &LSN(argp->pgdbt.data), sizeof(DB_LSN)); + (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); @@ -694,13 +424,16 @@ __bam_rsplit_recover(dbenv, dbtp, lsnp, op, info) memcpy(pagep, argp->pgdbt.data, argp->pgdbt.size); modified = 1; } - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + pagep = NULL; done: *lsnp = argp->prev_lsn; ret = 0; -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } /* @@ -725,15 +458,16 @@ __bam_adj_recover(dbenv, dbtp, lsnp, op, info) PAGE *pagep; int cmp_n, cmp_p, modified, ret; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_adj_print); REC_INTRO(__bam_adj_read, 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 = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) goto done; - (void)__db_pgerr(file_dbp, argp->pgno); + __db_pgerr(file_dbp, argp->pgno, ret); goto out; } @@ -745,7 +479,7 @@ __bam_adj_recover(dbenv, dbtp, lsnp, op, info) /* Need to redo update described. */ if ((ret = __bam_adjindx(dbc, pagep, argp->indx, argp->indx_copy, argp->is_insert)) != 0) - goto err; + goto out; LSN(pagep) = *lsnp; modified = 1; @@ -753,21 +487,21 @@ __bam_adj_recover(dbenv, dbtp, lsnp, op, info) /* Need to undo update described. */ if ((ret = __bam_adjindx(dbc, pagep, argp->indx, argp->indx_copy, !argp->is_insert)) != 0) - goto err; + goto out; LSN(pagep) = argp->lsn; modified = 1; } - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + pagep = NULL; done: *lsnp = argp->prev_lsn; ret = 0; - if (0) { -err: (void)memp_fput(mpf, pagep, 0); - } -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } /* @@ -793,15 +527,16 @@ __bam_cadjust_recover(dbenv, dbtp, lsnp, op, info) PAGE *pagep; int cmp_n, cmp_p, modified, ret; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_cadjust_print); REC_INTRO(__bam_cadjust_read, 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 = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) goto done; - (void)__db_pgerr(file_dbp, argp->pgno); + __db_pgerr(file_dbp, argp->pgno, ret); goto out; } @@ -812,11 +547,13 @@ __bam_cadjust_recover(dbenv, dbtp, lsnp, op, info) if (cmp_p == 0 && DB_REDO(op)) { /* Need to redo update described. */ if (IS_BTREE_PAGE(pagep)) { - GET_BINTERNAL(pagep, argp->indx)->nrecs += argp->adjust; + GET_BINTERNAL(file_dbp, pagep, argp->indx)->nrecs += + argp->adjust; if (argp->opflags & CAD_UPDATEROOT) RE_NREC_ADJ(pagep, argp->adjust); } else { - GET_RINTERNAL(pagep, argp->indx)->nrecs += argp->adjust; + GET_RINTERNAL(file_dbp, pagep, argp->indx)->nrecs += + argp->adjust; if (argp->opflags & CAD_UPDATEROOT) RE_NREC_ADJ(pagep, argp->adjust); } @@ -826,24 +563,29 @@ __bam_cadjust_recover(dbenv, dbtp, lsnp, op, info) } else if (cmp_n == 0 && DB_UNDO(op)) { /* Need to undo update described. */ if (IS_BTREE_PAGE(pagep)) { - GET_BINTERNAL(pagep, argp->indx)->nrecs -= argp->adjust; + GET_BINTERNAL(file_dbp, pagep, argp->indx)->nrecs -= + argp->adjust; if (argp->opflags & CAD_UPDATEROOT) RE_NREC_ADJ(pagep, -(argp->adjust)); } else { - GET_RINTERNAL(pagep, argp->indx)->nrecs -= argp->adjust; + GET_RINTERNAL(file_dbp, pagep, argp->indx)->nrecs -= + argp->adjust; if (argp->opflags & CAD_UPDATEROOT) 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 = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + pagep = NULL; done: *lsnp = argp->prev_lsn; ret = 0; -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } /* @@ -869,15 +611,16 @@ __bam_cdel_recover(dbenv, dbtp, lsnp, op, info) u_int32_t indx; int cmp_n, cmp_p, modified, ret; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_cdel_print); REC_INTRO(__bam_cdel_read, 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 = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) goto done; - (void)__db_pgerr(file_dbp, argp->pgno); + __db_pgerr(file_dbp, argp->pgno, ret); goto out; } @@ -888,27 +631,30 @@ __bam_cdel_recover(dbenv, dbtp, lsnp, op, info) if (cmp_p == 0 && DB_REDO(op)) { /* Need to redo update described. */ indx = argp->indx + (TYPE(pagep) == P_LBTREE ? O_INDX : 0); - B_DSET(GET_BKEYDATA(pagep, indx)->type); + 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. */ indx = argp->indx + (TYPE(pagep) == P_LBTREE ? O_INDX : 0); - B_DCLR(GET_BKEYDATA(pagep, indx)->type); + B_DCLR(GET_BKEYDATA(file_dbp, pagep, indx)->type); (void)__bam_ca_delete(file_dbp, argp->pgno, argp->indx, 0); LSN(pagep) = argp->lsn; modified = 1; } - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + pagep = NULL; done: *lsnp = argp->prev_lsn; ret = 0; -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } /* @@ -936,18 +682,19 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info) int cmp_n, cmp_p, modified, ret; u_int8_t *p; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_repl_print); REC_INTRO(__bam_repl_read, 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 = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) goto done; - (void)__db_pgerr(file_dbp, argp->pgno); + __db_pgerr(file_dbp, argp->pgno, ret); goto out; } - bk = GET_BKEYDATA(pagep, argp->indx); + bk = GET_BKEYDATA(file_dbp, pagep, argp->indx); modified = 0; cmp_n = log_compare(lsnp, &LSN(pagep)); @@ -961,8 +708,8 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info) */ memset(&dbt, 0, sizeof(dbt)); dbt.size = argp->prefix + argp->suffix + argp->repl.size; - if ((ret = __os_malloc(dbenv, dbt.size, NULL, &dbt.data)) != 0) - goto err; + if ((ret = __os_malloc(dbenv, dbt.size, &dbt.data)) != 0) + goto out; p = dbt.data; memcpy(p, bk->data, argp->prefix); p += argp->prefix; @@ -971,9 +718,9 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info) memcpy(p, bk->data + (bk->len - argp->suffix), argp->suffix); ret = __bam_ritem(dbc, pagep, argp->indx, &dbt); - __os_free(dbt.data, dbt.size); + __os_free(dbenv, dbt.data); if (ret != 0) - goto err; + goto out; LSN(pagep) = *lsnp; modified = 1; @@ -985,8 +732,8 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info) */ memset(&dbt, 0, sizeof(dbt)); dbt.size = argp->prefix + argp->suffix + argp->orig.size; - if ((ret = __os_malloc(dbenv, dbt.size, NULL, &dbt.data)) != 0) - goto err; + if ((ret = __os_malloc(dbenv, dbt.size, &dbt.data)) != 0) + goto out; p = dbt.data; memcpy(p, bk->data, argp->prefix); p += argp->prefix; @@ -995,27 +742,27 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info) memcpy(p, bk->data + (bk->len - argp->suffix), argp->suffix); ret = __bam_ritem(dbc, pagep, argp->indx, &dbt); - __os_free(dbt.data, dbt.size); + __os_free(dbenv, dbt.data); if (ret != 0) - goto err; + goto out; /* Reset the deleted flag, if necessary. */ if (argp->isdeleted) - B_DSET(GET_BKEYDATA(pagep, argp->indx)->type); + 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 = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + pagep = NULL; done: *lsnp = argp->prev_lsn; ret = 0; - if (0) { -err: (void)memp_fput(mpf, pagep, 0); - } -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } /* @@ -1040,14 +787,15 @@ __bam_root_recover(dbenv, dbtp, lsnp, op, info) DB_MPOOLFILE *mpf; int cmp_n, cmp_p, modified, ret; + meta = NULL; COMPQUIET(info, NULL); REC_PRINT(__bam_root_print); REC_INTRO(__bam_root_read, 0); - if ((ret = memp_fget(mpf, &argp->meta_pgno, 0, &meta)) != 0) { + if ((ret = mpf->get(mpf, &argp->meta_pgno, 0, &meta)) != 0) { /* The metadata page must always exist on redo. */ if (DB_REDO(op)) { - (void)__db_pgerr(file_dbp, argp->meta_pgno); + __db_pgerr(file_dbp, argp->meta_pgno, ret); goto out; } else goto done; @@ -1068,13 +816,16 @@ __bam_root_recover(dbenv, dbtp, lsnp, op, info) meta->dbmeta.lsn = argp->meta_lsn; modified = 1; } - if ((ret = memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = mpf->put(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + meta = NULL; done: *lsnp = argp->prev_lsn; ret = 0; -out: REC_CLOSE; +out: if (meta != NULL) + (void)mpf->put(mpf, meta, 0); + REC_CLOSE; } /* @@ -1116,7 +867,7 @@ __bam_curadj_recover(dbenv, dbtp, lsnp, op, info) break; case DB_CA_DUP: if ((ret = __bam_ca_undodup(file_dbp, argp->first_indx, - argp->from_pgno, argp->from_indx, argp->to_indx)) != 0) + argp->from_pgno, argp->from_indx, argp->to_indx)) != 0) goto out; break; @@ -1181,7 +932,8 @@ __bam_rcuradj_recover(dbenv, dbtp, lsnp, op, info) * this function know anything about how offpage dups work. */ if ((ret = - __db_icursor(file_dbp, NULL, DB_RECNO, argp->root, 0, &rdbc)) != 0) + __db_icursor(file_dbp, + NULL, DB_RECNO, argp->root, 0, DB_LOCK_INVALIDID, &rdbc)) != 0) goto out; cp = (BTREE_CURSOR *)rdbc->internal; diff --git a/bdb/btree/bt_reclaim.c b/bdb/btree/bt_reclaim.c index 538d837c2d2..ae4554ea7d6 100644 --- a/bdb/btree/bt_reclaim.c +++ b/bdb/btree/bt_reclaim.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1998, 1999, 2000 + * Copyright (c) 1998-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_reclaim.c,v 11.5 2000/03/22 04:21:01 ubell Exp $"; +static const char revid[] = "$Id: bt_reclaim.c,v 11.11 2002/03/29 20:46:26 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,10 +18,8 @@ static const char revid[] = "$Id: bt_reclaim.c,v 11.5 2000/03/22 04:21:01 ubell #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "lock.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" /* * __bam_reclaim -- @@ -51,3 +49,38 @@ __bam_reclaim(dbp, txn) return (ret); } + +/* + * __bam_truncate -- + * Truncate a database. + * + * PUBLIC: int __bam_truncate __P((DB *, DB_TXN *, u_int32_t *)); + */ +int +__bam_truncate(dbp, txn, countp) + DB *dbp; + DB_TXN *txn; + u_int32_t *countp; +{ + DBC *dbc; + db_trunc_param trunc; + int ret, t_ret; + + /* Acquire a cursor. */ + if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0) + return (ret); + + trunc.count = 0; + trunc.dbc = dbc; + /* Walk the tree, freeing pages. */ + ret = __bam_traverse(dbc, + DB_LOCK_WRITE, dbc->internal->root, __db_truncate_callback, &trunc); + + /* Discard the cursor. */ + if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) + ret = t_ret; + + *countp = trunc.count; + + return (ret); +} diff --git a/bdb/btree/bt_recno.c b/bdb/btree/bt_recno.c index 6ac0cac350d..fab684f3a5f 100644 --- a/bdb/btree/bt_recno.c +++ b/bdb/btree/bt_recno.c @@ -1,36 +1,31 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_recno.c,v 11.65 2001/01/18 14:33:22 bostic Exp $"; +static const char revid[] = "$Id: bt_recno.c,v 11.106 2002/08/16 04:56:30 ubell Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include #include +#include #include #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" -#include "db_ext.h" -#include "db_shash.h" -#include "lock.h" -#include "lock_ext.h" -#include "qam.h" -#include "txn.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" +#include "dbinc/db_shash.h" +#include "dbinc/lock.h" static int __ram_add __P((DBC *, db_recno_t *, DBT *, u_int32_t, u_int32_t)); -static int __ram_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); -static int __ram_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); static int __ram_source __P((DB *)); static int __ram_sread __P((DBC *, db_recno_t)); static int __ram_update __P((DBC *, db_recno_t, int)); @@ -90,17 +85,32 @@ static int __ram_update __P((DBC *, db_recno_t, int)); * Do we need to log the current cursor adjustment? */ #define CURADJ_LOG(dbc) \ - (DB_LOGGING((dbc)) && (dbc)->txn != NULL && (dbc)->txn->parent != NULL) + (DBC_LOGGING((dbc)) && (dbc)->txn != NULL && (dbc)->txn->parent != NULL) + +/* + * After a search, copy the found page into the cursor, discarding any + * currently held lock. + */ +#define STACK_TO_CURSOR(cp) { \ + (cp)->page = (cp)->csp->page; \ + (cp)->pgno = (cp)->csp->page->pgno; \ + (cp)->indx = (cp)->csp->indx; \ + (void)__TLPUT(dbc, (cp)->lock); \ + (cp)->lock = (cp)->csp->lock; \ + (cp)->lock_mode = (cp)->csp->lock_mode; \ +} /* * __ram_open -- * Recno open function. * - * PUBLIC: int __ram_open __P((DB *, const char *, db_pgno_t, u_int32_t)); + * PUBLIC: int __ram_open __P((DB *, + * PUBLIC: DB_TXN *, const char *, db_pgno_t, u_int32_t)); */ int -__ram_open(dbp, name, base_pgno, flags) +__ram_open(dbp, txn, name, base_pgno, flags) DB *dbp; + DB_TXN *txn; const char *name; db_pgno_t base_pgno; u_int32_t flags; @@ -109,15 +119,14 @@ __ram_open(dbp, name, base_pgno, flags) DBC *dbc; int ret, t_ret; + COMPQUIET(name, NULL); t = dbp->bt_internal; /* Initialize the remaining fields/methods of the DB. */ - dbp->del = __ram_delete; - dbp->put = __ram_put; dbp->stat = __bam_stat; /* Start up the tree. */ - if ((ret = __bam_read_root(dbp, name, base_pgno, flags)) != 0) + if ((ret = __bam_read_root(dbp, txn, base_pgno, flags)) != 0) return (ret); /* @@ -132,7 +141,7 @@ __ram_open(dbp, name, base_pgno, flags) return (ret); /* If we're snapshotting an underlying source file, do it now. */ - if (F_ISSET(dbp, DB_RE_SNAPSHOT)) { + if (F_ISSET(dbp, DB_AM_SNAPSHOT)) { /* Allocate a cursor. */ if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0) return (ret); @@ -147,104 +156,38 @@ __ram_open(dbp, name, base_pgno, flags) ret = t_ret; } - return (0); -} - -/* - * __ram_delete -- - * Recno db->del function. - */ -static int -__ram_delete(dbp, txn, key, flags) - DB *dbp; - DB_TXN *txn; - DBT *key; - u_int32_t flags; -{ - BTREE_CURSOR *cp; - DBC *dbc; - db_recno_t recno; - int ret, t_ret; - - PANIC_CHECK(dbp->dbenv); - - /* Check for invalid flags. */ - if ((ret = __db_delchk(dbp, - key, flags, F_ISSET(dbp, DB_AM_RDONLY))) != 0) - return (ret); - - /* Acquire a cursor. */ - if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) - return (ret); - - DEBUG_LWRITE(dbc, txn, "ram_delete", key, NULL, flags); - - /* Check the user's record number and fill in as necessary. */ - if ((ret = __ram_getno(dbc, key, &recno, 0)) != 0) - goto err; - - /* Do the delete. */ - cp = (BTREE_CURSOR *)dbc->internal; - cp->recno = recno; - - ret = __ram_c_del(dbc); - - /* Release the cursor. */ -err: if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) - ret = t_ret; - return (ret); } /* - * __ram_put -- - * Recno db->put function. + * __ram_append -- + * Recno append function. + * + * PUBLIC: int __ram_append __P((DBC *, DBT *, DBT *)); */ -static int -__ram_put(dbp, txn, key, data, flags) - DB *dbp; - DB_TXN *txn; - DBT *key, *data; - u_int32_t flags; -{ +int +__ram_append(dbc, key, data) DBC *dbc; - db_recno_t recno; - int ret, t_ret; + DBT *key, *data; +{ + BTREE_CURSOR *cp; + int ret; - PANIC_CHECK(dbp->dbenv); - - /* Check for invalid flags. */ - if ((ret = __db_putchk(dbp, - key, data, flags, F_ISSET(dbp, DB_AM_RDONLY), 0)) != 0) - return (ret); - - /* Allocate a cursor. */ - if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) - return (ret); - - DEBUG_LWRITE(dbc, txn, "ram_put", key, data, flags); + cp = (BTREE_CURSOR *)dbc->internal; /* - * If we're appending to the tree, make sure we've read in all of - * the backing source file. Otherwise, check the user's record - * number and fill in as necessary. If we found the record or it - * simply didn't exist, add the user's record. + * Make sure we've read in all of the backing source file. If + * we found the record or it simply didn't exist, add the + * user's record. */ - if (flags == DB_APPEND) - ret = __ram_update(dbc, DB_MAX_RECORDS, 0); - else - ret = __ram_getno(dbc, key, &recno, 1); + ret = __ram_update(dbc, DB_MAX_RECORDS, 0); if (ret == 0 || ret == DB_NOTFOUND) - ret = __ram_add(dbc, &recno, data, flags, 0); + ret = __ram_add(dbc, &cp->recno, data, DB_APPEND, 0); - /* Discard the cursor. */ - if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) - ret = t_ret; - - /* Return the record number if we're appending to the tree. */ - if (ret == 0 && flags == DB_APPEND) - ret = __db_retcopy(dbp, key, &recno, sizeof(recno), - &dbc->rkey.data, &dbc->rkey.ulen); + /* Return the record number. */ + if (ret == 0) + ret = __db_retcopy(dbc->dbp->dbenv, key, &cp->recno, + sizeof(cp->recno), &dbc->rkey->data, &dbc->rkey->ulen); return (ret); } @@ -295,9 +238,9 @@ __ram_c_del(dbc) goto err; } stack = 1; - cp->page = cp->csp->page; - cp->pgno = cp->csp->page->pgno; - cp->indx = cp->csp->indx; + + /* Copy the page into the cursor. */ + STACK_TO_CURSOR(cp); /* * If re-numbering records, the on-page deleted flag can only mean @@ -310,7 +253,7 @@ __ram_c_del(dbc) * delete records they never created, the latter is an error because * if the record was "deleted", we could never have found it. */ - if (B_DISSET(GET_BKEYDATA(cp->page, cp->indx)->type)) { + if (B_DISSET(GET_BKEYDATA(dbp, cp->page, cp->indx)->type)) { ret = DB_KEYEMPTY; goto err; } @@ -321,9 +264,8 @@ __ram_c_del(dbc) goto err; __bam_adjust(dbc, -1); if (__ram_ca(dbc, CA_DELETE) > 0 && - CURADJ_LOG(dbc) && (ret = __bam_rcuradj_log(dbp->dbenv, - dbc->txn, &lsn, 0, dbp->log_fileid, CA_DELETE, - cp->root, cp->recno, cp->order)) != 0) + CURADJ_LOG(dbc) && (ret = __bam_rcuradj_log(dbp, dbc->txn, + &lsn, 0, CA_DELETE, cp->root, cp->recno, cp->order)) != 0) goto err; /* @@ -346,15 +288,15 @@ __ram_c_del(dbc) * going to be emptied by removing the single reference * to the emptied page (or one of its parents). */ - for (epg = cp->sp; epg <= cp->csp; ++epg) - if (NUM_ENT(epg->page) <= 1) + 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, back up to that page. + * that we're not deleting. */ - ret = __bam_dpages(dbc, --epg); + ret = __bam_dpages(dbc, epg); /* * Regardless of the return from __bam_dpages, it will @@ -412,6 +354,7 @@ __ram_c_get(dbc, key, data, flags, pgnop) dbp = dbc->dbp; cp = (BTREE_CURSOR *)dbc->internal; + LF_CLR(DB_MULTIPLE|DB_MULTIPLE_KEY); retry: switch (flags) { case DB_CURRENT: /* @@ -504,6 +447,7 @@ retry: switch (flags) { goto err; /* NOTREACHED */ case DB_GET_BOTH: + case DB_GET_BOTH_RANGE: /* * If we're searching a set of off-page dups, we start * a new linear search from the first record. Otherwise, @@ -531,6 +475,8 @@ retry: switch (flags) { * read from the backing source file. Do it now for DB_CURRENT (if * the current record was deleted we may need more records from the * backing file for a DB_CURRENT operation), DB_FIRST and DB_NEXT. + * (We don't have to test for flags == DB_FIRST, because the switch + * statement above re-set flags to DB_NEXT in that case.) */ if ((flags == DB_NEXT || flags == DB_CURRENT) && ((ret = __ram_update(dbc, cp->recno, 0)) != 0) && ret != DB_NOTFOUND) @@ -547,16 +493,8 @@ retry: switch (flags) { goto err; } - /* - * Copy the page into the cursor, discarding any lock we - * are currently holding. - */ - cp->page = cp->csp->page; - cp->pgno = cp->csp->page->pgno; - cp->indx = cp->csp->indx; - (void)__TLPUT(dbc, cp->lock); - cp->lock = cp->csp->lock; - cp->lock_mode = cp->csp->lock_mode; + /* Copy the page into the cursor. */ + STACK_TO_CURSOR(cp); /* * If re-numbering records, the on-page deleted flag means this @@ -567,21 +505,34 @@ retry: switch (flags) { * walking through off-page duplicates, and fail if they were * requested explicitly by the application. */ - if (B_DISSET(GET_BKEYDATA(cp->page, cp->indx)->type)) + if (B_DISSET(GET_BKEYDATA(dbp, cp->page, cp->indx)->type)) switch (flags) { case DB_NEXT: case DB_PREV: (void)__bam_stkrel(dbc, STK_CLRDBC); goto retry; case DB_GET_BOTH: - (void)__bam_stkrel(dbc, STK_CLRDBC); - continue; + case DB_GET_BOTH_RANGE: + /* + * If we're an OPD tree, we don't care about + * matching a record number on a DB_GET_BOTH + * -- everything belongs to the same tree. A + * normal recno should give up and return + * DB_NOTFOUND if the matching recno is deleted. + */ + if (F_ISSET(dbc, DBC_OPD)) { + (void)__bam_stkrel(dbc, STK_CLRDBC); + continue; + } + ret = DB_NOTFOUND; + goto err; default: ret = DB_KEYEMPTY; goto err; } - if (flags == DB_GET_BOTH || flags == DB_GET_BOTHC) { + if (flags == DB_GET_BOTH || + flags == DB_GET_BOTHC || flags == DB_GET_BOTH_RANGE) { if ((ret = __bam_cmp(dbp, data, cp->page, cp->indx, __bam_defcmp, &cmp)) != 0) return (ret); @@ -598,10 +549,11 @@ retry: switch (flags) { /* Return the key if the user didn't give us one. */ if (!F_ISSET(dbc, DBC_OPD)) { - if (flags != DB_SET && flags != DB_SET_RANGE) - ret = __db_retcopy(dbp, - key, &cp->recno, sizeof(cp->recno), - &dbc->rkey.data, &dbc->rkey.ulen); + 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); F_SET(key, DB_DBT_ISSET); } @@ -637,23 +589,43 @@ __ram_c_put(dbc, key, data, flags, pgnop) cp = (BTREE_CURSOR *)dbc->internal; /* - * DB_KEYFIRST and DB_KEYLAST will only be set if we're dealing with - * an off-page duplicate tree, they can't be specified at user level. - * Translate them into something else. + * DB_KEYFIRST and DB_KEYLAST mean different things if they're + * used in an off-page duplicate tree. If we're an off-page + * duplicate tree, they really mean "put at the beginning of the + * tree" and "put at the end of the tree" respectively, so translate + * them to something else. */ - switch (flags) { - case DB_KEYFIRST: - cp->recno = 1; - flags = DB_BEFORE; - break; - case DB_KEYLAST: - if ((ret = __ram_add(dbc, &cp->recno, data, DB_APPEND, 0)) != 0) - return (ret); - if (CURADJ_LOG(dbc) && (ret = __bam_rcuradj_log(dbp->dbenv, - dbc->txn, &lsn, 0, dbp->log_fileid, CA_ICURRENT, - cp->root, cp->recno, cp->order))) - return (ret); - return (0); + if (F_ISSET(dbc, DBC_OPD)) + switch (flags) { + case DB_KEYFIRST: + cp->recno = 1; + flags = DB_BEFORE; + break; + case DB_KEYLAST: + if ((ret = __ram_add(dbc, + &cp->recno, data, DB_APPEND, 0)) != 0) + return (ret); + if (CURADJ_LOG(dbc) && + (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0, + CA_ICURRENT, cp->root, cp->recno, cp->order))) + return (ret); + return (0); + } + + /* + * 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) { + ret = __ram_getno(dbc, key, &cp->recno, 1); + if (ret == 0 || ret == DB_NOTFOUND) + ret = __ram_add(dbc, &cp->recno, data, 0, 0); + return (ret); } /* @@ -677,9 +649,8 @@ split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) */ DB_ASSERT(exact || CD_ISSET(cp)); - cp->page = cp->csp->page; - cp->pgno = cp->csp->page->pgno; - cp->indx = cp->csp->indx; + /* Copy the page into the cursor. */ + STACK_TO_CURSOR(cp); ret = __bam_iitem(dbc, key, data, iiflags, 0); t_ret = __bam_stkrel(dbc, STK_CLRDBC); @@ -688,7 +659,7 @@ split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) ret = t_ret; else if (ret == DB_NEEDSPLIT) { arg = &cp->recno; - if ((ret = __bam_split(dbc, arg)) != 0) + if ((ret = __bam_split(dbc, arg, NULL)) != 0) goto err; goto split; } @@ -709,8 +680,7 @@ split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) /* Only log if __ram_ca found any relevant cursors. */ if (nc > 0 && CURADJ_LOG(dbc) && - (ret = __bam_rcuradj_log(dbp->dbenv, - dbc->txn, &lsn, 0, dbp->log_fileid, CA_IAFTER, + (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0, CA_IAFTER, cp->root, cp->recno, cp->order)) != 0) goto err; break; @@ -720,8 +690,7 @@ split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) /* Only log if __ram_ca found any relevant cursors. */ if (nc > 0 && CURADJ_LOG(dbc) && - (ret = __bam_rcuradj_log(dbp->dbenv, - dbc->txn, &lsn, 0, dbp->log_fileid, CA_IBEFORE, + (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0, CA_IBEFORE, cp->root, cp->recno, cp->order)) != 0) goto err; break; @@ -734,8 +703,8 @@ split: if ((ret = __bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) * Only log if __ram_ca found any relevant cursors. */ if (CD_ISSET(cp) && __ram_ca(dbc, CA_ICURRENT) > 0 && - CURADJ_LOG(dbc) && (ret = __bam_rcuradj_log( - dbp->dbenv, dbc->txn, &lsn, 0, dbp->log_fileid, + CURADJ_LOG(dbc) && + (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0, CA_ICURRENT, cp->root, cp->recno, cp->order)) != 0) goto err; break; @@ -743,8 +712,8 @@ 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, key, &cp->recno, - sizeof(cp->recno), &dbc->rkey.data, &dbc->rkey.ulen); + ret = __db_retcopy(dbp->dbenv, key, &cp->recno, + sizeof(cp->recno), &dbc->rkey->data, &dbc->rkey->ulen); /* The cursor was reset, no further delete adjustment is necessary. */ err: CD_CLR(cp); @@ -940,13 +909,12 @@ __ram_update(dbc, recno, can_create) int can_create; { BTREE *t; - BTREE_CURSOR *cp; DB *dbp; + DBT *rdata; db_recno_t nrecs; int ret; dbp = dbc->dbp; - cp = (BTREE_CURSOR *)dbc->internal; t = dbp->bt_internal; /* @@ -976,27 +944,13 @@ __ram_update(dbc, recno, can_create) if (!can_create || recno <= nrecs + 1) return (0); - dbc->rdata.dlen = 0; - dbc->rdata.doff = 0; - dbc->rdata.flags = 0; - if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { - if (dbc->rdata.ulen < t->re_len) { - if ((ret = __os_realloc(dbp->dbenv, - t->re_len, NULL, &dbc->rdata.data)) != 0) { - dbc->rdata.ulen = 0; - dbc->rdata.data = NULL; - return (ret); - } - dbc->rdata.ulen = t->re_len; - } - dbc->rdata.size = t->re_len; - memset(dbc->rdata.data, t->re_pad, t->re_len); - } else - dbc->rdata.size = 0; + rdata = &dbc->my_rdata; + rdata->flags = 0; + rdata->size = 0; while (recno > ++nrecs) if ((ret = __ram_add(dbc, - &nrecs, &dbc->rdata, 0, BI_DELETED)) != 0) + &nrecs, rdata, 0, BI_DELETED)) != 0) return (ret); return (0); } @@ -1017,9 +971,9 @@ __ram_source(dbp) /* Find the real name, and swap out the one we had before. */ if ((ret = __db_appname(dbp->dbenv, - DB_APP_DATA, NULL, t->re_source, 0, NULL, &source)) != 0) + DB_APP_DATA, t->re_source, 0, NULL, &source)) != 0) return (ret); - __os_freestr(t->re_source); + __os_free(dbp->dbenv, t->re_source); t->re_source = source; /* @@ -1060,6 +1014,7 @@ __ram_writeback(dbp) t = dbp->bt_internal; dbenv = dbp->dbenv; fp = NULL; + pad = NULL; /* If the file wasn't modified, we're done. */ if (!t->re_modified) @@ -1119,40 +1074,45 @@ __ram_writeback(dbp) /* * 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. + * 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)); - memset(&data, 0, sizeof(data)); 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. */ delim = t->re_delim; - if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { - if ((ret = __os_malloc(dbenv, t->re_len, NULL, &pad)) != 0) + if (F_ISSET(dbp, DB_AM_FIXEDLEN)) { + if ((ret = __os_malloc(dbenv, t->re_len, &pad)) != 0) goto err; memset(pad, t->re_pad, t->re_len); - } else - COMPQUIET(pad, NULL); + } for (keyno = 1;; ++keyno) { switch (ret = dbp->get(dbp, NULL, &key, &data, 0)) { case 0: - if (fwrite(data.data, 1, data.size, fp) != data.size) + if (data.size != 0 && (u_int32_t)fwrite( + data.data, 1, data.size, fp) != data.size) goto write_err; break; case DB_KEYEMPTY: - if (F_ISSET(dbp, DB_RE_FIXEDLEN) && - fwrite(pad, 1, t->re_len, fp) != t->re_len) + if (F_ISSET(dbp, DB_AM_FIXEDLEN) && + (u_int32_t)fwrite(pad, 1, t->re_len, fp) != + t->re_len) goto write_err; break; case DB_NOTFOUND: ret = 0; goto done; + default: + goto err; } - if (!F_ISSET(dbp, DB_RE_FIXEDLEN) && + if (!F_ISSET(dbp, DB_AM_FIXEDLEN) && fwrite(&delim, 1, 1, fp) != 1) { write_err: ret = errno; __db_err(dbp->dbenv, @@ -1174,6 +1134,12 @@ done: /* Close the file descriptor. */ if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; + /* Discard memory allocated to hold the data items. */ + if (data.data != NULL) + __os_ufree(dbenv, data.data); + if (pad != NULL) + __os_free(dbenv, pad); + if (ret == 0) t->re_modified = 0; @@ -1191,7 +1157,7 @@ __ram_sread(dbc, top) { BTREE *t; DB *dbp; - DBT data; + DBT data, *rdata; db_recno_t recno; size_t len; int ch, ret, was_modified; @@ -1203,45 +1169,56 @@ __ram_sread(dbc, top) if ((ret = __bam_nrecs(dbc, &recno)) != 0) return (ret); - /* Use the record data return memory, it's only a short-term use. */ - len = F_ISSET(dbp, DB_RE_FIXEDLEN) ? t->re_len : 256; - if (dbc->rdata.ulen < len) { + /* + * Use the record key return memory, it's only a short-term use. + * The record data return memory is used by __bam_iitem, which + * we'll indirectly call, so use the key so as not to collide. + */ + len = F_ISSET(dbp, DB_AM_FIXEDLEN) ? t->re_len : 256; + rdata = &dbc->my_rkey; + if (rdata->ulen < len) { if ((ret = __os_realloc( - dbp->dbenv, len, NULL, &dbc->rdata.data)) != 0) { - dbc->rdata.ulen = 0; - dbc->rdata.data = NULL; + dbp->dbenv, len, &rdata->data)) != 0) { + rdata->ulen = 0; + rdata->data = NULL; return (ret); } - dbc->rdata.ulen = len; + rdata->ulen = (u_int32_t)len; } memset(&data, 0, sizeof(data)); while (recno < top) { - data.data = dbc->rdata.data; + data.data = rdata->data; data.size = 0; - if (F_ISSET(dbp, DB_RE_FIXEDLEN)) + if (F_ISSET(dbp, DB_AM_FIXEDLEN)) for (len = t->re_len; len > 0; --len) { - if ((ch = getc(t->re_fp)) == EOF) - goto eof; + if ((ch = getc(t->re_fp)) == EOF) { + if (data.size == 0) + goto eof; + break; + } ((u_int8_t *)data.data)[data.size++] = ch; } else for (;;) { - if ((ch = getc(t->re_fp)) == EOF) - goto eof; + if ((ch = getc(t->re_fp)) == EOF) { + if (data.size == 0) + goto eof; + break; + } if (ch == t->re_delim) break; ((u_int8_t *)data.data)[data.size++] = ch; - if (data.size == dbc->rdata.ulen) { + if (data.size == rdata->ulen) { if ((ret = __os_realloc(dbp->dbenv, - dbc->rdata.ulen *= 2, - NULL, &dbc->rdata.data)) != 0) { - dbc->rdata.ulen = 0; - dbc->rdata.data = NULL; + rdata->ulen *= 2, + &rdata->data)) != 0) { + rdata->ulen = 0; + rdata->data = NULL; return (ret); } else - data.data = dbc->rdata.data; + data.data = rdata->data; } } @@ -1281,7 +1258,6 @@ __ram_add(dbc, recnop, data, flags, bi_flags) DBT *data; u_int32_t flags, bi_flags; { - BKEYDATA *bk; BTREE_CURSOR *cp; int exact, ret, stack; @@ -1292,9 +1268,9 @@ retry: /* Find the slot for insertion. */ S_INSERT | (flags == DB_APPEND ? S_APPEND : 0), 1, &exact)) != 0) return (ret); stack = 1; - cp->page = cp->csp->page; - cp->pgno = cp->csp->page->pgno; - cp->indx = cp->csp->indx; + + /* Copy the page into the cursor. */ + STACK_TO_CURSOR(cp); /* * The application may modify the data based on the selected record @@ -1304,24 +1280,6 @@ retry: /* Find the slot for insertion. */ (ret = dbc->dbp->db_append_recno(dbc->dbp, data, *recnop)) != 0) goto err; - /* - * If re-numbering records, the on-page deleted flag means this record - * was implicitly created. If not re-numbering records, the on-page - * deleted flag means this record was implicitly created, or, it was - * deleted at some time. - * - * If DB_NOOVERWRITE is set and the item already exists in the tree, - * return an error unless the item was either marked for deletion or - * only implicitly created. - */ - if (exact) { - bk = GET_BKEYDATA(cp->page, cp->indx); - if (!B_DISSET(bk->type) && flags == DB_NOOVERWRITE) { - ret = DB_KEYEXIST; - goto err; - } - } - /* * Select the arguments for __bam_iitem() and do the insert. If the * key is an exact match, or we're replacing the data item with a @@ -1353,7 +1311,7 @@ retry: /* Find the slot for insertion. */ (void)__bam_stkrel(dbc, STK_CLRDBC); stack = 0; - if ((ret = __bam_split(dbc, recnop)) != 0) + if ((ret = __bam_split(dbc, recnop, NULL)) != 0) goto err; goto retry; diff --git a/bdb/btree/bt_rsearch.c b/bdb/btree/bt_rsearch.c index 7102cd715aa..a75181b44e2 100644 --- a/bdb/btree/bt_rsearch.c +++ b/bdb/btree/bt_rsearch.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -40,7 +40,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_rsearch.c,v 11.21 2000/03/28 21:50:04 ubell Exp $"; +static const char revid[] = "$Id: bt_rsearch.c,v 11.34 2002/07/03 19:03:50 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -48,10 +48,10 @@ static const char revid[] = "$Id: bt_rsearch.c,v 11.21 2000/03/28 21:50:04 ubell #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" -#include "db_shash.h" -#include "lock.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" +#include "dbinc/db_shash.h" +#include "dbinc/lock.h" /* * __bam_rsearch -- @@ -70,6 +70,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) BTREE_CURSOR *cp; DB *dbp; DB_LOCK lock; + DB_MPOOLFILE *mpf; PAGE *h; RINTERNAL *ri; db_indx_t adjust, deloffset, indx, top; @@ -79,6 +80,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) int ret, stack; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; BT_STK_CLR(cp); @@ -99,11 +101,11 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) * Retrieve the root page. */ pg = cp->root; - stack = LF_ISSET(S_STACK); + 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(dbp->mpf, &pg, 0, &h)) != 0) { + if ((ret = mpf->get(mpf, &pg, 0, &h)) != 0) { /* Did not read it, so we can release the lock */ (void)__LPUT(dbc, lock); return (ret); @@ -120,12 +122,12 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) if (!stack && ((LF_ISSET(S_PARENT) && (u_int8_t)(stop + 1) >= h->level) || (LF_ISSET(S_WRITE) && h->level == LEAFLEVEL))) { - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); (void)__LPUT(dbc, lock); lock_mode = DB_LOCK_WRITE; if ((ret = __db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) return (ret); - if ((ret = memp_fget(dbp->mpf, &pg, 0, &h)) != 0) { + if ((ret = mpf->get(mpf, &pg, 0, &h)) != 0) { /* Did not read it, so we can release the lock */ (void)__LPUT(dbc, lock); return (ret); @@ -164,7 +166,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) * eliminate any concurrency. A possible fix * would be to lock the last leaf page instead. */ - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); (void)__TLPUT(dbc, lock); return (DB_NOTFOUND); } @@ -202,8 +204,8 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) goto err; } } - if (!B_DISSET( - GET_BKEYDATA(h, indx + deloffset)->type) && + if (!B_DISSET(GET_BKEYDATA(dbp, h, + indx + deloffset)->type) && ++t_recno == recno) break; } @@ -216,7 +218,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) return (0); case P_IBTREE: for (indx = 0, top = NUM_ENT(h);;) { - bi = GET_BINTERNAL(h, indx); + bi = GET_BINTERNAL(dbp, h, indx); if (++indx == top || total + bi->nrecs >= recno) break; total += bi->nrecs; @@ -235,7 +237,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) return (0); case P_IRECNO: for (indx = 0, top = NUM_ENT(h);;) { - ri = GET_RINTERNAL(h, indx); + ri = GET_RINTERNAL(dbp, h, indx); if (++indx == top || total + ri->nrecs >= recno) break; total += ri->nrecs; @@ -243,7 +245,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) pg = ri->pgno; break; default: - return (__db_pgfmt(dbp, h->pgno)); + return (__db_pgfmt(dbp->dbenv, h->pgno)); } --indx; @@ -276,12 +278,12 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) (h->level - 1) == LEAFLEVEL) stack = 1; - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); lock_mode = stack && LF_ISSET(S_WRITE) ? DB_LOCK_WRITE : DB_LOCK_READ; if ((ret = __db_lget(dbc, - LCK_COUPLE, pg, lock_mode, 0, &lock)) != 0) { + LCK_COUPLE_ALWAYS, pg, lock_mode, 0, &lock)) != 0) { /* * If we fail, discard the lock we held. This * is OK because this only happens when we are @@ -292,7 +294,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp) } } - if ((ret = memp_fget(dbp->mpf, &pg, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &pg, 0, &h)) != 0) goto err; } /* NOTREACHED */ @@ -315,12 +317,14 @@ __bam_adjust(dbc, adjust) { BTREE_CURSOR *cp; DB *dbp; + DB_MPOOLFILE *mpf; EPG *epg; PAGE *h; db_pgno_t root_pgno; int ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; root_pgno = cp->root; @@ -328,22 +332,27 @@ __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 (DB_LOGGING(dbc) && - (ret = __bam_cadjust_log(dbp->dbenv, - dbc->txn, &LSN(h), 0, dbp->log_fileid, - PGNO(h), &LSN(h), (u_int32_t)epg->indx, adjust, - PGNO(h) == root_pgno ? CAD_UPDATEROOT : 0)) != 0) - return (ret); + if (DBC_LOGGING(dbc)) { + if ((ret = __bam_cadjust_log(dbp, dbc->txn, + &LSN(h), 0, PGNO(h), &LSN(h), + (u_int32_t)epg->indx, adjust, + PGNO(h) == root_pgno ? + CAD_UPDATEROOT : 0)) != 0) + return (ret); + } else + LSN_NOT_LOGGED(LSN(h)); if (TYPE(h) == P_IBTREE) - GET_BINTERNAL(h, epg->indx)->nrecs += adjust; + GET_BINTERNAL(dbp, h, epg->indx)->nrecs += + adjust; else - GET_RINTERNAL(h, epg->indx)->nrecs += adjust; + GET_RINTERNAL(dbp, h, epg->indx)->nrecs += + adjust; if (PGNO(h) == root_pgno) RE_NREC_ADJ(h, adjust); - if ((ret = memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->set(mpf, h, DB_MPOOL_DIRTY)) != 0) return (ret); } } @@ -363,21 +372,23 @@ __bam_nrecs(dbc, rep) { DB *dbp; DB_LOCK lock; + DB_MPOOLFILE *mpf; PAGE *h; db_pgno_t pgno; int ret; dbp = dbc->dbp; + mpf = dbp->mpf; pgno = dbc->internal->root; if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0) return (ret); - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) return (ret); *rep = RE_NREC(h); - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); (void)__TLPUT(dbc, lock); return (0); @@ -387,10 +398,11 @@ __bam_nrecs(dbc, rep) * __bam_total -- * Return the number of records below a page. * - * PUBLIC: db_recno_t __bam_total __P((PAGE *)); + * PUBLIC: db_recno_t __bam_total __P((DB *, PAGE *)); */ db_recno_t -__bam_total(h) +__bam_total(dbp, h) + DB *dbp; PAGE *h; { db_recno_t nrecs; @@ -403,25 +415,26 @@ __bam_total(h) case P_LBTREE: /* Check for logically deleted records. */ for (indx = 0; indx < top; indx += P_INDX) - if (!B_DISSET(GET_BKEYDATA(h, indx + O_INDX)->type)) + if (!B_DISSET( + GET_BKEYDATA(dbp, h, indx + O_INDX)->type)) ++nrecs; break; case P_LDUP: /* Check for logically deleted records. */ for (indx = 0; indx < top; indx += O_INDX) - if (!B_DISSET(GET_BKEYDATA(h, indx)->type)) + if (!B_DISSET(GET_BKEYDATA(dbp, h, indx)->type)) ++nrecs; break; case P_IBTREE: for (indx = 0; indx < top; indx += O_INDX) - nrecs += GET_BINTERNAL(h, indx)->nrecs; + nrecs += GET_BINTERNAL(dbp, h, indx)->nrecs; break; case P_LRECNO: nrecs = NUM_ENT(h); break; case P_IRECNO: for (indx = 0; indx < top; indx += O_INDX) - nrecs += GET_RINTERNAL(h, indx)->nrecs; + nrecs += GET_RINTERNAL(dbp, h, indx)->nrecs; break; } diff --git a/bdb/btree/bt_search.c b/bdb/btree/bt_search.c index d822198f243..92b2106311d 100644 --- a/bdb/btree/bt_search.c +++ b/bdb/btree/bt_search.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -43,7 +43,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_search.c,v 11.32 2001/01/17 20:19:46 bostic Exp $"; +static const char revid[] = "$Id: bt_search.c,v 11.43 2002/07/03 19:03:50 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -53,21 +53,22 @@ static const char revid[] = "$Id: bt_search.c,v 11.32 2001/01/17 20:19:46 bostic #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "btree.h" -#include "lock.h" +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/btree.h" +#include "dbinc/lock.h" /* * __bam_search -- * Search a btree for a key. * - * PUBLIC: int __bam_search __P((DBC *, + * PUBLIC: int __bam_search __P((DBC *, db_pgno_t, * PUBLIC: const DBT *, u_int32_t, int, db_recno_t *, int *)); */ int -__bam_search(dbc, key, flags, stop, recnop, exactp) +__bam_search(dbc, root_pgno, key, flags, stop, recnop, exactp) DBC *dbc; + db_pgno_t root_pgno; const DBT *key; u_int32_t flags; int stop, *exactp; @@ -77,8 +78,9 @@ __bam_search(dbc, key, flags, stop, recnop, exactp) BTREE_CURSOR *cp; DB *dbp; DB_LOCK lock; + DB_MPOOLFILE *mpf; PAGE *h; - db_indx_t base, i, indx, lim; + db_indx_t base, i, indx, *inp, lim; db_lockmode_t lock_mode; db_pgno_t pg; db_recno_t recno; @@ -86,6 +88,7 @@ __bam_search(dbc, key, flags, stop, recnop, exactp) int (*func) __P((DB *, const DBT *, const DBT *)); dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; t = dbp->bt_internal; recno = 0; @@ -109,12 +112,12 @@ __bam_search(dbc, key, flags, stop, recnop, exactp) * Retrieve the root page. */ try_again: - pg = cp->root; + 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; if ((ret = __db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) return (ret); - if ((ret = memp_fget(dbp->mpf, &pg, 0, &h)) != 0) { + if ((ret = mpf->get(mpf, &pg, 0, &h)) != 0) { /* Did not read it, so we can release the lock */ (void)__LPUT(dbc, lock); return (ret); @@ -131,21 +134,21 @@ try_again: if (!stack && ((LF_ISSET(S_PARENT) && (u_int8_t)(stop + 1) >= h->level) || (LF_ISSET(S_WRITE) && h->level == LEAFLEVEL))) { - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); (void)__LPUT(dbc, lock); lock_mode = DB_LOCK_WRITE; if ((ret = __db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) return (ret); - if ((ret = memp_fget(dbp->mpf, &pg, 0, &h)) != 0) { + if ((ret = mpf->get(mpf, &pg, 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) || + if (!((LF_ISSET(S_PARENT) && + (u_int8_t)(stop + 1) >= h->level) || (LF_ISSET(S_WRITE) && h->level == LEAFLEVEL))) { /* Someone else split the root, start over. */ - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); (void)__LPUT(dbc, lock); goto try_again; } @@ -158,6 +161,7 @@ try_again: t->bt_compare; for (;;) { + inp = P_INP(dbp, h); /* * 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 @@ -199,7 +203,7 @@ try_again: if (LF_ISSET(S_STK_ONLY)) { BT_STK_NUM(dbp->dbenv, cp, h, base, ret); __LPUT(dbc, lock); - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); return (ret); } @@ -232,21 +236,21 @@ try_again: */ next: if (recnop != NULL) for (i = 0; i < indx; ++i) - recno += GET_BINTERNAL(h, i)->nrecs; + recno += GET_BINTERNAL(dbp, h, i)->nrecs; - pg = GET_BINTERNAL(h, indx)->pgno; + 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); __LPUT(dbc, lock); - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); return (ret); } BT_STK_NUMPUSH(dbp->dbenv, cp, h, indx, ret); - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); if ((ret = __db_lget(dbc, - LCK_COUPLE, pg, lock_mode, 0, &lock)) != 0) { + LCK_COUPLE_ALWAYS, pg, lock_mode, 0, &lock)) != 0) { /* * Discard our lock and return on failure. This * is OK because it only happens when descending @@ -284,12 +288,12 @@ next: if (recnop != NULL) (h->level - 1) == LEAFLEVEL) stack = 1; - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); lock_mode = stack && LF_ISSET(S_WRITE) ? DB_LOCK_WRITE : DB_LOCK_READ; if ((ret = __db_lget(dbc, - LCK_COUPLE, pg, lock_mode, 0, &lock)) != 0) { + LCK_COUPLE_ALWAYS, pg, lock_mode, 0, &lock)) != 0) { /* * If we fail, discard the lock we held. This * is OK because this only happens when we are @@ -299,7 +303,7 @@ next: if (recnop != NULL) goto err; } } - if ((ret = memp_fget(dbp->mpf, &pg, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &pg, 0, &h)) != 0) goto err; } /* NOTREACHED */ @@ -327,11 +331,11 @@ found: *exactp = 1; if (TYPE(h) == P_LBTREE) { if (LF_ISSET(S_DUPLAST)) while (indx < (db_indx_t)(NUM_ENT(h) - P_INDX) && - h->inp[indx] == h->inp[indx + P_INDX]) + inp[indx] == inp[indx + P_INDX]) indx += P_INDX; else while (indx > 0 && - h->inp[indx] == h->inp[indx - P_INDX]) + inp[indx] == inp[indx - P_INDX]) indx -= P_INDX; } @@ -344,29 +348,29 @@ found: *exactp = 1; if (LF_ISSET(S_DELNO)) { deloffset = TYPE(h) == P_LBTREE ? O_INDX : 0; if (LF_ISSET(S_DUPLAST)) - while (B_DISSET(GET_BKEYDATA( + while (B_DISSET(GET_BKEYDATA(dbp, h, indx + deloffset)->type) && indx > 0 && - h->inp[indx] == h->inp[indx - adjust]) + inp[indx] == inp[indx - adjust]) indx -= adjust; else - while (B_DISSET(GET_BKEYDATA( + while (B_DISSET(GET_BKEYDATA(dbp, h, indx + deloffset)->type) && indx < (db_indx_t)(NUM_ENT(h) - adjust) && - h->inp[indx] == h->inp[indx + adjust]) + inp[indx] == inp[indx + adjust]) indx += adjust; /* * If we weren't able to find a non-deleted duplicate, return * DB_NOTFOUND. */ - if (B_DISSET(GET_BKEYDATA(h, indx + deloffset)->type)) + if (B_DISSET(GET_BKEYDATA(dbp, h, indx + deloffset)->type)) goto notfound; } if (LF_ISSET(S_STK_ONLY)) { BT_STK_NUM(dbp->dbenv, cp, h, indx, ret); __LPUT(dbc, lock); - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); } else { BT_STK_ENTER(dbp->dbenv, cp, h, indx, lock, lock_mode, ret); if (ret != 0) @@ -376,7 +380,7 @@ found: *exactp = 1; notfound: /* Keep the page locked for serializability. */ - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); (void)__TLPUT(dbc, lock); ret = DB_NOTFOUND; @@ -398,10 +402,12 @@ __bam_stkrel(dbc, flags) { BTREE_CURSOR *cp; DB *dbp; + DB_MPOOLFILE *mpf; EPG *epg; int ret, t_ret; dbp = dbc->dbp; + mpf = dbp->mpf; cp = (BTREE_CURSOR *)dbc->internal; /* @@ -414,10 +420,10 @@ __bam_stkrel(dbc, flags) if (epg->page != NULL) { if (LF_ISSET(STK_CLRDBC) && cp->page == epg->page) { cp->page = NULL; - cp->lock.off = LOCK_INVALID; + LOCK_INIT(cp->lock); } - if ((t_ret = memp_fput( - dbp->mpf, epg->page, 0)) != 0 && ret == 0) + if ((t_ret = + mpf->put(mpf, epg->page, 0)) != 0 && ret == 0) ret = t_ret; /* * XXX @@ -428,12 +434,10 @@ __bam_stkrel(dbc, flags) */ epg->page = NULL; } - if (epg->lock.off != LOCK_INVALID) { - if (LF_ISSET(STK_NOLOCK)) - (void)__LPUT(dbc, epg->lock); - else - (void)__TLPUT(dbc, epg->lock); - } + if (LF_ISSET(STK_NOLOCK)) + (void)__LPUT(dbc, epg->lock); + else + (void)__TLPUT(dbc, epg->lock); } /* Clear the stack, all pages have been released. */ @@ -463,7 +467,7 @@ __bam_stkgrow(dbenv, cp) return (ret); memcpy(p, cp->sp, entries * sizeof(EPG)); if (cp->sp != cp->stack) - __os_free(cp->sp, entries * sizeof(EPG)); + __os_free(dbenv, cp->sp); cp->sp = p; cp->csp = p + entries; cp->esp = p + entries * 2; diff --git a/bdb/btree/bt_split.c b/bdb/btree/bt_split.c index f76337b1944..f3302a6905f 100644 --- a/bdb/btree/bt_split.c +++ b/bdb/btree/bt_split.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -40,7 +40,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_split.c,v 11.31 2000/12/22 19:08:27 bostic Exp $"; +static const char revid[] = "$Id: bt_split.c,v 11.58 2002/07/03 19:03:50 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -51,10 +51,10 @@ static const char revid[] = "$Id: bt_split.c,v 11.31 2000/12/22 19:08:27 bostic #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "lock.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/lock.h" +#include "dbinc/btree.h" static int __bam_broot __P((DBC *, PAGE *, PAGE *, PAGE *)); static int __bam_page __P((DBC *, EPG *, EPG *)); @@ -67,21 +67,19 @@ static int __ram_root __P((DBC *, PAGE *, PAGE *, PAGE *)); * __bam_split -- * Split a page. * - * PUBLIC: int __bam_split __P((DBC *, void *)); + * PUBLIC: int __bam_split __P((DBC *, void *, db_pgno_t *)); */ int -__bam_split(dbc, arg) +__bam_split(dbc, arg, root_pgnop) DBC *dbc; void *arg; + db_pgno_t *root_pgnop; { - BTREE *t; BTREE_CURSOR *cp; - DB *dbp; enum { UP, DOWN } dir; db_pgno_t root_pgno; int exact, level, ret; - dbp = dbc->dbp; cp = (BTREE_CURSOR *)dbc->internal; root_pgno = cp->root; @@ -112,17 +110,20 @@ __bam_split(dbc, arg) * split. This would be an easy change for this code, but I have no * numbers that indicate it's worthwhile. */ - t = dbp->bt_internal; for (dir = UP, level = LEAFLEVEL;; dir == UP ? ++level : --level) { /* * Acquire a page and its parent, locked. */ if ((ret = (dbc->dbtype == DB_BTREE ? - __bam_search(dbc, arg, S_WRPAIR, level, NULL, &exact) : + __bam_search(dbc, PGNO_INVALID, + arg, S_WRPAIR, level, NULL, &exact) : __bam_rsearch(dbc, (db_recno_t *)arg, S_WRPAIR, level, &exact))) != 0) return (ret); + if (root_pgnop != NULL) + *root_pgnop = cp->csp[0].page->pgno == root_pgno ? + root_pgno : cp->csp[-1].page->pgno; /* * Split the page if it still needs it (it's possible another * thread of control has already split the page). If we are @@ -130,7 +131,7 @@ __bam_split(dbc, arg) * is no longer necessary. */ if (2 * B_MAXSIZEONPAGE(cp->ovflsize) - <= (db_indx_t)P_FREESPACE(cp->csp[0].page)) { + <= (db_indx_t)P_FREESPACE(dbc->dbp, cp->csp[0].page)) { __bam_stkrel(dbc, STK_NOLOCK); return (0); } @@ -178,12 +179,14 @@ __bam_root(dbc, cp) DB *dbp; DBT log_dbt; DB_LSN log_lsn; + DB_MPOOLFILE *mpf; PAGE *lp, *rp; db_indx_t split; u_int32_t opflags; int ret; dbp = dbc->dbp; + mpf = dbp->mpf; /* Yeah, right. */ if (cp->page->level >= MAXBTREELEVEL) { @@ -210,21 +213,22 @@ __bam_root(dbc, cp) goto err; /* Log the change. */ - if (DB_LOGGING(dbc)) { + if (DBC_LOGGING(dbc)) { memset(&log_dbt, 0, sizeof(log_dbt)); log_dbt.data = cp->page; log_dbt.size = dbp->pgsize; ZERO_LSN(log_lsn); opflags = F_ISSET( (BTREE_CURSOR *)dbc->internal, C_RECNUM) ? SPL_NRECS : 0; - if ((ret = __bam_split_log(dbp->dbenv, dbc->txn, - &LSN(cp->page), 0, dbp->log_fileid, PGNO(lp), &LSN(lp), - PGNO(rp), &LSN(rp), (u_int32_t)NUM_ENT(lp), 0, &log_lsn, + if ((ret = __bam_split_log(dbp, + dbc->txn, &LSN(cp->page), 0, PGNO(lp), &LSN(lp), PGNO(rp), + &LSN(rp), (u_int32_t)NUM_ENT(lp), 0, &log_lsn, dbc->internal->root, &log_dbt, opflags)) != 0) goto err; - LSN(lp) = LSN(cp->page); - LSN(rp) = LSN(cp->page); - } + } else + LSN_NOT_LOGGED(LSN(cp->page)); + LSN(lp) = LSN(cp->page); + LSN(rp) = LSN(cp->page); /* Clean up the new root page. */ if ((ret = (dbc->dbtype == DB_RECNO ? @@ -238,18 +242,18 @@ __bam_root(dbc, cp) goto err; /* Success -- write the real pages back to the store. */ - (void)memp_fput(dbp->mpf, cp->page, DB_MPOOL_DIRTY); + (void)mpf->put(mpf, cp->page, DB_MPOOL_DIRTY); (void)__TLPUT(dbc, cp->lock); - (void)memp_fput(dbp->mpf, lp, DB_MPOOL_DIRTY); - (void)memp_fput(dbp->mpf, rp, DB_MPOOL_DIRTY); + (void)mpf->put(mpf, lp, DB_MPOOL_DIRTY); + (void)mpf->put(mpf, rp, DB_MPOOL_DIRTY); return (0); err: if (lp != NULL) - (void)__db_free(dbc, lp); + (void)mpf->put(mpf, lp, 0); if (rp != NULL) - (void)__db_free(dbc, rp); - (void)memp_fput(dbp->mpf, cp->page, 0); + (void)mpf->put(mpf, rp, 0); + (void)mpf->put(mpf, cp->page, 0); (void)__TLPUT(dbc, cp->lock); return (ret); } @@ -267,7 +271,8 @@ __bam_page(dbc, pp, cp) DBT log_dbt; DB_LSN log_lsn; DB *dbp; - DB_LOCK tplock; + DB_LOCK rplock, tplock; + DB_MPOOLFILE *mpf; DB_LSN save_lsn; PAGE *lp, *rp, *alloc_rp, *tp; db_indx_t split; @@ -275,8 +280,10 @@ __bam_page(dbc, pp, cp) int ret, t_ret; dbp = dbc->dbp; + mpf = dbp->mpf; alloc_rp = lp = rp = tp = NULL; - tplock.off = LOCK_INVALID; + LOCK_INIT(rplock); + LOCK_INIT(tplock); ret = -1; /* @@ -296,7 +303,7 @@ __bam_page(dbc, pp, cp) * up the tree badly, because we've violated the rule of always locking * down the tree, and never up. */ - if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, NULL, &rp)) != 0) + if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, &rp)) != 0) goto err; P_INIT(rp, dbp->pgsize, 0, ISINTERNAL(cp->page) ? PGNO_INVALID : PGNO(cp->page), @@ -307,7 +314,7 @@ __bam_page(dbc, pp, cp) * Create new left page for the split, and fill in everything * except its LSN and next-page page number. */ - if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, NULL, &lp)) != 0) + if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, &lp)) != 0) goto err; P_INIT(lp, dbp->pgsize, PGNO(cp->page), ISINTERNAL(cp->page) ? PGNO_INVALID : PREV_PGNO(cp->page), @@ -351,8 +358,7 @@ __bam_page(dbc, pp, cp) if ((ret = __db_lget(dbc, 0, NEXT_PGNO(cp->page), DB_LOCK_WRITE, 0, &tplock)) != 0) goto err; - if ((ret = - memp_fget(dbp->mpf, &NEXT_PGNO(cp->page), 0, &tp)) != 0) + if ((ret = mpf->get(mpf, &NEXT_PGNO(cp->page), 0, &tp)) != 0) goto err; } @@ -363,6 +369,15 @@ __bam_page(dbc, pp, cp) if ((ret = __db_new(dbc, TYPE(cp->page), &alloc_rp)) != 0) goto err; + /* + * Lock the new page. We need to do this because someone + * could get here through bt_lpgno if this page was recently + * dealocated. They can't look at it before we commit. + */ + if ((ret = __db_lget(dbc, + 0, PGNO(alloc_rp), DB_LOCK_WRITE, 0, &rplock)) != 0) + goto err; + /* * Fix up the page numbers we didn't have before. We have to do this * before calling __bam_pinsert because it may copy a page number onto @@ -376,29 +391,30 @@ __bam_page(dbc, pp, cp) bc = (BTREE_CURSOR *)dbc->internal; /* Log the change. */ - if (DB_LOGGING(dbc)) { + if (DBC_LOGGING(dbc)) { memset(&log_dbt, 0, sizeof(log_dbt)); log_dbt.data = cp->page; log_dbt.size = dbp->pgsize; if (tp == NULL) ZERO_LSN(log_lsn); opflags = F_ISSET(bc, C_RECNUM) ? SPL_NRECS : 0; - if ((ret = __bam_split_log(dbp->dbenv, dbc->txn, - &LSN(cp->page), 0, dbp->log_fileid, PGNO(cp->page), - &LSN(cp->page), PGNO(alloc_rp), &LSN(alloc_rp), - (u_int32_t)NUM_ENT(lp), + if ((ret = __bam_split_log(dbp, dbc->txn, &LSN(cp->page), 0, + PGNO(cp->page), &LSN(cp->page), PGNO(alloc_rp), + &LSN(alloc_rp), (u_int32_t)NUM_ENT(lp), tp == NULL ? 0 : PGNO(tp), tp == NULL ? &log_lsn : &LSN(tp), - bc->root, &log_dbt, opflags)) != 0) + PGNO_INVALID, &log_dbt, opflags)) != 0) goto err; - /* Update the LSNs for all involved pages. */ - LSN(alloc_rp) = LSN(cp->page); - LSN(lp) = LSN(cp->page); - LSN(rp) = LSN(cp->page); - if (tp != NULL) - LSN(tp) = LSN(cp->page); - } + } else + LSN_NOT_LOGGED(LSN(cp->page)); + + /* Update the LSNs for all involved pages. */ + LSN(alloc_rp) = LSN(cp->page); + LSN(lp) = LSN(cp->page); + LSN(rp) = LSN(cp->page); + if (tp != NULL) + LSN(tp) = LSN(cp->page); /* * Copy the left and right pages into place. There are two paths @@ -411,13 +427,13 @@ __bam_page(dbc, pp, cp) * do the copy. */ save_lsn = alloc_rp->lsn; - memcpy(alloc_rp, rp, LOFFSET(rp)); + memcpy(alloc_rp, rp, LOFFSET(dbp, rp)); memcpy((u_int8_t *)alloc_rp + HOFFSET(rp), (u_int8_t *)rp + HOFFSET(rp), dbp->pgsize - HOFFSET(rp)); alloc_rp->lsn = save_lsn; save_lsn = cp->page->lsn; - memcpy(cp->page, lp, LOFFSET(lp)); + memcpy(cp->page, lp, LOFFSET(dbp, lp)); memcpy((u_int8_t *)cp->page + HOFFSET(lp), (u_int8_t *)lp + HOFFSET(lp), dbp->pgsize - HOFFSET(lp)); cp->page->lsn = save_lsn; @@ -431,8 +447,8 @@ __bam_page(dbc, pp, cp) PGNO(cp->page), PGNO(cp->page), PGNO(rp), split, 0)) != 0) goto err; - __os_free(lp, dbp->pgsize); - __os_free(rp, dbp->pgsize); + __os_free(dbp->dbenv, lp); + __os_free(dbp->dbenv, rp); /* * Success -- write the real pages back to the store. As we never @@ -440,45 +456,43 @@ __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(dbp->mpf, alloc_rp, DB_MPOOL_DIRTY)) != 0 && ret == 0) + if ((t_ret = mpf->put(mpf, alloc_rp, DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; - if ((t_ret = - memp_fput(dbp->mpf, pp->page, DB_MPOOL_DIRTY)) != 0 && ret == 0) + (void)__TLPUT(dbc, rplock); + if ((t_ret = mpf->put(mpf, pp->page, DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; (void)__TLPUT(dbc, pp->lock); - if ((t_ret = - memp_fput(dbp->mpf, cp->page, DB_MPOOL_DIRTY)) != 0 && ret == 0) + if ((t_ret = mpf->put(mpf, cp->page, DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; (void)__TLPUT(dbc, cp->lock); if (tp != NULL) { if ((t_ret = - memp_fput(dbp->mpf, tp, DB_MPOOL_DIRTY)) != 0 && ret == 0) + mpf->put(mpf, tp, DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; (void)__TLPUT(dbc, tplock); } return (ret); err: if (lp != NULL) - __os_free(lp, dbp->pgsize); + __os_free(dbp->dbenv, lp); if (rp != NULL) - __os_free(rp, dbp->pgsize); + __os_free(dbp->dbenv, rp); if (alloc_rp != NULL) - (void)__db_free(dbc, alloc_rp); - + (void)mpf->put(mpf, alloc_rp, 0); if (tp != NULL) - (void)memp_fput(dbp->mpf, tp, 0); - if (tplock.off != LOCK_INVALID) - /* We never updated the next page, we can release it. */ - (void)__LPUT(dbc, tplock); + (void)mpf->put(mpf, tp, 0); - (void)memp_fput(dbp->mpf, pp->page, 0); + /* We never updated the new or next pages, we can release them. */ + (void)__LPUT(dbc, rplock); + (void)__LPUT(dbc, tplock); + + (void)mpf->put(mpf, pp->page, 0); if (ret == DB_NEEDSPLIT) (void)__LPUT(dbc, pp->lock); else (void)__TLPUT(dbc, pp->lock); - (void)memp_fput(dbp->mpf, cp->page, 0); + (void)mpf->put(mpf, cp->page, 0); if (ret == DB_NEEDSPLIT) (void)__LPUT(dbc, cp->lock); else @@ -529,7 +543,7 @@ __bam_broot(dbc, rootp, lp, rp) B_TSET(bi.type, B_KEYDATA, 0); bi.pgno = lp->pgno; if (F_ISSET(cp, C_RECNUM)) { - bi.nrecs = __bam_total(lp); + bi.nrecs = __bam_total(dbp, lp); RE_NREC_SET(rootp, bi.nrecs); } hdr.data = &bi; @@ -541,13 +555,13 @@ __bam_broot(dbc, rootp, lp, rp) switch (TYPE(rp)) { case P_IBTREE: /* Copy the first key of the child page onto the root page. */ - child_bi = GET_BINTERNAL(rp, 0); + 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(rp); + bi.nrecs = __bam_total(dbp, rp); RE_NREC_ADJ(rootp, bi.nrecs); } hdr.data = &bi; @@ -567,14 +581,14 @@ __bam_broot(dbc, rootp, lp, rp) case P_LDUP: case P_LBTREE: /* Copy the first key of the child page onto the root page. */ - child_bk = GET_BKEYDATA(rp, 0); + child_bk = GET_BKEYDATA(dbp, rp, 0); switch (B_TYPE(child_bk->type)) { case B_KEYDATA: bi.len = child_bk->len; B_TSET(bi.type, child_bk->type, 0); bi.pgno = rp->pgno; if (F_ISSET(cp, C_RECNUM)) { - bi.nrecs = __bam_total(rp); + bi.nrecs = __bam_total(dbp, rp); RE_NREC_ADJ(rootp, bi.nrecs); } hdr.data = &bi; @@ -591,7 +605,7 @@ __bam_broot(dbc, rootp, lp, rp) B_TSET(bi.type, child_bk->type, 0); bi.pgno = rp->pgno; if (F_ISSET(cp, C_RECNUM)) { - bi.nrecs = __bam_total(rp); + bi.nrecs = __bam_total(dbp, rp); RE_NREC_ADJ(rootp, bi.nrecs); } hdr.data = &bi; @@ -609,11 +623,11 @@ __bam_broot(dbc, rootp, lp, rp) return (ret); break; default: - return (__db_pgfmt(dbp, rp->pgno)); + return (__db_pgfmt(dbp->dbenv, rp->pgno)); } break; default: - return (__db_pgfmt(dbp, rp->pgno)); + return (__db_pgfmt(dbp->dbenv, rp->pgno)); } return (0); } @@ -647,12 +661,12 @@ __ram_root(dbc, rootp, lp, rp) /* Insert the left and right keys, set the header information. */ ri.pgno = lp->pgno; - ri.nrecs = __bam_total(lp); + ri.nrecs = __bam_total(dbp, lp); if ((ret = __db_pitem(dbc, rootp, 0, RINTERNAL_SIZE, &hdr, NULL)) != 0) return (ret); RE_NREC_SET(rootp, ri.nrecs); ri.pgno = rp->pgno; - ri.nrecs = __bam_total(rp); + ri.nrecs = __bam_total(dbp, rp); if ((ret = __db_pitem(dbc, rootp, 1, RINTERNAL_SIZE, &hdr, NULL)) != 0) return (ret); RE_NREC_ADJ(rootp, ri.nrecs); @@ -690,7 +704,8 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check) ppage = parent->page; /* If handling record numbers, count records split to the right page. */ - nrecs = F_ISSET(cp, C_RECNUM) && !space_check ? __bam_total(rchild) : 0; + nrecs = F_ISSET(cp, C_RECNUM) && + !space_check ? __bam_total(dbp, rchild) : 0; /* * Now we insert the new page's first key into the parent page, which @@ -721,10 +736,10 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check) */ switch (TYPE(rchild)) { case P_IBTREE: - child_bi = GET_BINTERNAL(rchild, 0); + child_bi = GET_BINTERNAL(dbp, rchild, 0); nbytes = BINTERNAL_PSIZE(child_bi->len); - if (P_FREESPACE(ppage) < nbytes) + if (P_FREESPACE(dbp, ppage) < nbytes) return (DB_NEEDSPLIT); if (space_check) return (0); @@ -753,7 +768,7 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check) break; case P_LDUP: case P_LBTREE: - child_bk = GET_BKEYDATA(rchild, 0); + child_bk = GET_BKEYDATA(dbp, rchild, 0); switch (B_TYPE(child_bk->type)) { case B_KEYDATA: /* @@ -783,7 +798,7 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check) goto noprefix; if (ppage->prev_pgno == PGNO_INVALID && off <= 1) goto noprefix; - tmp_bk = GET_BKEYDATA(lchild, NUM_ENT(lchild) - + 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; @@ -793,13 +808,13 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check) memset(&b, 0, sizeof(b)); b.size = child_bk->len; b.data = child_bk->data; - nksize = func(dbp, &a, &b); + nksize = (u_int32_t)func(dbp, &a, &b); if ((n = BINTERNAL_PSIZE(nksize)) < nbytes) nbytes = n; else noprefix: nksize = child_bk->len; - if (P_FREESPACE(ppage) < nbytes) + if (P_FREESPACE(dbp, ppage) < nbytes) return (DB_NEEDSPLIT); if (space_check) return (0); @@ -823,7 +838,7 @@ noprefix: nksize = child_bk->len; case B_OVERFLOW: nbytes = BINTERNAL_PSIZE(BOVERFLOW_SIZE); - if (P_FREESPACE(ppage) < nbytes) + if (P_FREESPACE(dbp, ppage) < nbytes) return (DB_NEEDSPLIT); if (space_check) return (0); @@ -850,14 +865,14 @@ noprefix: nksize = child_bk->len; return (ret); break; default: - return (__db_pgfmt(dbp, rchild->pgno)); + return (__db_pgfmt(dbp->dbenv, rchild->pgno)); } break; case P_IRECNO: case P_LRECNO: nbytes = RINTERNAL_PSIZE; - if (P_FREESPACE(ppage) < nbytes) + if (P_FREESPACE(dbp, ppage) < nbytes) return (DB_NEEDSPLIT); if (space_check) return (0); @@ -873,7 +888,7 @@ noprefix: nksize = child_bk->len; return (ret); break; default: - return (__db_pgfmt(dbp, rchild->pgno)); + return (__db_pgfmt(dbp->dbenv, rchild->pgno)); } /* @@ -882,17 +897,19 @@ noprefix: nksize = child_bk->len; */ if (F_ISSET(cp, C_RECNUM)) { /* Log the change. */ - if (DB_LOGGING(dbc) && - (ret = __bam_cadjust_log(dbp->dbenv, dbc->txn, - &LSN(ppage), 0, dbp->log_fileid, PGNO(ppage), + 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); + } else + LSN_NOT_LOGGED(LSN(ppage)); /* Update the left page count. */ if (dbc->dbtype == DB_RECNO) - GET_RINTERNAL(ppage, parent->indx)->nrecs -= nrecs; + GET_RINTERNAL(dbp, ppage, parent->indx)->nrecs -= nrecs; else - GET_BINTERNAL(ppage, parent->indx)->nrecs -= nrecs; + GET_BINTERNAL(dbp, ppage, parent->indx)->nrecs -= nrecs; } return (0); @@ -911,28 +928,52 @@ __bam_psplit(dbc, cp, lp, rp, splitret) { DB *dbp; PAGE *pp; - db_indx_t half, nbytes, off, splitp, top; + db_indx_t half, *inp, nbytes, off, splitp, top; int adjust, cnt, iflag, isbigkey, ret; dbp = dbc->dbp; pp = cp->page; + inp = P_INP(dbp, pp); adjust = TYPE(pp) == P_LBTREE ? P_INDX : O_INDX; /* * If we're splitting the first (last) page on a level because we're * inserting (appending) a key to it, it's likely that the data is * sorted. Moving a single item to the new page is less work and can - * push the fill factor higher than normal. If we're wrong it's not - * a big deal, we'll just do the split the right way next time. + * push the fill factor higher than normal. This is trivial when we + * are splitting a new page before the beginning of the tree, all of + * the interesting tests are against values of 0. + * + * Catching appends to the tree is harder. In a simple append, we're + * inserting an item that sorts past the end of the tree; the cursor + * 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). + * 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. + * When splitting internal pages during an append, the search code + * guarantees the cursor always points to the largest page item less + * than the new internal entry. To summarize, we want to catch three + * possible index values: + * + * NUM_ENT(page) Btree/Recno leaf insert past end-of-tree + * NUM_ENT(page) - O_INDX Btree or Recno internal insert past EOT + * NUM_ENT(page) - P_INDX Btree leaf insert past EOT after a set + * of duplicates + * + * two of which, (NUM_ENT(page) - O_INDX or P_INDX) might be an insert + * near the end of the tree, and not after the end of the tree at all. + * Do a simple test which might be wrong because calling the comparison + * functions is expensive. Regardless, it's not a big deal if we're + * wrong, we'll do the split the right way next time. */ off = 0; - if (NEXT_PGNO(pp) == PGNO_INVALID && - ((ISINTERNAL(pp) && cp->indx == NUM_ENT(cp->page) - 1) || - (!ISINTERNAL(pp) && cp->indx == NUM_ENT(cp->page)))) - off = NUM_ENT(cp->page) - adjust; + if (NEXT_PGNO(pp) == PGNO_INVALID && cp->indx >= NUM_ENT(pp) - adjust) + off = NUM_ENT(pp) - adjust; else if (PREV_PGNO(pp) == PGNO_INVALID && cp->indx == 0) off = adjust; - if (off != 0) goto sort; @@ -962,16 +1003,18 @@ __bam_psplit(dbc, cp, lp, rp, splitret) for (nbytes = 0, off = 0; off < top && nbytes < half; ++off) switch (TYPE(pp)) { case P_IBTREE: - if (B_TYPE(GET_BINTERNAL(pp, off)->type) == B_KEYDATA) - nbytes += - BINTERNAL_SIZE(GET_BINTERNAL(pp, off)->len); + if (B_TYPE( + GET_BINTERNAL(dbp, pp, off)->type) == B_KEYDATA) + nbytes += BINTERNAL_SIZE( + GET_BINTERNAL(dbp, pp, off)->len); else nbytes += BINTERNAL_SIZE(BOVERFLOW_SIZE); break; case P_LBTREE: - if (B_TYPE(GET_BKEYDATA(pp, off)->type) == B_KEYDATA) - nbytes += - BKEYDATA_SIZE(GET_BKEYDATA(pp, off)->len); + if (B_TYPE(GET_BKEYDATA(dbp, pp, off)->type) == + B_KEYDATA) + nbytes += BKEYDATA_SIZE(GET_BKEYDATA(dbp, + pp, off)->len); else nbytes += BOVERFLOW_SIZE; @@ -979,9 +1022,10 @@ __bam_psplit(dbc, cp, lp, rp, splitret) /* FALLTHROUGH */ case P_LDUP: case P_LRECNO: - if (B_TYPE(GET_BKEYDATA(pp, off)->type) == B_KEYDATA) - nbytes += - BKEYDATA_SIZE(GET_BKEYDATA(pp, off)->len); + if (B_TYPE(GET_BKEYDATA(dbp, pp, off)->type) == + B_KEYDATA) + nbytes += BKEYDATA_SIZE(GET_BKEYDATA(dbp, + pp, off)->len); else nbytes += BOVERFLOW_SIZE; break; @@ -989,7 +1033,7 @@ __bam_psplit(dbc, cp, lp, rp, splitret) nbytes += RINTERNAL_SIZE; break; default: - return (__db_pgfmt(dbp, pp->pgno)); + return (__db_pgfmt(dbp->dbenv, pp->pgno)); } sort: splitp = off; @@ -1002,12 +1046,14 @@ sort: splitp = off; switch (TYPE(pp)) { case P_IBTREE: iflag = 1; - isbigkey = B_TYPE(GET_BINTERNAL(pp, off)->type) != B_KEYDATA; + isbigkey = + B_TYPE(GET_BINTERNAL(dbp, pp, off)->type) != B_KEYDATA; break; case P_LBTREE: case P_LDUP: iflag = 0; - isbigkey = B_TYPE(GET_BKEYDATA(pp, off)->type) != B_KEYDATA; + isbigkey = B_TYPE(GET_BKEYDATA(dbp, pp, off)->type) != + B_KEYDATA; break; default: iflag = isbigkey = 0; @@ -1016,18 +1062,20 @@ sort: splitp = off; for (cnt = 1; cnt <= 3; ++cnt) { off = splitp + cnt * adjust; if (off < (db_indx_t)NUM_ENT(pp) && - ((iflag && - B_TYPE(GET_BINTERNAL(pp,off)->type) == B_KEYDATA) || - B_TYPE(GET_BKEYDATA(pp, off)->type) == B_KEYDATA)) { + ((iflag && B_TYPE( + GET_BINTERNAL(dbp, pp,off)->type) == B_KEYDATA) || + B_TYPE(GET_BKEYDATA(dbp, pp, off)->type) == + B_KEYDATA)) { splitp = off; break; } if (splitp <= (db_indx_t)(cnt * adjust)) continue; off = splitp - cnt * adjust; - if (iflag ? - B_TYPE(GET_BINTERNAL(pp, off)->type) == B_KEYDATA : - B_TYPE(GET_BKEYDATA(pp, off)->type) == B_KEYDATA) { + if (iflag ? B_TYPE( + GET_BINTERNAL(dbp, pp, off)->type) == B_KEYDATA : + B_TYPE(GET_BKEYDATA(dbp, pp, off)->type) == + B_KEYDATA) { splitp = off; break; } @@ -1040,18 +1088,18 @@ sort: splitp = off; * page set. So, this loop can't be unbounded. */ if (TYPE(pp) == P_LBTREE && - pp->inp[splitp] == pp->inp[splitp - adjust]) + inp[splitp] == inp[splitp - adjust]) for (cnt = 1;; ++cnt) { off = splitp + cnt * adjust; if (off < NUM_ENT(pp) && - pp->inp[splitp] != pp->inp[off]) { + inp[splitp] != inp[off]) { splitp = off; break; } if (splitp <= (db_indx_t)(cnt * adjust)) continue; off = splitp - cnt * adjust; - if (pp->inp[splitp] != pp->inp[off]) { + if (inp[splitp] != inp[off]) { splitp = off + adjust; break; } @@ -1079,18 +1127,20 @@ __bam_copy(dbp, pp, cp, nxt, stop) PAGE *pp, *cp; u_int32_t nxt, stop; { - db_indx_t nbytes, off; + db_indx_t *cinp, nbytes, off, *pinp; + cinp = P_INP(dbp, cp); + pinp = P_INP(dbp, pp); /* - * Copy the rest of the data to the right page. Nxt is the next - * offset placed on the target page. + * Nxt is the offset of the next record to be placed on the target page. */ for (off = 0; nxt < stop; ++nxt, ++NUM_ENT(cp), ++off) { switch (TYPE(pp)) { case P_IBTREE: - if (B_TYPE(GET_BINTERNAL(pp, nxt)->type) == B_KEYDATA) - nbytes = - BINTERNAL_SIZE(GET_BINTERNAL(pp, nxt)->len); + if (B_TYPE( + GET_BINTERNAL(dbp, pp, nxt)->type) == B_KEYDATA) + nbytes = BINTERNAL_SIZE( + GET_BINTERNAL(dbp, pp, nxt)->len); else nbytes = BINTERNAL_SIZE(BOVERFLOW_SIZE); break; @@ -1100,16 +1150,17 @@ __bam_copy(dbp, pp, cp, nxt, stop) * the offset. */ if (off != 0 && (nxt % P_INDX) == 0 && - pp->inp[nxt] == pp->inp[nxt - P_INDX]) { - cp->inp[off] = cp->inp[off - P_INDX]; + pinp[nxt] == pinp[nxt - P_INDX]) { + cinp[off] = cinp[off - P_INDX]; continue; } /* FALLTHROUGH */ case P_LDUP: case P_LRECNO: - if (B_TYPE(GET_BKEYDATA(pp, nxt)->type) == B_KEYDATA) - nbytes = - BKEYDATA_SIZE(GET_BKEYDATA(pp, nxt)->len); + if (B_TYPE(GET_BKEYDATA(dbp, pp, nxt)->type) == + B_KEYDATA) + nbytes = BKEYDATA_SIZE(GET_BKEYDATA(dbp, + pp, nxt)->len); else nbytes = BOVERFLOW_SIZE; break; @@ -1117,10 +1168,10 @@ __bam_copy(dbp, pp, cp, nxt, stop) nbytes = RINTERNAL_SIZE; break; default: - return (__db_pgfmt(dbp, pp->pgno)); + return (__db_pgfmt(dbp->dbenv, pp->pgno)); } - cp->inp[off] = HOFFSET(cp) -= nbytes; - memcpy(P_ENTRY(cp, off), P_ENTRY(pp, nxt), nbytes); + cinp[off] = HOFFSET(cp) -= nbytes; + memcpy(P_ENTRY(dbp, cp, off), P_ENTRY(dbp, pp, nxt), nbytes); } return (0); } diff --git a/bdb/btree/bt_stat.c b/bdb/btree/bt_stat.c index 349bb40cf8b..4428de98294 100644 --- a/bdb/btree/bt_stat.c +++ b/bdb/btree/bt_stat.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_stat.c,v 11.29 2000/11/28 21:42:27 bostic Exp $"; +static const char revid[] = "$Id: bt_stat.c,v 11.52 2002/05/30 15:40:27 krinsky Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,22 +18,22 @@ static const char revid[] = "$Id: bt_stat.c,v 11.29 2000/11/28 21:42:27 bostic E #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "lock.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/btree.h" +#include "dbinc/lock.h" +#include "dbinc/log.h" /* * __bam_stat -- * Gather/print the btree statistics * - * PUBLIC: int __bam_stat __P((DB *, void *, void *(*)(size_t), u_int32_t)); + * PUBLIC: int __bam_stat __P((DB *, void *, u_int32_t)); */ int -__bam_stat(dbp, spp, db_malloc, flags) +__bam_stat(dbp, spp, flags) DB *dbp; void *spp; - void *(*db_malloc) __P((size_t)); u_int32_t flags; { BTMETA *meta; @@ -42,9 +42,10 @@ __bam_stat(dbp, spp, db_malloc, flags) DBC *dbc; DB_BTREE_STAT *sp; DB_LOCK lock, metalock; + DB_MPOOLFILE *mpf; PAGE *h; db_pgno_t pgno; - int ret, t_ret; + int ret, t_ret, write_meta; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->stat"); @@ -52,9 +53,12 @@ __bam_stat(dbp, spp, db_malloc, flags) meta = NULL; t = dbp->bt_internal; sp = NULL; - metalock.off = lock.off = LOCK_INVALID; + LOCK_INIT(metalock); + LOCK_INIT(lock); + mpf = dbp->mpf; h = NULL; ret = 0; + write_meta = 0; /* Check for invalid flags. */ if ((ret = __db_statchk(dbp, flags)) != 0) @@ -68,52 +72,31 @@ __bam_stat(dbp, spp, db_malloc, flags) DEBUG_LWRITE(dbc, NULL, "bam_stat", NULL, NULL, flags); /* Allocate and clear the structure. */ - if ((ret = __os_malloc(dbp->dbenv, sizeof(*sp), db_malloc, &sp)) != 0) + if ((ret = __os_umalloc(dbp->dbenv, sizeof(*sp), &sp)) != 0) goto err; memset(sp, 0, sizeof(*sp)); - /* If the app just wants the record count, make it fast. */ - if (flags == DB_RECORDCOUNT) { - if ((ret = __db_lget(dbc, 0, - cp->root, DB_LOCK_READ, 0, &lock)) != 0) - goto err; - if ((ret = memp_fget(dbp->mpf, - &cp->root, 0, (PAGE **)&h)) != 0) - goto err; - - sp->bt_nkeys = RE_NREC(h); - - goto done; - } - if (flags == DB_CACHED_COUNTS) { - if ((ret = __db_lget(dbc, - 0, t->bt_meta, DB_LOCK_READ, 0, &lock)) != 0) - goto err; - if ((ret = - memp_fget(dbp->mpf, &t->bt_meta, 0, (PAGE **)&meta)) != 0) - goto err; - sp->bt_nkeys = meta->dbmeta.key_count; - sp->bt_ndata = meta->dbmeta.record_count; - - goto done; - } - /* Get the metadata page for the entire database. */ pgno = PGNO_BASE_MD; if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &metalock)) != 0) goto err; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, (PAGE **)&meta)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, (PAGE **)&meta)) != 0) goto err; + if (flags == DB_RECORDCOUNT || flags == DB_CACHED_COUNTS) + flags = DB_FAST_STAT; + if (flags == DB_FAST_STAT) + goto meta_only; + /* Walk the metadata free list, counting pages. */ for (sp->bt_free = 0, pgno = meta->dbmeta.free; pgno != PGNO_INVALID;) { ++sp->bt_free; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) goto err; pgno = h->next_pgno; - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) + if ((ret = mpf->put(mpf, h, 0)) != 0) goto err; h = NULL; } @@ -122,14 +105,14 @@ __bam_stat(dbp, spp, db_malloc, flags) pgno = cp->root; if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0) goto err; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) goto err; /* Get the levels from the root page. */ sp->bt_levels = h->level; /* Discard the root page. */ - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) + if ((ret = mpf->put(mpf, h, 0)) != 0) goto err; h = NULL; __LPUT(dbc, lock); @@ -143,20 +126,36 @@ __bam_stat(dbp, spp, db_malloc, flags) * Get the subdatabase metadata page if it's not the same as the * one we already have. */ - if (t->bt_meta != PGNO_BASE_MD || !F_ISSET(dbp, DB_AM_RDONLY)) { - if ((ret = memp_fput(dbp->mpf, meta, 0)) != 0) + write_meta = !F_ISSET(dbp, DB_AM_RDONLY); +meta_only: + if (t->bt_meta != PGNO_BASE_MD || write_meta != 0) { + if ((ret = mpf->put(mpf, meta, 0)) != 0) goto err; meta = NULL; __LPUT(dbc, metalock); if ((ret = __db_lget(dbc, - 0, t->bt_meta, F_ISSET(dbp, DB_AM_RDONLY) ? + 0, t->bt_meta, write_meta == 0 ? DB_LOCK_READ : DB_LOCK_WRITE, 0, &metalock)) != 0) goto err; - if ((ret = - memp_fget(dbp->mpf, &t->bt_meta, 0, (PAGE **)&meta)) != 0) + if ((ret = mpf->get(mpf, &t->bt_meta, 0, (PAGE **)&meta)) != 0) goto err; } + if (flags == DB_FAST_STAT) { + if (dbp->type == DB_RECNO || + (dbp->type == DB_BTREE && F_ISSET(dbp, DB_AM_RECNUM))) { + if ((ret = __db_lget(dbc, 0, + cp->root, DB_LOCK_READ, 0, &lock)) != 0) + goto err; + if ((ret = + mpf->get(mpf, &cp->root, 0, (PAGE **)&h)) != 0) + goto err; + + sp->bt_nkeys = RE_NREC(h); + } else + sp->bt_nkeys = meta->dbmeta.key_count; + sp->bt_ndata = meta->dbmeta.record_count; + } /* Get metadata page statistics. */ sp->bt_metaflags = meta->dbmeta.flags; @@ -167,39 +166,33 @@ __bam_stat(dbp, spp, db_malloc, flags) sp->bt_pagesize = meta->dbmeta.pagesize; sp->bt_magic = meta->dbmeta.magic; sp->bt_version = meta->dbmeta.version; - if (!F_ISSET(dbp, DB_AM_RDONLY)) { + + if (write_meta != 0) { meta->dbmeta.key_count = sp->bt_nkeys; meta->dbmeta.record_count = sp->bt_ndata; } + *(DB_BTREE_STAT **)spp = sp; + +err: /* Discard the second page. */ + __LPUT(dbc, lock); + if (h != NULL && (t_ret = mpf->put(mpf, h, 0)) != 0 && ret == 0) + ret = t_ret; + /* Discard the metadata page. */ - if ((ret = memp_fput(dbp->mpf, - meta, F_ISSET(dbp, DB_AM_RDONLY) ? 0 : DB_MPOOL_DIRTY)) != 0) - goto err; - meta = NULL; __LPUT(dbc, metalock); - -done: *(DB_BTREE_STAT **)spp = sp; - - if (0) { -err: if (sp != NULL) - __os_free(sp, sizeof(*sp)); - } - - if (h != NULL && - (t_ret = memp_fput(dbp->mpf, h, 0)) != 0 && ret == 0) + if (meta != NULL && (t_ret = mpf->put( + mpf, meta, write_meta == 0 ? 0 : DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; - if (meta != NULL && - (t_ret = memp_fput(dbp->mpf, meta, 0)) != 0 && ret == 0) - ret = t_ret; - - if (lock.off != LOCK_INVALID) - __LPUT(dbc, lock); - if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; + if (ret != 0 && sp != NULL) { + __os_ufree(dbp->dbenv, sp); + *(DB_BTREE_STAT **)spp = NULL; + } + return (ret); } @@ -222,22 +215,27 @@ __bam_traverse(dbc, mode, root_pgno, callback, cookie) BKEYDATA *bk; DB *dbp; DB_LOCK lock; + DB_MPOOLFILE *mpf; PAGE *h; RINTERNAL *ri; db_indx_t indx; int already_put, ret, t_ret; dbp = dbc->dbp; + mpf = dbp->mpf; + already_put = 0; if ((ret = __db_lget(dbc, 0, root_pgno, mode, 0, &lock)) != 0) return (ret); - if ((ret = memp_fget(dbp->mpf, &root_pgno, 0, &h)) != 0) - goto err; + if ((ret = mpf->get(mpf, &root_pgno, 0, &h)) != 0) { + __LPUT(dbc, lock); + return (ret); + } switch (TYPE(h)) { case P_IBTREE: for (indx = 0; indx < NUM_ENT(h); indx += O_INDX) { - bi = GET_BINTERNAL(h, indx); + bi = GET_BINTERNAL(dbp, h, indx); if (B_TYPE(bi->type) == B_OVERFLOW && (ret = __db_traverse_big(dbp, ((BOVERFLOW *)bi->data)->pgno, @@ -245,34 +243,34 @@ __bam_traverse(dbc, mode, root_pgno, callback, cookie) goto err; if ((ret = __bam_traverse( dbc, mode, bi->pgno, callback, cookie)) != 0) - break; + goto err; } break; case P_IRECNO: for (indx = 0; indx < NUM_ENT(h); indx += O_INDX) { - ri = GET_RINTERNAL(h, indx); + ri = GET_RINTERNAL(dbp, h, indx); if ((ret = __bam_traverse( dbc, mode, ri->pgno, callback, cookie)) != 0) - break; + goto err; } break; case P_LBTREE: for (indx = 0; indx < NUM_ENT(h); indx += P_INDX) { - bk = GET_BKEYDATA(h, indx); + bk = GET_BKEYDATA(dbp, h, indx); if (B_TYPE(bk->type) == B_OVERFLOW && (ret = __db_traverse_big(dbp, - GET_BOVERFLOW(h, indx)->pgno, + GET_BOVERFLOW(dbp, h, indx)->pgno, callback, cookie)) != 0) goto err; - bk = GET_BKEYDATA(h, indx + O_INDX); + bk = GET_BKEYDATA(dbp, h, indx + O_INDX); if (B_TYPE(bk->type) == B_DUPLICATE && (ret = __bam_traverse(dbc, mode, - GET_BOVERFLOW(h, indx + O_INDX)->pgno, + GET_BOVERFLOW(dbp, h, indx + O_INDX)->pgno, callback, cookie)) != 0) goto err; if (B_TYPE(bk->type) == B_OVERFLOW && (ret = __db_traverse_big(dbp, - GET_BOVERFLOW(h, indx + O_INDX)->pgno, + GET_BOVERFLOW(dbp, h, indx + O_INDX)->pgno, callback, cookie)) != 0) goto err; } @@ -280,22 +278,19 @@ __bam_traverse(dbc, mode, root_pgno, callback, cookie) case P_LDUP: case P_LRECNO: for (indx = 0; indx < NUM_ENT(h); indx += O_INDX) { - bk = GET_BKEYDATA(h, indx); + bk = GET_BKEYDATA(dbp, h, indx); if (B_TYPE(bk->type) == B_OVERFLOW && (ret = __db_traverse_big(dbp, - GET_BOVERFLOW(h, indx)->pgno, + GET_BOVERFLOW(dbp, h, indx)->pgno, callback, cookie)) != 0) goto err; } break; } - already_put = 0; - if ((ret = callback(dbp, h, cookie, &already_put)) != 0) - goto err; + ret = callback(dbp, h, cookie, &already_put); -err: if (!already_put && - (t_ret = memp_fput(dbp->mpf, h, 0)) != 0 && ret != 0) +err: if (!already_put && (t_ret = mpf->put(mpf, h, 0)) != 0 && ret != 0) ret = t_ret; __LPUT(dbc, lock); @@ -316,33 +311,34 @@ __bam_stat_callback(dbp, h, cookie, putp) int *putp; { DB_BTREE_STAT *sp; - db_indx_t indx, top; + db_indx_t indx, *inp, top; u_int8_t type; sp = cookie; *putp = 0; top = NUM_ENT(h); + inp = P_INP(dbp, h); switch (TYPE(h)) { case P_IBTREE: case P_IRECNO: ++sp->bt_int_pg; - sp->bt_int_pgfree += P_FREESPACE(h); + sp->bt_int_pgfree += P_FREESPACE(dbp, h); break; case P_LBTREE: /* Correct for on-page duplicates and deleted items. */ for (indx = 0; indx < top; indx += P_INDX) { if (indx + P_INDX >= top || - h->inp[indx] != h->inp[indx + P_INDX]) + inp[indx] != inp[indx + P_INDX]) ++sp->bt_nkeys; - type = GET_BKEYDATA(h, indx + O_INDX)->type; + type = GET_BKEYDATA(dbp, h, indx + O_INDX)->type; if (!B_DISSET(type) && B_TYPE(type) != B_DUPLICATE) ++sp->bt_ndata; } ++sp->bt_leaf_pg; - sp->bt_leaf_pgfree += P_FREESPACE(h); + sp->bt_leaf_pgfree += P_FREESPACE(dbp, h); break; case P_LRECNO: /* @@ -356,39 +352,39 @@ __bam_stat_callback(dbp, h, cookie, putp) * Correct for deleted items in non-renumbering * Recno databases. */ - if (F_ISSET(dbp, DB_RE_RENUMBER)) + if (F_ISSET(dbp, DB_AM_RENUMBER)) sp->bt_ndata += top; else for (indx = 0; indx < top; indx += O_INDX) { - type = GET_BKEYDATA(h, indx)->type; + type = GET_BKEYDATA(dbp, h, indx)->type; if (!B_DISSET(type)) ++sp->bt_ndata; } ++sp->bt_leaf_pg; - sp->bt_leaf_pgfree += P_FREESPACE(h); + sp->bt_leaf_pgfree += P_FREESPACE(dbp, h); } else { sp->bt_ndata += top; ++sp->bt_dup_pg; - sp->bt_dup_pgfree += P_FREESPACE(h); + sp->bt_dup_pgfree += P_FREESPACE(dbp, h); } break; case P_LDUP: /* Correct for deleted items. */ for (indx = 0; indx < top; indx += O_INDX) - if (!B_DISSET(GET_BKEYDATA(h, indx)->type)) + if (!B_DISSET(GET_BKEYDATA(dbp, h, indx)->type)) ++sp->bt_ndata; ++sp->bt_dup_pg; - sp->bt_dup_pgfree += P_FREESPACE(h); + sp->bt_dup_pgfree += P_FREESPACE(dbp, h); break; case P_OVERFLOW: ++sp->bt_over_pg; - sp->bt_over_pgfree += P_OVFLSPACE(dbp->pgsize, h); + sp->bt_over_pgfree += P_OVFLSPACE(dbp, dbp->pgsize, h); break; default: - return (__db_pgfmt(dbp, h->pgno)); + return (__db_pgfmt(dbp->dbenv, h->pgno)); } return (0); } @@ -421,13 +417,18 @@ __bam_key_range(dbp, txn, dbt, kp, flags) if (flags != 0) return (__db_ferr(dbp->dbenv, "DB->key_range", 0)); + /* Check for consistent transaction usage. */ + if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 1)) != 0) + return (ret); + /* Acquire a cursor. */ if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0) return (ret); DEBUG_LWRITE(dbc, NULL, "bam_key_range", NULL, NULL, 0); - if ((ret = __bam_search(dbc, dbt, S_STK_ONLY, 1, NULL, &exact)) != 0) + if ((ret = __bam_search(dbc, PGNO_INVALID, + dbt, S_STK_ONLY, 1, NULL, &exact)) != 0) goto err; cp = (BTREE_CURSOR *)dbc->internal; diff --git a/bdb/btree/bt_upgrade.c b/bdb/btree/bt_upgrade.c index 4032dba3b36..9f92648d739 100644 --- a/bdb/btree/bt_upgrade.c +++ b/bdb/btree/bt_upgrade.c @@ -1,13 +1,13 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_upgrade.c,v 11.19 2000/11/30 00:58:29 ubell Exp $"; +static const char revid[] = "$Id: bt_upgrade.c,v 11.25 2002/08/06 06:11:13 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,11 +18,9 @@ static const char revid[] = "$Id: bt_upgrade.c,v 11.19 2000/11/30 00:58:29 ubell #endif #include "db_int.h" -#include "db_page.h" -#include "db_swap.h" -#include "btree.h" -#include "db_am.h" -#include "db_upgrade.h" +#include "dbinc/db_page.h" +#include "dbinc/db_am.h" +#include "dbinc/db_upgrade.h" /* * __bam_30_btreemeta -- @@ -107,7 +105,7 @@ __bam_31_btreemeta(dbp, real_name, flags, fhp, h, dirtyp) newmeta->minkey = oldmeta->minkey; newmeta->maxkey = oldmeta->maxkey; memmove(newmeta->dbmeta.uid, - oldmeta->dbmeta.uid, sizeof(oldmeta->dbmeta.uid)); + oldmeta->dbmeta.uid, sizeof(oldmeta->dbmeta.uid)); newmeta->dbmeta.flags = oldmeta->dbmeta.flags; newmeta->dbmeta.record_count = 0; newmeta->dbmeta.key_count = 0; @@ -126,7 +124,7 @@ __bam_31_btreemeta(dbp, real_name, flags, fhp, h, dirtyp) /* * __bam_31_lbtree -- - * Upgrade the database btree leaf pages. + * Upgrade the database btree leaf pages. * * PUBLIC: int __bam_31_lbtree * PUBLIC: __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *)); @@ -147,15 +145,15 @@ __bam_31_lbtree(dbp, real_name, flags, fhp, h, dirtyp) ret = 0; for (indx = O_INDX; indx < NUM_ENT(h); indx += P_INDX) { - bk = GET_BKEYDATA(h, indx); + bk = GET_BKEYDATA(dbp, h, indx); if (B_TYPE(bk->type) == B_DUPLICATE) { - pgno = GET_BOVERFLOW(h, indx)->pgno; + pgno = GET_BOVERFLOW(dbp, h, indx)->pgno; if ((ret = __db_31_offdup(dbp, real_name, fhp, LF_ISSET(DB_DUPSORT) ? 1 : 0, &pgno)) != 0) break; - if (pgno != GET_BOVERFLOW(h, indx)->pgno) { + if (pgno != GET_BOVERFLOW(dbp, h, indx)->pgno) { *dirtyp = 1; - GET_BOVERFLOW(h, indx)->pgno = pgno; + GET_BOVERFLOW(dbp, h, indx)->pgno = pgno; } } } diff --git a/bdb/btree/bt_verify.c b/bdb/btree/bt_verify.c index 9f8647e7e2a..0cf8a47e476 100644 --- a/bdb/btree/bt_verify.c +++ b/bdb/btree/bt_verify.c @@ -1,16 +1,16 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1999, 2000 + * Copyright (c) 1999-2002 * Sleepycat Software. All rights reserved. * - * $Id: bt_verify.c,v 1.44 2000/12/06 19:55:44 ubell Exp $ + * $Id: bt_verify.c,v 1.76 2002/07/03 19:03:51 bostic Exp $ */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: bt_verify.c,v 1.44 2000/12/06 19:55:44 ubell Exp $"; +static const char revid[] = "$Id: bt_verify.c,v 1.76 2002/07/03 19:03:51 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -20,9 +20,9 @@ static const char revid[] = "$Id: bt_verify.c,v 1.44 2000/12/06 19:55:44 ubell E #endif #include "db_int.h" -#include "db_page.h" -#include "db_verify.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/db_verify.h" +#include "dbinc/btree.h" 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, @@ -79,15 +79,15 @@ __bam_vrfy_meta(dbp, vdp, meta, pgno, flags) /* avoid division by zero */ ovflsize = meta->minkey > 0 ? - B_MINKEY_TO_OVFLSIZE(meta->minkey, dbp->pgsize) : 0; + B_MINKEY_TO_OVFLSIZE(dbp, meta->minkey, dbp->pgsize) : 0; if (meta->minkey < 2 || - ovflsize > B_MINKEY_TO_OVFLSIZE(DEFMINKEYPAGE, dbp->pgsize)) { + ovflsize > B_MINKEY_TO_OVFLSIZE(dbp, DEFMINKEYPAGE, dbp->pgsize)) { pip->bt_minkey = 0; isbad = 1; EPRINT((dbp->dbenv, - "Nonsensical bt_minkey value %lu on metadata page %lu", - (u_long)meta->minkey, (u_long)pgno)); + "Page %lu: nonsensical bt_minkey value %lu on metadata page", + (u_long)pgno, (u_long)meta->minkey)); } else pip->bt_minkey = meta->minkey; @@ -103,13 +103,13 @@ __bam_vrfy_meta(dbp, vdp, meta, pgno, flags) * of the file, then the root page had better be page 1. */ pip->root = 0; - if (meta->root == PGNO_INVALID - || meta->root == pgno || !IS_VALID_PGNO(meta->root) || + if (meta->root == PGNO_INVALID || + meta->root == pgno || !IS_VALID_PGNO(meta->root) || (pgno == PGNO_BASE_MD && meta->root != 1)) { isbad = 1; EPRINT((dbp->dbenv, - "Nonsensical root page %lu on metadata page %lu", - (u_long)meta->root, (u_long)vdp->last_pgno)); + "Page %lu: nonsensical root page %lu on metadata page", + (u_long)pgno, (u_long)meta->root)); } else pip->root = meta->root; @@ -125,7 +125,7 @@ __bam_vrfy_meta(dbp, vdp, meta, pgno, flags) if (F_ISSET(&meta->dbmeta, BTM_DUP) && pgno == PGNO_BASE_MD) { isbad = 1; EPRINT((dbp->dbenv, - "Btree metadata page %lu has both duplicates and multiple databases", +"Page %lu: Btree metadata page has both duplicates and multiple databases", (u_long)pgno)); } F_SET(pip, VRFY_HAS_SUBDBS); @@ -139,7 +139,7 @@ __bam_vrfy_meta(dbp, vdp, meta, pgno, flags) F_SET(pip, VRFY_HAS_RECNUMS); if (F_ISSET(pip, VRFY_HAS_RECNUMS) && F_ISSET(pip, VRFY_HAS_DUPS)) { EPRINT((dbp->dbenv, - "Btree metadata page %lu illegally has both recnums and dups", + "Page %lu: Btree metadata page illegally has both recnums and dups", (u_long)pgno)); isbad = 1; } @@ -150,13 +150,13 @@ __bam_vrfy_meta(dbp, vdp, meta, pgno, flags) } else if (F_ISSET(pip, VRFY_IS_RRECNO)) { isbad = 1; EPRINT((dbp->dbenv, - "Metadata page %lu has renumber flag set but is not recno", + "Page %lu: metadata page has renumber flag set but is not recno", (u_long)pgno)); } if (F_ISSET(pip, VRFY_IS_RECNO) && F_ISSET(pip, VRFY_HAS_DUPS)) { EPRINT((dbp->dbenv, - "Recno metadata page %lu specifies duplicates", + "Page %lu: recno metadata page specifies duplicates", (u_long)pgno)); isbad = 1; } @@ -170,8 +170,8 @@ __bam_vrfy_meta(dbp, vdp, meta, pgno, flags) */ isbad = 1; EPRINT((dbp->dbenv, - "re_len of %lu in non-fixed-length database", - (u_long)pip->re_len)); + "Page %lu: re_len of %lu in non-fixed-length database", + (u_long)pgno, (u_long)pip->re_len)); } /* @@ -179,7 +179,8 @@ __bam_vrfy_meta(dbp, vdp, meta, pgno, flags) * not be and may still be correct. */ -err: if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) +err: if ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } @@ -242,7 +243,7 @@ __ram_vrfy_leaf(dbp, vdp, h, pgno, flags) if (F_ISSET(pip, VRFY_HAS_DUPS)) { EPRINT((dbp->dbenv, - "Recno database has dups on page %lu", (u_long)pgno)); + "Page %lu: Recno database has dups", (u_long)pgno)); ret = DB_VERIFY_BAD; goto err; } @@ -255,7 +256,7 @@ __ram_vrfy_leaf(dbp, vdp, h, pgno, flags) */ re_len_guess = 0; for (i = 0; i < NUM_ENT(h); i++) { - bk = GET_BKEYDATA(h, i); + bk = GET_BKEYDATA(dbp, h, i); /* KEYEMPTY. Go on. */ if (B_DISSET(bk->type)) continue; @@ -266,8 +267,8 @@ __ram_vrfy_leaf(dbp, vdp, h, pgno, flags) else { isbad = 1; EPRINT((dbp->dbenv, - "Nonsensical type for item %lu, page %lu", - (u_long)i, (u_long)pgno)); + "Page %lu: nonsensical type for item %lu", + (u_long)pgno, (u_long)i)); continue; } if (re_len_guess == 0) @@ -288,9 +289,10 @@ __ram_vrfy_leaf(dbp, vdp, h, pgno, flags) /* Save off record count. */ pip->rec_cnt = NUM_ENT(h); -err: if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) +err: if ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; - return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : 0); + return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* @@ -362,7 +364,7 @@ __bam_vrfy(dbp, vdp, h, pgno, flags) else goto err; EPRINT((dbp->dbenv, - "item order check on page %lu unsafe: skipping", + "Page %lu: item order check unsafe: skipping", (u_long)pgno)); } else if (!LF_ISSET(DB_NOORDERCHK) && (ret = __bam_vrfy_itemorder(dbp, vdp, h, pgno, 0, 0, 0, flags)) != 0) { @@ -377,9 +379,10 @@ __bam_vrfy(dbp, vdp, h, pgno, flags) goto err; } -err: if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) +err: if ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; - return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : 0); + return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* @@ -403,6 +406,7 @@ __ram_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) VRFY_PAGEINFO *pip; int ret, t_ret, isbad; u_int32_t himark, i, offset, nentries; + db_indx_t *inp; u_int8_t *pagelayout, *p; isbad = 0; @@ -422,30 +426,31 @@ __ram_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) himark = dbp->pgsize; if ((ret = - __os_malloc(dbp->dbenv, dbp->pgsize, NULL, &pagelayout)) != 0) + __os_malloc(dbp->dbenv, dbp->pgsize, &pagelayout)) != 0) goto err; memset(pagelayout, 0, dbp->pgsize); + inp = P_INP(dbp, h); for (i = 0; i < NUM_ENT(h); i++) { - if ((u_int8_t *)h->inp + i >= (u_int8_t *)h + himark) { + if ((u_int8_t *)inp + i >= (u_int8_t *)h + himark) { EPRINT((dbp->dbenv, - "Page %lu entries listing %lu overlaps data", + "Page %lu: entries listing %lu overlaps data", (u_long)pgno, (u_long)i)); ret = DB_VERIFY_BAD; goto err; } - offset = h->inp[i]; + offset = inp[i]; /* * Check that the item offset is reasonable: it points * somewhere after the inp array and before the end of the * page. */ - if (offset <= (u_int32_t)((u_int8_t *)h->inp + i - + if (offset <= (u_int32_t)((u_int8_t *)inp + i - (u_int8_t *)h) || offset > (u_int32_t)(dbp->pgsize - RINTERNAL_SIZE)) { isbad = 1; EPRINT((dbp->dbenv, - "Bad offset %lu at page %lu index %lu", - (u_long)offset, (u_long)pgno, (u_long)i)); + "Page %lu: bad offset %lu at index %lu", + (u_long)pgno, (u_long)offset, (u_long)i)); continue; } @@ -456,7 +461,7 @@ __ram_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) nentries++; /* Make sure this RINTERNAL is not multiply referenced. */ - ri = GET_RINTERNAL(h, i); + ri = GET_RINTERNAL(dbp, h, i); if (pagelayout[offset] == 0) { pagelayout[offset] = 1; child.pgno = ri->pgno; @@ -466,8 +471,8 @@ __ram_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) goto err; } else { EPRINT((dbp->dbenv, - "RINTERNAL structure at offset %lu, page %lu referenced twice", - (u_long)offset, (u_long)pgno)); + "Page %lu: RINTERNAL structure at offset %lu referenced twice", + (u_long)pgno, (u_long)offset)); isbad = 1; } } @@ -477,23 +482,25 @@ __ram_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) p += RINTERNAL_SIZE) if (*p != 1) { EPRINT((dbp->dbenv, - "Gap between items at offset %lu, page %lu", - (u_long)(p - pagelayout), (u_long)pgno)); + "Page %lu: gap between items at offset %lu", + (u_long)pgno, (u_long)(p - pagelayout))); isbad = 1; } if ((db_indx_t)himark != HOFFSET(h)) { - EPRINT((dbp->dbenv, "Bad HOFFSET %lu, appears to be %lu", - (u_long)(HOFFSET(h)), (u_long)himark)); + EPRINT((dbp->dbenv, + "Page %lu: bad HOFFSET %lu, appears to be %lu", + (u_long)pgno, (u_long)(HOFFSET(h)), (u_long)himark)); isbad = 1; } *nentriesp = nentries; -err: if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) +err: if ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; if (pagelayout != NULL) - __os_free(pagelayout, dbp->pgsize); + __os_free(dbp->dbenv, pagelayout); return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } @@ -558,22 +565,24 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) * it and the region immediately after it. */ himark = dbp->pgsize; - if ((ret = __os_malloc(dbp->dbenv, - dbp->pgsize, NULL, &pagelayout)) != 0) + if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, &pagelayout)) != 0) goto err; memset(pagelayout, 0, dbp->pgsize); for (i = 0; i < NUM_ENT(h); i++) { - - ret = __db_vrfy_inpitem(dbp, - h, pgno, i, 1, flags, &himark, &offset); - if (ret == DB_VERIFY_BAD) { + switch (ret = __db_vrfy_inpitem(dbp, + h, pgno, i, 1, flags, &himark, &offset)) { + case 0: + break; + case DB_VERIFY_BAD: isbad = 1; continue; - } else if (ret == DB_VERIFY_FATAL) { + case DB_VERIFY_FATAL: isbad = 1; goto err; - } else if (ret != 0) - DB_ASSERT(0); + default: + DB_ASSERT(ret != 0); + break; + } /* * We now have a plausible beginning for the item, and we know @@ -582,7 +591,7 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) * Mark the beginning and end in pagelayout so we can make sure * items have no overlaps or gaps. */ - bk = GET_BKEYDATA(h, i); + bk = GET_BKEYDATA(dbp, h, i); #define ITEM_BEGIN 1 #define ITEM_END 2 if (pagelayout[offset] == 0) @@ -609,8 +618,8 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) } else { isbad = 1; EPRINT((dbp->dbenv, - "Duplicated item %lu on page %lu", - (u_long)i, (u_long)pgno)); + "Page %lu: duplicated item %lu", + (u_long)pgno, (u_long)i)); } } @@ -662,8 +671,8 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) */ if (isdupitem && pagelayout[endoff] != ITEM_END) { EPRINT((dbp->dbenv, - "Duplicated item %lu on page %lu", - (u_long)i, (u_long)pgno)); + "Page %lu: duplicated item %lu", + (u_long)pgno, (u_long)i)); isbad = 1; } else if (pagelayout[endoff] == 0) pagelayout[endoff] = ITEM_END; @@ -676,8 +685,8 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) if (B_DISSET(bk->type) && TYPE(h) != P_LRECNO) { isbad = 1; EPRINT((dbp->dbenv, - "Item %lu on page %lu marked deleted", - (u_long)i, (u_long)pgno)); + "Page %lu: item %lu marked deleted", + (u_long)pgno, (u_long)i)); } /* @@ -696,13 +705,13 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) if (TYPE(h) == P_IBTREE) { isbad = 1; EPRINT((dbp->dbenv, - "Duplicate page referenced by internal btree page %lu at item %lu", + "Page %lu: duplicate page referenced by internal btree page at item %lu", (u_long)pgno, (u_long)i)); break; } else if (TYPE(h) == P_LRECNO) { isbad = 1; EPRINT((dbp->dbenv, - "Duplicate page referenced by recno page %lu at item %lu", + "Page %lu: duplicate page referenced by recno page at item %lu", (u_long)pgno, (u_long)i)); break; } @@ -717,9 +726,9 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) if (bo->tlen > dbp->pgsize * vdp->last_pgno) { isbad = 1; EPRINT((dbp->dbenv, - "Impossible tlen %lu, item %lu, page %lu", - (u_long)bo->tlen, (u_long)i, - (u_long)pgno)); + "Page %lu: impossible tlen %lu, item %lu", + (u_long)pgno, + (u_long)bo->tlen, (u_long)i)); /* Don't save as a child. */ break; } @@ -728,8 +737,8 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) bo->pgno == PGNO_INVALID) { isbad = 1; EPRINT((dbp->dbenv, - "Offpage item %lu, page %lu has bad pgno", - (u_long)i, (u_long)pgno)); + "Page %lu: offpage item %lu has bad pgno %lu", + (u_long)pgno, (u_long)i, (u_long)bo->pgno)); /* Don't save as a child. */ break; } @@ -744,8 +753,8 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) default: isbad = 1; EPRINT((dbp->dbenv, - "Item %lu on page %lu of invalid type %lu", - (u_long)i, (u_long)pgno)); + "Page %lu: item %lu of invalid type %lu", + (u_long)pgno, (u_long)i)); break; } } @@ -765,7 +774,7 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) isbad = 1; EPRINT((dbp->dbenv, - "Gap between items, page %lu offset %lu", + "Page %lu: gap between items at offset %lu", (u_long)pgno, (u_long)i)); /* Find the end of the gap */ for ( ; pagelayout[i + 1] == 0 && @@ -777,8 +786,8 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) if (i != ALIGN(i, sizeof(u_int32_t))) { isbad = 1; EPRINT((dbp->dbenv, - "Offset %lu page %lu unaligned", - (u_long)i, (u_long)pgno)); + "Page %lu: offset %lu unaligned", + (u_long)pgno, (u_long)i)); } initem = 1; nentries++; @@ -791,7 +800,7 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) */ isbad = 1; EPRINT((dbp->dbenv, - "Overlapping items, page %lu offset %lu", + "Page %lu: overlapping items at offset %lu", (u_long)pgno, (u_long)i)); break; default: @@ -816,24 +825,26 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) */ isbad = 1; EPRINT((dbp->dbenv, - "Overlapping items, page %lu offset %lu", + "Page %lu: overlapping items at offset %lu", (u_long)pgno, (u_long)i)); break; } - (void)__os_free(pagelayout, dbp->pgsize); + (void)__os_free(dbp->dbenv, pagelayout); /* Verify HOFFSET. */ if ((db_indx_t)himark != HOFFSET(h)) { - EPRINT((dbp->dbenv, "Bad HOFFSET %lu, appears to be %lu", - (u_long)HOFFSET(h), (u_long)himark)); + EPRINT((dbp->dbenv, + "Page %lu: bad HOFFSET %lu, appears to be %lu", + (u_long)pgno, (u_long)HOFFSET(h), (u_long)himark)); isbad = 1; } err: if (nentriesp != NULL) *nentriesp = nentries; - if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) + if ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((isbad == 1 && ret == 0) ? DB_VERIFY_BAD : ret); @@ -865,14 +876,14 @@ __bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags) int ovflok, hasdups; u_int32_t flags; { - DBT dbta, dbtb, dup1, dup2, *p1, *p2, *tmp; + DBT dbta, dbtb, dup_1, dup_2, *p1, *p2, *tmp; BTREE *bt; BINTERNAL *bi; BKEYDATA *bk; BOVERFLOW *bo; VRFY_PAGEINFO *pip; db_indx_t i; - int cmp, freedup1, freedup2, isbad, ret, t_ret; + int 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; @@ -949,7 +960,7 @@ __bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags) */ switch (TYPE(h)) { case P_IBTREE: - bi = GET_BINTERNAL(h, i); + bi = GET_BINTERNAL(dbp, h, i); if (B_TYPE(bi->type) == B_OVERFLOW) { bo = (BOVERFLOW *)(bi->data); goto overflow; @@ -972,14 +983,14 @@ __bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags) if (i == 0 && bi->len != 0) { isbad = 1; EPRINT((dbp->dbenv, - "Lowest key on internal page %lu of nonzero length", + "Page %lu: lowest key on internal page of nonzero length", (u_long)pgno)); } #endif break; case P_LBTREE: case P_LDUP: - bk = GET_BKEYDATA(h, i); + bk = GET_BKEYDATA(dbp, h, i); if (B_TYPE(bk->type) == B_OVERFLOW) { bo = (BOVERFLOW *)bk; goto overflow; @@ -1030,8 +1041,8 @@ overflow: if (!ovflok) { p2, bo->tlen, bo->pgno, NULL, NULL)) != 0) { isbad = 1; EPRINT((dbp->dbenv, - "Error %lu in fetching overflow item %lu, page %lu", - (u_long)ret, (u_long)i, (u_long)pgno)); + "Page %lu: error %lu in fetching overflow item %lu", + (u_long)pgno, (u_long)ret, (u_long)i)); } /* In case it got realloc'ed and thus changed. */ buf2 = p2->data; @@ -1045,7 +1056,7 @@ overflow: if (!ovflok) { if (cmp > 0) { isbad = 1; EPRINT((dbp->dbenv, - "Out-of-order key, page %lu item %lu", + "Page %lu: out-of-order key at entry %lu", (u_long)pgno, (u_long)i)); /* proceed */ } else if (cmp == 0) { @@ -1060,7 +1071,7 @@ overflow: if (!ovflok) { else if (hasdups == 0) { isbad = 1; EPRINT((dbp->dbenv, - "Database with no duplicates has duplicated keys on page %lu", + "Page %lu: database with no duplicates has duplicated keys", (u_long)pgno)); } @@ -1092,11 +1103,11 @@ overflow: if (!ovflok) { * dups are probably (?) rare. */ if (((ret = __bam_safe_getdata(dbp, - h, i - 1, ovflok, &dup1, - &freedup1)) != 0) || + h, i - 1, ovflok, &dup_1, + &freedup_1)) != 0) || ((ret = __bam_safe_getdata(dbp, - h, i + 1, ovflok, &dup2, - &freedup2)) != 0)) + h, i + 1, ovflok, &dup_2, + &freedup_2)) != 0)) goto err; /* @@ -1105,8 +1116,8 @@ overflow: if (!ovflok) { * it's not safe to chase them now. * Mark an incomplete and return. */ - if (dup1.data == NULL || - dup2.data == NULL) { + if (dup_1.data == NULL || + dup_2.data == NULL) { DB_ASSERT(!ovflok); F_SET(pip, VRFY_INCOMPLETE); goto err; @@ -1118,26 +1129,28 @@ overflow: if (!ovflok) { * until we do the structure check * and see whether DUPSORT is set. */ - if (dupfunc(dbp, &dup1, &dup2) > 0) + if (dupfunc(dbp, &dup_1, &dup_2) > 0) F_SET(pip, VRFY_DUPS_UNSORTED); - if (freedup1) - __os_free(dup1.data, 0); - if (freedup2) - __os_free(dup2.data, 0); + if (freedup_1) + __os_ufree(dbp->dbenv, + dup_1.data); + if (freedup_2) + __os_ufree(dbp->dbenv, + dup_2.data); } } } } -err: if (pip != NULL && - ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0) && ret == 0) +err: if (pip != NULL && ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0) && ret == 0) ret = t_ret; if (buf1 != NULL) - __os_free(buf1, 0); + __os_ufree(dbp->dbenv, buf1); if (buf2 != NULL) - __os_free(buf2, 0); + __os_ufree(dbp->dbenv, buf2); return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } @@ -1173,7 +1186,7 @@ __bam_vrfy_structure(dbp, vdp, meta_pgno, flags) goto err; if (p != 0) { EPRINT((dbp->dbenv, - "Btree metadata page number %lu observed twice", + "Page %lu: btree metadata page observed twice", (u_long)meta_pgno)); ret = DB_VERIFY_BAD; goto err; @@ -1185,7 +1198,8 @@ __bam_vrfy_structure(dbp, vdp, meta_pgno, flags) if (root == 0) { EPRINT((dbp->dbenv, - "Btree metadata page %lu has no root", (u_long)meta_pgno)); + "Page %lu: btree metadata page has no root", + (u_long)meta_pgno)); ret = DB_VERIFY_BAD; goto err; } @@ -1222,7 +1236,7 @@ __bam_vrfy_structure(dbp, vdp, meta_pgno, flags) */ if (mip->re_len > 0 && relen > 0 && mip->re_len != relen) { EPRINT((dbp->dbenv, - "Recno database with meta page %lu has bad re_len %lu", + "Page %lu: recno database has bad re_len %lu", (u_long)meta_pgno, (u_long)relen)); ret = DB_VERIFY_BAD; goto err; @@ -1231,24 +1245,24 @@ __bam_vrfy_structure(dbp, vdp, meta_pgno, flags) break; case P_LDUP: EPRINT((dbp->dbenv, - "Duplicate tree referenced from metadata page %lu", + "Page %lu: duplicate tree referenced from metadata page", (u_long)meta_pgno)); ret = DB_VERIFY_BAD; break; default: EPRINT((dbp->dbenv, - "Btree root of incorrect type %lu on meta page %lu", - (u_long)rip->type, (u_long)meta_pgno)); + "Page %lu: btree root of incorrect type %lu on metadata page", + (u_long)meta_pgno, (u_long)rip->type)); ret = DB_VERIFY_BAD; break; } -err: if (mip != NULL && - ((t_ret = __db_vrfy_putpageinfo(vdp, mip)) != 0) && ret == 0) - t_ret = ret; - if (rip != NULL && - ((t_ret = __db_vrfy_putpageinfo(vdp, rip)) != 0) && ret == 0) - t_ret = ret; +err: if (mip != NULL && ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, mip)) != 0) && ret == 0) + ret = t_ret; + if (rip != NULL && ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, rip)) != 0) && ret == 0) + ret = t_ret; return (ret); } @@ -1273,20 +1287,26 @@ __bam_vrfy_subtree(dbp, { BINTERNAL *li, *ri, *lp, *rp; DB *pgset; + DB_MPOOLFILE *mpf; DBC *cc; PAGE *h; VRFY_CHILDINFO *child; VRFY_PAGEINFO *pip; - db_recno_t nrecs, child_nrecs; db_indx_t i; - int ret, t_ret, isbad, toplevel, p; + db_pgno_t next_pgno, prev_pgno; + db_recno_t child_nrecs, nrecs; + u_int32_t child_level, child_relen, level, relen, stflags; + u_int8_t leaf_type; int (*func) __P((DB *, const DBT *, const DBT *)); - u_int32_t level, child_level, stflags, child_relen, relen; + int isbad, p, ret, t_ret, toplevel; + mpf = dbp->mpf; ret = isbad = 0; nrecs = 0; h = NULL; relen = 0; + leaf_type = P_INVALID; + next_pgno = prev_pgno = PGNO_INVALID; rp = (BINTERNAL *)r; lp = (BINTERNAL *)l; @@ -1300,9 +1320,32 @@ __bam_vrfy_subtree(dbp, cc = NULL; level = pip->bt_level; - toplevel = LF_ISSET(ST_TOPLEVEL); + toplevel = LF_ISSET(ST_TOPLEVEL) ? 1 : 0; LF_CLR(ST_TOPLEVEL); + /* + * If this is the root, initialize the vdp's prev- and next-pgno + * accounting. + * + * For each leaf page we hit, we'll want to make sure that + * vdp->prev_pgno is the same as pip->prev_pgno and vdp->next_pgno is + * our page number. Then, we'll set vdp->next_pgno to pip->next_pgno + * and vdp->prev_pgno to our page number, and the next leaf page in + * line should be able to do the same verification. + */ + if (toplevel) { + /* + * Cache the values stored in the vdp so that if we're an + * auxiliary tree such as an off-page duplicate set, our + * caller's leaf page chain doesn't get lost. + */ + prev_pgno = vdp->prev_pgno; + next_pgno = vdp->next_pgno; + leaf_type = vdp->leaf_type; + vdp->next_pgno = vdp->prev_pgno = PGNO_INVALID; + vdp->leaf_type = P_INVALID; + } + /* * We are recursively descending a btree, starting from the root * and working our way out to the leaves. @@ -1333,8 +1376,53 @@ __bam_vrfy_subtree(dbp, case P_LDUP: case P_LBTREE: /* - * Cases 1, 2 and 3 (overflow pages are common to all three); - * traverse child list, looking for overflows. + * Cases 1, 2 and 3. + * + * We're some sort of leaf page; verify + * that our linked list of leaves is consistent. + */ + if (vdp->leaf_type == P_INVALID) { + /* + * First leaf page. Set the type that all its + * successors should be, and verify that our prev_pgno + * is PGNO_INVALID. + */ + vdp->leaf_type = pip->type; + if (pip->prev_pgno != PGNO_INVALID) + goto bad_prev; + } else { + /* + * Successor leaf page. Check our type, the previous + * page's next_pgno, and our prev_pgno. + */ + if (pip->type != vdp->leaf_type) { + EPRINT((dbp->dbenv, + "Page %lu: unexpected page type %lu found in leaf chain (expected %lu)", + (u_long)pip->pgno, (u_long)pip->type, + (u_long)vdp->leaf_type)); + isbad = 1; + } + if (pip->pgno != vdp->next_pgno) { + EPRINT((dbp->dbenv, + "Page %lu: incorrect next_pgno %lu found in leaf chain (should be %lu)", + (u_long)vdp->prev_pgno, + (u_long)vdp->next_pgno, (u_long)pip->pgno)); + isbad = 1; + } + if (pip->prev_pgno != vdp->prev_pgno) { +bad_prev: EPRINT((dbp->dbenv, + "Page %lu: incorrect prev_pgno %lu found in leaf chain (should be %lu)", + (u_long)pip->pgno, (u_long)pip->prev_pgno, + (u_long)vdp->prev_pgno)); + isbad = 1; + } + } + vdp->prev_pgno = pip->pgno; + vdp->next_pgno = pip->next_pgno; + + /* + * Overflow pages are common to all three leaf types; + * traverse the child list, looking for overflows. */ if ((ret = __db_vrfy_childcursor(vdp, &cc)) != 0) goto err; @@ -1360,7 +1448,7 @@ __bam_vrfy_subtree(dbp, !(LF_ISSET(ST_DUPOK) && !LF_ISSET(ST_DUPSORT))) { isbad = 1; EPRINT((dbp->dbenv, - "Recno leaf page %lu in non-recno tree", + "Page %lu: recno leaf page non-recno tree", (u_long)pgno)); goto done; } @@ -1372,7 +1460,7 @@ __bam_vrfy_subtree(dbp, */ isbad = 1; EPRINT((dbp->dbenv, - "Non-recno leaf page %lu in recno tree", + "Page %lu: non-recno leaf page in recno tree", (u_long)pgno)); goto done; } @@ -1389,7 +1477,7 @@ __bam_vrfy_subtree(dbp, if (!LF_ISSET(ST_DUPOK)) { isbad = 1; EPRINT((dbp->dbenv, - "Duplicates on page %lu in non-dup btree", + "Page %lu: duplicates in non-dup btree", (u_long)pgno)); } else { /* @@ -1414,8 +1502,8 @@ __bam_vrfy_subtree(dbp, } if ((ret = __bam_vrfy_subtree( dbp, vdp, child->pgno, NULL, - NULL, stflags, NULL, NULL, - NULL)) != 0) { + NULL, stflags | ST_TOPLEVEL, + NULL, NULL, NULL)) != 0) { if (ret != DB_VERIFY_BAD) goto err; @@ -1436,14 +1524,13 @@ __bam_vrfy_subtree(dbp, if (F_ISSET(pip, VRFY_DUPS_UNSORTED) && LF_ISSET(ST_DUPSORT)) { EPRINT((dbp->dbenv, - "Unsorted duplicate set at page %lu in sorted-dup database", + "Page %lu: unsorted duplicate set in sorted-dup database", (u_long)pgno)); isbad = 1; } } } goto leaf; - break; case P_IBTREE: case P_IRECNO: /* We handle these below. */ @@ -1455,10 +1542,18 @@ __bam_vrfy_subtree(dbp, * Note that the code at the "done" label assumes that the * current page is a btree/recno one of some sort; this * is not the case here, so we goto err. + * + * If the page is entirely zeroed, its pip->type will be a lie + * (we assumed it was a hash page, as they're allowed to be + * zeroed); handle this case specially. */ - EPRINT((dbp->dbenv, - "Page %lu is of inappropriate type %lu", - (u_long)pgno, (u_long)pip->type)); + if (F_ISSET(pip, VRFY_IS_ALLZEROES)) + ZEROPG_ERR_PRINT(dbp->dbenv, + pgno, "btree or recno page"); + else + EPRINT((dbp->dbenv, + "Page %lu: btree or recno page is of inappropriate type %lu", + (u_long)pgno, (u_long)pip->type)); ret = DB_VERIFY_BAD; goto err; } @@ -1500,8 +1595,9 @@ __bam_vrfy_subtree(dbp, relen != child_relen) { isbad = 1; EPRINT((dbp->dbenv, - "Recno page %lu returned bad re_len", - (u_long)child->pgno)); + "Page %lu: recno page returned bad re_len %lu", + (u_long)child->pgno, + (u_long)child_relen)); } if (relenp) *relenp = relen; @@ -1510,10 +1606,8 @@ __bam_vrfy_subtree(dbp, nrecs += child_nrecs; if (level != child_level + 1) { isbad = 1; - EPRINT((dbp->dbenv, "%s%lu%s%lu%s%lu", - "Recno level incorrect on page ", - (u_long)child->pgno, ": got ", - (u_long)child_level, ", expected ", + EPRINT((dbp->dbenv, "Page %lu: recno level incorrect: got %lu, expected %lu", + (u_long)child->pgno, (u_long)child_level, (u_long)(level - 1))); } } else if (child->type == V_OVERFLOW && @@ -1543,12 +1637,12 @@ __bam_vrfy_subtree(dbp, * 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(dbp->mpf, &pgno, 0, &h)) != 0) + if (h == NULL && (ret = mpf->get(mpf, &pgno, 0, &h)) != 0) goto err; for (i = 0; i < pip->entries; i += O_INDX) { - li = GET_BINTERNAL(h, i); + li = GET_BINTERNAL(dbp, h, i); ri = (i + O_INDX < pip->entries) ? - GET_BINTERNAL(h, i + O_INDX) : NULL; + GET_BINTERNAL(dbp, h, i + O_INDX) : NULL; /* * The leftmost key is forcibly sorted less than all entries, @@ -1578,18 +1672,18 @@ __bam_vrfy_subtree(dbp, if (li->nrecs != child_nrecs) { isbad = 1; EPRINT((dbp->dbenv, - "Item %lu page %lu has incorrect record count of %lu, should be %lu", - (u_long)i, (u_long)pgno, (u_long)li->nrecs, + "Page %lu: item %lu has incorrect record count of %lu, should be %lu", + (u_long)pgno, (u_long)i, (u_long)li->nrecs, (u_long)child_nrecs)); } } if (level != child_level + 1) { isbad = 1; - EPRINT((dbp->dbenv, "%s%lu%s%lu%s%lu", - "Btree level incorrect on page ", (u_long)li->pgno, - ": got ", (u_long)child_level, ", expected ", - (u_long)(level - 1))); + EPRINT((dbp->dbenv, + "Page %lu: Btree level incorrect: got %lu, expected %lu", + (u_long)li->pgno, + (u_long)child_level, (u_long)(level - 1))); } } @@ -1616,7 +1710,7 @@ 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(dbp->mpf, &pgno, 0, &h)) != 0) + if (h == NULL && (ret = mpf->get(mpf, &pgno, 0, &h)) != 0) goto err; if ((ret = __bam_vrfy_itemorder(dbp, vdp, h, pgno, 0, 1, 0, flags)) != 0) @@ -1624,13 +1718,36 @@ done: if (F_ISSET(pip, VRFY_INCOMPLETE) && isbad == 0 && ret == 0) { F_CLR(pip, VRFY_INCOMPLETE); } + /* + * It's possible to get to this point with a page that has no + * items, but without having detected any sort of failure yet. + * Having zero items is legal if it's a leaf--it may be the + * root page in an empty tree, or the tree may have been + * modified with the DB_REVSPLITOFF flag set (there's no way + * to tell from what's on disk). For an internal page, + * though, having no items is a problem (all internal pages + * must have children). + */ + if (isbad == 0 && ret == 0) { + if (h == NULL && (ret = mpf->get(mpf, &pgno, 0, &h)) != 0) + goto err; + + if (NUM_ENT(h) == 0 && ISINTERNAL(h)) { + EPRINT((dbp->dbenv, + "Page %lu: internal page is empty and should not be", + (u_long)pgno)); + isbad = 1; + goto err; + } + } + /* * Our parent has sent us BINTERNAL pointers to parent records * 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(dbp->mpf, &pgno, 0, &h)) != 0) + if (h == NULL && (ret = mpf->get(mpf, &pgno, 0, &h)) != 0) goto err; /* @@ -1662,7 +1779,7 @@ done: if (F_ISSET(pip, VRFY_INCOMPLETE) && isbad == 0 && ret == 0) { if (LF_ISSET(ST_RECNUM) && nrecs != pip->rec_cnt && toplevel) { isbad = 1; EPRINT((dbp->dbenv, - "Bad record count on page %lu: got %lu, expected %lu", + "Page %lu: bad record count: has %lu records, claims %lu", (u_long)pgno, (u_long)nrecs, (u_long)pip->rec_cnt)); } @@ -1676,13 +1793,32 @@ done: if (F_ISSET(pip, VRFY_INCOMPLETE) && isbad == 0 && ret == 0) { goto err; if (p != 0) { isbad = 1; - EPRINT((dbp->dbenv, "Page %lu linked twice", (u_long)pgno)); + EPRINT((dbp->dbenv, "Page %lu: linked twice", (u_long)pgno)); } else if ((ret = __db_vrfy_pgset_inc(pgset, pgno)) != 0) goto err; -err: if (h != NULL && (t_ret = memp_fput(dbp->mpf, h, 0)) != 0 && ret == 0) + if (toplevel) + /* + * The last page's next_pgno in the leaf chain should have been + * PGNO_INVALID. + */ + if (vdp->next_pgno != PGNO_INVALID) { + EPRINT((dbp->dbenv, "Page %lu: unterminated leaf chain", + (u_long)vdp->prev_pgno)); + isbad = 1; + } + +err: if (toplevel) { + /* Restore our caller's settings. */ + vdp->next_pgno = next_pgno; + vdp->prev_pgno = prev_pgno; + vdp->leaf_type = leaf_type; + } + + if (h != NULL && (t_ret = mpf->put(mpf, h, 0)) != 0 && ret == 0) ret = t_ret; - if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) + if ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; if (cc != NULL && ((t_ret = __db_vrfy_ccclose(cc)) != 0) && ret == 0) ret = t_ret; @@ -1720,6 +1856,14 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags) F_SET(&dbt, DB_DBT_MALLOC); ret = 0; + /* + * Empty pages are sorted correctly by definition. We check + * to see whether they ought to be empty elsewhere; leaf + * pages legally may be. + */ + if (NUM_ENT(h) == 0) + return (0); + switch (TYPE(h)) { case P_IBTREE: case P_LDUP: @@ -1760,7 +1904,8 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags) } else { DB_ASSERT(0); EPRINT((dbp->dbenv, - "Unknown type for internal record")); + "Page %lu: unknown type for internal record", + (u_long)PGNO(h))); return (EINVAL); } @@ -1768,17 +1913,17 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags) if ((ret = __bam_cmp(dbp, &dbt, h, 0, func, &cmp)) == 0) { if (cmp > 0) { EPRINT((dbp->dbenv, - "First item on page %lu sorted greater than parent entry", + "Page %lu: first item on page sorted greater than parent entry", (u_long)PGNO(h))); ret = DB_VERIFY_BAD; } } else EPRINT((dbp->dbenv, - "First item on page %lu had comparison error", + "Page %lu: first item on page had comparison error", (u_long)PGNO(h))); if (dbt.data != lp->data) - __os_free(dbt.data, 0); + __os_ufree(dbp->dbenv, dbt.data); if (ret != 0) return (ret); } @@ -1795,7 +1940,8 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags) } else { DB_ASSERT(0); EPRINT((dbp->dbenv, - "Unknown type for internal record")); + "Page %lu: unknown type for internal record", + (u_long)PGNO(h))); return (EINVAL); } @@ -1803,17 +1949,17 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags) if ((ret = __bam_cmp(dbp, &dbt, h, last, func, &cmp)) == 0) { if (cmp < 0) { EPRINT((dbp->dbenv, - "Last item on page %lu sorted greater than parent entry", + "Page %lu: last item on page sorted greater than parent entry", (u_long)PGNO(h))); ret = DB_VERIFY_BAD; } } else EPRINT((dbp->dbenv, - "Last item on page %lu had comparison error", + "Page %lu: last item on page had comparison error", (u_long)PGNO(h))); if (dbt.data != rp->data) - __os_free(dbt.data, 0); + __os_ufree(dbp->dbenv, dbt.data); } return (ret); @@ -1843,7 +1989,7 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) DBT dbt, unkdbt; BKEYDATA *bk; BOVERFLOW *bo; - db_indx_t i, beg, end; + db_indx_t i, beg, end, *inp; u_int32_t himark; u_int8_t *pgmap; void *ovflbuf; @@ -1854,24 +2000,25 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) 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 = strlen("UNKNOWN") + 1; + unkdbt.size = (u_int32_t)(strlen("UNKNOWN") + 1); unkdbt.data = "UNKNOWN"; /* * Allocate a buffer for overflow items. Start at one page; * __db_safe_goff will realloc as needed. */ - if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, NULL, &ovflbuf)) != 0) + if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, &ovflbuf)) != 0) return (ret); if (LF_ISSET(DB_AGGRESSIVE)) { if ((ret = - __os_malloc(dbp->dbenv, dbp->pgsize, NULL, &pgmap)) != 0) + __os_malloc(dbp->dbenv, dbp->pgsize, &pgmap)) != 0) goto err; memset(pgmap, 0, dbp->pgsize); } @@ -1914,7 +2061,7 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) * We only want to print deleted items if * DB_AGGRESSIVE is set. */ - bk = GET_BKEYDATA(h, i); + bk = GET_BKEYDATA(dbp, h, i); if (!LF_ISSET(DB_AGGRESSIVE) && B_DISSET(bk->type)) continue; @@ -1927,10 +2074,10 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) if (key != NULL && (i != 0 || !LF_ISSET(SA_SKIPFIRSTKEY))) if ((ret = __db_prdbt(key, - 0, " ", handle, callback, 0, NULL)) != 0) + 0, " ", handle, callback, 0, vdp)) != 0) err_ret = ret; - beg = h->inp[i]; + beg = inp[i]; switch (B_TYPE(bk->type)) { case B_DUPLICATE: end = beg + BOVERFLOW_SIZE - 1; @@ -1958,23 +2105,24 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) (i % P_INDX == 0)) { /* Not much to do on failure. */ if ((ret = __db_prdbt(&unkdbt, 0, " ", - handle, callback, 0, NULL)) != 0) + handle, callback, 0, vdp)) != 0) err_ret = ret; break; } if ((ret = __db_salvage_duptree(dbp, vdp, bo->pgno, &dbt, handle, callback, - flags | SA_SKIPFIRSTKEY)) != 0) + flags | SA_SKIPFIRSTKEY)) != 0) err_ret = ret; break; case B_KEYDATA: - end = ALIGN(beg + bk->len, sizeof(u_int32_t)) - 1; + end = + ALIGN(beg + bk->len, sizeof(u_int32_t)) - 1; dbt.data = bk->data; dbt.size = bk->len; if ((ret = __db_prdbt(&dbt, - 0, " ", handle, callback, 0, NULL)) != 0) + 0, " ", handle, callback, 0, vdp)) != 0) err_ret = ret; break; case B_OVERFLOW: @@ -1985,11 +2133,11 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) err_ret = ret; /* We care about err_ret more. */ (void)__db_prdbt(&unkdbt, 0, " ", - handle, callback, 0, NULL); + handle, callback, 0, vdp); break; } if ((ret = __db_prdbt(&dbt, - 0, " ", handle, callback, 0, NULL)) != 0) + 0, " ", handle, callback, 0, vdp)) != 0) err_ret = ret; break; default: @@ -2020,12 +2168,12 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) * a datum; fix this imbalance by printing an "UNKNOWN". */ if (pgtype == P_LBTREE && (i % P_INDX == 1) && ((ret = - __db_prdbt(&unkdbt, 0, " ", handle, callback, 0, NULL)) != 0)) + __db_prdbt(&unkdbt, 0, " ", handle, callback, 0, vdp)) != 0)) err_ret = ret; err: if (pgmap != NULL) - __os_free(pgmap, 0); - __os_free(ovflbuf, 0); + __os_free(dbp->dbenv, pgmap); + __os_free(dbp->dbenv, ovflbuf); /* Mark this page as done. */ if ((t_ret = __db_salvage_markdone(vdp, pgno)) != 0) @@ -2061,12 +2209,13 @@ __bam_salvage_walkdupint(dbp, vdp, h, key, handle, callback, flags) for (i = 0; i < NUM_ENT(h); i++) { switch (TYPE(h)) { case P_IBTREE: - bi = GET_BINTERNAL(h, i); + bi = GET_BINTERNAL(dbp, h, i); if ((t_ret = __db_salvage_duptree(dbp, vdp, bi->pgno, key, handle, callback, flags)) != 0) ret = t_ret; + break; case P_IRECNO: - ri = GET_RINTERNAL(h, i); + ri = GET_RINTERNAL(dbp, h, i); if ((t_ret = __db_salvage_duptree(dbp, vdp, ri->pgno, key, handle, callback, flags)) != 0) ret = t_ret; @@ -2110,11 +2259,13 @@ __bam_meta2pgset(dbp, vdp, btmeta, flags, pgset) DB *pgset; { BINTERNAL *bi; + DB_MPOOLFILE *mpf; PAGE *h; RINTERNAL *ri; db_pgno_t current, p; int err_ret, ret; + mpf = dbp->mpf; h = NULL; ret = err_ret = 0; DB_ASSERT(pgset != NULL); @@ -2123,7 +2274,7 @@ __bam_meta2pgset(dbp, vdp, btmeta, flags, pgset) err_ret = DB_VERIFY_BAD; goto err; } - if ((ret = memp_fget(dbp->mpf, ¤t, 0, &h)) != 0) { + if ((ret = mpf->get(mpf, ¤t, 0, &h)) != 0) { err_ret = ret; goto err; } @@ -2137,10 +2288,10 @@ __bam_meta2pgset(dbp, vdp, btmeta, flags, pgset) goto err; } if (TYPE(h) == P_IBTREE) { - bi = GET_BINTERNAL(h, 0); + bi = GET_BINTERNAL(dbp, h, 0); current = bi->pgno; } else { /* P_IRECNO */ - ri = GET_RINTERNAL(h, 0); + ri = GET_RINTERNAL(dbp, h, 0); current = ri->pgno; } break; @@ -2152,7 +2303,7 @@ __bam_meta2pgset(dbp, vdp, btmeta, flags, pgset) goto err; } - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) + if ((ret = mpf->put(mpf, h, 0)) != 0) err_ret = ret; h = NULL; } @@ -2163,8 +2314,7 @@ __bam_meta2pgset(dbp, vdp, btmeta, flags, pgset) */ traverse: while (IS_VALID_PGNO(current) && current != PGNO_INVALID) { - if (h == NULL && - (ret = memp_fget(dbp->mpf, ¤t, 0, &h) != 0)) { + if (h == NULL && (ret = mpf->get(mpf, ¤t, 0, &h)) != 0) { err_ret = ret; break; } @@ -2184,13 +2334,13 @@ traverse: goto err; current = NEXT_PGNO(h); - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) + if ((ret = mpf->put(mpf, h, 0)) != 0) err_ret = ret; h = NULL; } err: if (h != NULL) - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); return (ret == 0 ? err_ret : ret); } @@ -2218,7 +2368,7 @@ __bam_safe_getdata(dbp, h, i, ovflok, dbt, freedbtp) memset(dbt, 0, sizeof(DBT)); *freedbtp = 0; - bk = GET_BKEYDATA(h, i); + bk = GET_BKEYDATA(dbp, h, i); if (B_TYPE(bk->type) == B_OVERFLOW) { if (!ovflok) return (0); diff --git a/bdb/btree/btree.src b/bdb/btree/btree.src index a1eba7d7fc7..73f4abac874 100644 --- a/bdb/btree/btree.src +++ b/bdb/btree/btree.src @@ -1,13 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: btree.src,v 10.26 2000/12/12 17:40:23 bostic Exp $ + * $Id: btree.src,v 10.35 2002/04/17 19:02:56 krinsky Exp $ */ -PREFIX bam +PREFIX __bam +DBPRIVATE INCLUDE #include "db_config.h" INCLUDE @@ -15,69 +16,23 @@ INCLUDE #ifndef NO_SYSTEM_INCLUDES INCLUDE #include INCLUDE INCLUDE #include -INCLUDE #include INCLUDE #include INCLUDE #endif INCLUDE INCLUDE #include "db_int.h" -INCLUDE #include "db_page.h" -INCLUDE #include "db_dispatch.h" -INCLUDE #include "db_am.h" -INCLUDE #include "btree.h" -INCLUDE #include "txn.h" +INCLUDE #include "dbinc/crypto.h" +INCLUDE #include "dbinc/db_page.h" +INCLUDE #include "dbinc/db_dispatch.h" +INCLUDE #include "dbinc/db_am.h" +INCLUDE #include "dbinc/btree.h" +INCLUDE #include "dbinc/log.h" +INCLUDE #include "dbinc/rep.h" +INCLUDE #include "dbinc/txn.h" INCLUDE /* - * BTREE-pg_alloc: used to record allocating a new page. - * - * meta_lsn: the meta-data page's original lsn. - * page_lsn: the allocated page's original lsn. - * pgno: the page allocated. - * next: the next page on the free list. + * NOTE: pg_alloc and pg_free have been moved to db.src, where they belong. */ -BEGIN pg_alloc 51 -ARG fileid int32_t ld -POINTER meta_lsn DB_LSN * 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 - -DEPRECATED pg_alloc1 60 -ARG fileid int32_t ld -POINTER meta_lsn DB_LSN * lu -POINTER alloc_lsn DB_LSN * 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 - -/* - * BTREE-pg_free: used to record freeing a page. - * - * pgno: the page being freed. - * meta_lsn: the meta-data page's original lsn. - * header: the header from the free'd page. - * next: the previous next pointer on the metadata page. - */ -BEGIN pg_free 52 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu -POINTER meta_lsn DB_LSN * lu -DBT header DBT s -ARG next db_pgno_t lu -END - -DEPRECATED pg_free1 61 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu -POINTER meta_lsn DB_LSN * lu -POINTER alloc_lsn DB_LSN * lu -DBT header DBT s -ARG next db_pgno_t lu -END /* * BTREE-split: used to log a page split. @@ -89,67 +44,24 @@ END * indx: the number of entries that went to the left page. * npgno: the next page number * nlsn: the next page's original LSN (or 0 if no next page). - * pg: the split page's contents before the split. - */ -DEPRECATED split1 53 -ARG fileid int32_t ld -ARG left db_pgno_t lu -POINTER llsn DB_LSN * lu -ARG right db_pgno_t lu -POINTER rlsn DB_LSN * lu -ARG indx u_int32_t lu -ARG npgno db_pgno_t lu -POINTER nlsn DB_LSN * lu -DBT pg DBT s -END - -/* - * BTREE-split: used to log a page split. - * - * left: the page number for the low-order contents. - * llsn: the left page's original LSN. - * right: the page number for the high-order contents. - * rlsn: the right page's original LSN. - * indx: the number of entries that went to the left page. - * npgno: the next page number - * npgno: the next page number - * nlsn: the next page's original LSN (or 0 if no next page). * root_pgno: the root page number * pg: the split page's contents before the split. * opflags: SPL_NRECS: if splitting a tree that maintains a record count. */ BEGIN split 62 -ARG fileid int32_t ld -ARG left db_pgno_t lu +DB fileid int32_t ld +WRLOCK left db_pgno_t lu POINTER llsn DB_LSN * lu -ARG right db_pgno_t lu +WRLOCK right db_pgno_t lu POINTER rlsn DB_LSN * lu ARG indx u_int32_t lu ARG npgno db_pgno_t lu POINTER nlsn DB_LSN * lu -ARG root_pgno db_pgno_t lu -DBT pg DBT s +WRLOCKNZ root_pgno db_pgno_t lu +PGDBT pg DBT s ARG opflags u_int32_t lu END -/* - * BTREE-rsplit: used to log a reverse-split - * - * pgno: the page number of the page copied over the root. - * pgdbt: the page being copied on the root page. - * nrec: the tree's record count. - * rootent: last entry on the root page. - * rootlsn: the root page's original lsn. - */ -DEPRECATED rsplit1 54 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu -DBT pgdbt DBT s -ARG nrec db_pgno_t lu -DBT rootent DBT s -POINTER rootlsn DB_LSN * lu -END - /* * BTREE-rsplit: used to log a reverse-split * @@ -161,10 +73,10 @@ END * rootlsn: the root page's original lsn. */ BEGIN rsplit 63 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu -DBT pgdbt DBT s -ARG root_pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu +PGDBT pgdbt DBT s +WRLOCK root_pgno db_pgno_t lu ARG nrec db_pgno_t lu DBT rootent DBT s POINTER rootlsn DB_LSN * lu @@ -180,8 +92,8 @@ END * is_insert: 0 if a delete, 1 if an insert. */ BEGIN adj 55 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu POINTER lsn DB_LSN * lu ARG indx u_int32_t lu ARG indx_copy u_int32_t lu @@ -198,8 +110,8 @@ END * opflags: CAD_UPDATEROOT: if root page count was adjusted. */ BEGIN cadjust 56 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu POINTER lsn DB_LSN * lu ARG indx u_int32_t lu ARG adjust int32_t ld @@ -214,8 +126,8 @@ END * indx: the index to be deleted. */ BEGIN cdel 57 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu POINTER lsn DB_LSN * lu ARG indx u_int32_t lu END @@ -230,8 +142,8 @@ END * duplicate: the prefix of the replacement that matches the original. */ BEGIN repl 58 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu POINTER lsn DB_LSN * lu ARG indx u_int32_t lu ARG isdeleted u_int32_t lu @@ -245,9 +157,9 @@ END * BTREE-root: log the assignment of a root btree page. */ BEGIN root 59 -ARG fileid int32_t ld -ARG meta_pgno db_pgno_t lu -ARG root_pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK meta_pgno db_pgno_t lu +WRLOCK root_pgno db_pgno_t lu POINTER meta_lsn DB_LSN * lu END @@ -260,7 +172,7 @@ END */ BEGIN curadj 64 /* Fileid of db affected. */ -ARG fileid int32_t ld +DB fileid int32_t ld /* Which adjustment. */ ARG mode db_ca_mode ld /* Page entry is from. */ @@ -284,7 +196,7 @@ END */ BEGIN rcuradj 65 /* Fileid of db affected. */ -ARG fileid int32_t ld +DB fileid int32_t ld /* Which adjustment. */ ARG mode ca_recno_arg ld /* Root page number. */ diff --git a/bdb/build_vxworks/BerkeleyDB.wpj b/bdb/build_vxworks/BerkeleyDB.wpj index fa8aa61c14e..45b15a62687 100644 --- a/bdb/build_vxworks/BerkeleyDB.wpj +++ b/bdb/build_vxworks/BerkeleyDB.wpj @@ -1,224 +1,5 @@ Document file - DO NOT EDIT - BUILD_PENTIUM_RPCdebug_BUILDRULE -BerkeleyDB.out - - - BUILD_PENTIUM_RPCdebug_MACRO_AR -ar386 - - - BUILD_PENTIUM_RPCdebug_MACRO_ARCHIVE -$(PRJ_DIR)/PENTIUMgnu/BerkeleyDB_sim.a - - - BUILD_PENTIUM_RPCdebug_MACRO_AS -cc386 - - - BUILD_PENTIUM_RPCdebug_MACRO_CC -cc386 - - - BUILD_PENTIUM_RPCdebug_MACRO_CFLAGS --g \ - -mpentium \ - -ansi \ - -nostdinc \ - -DRW_MULTI_THREAD \ - -D_REENTRANT \ - -fvolatile \ - -nostdlib \ - -fno-builtin \ - -fno-defer-pop \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM \ - -O0 \ - -I$(PRJ_DIR) \ - -I/export/home/db/include \ - -DDIAGNOSTIC \ - -DDEBUG \ - -DHAVE_RPC - - - BUILD_PENTIUM_RPCdebug_MACRO_CFLAGS_AS --g \ - -mpentium \ - -ansi \ - -nostdinc \ - -fvolatile \ - -nostdlib \ - -fno-builtin \ - -fno-defer-pop \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM - - - BUILD_PENTIUM_RPCdebug_MACRO_CPP -cc386 -E -P -xc - - - BUILD_PENTIUM_RPCdebug_MACRO_LD -ld386 - - - BUILD_PENTIUM_RPCdebug_MACRO_LDFLAGS --X -N - - - BUILD_PENTIUM_RPCdebug_MACRO_LD_PARTIAL_FLAGS --X -r - - - BUILD_PENTIUM_RPCdebug_MACRO_NM -nm386 -g - - - BUILD_PENTIUM_RPCdebug_MACRO_OPTION_DEFINE_MACRO --D - - - BUILD_PENTIUM_RPCdebug_MACRO_OPTION_INCLUDE_DIR --I - - - BUILD_PENTIUM_RPCdebug_MACRO_POST_BUILD_RULE - - - - BUILD_PENTIUM_RPCdebug_MACRO_PRJ_LIBS - - - - BUILD_PENTIUM_RPCdebug_MACRO_SIZE -size386 - - - BUILD_PENTIUM_RPCdebug_RO_DEPEND_PATH -{$(WIND_BASE)/target/h/} \ - {$(WIND_BASE)/target/src/} \ - {$(WIND_BASE)/target/config/} - - - BUILD_PENTIUM_RPCdebug_TC -::tc_PENTIUMgnu - - - BUILD_PENTIUM_RPCnodebug_BUILDRULE -BerkeleyDB.out - - - BUILD_PENTIUM_RPCnodebug_MACRO_AR -ar386 - - - BUILD_PENTIUM_RPCnodebug_MACRO_ARCHIVE -$(PRJ_DIR)/PENTIUMgnu/BerkeleyDB_sim.a - - - BUILD_PENTIUM_RPCnodebug_MACRO_AS -cc386 - - - BUILD_PENTIUM_RPCnodebug_MACRO_CC -cc386 - - - BUILD_PENTIUM_RPCnodebug_MACRO_CFLAGS --mpentium \ - -ansi \ - -nostdinc \ - -DRW_MULTI_THREAD \ - -D_REENTRANT \ - -fvolatile \ - -nostdlib \ - -fno-builtin \ - -fno-defer-pop \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM \ - -O2 \ - -I$(PRJ_DIR) \ - -I/export/home/db/include \ - -DHAVE_RPC - - - BUILD_PENTIUM_RPCnodebug_MACRO_CFLAGS_AS --g \ - -mpentium \ - -ansi \ - -nostdinc \ - -fvolatile \ - -nostdlib \ - -fno-builtin \ - -fno-defer-pop \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM - - - BUILD_PENTIUM_RPCnodebug_MACRO_CPP -cc386 -E -P -xc - - - BUILD_PENTIUM_RPCnodebug_MACRO_LD -ld386 - - - BUILD_PENTIUM_RPCnodebug_MACRO_LDDEPS - - - - BUILD_PENTIUM_RPCnodebug_MACRO_LDFLAGS --X -N - - - BUILD_PENTIUM_RPCnodebug_MACRO_LD_PARTIAL_FLAGS --X -r - - - BUILD_PENTIUM_RPCnodebug_MACRO_NM -nm386 -g - - - BUILD_PENTIUM_RPCnodebug_MACRO_OPTION_DEFINE_MACRO --D - - - BUILD_PENTIUM_RPCnodebug_MACRO_OPTION_INCLUDE_DIR --I - - - BUILD_PENTIUM_RPCnodebug_MACRO_POST_BUILD_RULE - - - - BUILD_PENTIUM_RPCnodebug_MACRO_PRJ_LIBS - - - - BUILD_PENTIUM_RPCnodebug_MACRO_SIZE -size386 - - - BUILD_PENTIUM_RPCnodebug_RO_DEPEND_PATH -{$(WIND_BASE)/target/h/} \ - {$(WIND_BASE)/target/src/} \ - {$(WIND_BASE)/target/config/} - - - BUILD_PENTIUM_RPCnodebug_TC -::tc_PENTIUMgnu - - BUILD_PENTIUM_debug_BUILDRULE BerkeleyDB.out @@ -255,7 +36,7 @@ cc386 -DCPU=PENTIUM \ -O0 \ -I$(PRJ_DIR) \ - -I/export/home/db/include \ + -I$(PRJ_DIR)/.. \ -DDIAGNOSTIC \ -DDEBUG @@ -327,27 +108,27 @@ size386 ::tc_PENTIUMgnu - BUILD_PENTIUM_nodebug_BUILDRULE + BUILD_PENTIUM_release_BUILDRULE BerkeleyDB.out - BUILD_PENTIUM_nodebug_MACRO_AR + BUILD_PENTIUM_release_MACRO_AR ar386 - BUILD_PENTIUM_nodebug_MACRO_ARCHIVE + BUILD_PENTIUM_release_MACRO_ARCHIVE $(PRJ_DIR)/PENTIUMgnu/BerkeleyDB_sim.a - BUILD_PENTIUM_nodebug_MACRO_AS + BUILD_PENTIUM_release_MACRO_AS cc386 - BUILD_PENTIUM_nodebug_MACRO_CC + BUILD_PENTIUM_release_MACRO_CC cc386 - BUILD_PENTIUM_nodebug_MACRO_CFLAGS + BUILD_PENTIUM_release_MACRO_CFLAGS -mpentium \ -ansi \ -nostdinc \ @@ -362,10 +143,10 @@ cc386 -DCPU=PENTIUM \ -O2 \ -I$(PRJ_DIR) \ - -I/export/home/db/include + -I$(PRJ_DIR)/.. - BUILD_PENTIUM_nodebug_MACRO_CFLAGS_AS + BUILD_PENTIUM_release_MACRO_CFLAGS_AS -g \ -mpentium \ -ansi \ @@ -382,53 +163,57 @@ cc386 -DCPU=PENTIUM - BUILD_PENTIUM_nodebug_MACRO_CPP + BUILD_PENTIUM_release_MACRO_CPP cc386 -E -P -xc - BUILD_PENTIUM_nodebug_MACRO_LD + BUILD_PENTIUM_release_MACRO_LD ld386 - BUILD_PENTIUM_nodebug_MACRO_LDFLAGS + BUILD_PENTIUM_release_MACRO_LDDEPS + + + + BUILD_PENTIUM_release_MACRO_LDFLAGS -X -N - BUILD_PENTIUM_nodebug_MACRO_LD_PARTIAL_FLAGS + BUILD_PENTIUM_release_MACRO_LD_PARTIAL_FLAGS -X -r - BUILD_PENTIUM_nodebug_MACRO_NM + BUILD_PENTIUM_release_MACRO_NM nm386 -g - BUILD_PENTIUM_nodebug_MACRO_OPTION_DEFINE_MACRO + BUILD_PENTIUM_release_MACRO_OPTION_DEFINE_MACRO -D - BUILD_PENTIUM_nodebug_MACRO_OPTION_INCLUDE_DIR + BUILD_PENTIUM_release_MACRO_OPTION_INCLUDE_DIR -I - BUILD_PENTIUM_nodebug_MACRO_POST_BUILD_RULE + BUILD_PENTIUM_release_MACRO_POST_BUILD_RULE - BUILD_PENTIUM_nodebug_MACRO_PRJ_LIBS + BUILD_PENTIUM_release_MACRO_PRJ_LIBS - BUILD_PENTIUM_nodebug_MACRO_SIZE + BUILD_PENTIUM_release_MACRO_SIZE size386 - BUILD_PENTIUM_nodebug_RO_DEPEND_PATH + BUILD_PENTIUM_release_RO_DEPEND_PATH {$(WIND_BASE)/target/h/} \ {$(WIND_BASE)/target/src/} \ {$(WIND_BASE)/target/config/} - BUILD_PENTIUM_nodebug_TC + BUILD_PENTIUM_release_TC ::tc_PENTIUMgnu @@ -448,104 +233,12 @@ size386 - BUILD_SIMSPARCSOLARISgnu_MACRO_AR -arsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE -$(PRJ_DIR)/SIMSPARCSOLARISgnu/BerkeleyDB.a - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AS -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CC -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS --g \ - -ansi \ - -nostdinc \ - -DRW_MULTI_THREAD \ - -D_REENTRANT \ - -fvolatile \ - -fno-builtin \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS \ - -O2 \ - -I$(PRJ_DIR) \ - -I/export/home/db/include - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS --g \ - -ansi \ - -nostdinc \ - -fvolatile \ - -fno-builtin \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CPP -ccsimso -E -P -xc - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS --N - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS --nostdlib -r - - - BUILD_SIMSPARCSOLARISgnu_MACRO_NM -nmsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO --D - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR --I - - - BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE -sizesimso - - - BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH -{$(WIND_BASE)/target/h/} \ - {$(WIND_BASE)/target/src/} \ - {$(WIND_BASE)/target/config/} - - - BUILD_SIMSPARCSOLARISgnu_TC -::tc_SIMSPARCSOLARISgnu - - BUILD__CURRENT -PENTIUM_RPCdebug +PENTIUM_debug BUILD__LIST -PENTIUM_nodebug \ - PENTIUM_RPCdebug \ - PENTIUM_RPCnodebug \ - PENTIUM_debug \ - SIMSPARCSOLARISgnu +PENTIUM_release PENTIUM_debug CORE_INFO_TYPE @@ -556,5511 +249,3258 @@ PENTIUM_nodebug \ 2.0 - FILE_/export/home/db/btree/bt_compare.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_compare.c_dependDone TRUE - FILE_/export/home/db/btree/bt_compare.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_compare.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_compare.c_objects + FILE_$(PRJ_DIR)/../btree/bt_compare.c_objects bt_compare.o - FILE_/export/home/db/btree/bt_compare.c_tool + FILE_$(PRJ_DIR)/../btree/bt_compare.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_conv.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_conv.c_dependDone TRUE - FILE_/export/home/db/btree/bt_conv.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_conv.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_conv.c_objects + FILE_$(PRJ_DIR)/../btree/bt_conv.c_objects bt_conv.o - FILE_/export/home/db/btree/bt_conv.c_tool + FILE_$(PRJ_DIR)/../btree/bt_conv.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_curadj.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_curadj.c_dependDone TRUE - FILE_/export/home/db/btree/bt_curadj.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_curadj.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_curadj.c_objects + FILE_$(PRJ_DIR)/../btree/bt_curadj.c_objects bt_curadj.o - FILE_/export/home/db/btree/bt_curadj.c_tool + FILE_$(PRJ_DIR)/../btree/bt_curadj.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_cursor.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_cursor.c_dependDone TRUE - FILE_/export/home/db/btree/bt_cursor.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_cursor.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_cursor.c_objects + FILE_$(PRJ_DIR)/../btree/bt_cursor.c_objects bt_cursor.o - FILE_/export/home/db/btree/bt_cursor.c_tool + FILE_$(PRJ_DIR)/../btree/bt_cursor.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_delete.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_delete.c_dependDone TRUE - FILE_/export/home/db/btree/bt_delete.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_delete.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_delete.c_objects + FILE_$(PRJ_DIR)/../btree/bt_delete.c_objects bt_delete.o - FILE_/export/home/db/btree/bt_delete.c_tool + FILE_$(PRJ_DIR)/../btree/bt_delete.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_method.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_method.c_dependDone TRUE - FILE_/export/home/db/btree/bt_method.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_method.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_method.c_objects + FILE_$(PRJ_DIR)/../btree/bt_method.c_objects bt_method.o - FILE_/export/home/db/btree/bt_method.c_tool + FILE_$(PRJ_DIR)/../btree/bt_method.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_open.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_open.c_dependDone TRUE - FILE_/export/home/db/btree/bt_open.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_open.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_open.c_objects + FILE_$(PRJ_DIR)/../btree/bt_open.c_objects bt_open.o - FILE_/export/home/db/btree/bt_open.c_tool + FILE_$(PRJ_DIR)/../btree/bt_open.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_put.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_put.c_dependDone TRUE - FILE_/export/home/db/btree/bt_put.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_put.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_put.c_objects + FILE_$(PRJ_DIR)/../btree/bt_put.c_objects bt_put.o - FILE_/export/home/db/btree/bt_put.c_tool + FILE_$(PRJ_DIR)/../btree/bt_put.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_rec.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_rec.c_dependDone TRUE - FILE_/export/home/db/btree/bt_rec.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_rec.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_rec.c_objects + FILE_$(PRJ_DIR)/../btree/bt_rec.c_objects bt_rec.o - FILE_/export/home/db/btree/bt_rec.c_tool + FILE_$(PRJ_DIR)/../btree/bt_rec.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_reclaim.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_reclaim.c_dependDone TRUE - FILE_/export/home/db/btree/bt_reclaim.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_reclaim.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_reclaim.c_objects + FILE_$(PRJ_DIR)/../btree/bt_reclaim.c_objects bt_reclaim.o - FILE_/export/home/db/btree/bt_reclaim.c_tool + FILE_$(PRJ_DIR)/../btree/bt_reclaim.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_recno.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_recno.c_dependDone TRUE - FILE_/export/home/db/btree/bt_recno.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_recno.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_recno.c_objects + FILE_$(PRJ_DIR)/../btree/bt_recno.c_objects bt_recno.o - FILE_/export/home/db/btree/bt_recno.c_tool + FILE_$(PRJ_DIR)/../btree/bt_recno.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_rsearch.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_rsearch.c_dependDone TRUE - FILE_/export/home/db/btree/bt_rsearch.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_rsearch.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_rsearch.c_objects + FILE_$(PRJ_DIR)/../btree/bt_rsearch.c_objects bt_rsearch.o - FILE_/export/home/db/btree/bt_rsearch.c_tool + FILE_$(PRJ_DIR)/../btree/bt_rsearch.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_search.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_search.c_dependDone TRUE - FILE_/export/home/db/btree/bt_search.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_search.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_search.c_objects + FILE_$(PRJ_DIR)/../btree/bt_search.c_objects bt_search.o - FILE_/export/home/db/btree/bt_search.c_tool + FILE_$(PRJ_DIR)/../btree/bt_search.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_split.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_split.c_dependDone TRUE - FILE_/export/home/db/btree/bt_split.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_split.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_split.c_objects + FILE_$(PRJ_DIR)/../btree/bt_split.c_objects bt_split.o - FILE_/export/home/db/btree/bt_split.c_tool + FILE_$(PRJ_DIR)/../btree/bt_split.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_stat.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_stat.c_dependDone TRUE - FILE_/export/home/db/btree/bt_stat.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_stat.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_stat.c_objects + FILE_$(PRJ_DIR)/../btree/bt_stat.c_objects bt_stat.o - FILE_/export/home/db/btree/bt_stat.c_tool + FILE_$(PRJ_DIR)/../btree/bt_stat.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_upgrade.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_upgrade.c_dependDone TRUE - FILE_/export/home/db/btree/bt_upgrade.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_upgrade.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/db_upgrade.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_upgrade.c_objects + FILE_$(PRJ_DIR)/../btree/bt_upgrade.c_objects bt_upgrade.o - FILE_/export/home/db/btree/bt_upgrade.c_tool + FILE_$(PRJ_DIR)/../btree/bt_upgrade.c_tool C/C++ compiler - FILE_/export/home/db/btree/bt_verify.c_dependDone + FILE_$(PRJ_DIR)/../btree/bt_verify.c_dependDone TRUE - FILE_/export/home/db/btree/bt_verify.c_dependencies + FILE_$(PRJ_DIR)/../btree/bt_verify.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_verify.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/bt_verify.c_objects + FILE_$(PRJ_DIR)/../btree/bt_verify.c_objects bt_verify.o - FILE_/export/home/db/btree/bt_verify.c_tool + FILE_$(PRJ_DIR)/../btree/bt_verify.c_tool C/C++ compiler - FILE_/export/home/db/btree/btree_auto.c_dependDone + FILE_$(PRJ_DIR)/../btree/btree_auto.c_dependDone TRUE - FILE_/export/home/db/btree/btree_auto.c_dependencies + FILE_$(PRJ_DIR)/../btree/btree_auto.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/btree/btree_auto.c_objects + FILE_$(PRJ_DIR)/../btree/btree_auto.c_objects btree_auto.o - FILE_/export/home/db/btree/btree_auto.c_tool + FILE_$(PRJ_DIR)/../btree/btree_auto.c_tool C/C++ compiler - FILE_/export/home/db/clib/getopt.c_dependDone + FILE_$(PRJ_DIR)/../clib/getopt.c_dependDone TRUE - FILE_/export/home/db/clib/getopt.c_dependencies + FILE_$(PRJ_DIR)/../clib/getopt.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/clib/getopt.c_objects + FILE_$(PRJ_DIR)/../clib/getopt.c_objects getopt.o - FILE_/export/home/db/clib/getopt.c_tool + FILE_$(PRJ_DIR)/../clib/getopt.c_tool C/C++ compiler - FILE_/export/home/db/clib/snprintf.c_dependDone + FILE_$(PRJ_DIR)/../clib/snprintf.c_dependDone TRUE - FILE_/export/home/db/clib/snprintf.c_dependencies + FILE_$(PRJ_DIR)/../clib/snprintf.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/clib/snprintf.c_objects + FILE_$(PRJ_DIR)/../clib/snprintf.c_objects snprintf.o - FILE_/export/home/db/clib/snprintf.c_tool + FILE_$(PRJ_DIR)/../clib/snprintf.c_tool C/C++ compiler - FILE_/export/home/db/clib/strcasecmp.c_dependDone + FILE_$(PRJ_DIR)/../clib/strcasecmp.c_dependDone TRUE - FILE_/export/home/db/clib/strcasecmp.c_dependencies -$(PRJ_DIR)/db_config.h + FILE_$(PRJ_DIR)/../clib/strcasecmp.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h - FILE_/export/home/db/clib/strcasecmp.c_objects + FILE_$(PRJ_DIR)/../clib/strcasecmp.c_objects strcasecmp.o - FILE_/export/home/db/clib/strcasecmp.c_tool + FILE_$(PRJ_DIR)/../clib/strcasecmp.c_tool C/C++ compiler - FILE_/export/home/db/clib/vsnprintf.c_dependDone + FILE_$(PRJ_DIR)/../clib/strdup.c_dependDone TRUE - FILE_/export/home/db/clib/vsnprintf.c_dependencies + FILE_$(PRJ_DIR)/../clib/strdup.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/clib/vsnprintf.c_objects + FILE_$(PRJ_DIR)/../clib/strdup.c_objects +strdup.o + + + FILE_$(PRJ_DIR)/../clib/strdup.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../clib/vsnprintf.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../clib/vsnprintf.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../clib/vsnprintf.c_objects vsnprintf.o - FILE_/export/home/db/clib/vsnprintf.c_tool + FILE_$(PRJ_DIR)/../clib/vsnprintf.c_tool C/C++ compiler - FILE_/export/home/db/common/db_byteorder.c_dependDone + FILE_$(PRJ_DIR)/../common/db_byteorder.c_dependDone TRUE - FILE_/export/home/db/common/db_byteorder.c_dependencies + FILE_$(PRJ_DIR)/../common/db_byteorder.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/common/db_byteorder.c_objects + FILE_$(PRJ_DIR)/../common/db_byteorder.c_objects db_byteorder.o - FILE_/export/home/db/common/db_byteorder.c_tool + FILE_$(PRJ_DIR)/../common/db_byteorder.c_tool C/C++ compiler - FILE_/export/home/db/common/db_err.c_dependDone + FILE_$(PRJ_DIR)/../common/db_err.c_dependDone TRUE - FILE_/export/home/db/common/db_err.c_dependencies + FILE_$(PRJ_DIR)/../common/db_err.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/clib_ext.h \ - /export/home/db/include/db_auto.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/common/db_err.c_objects + FILE_$(PRJ_DIR)/../common/db_err.c_objects db_err.o - FILE_/export/home/db/common/db_err.c_tool + FILE_$(PRJ_DIR)/../common/db_err.c_tool C/C++ compiler - FILE_/export/home/db/common/db_getlong.c_dependDone + FILE_$(PRJ_DIR)/../common/db_getlong.c_dependDone TRUE - FILE_/export/home/db/common/db_getlong.c_dependencies + FILE_$(PRJ_DIR)/../common/db_getlong.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/clib_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/common/db_getlong.c_objects + FILE_$(PRJ_DIR)/../common/db_getlong.c_objects db_getlong.o - FILE_/export/home/db/common/db_getlong.c_tool + FILE_$(PRJ_DIR)/../common/db_getlong.c_tool C/C++ compiler - FILE_/export/home/db/common/db_log2.c_dependDone + FILE_$(PRJ_DIR)/../common/db_idspace.c_dependDone TRUE - FILE_/export/home/db/common/db_log2.c_dependencies + FILE_$(PRJ_DIR)/../common/db_idspace.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/common/db_log2.c_objects + FILE_$(PRJ_DIR)/../common/db_idspace.c_objects +db_idspace.o + + + FILE_$(PRJ_DIR)/../common/db_idspace.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../common/db_log2.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../common/db_log2.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../common/db_log2.c_objects db_log2.o - FILE_/export/home/db/common/db_log2.c_tool + FILE_$(PRJ_DIR)/../common/db_log2.c_tool C/C++ compiler - FILE_/export/home/db/common/util_log.c_dependDone + FILE_$(PRJ_DIR)/../common/util_arg.c_dependDone TRUE - FILE_/export/home/db/common/util_log.c_dependencies + FILE_$(PRJ_DIR)/../common/util_arg.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/common/util_log.c_objects + FILE_$(PRJ_DIR)/../common/util_arg.c_objects +util_arg.o + + + FILE_$(PRJ_DIR)/../common/util_arg.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../common/util_cache.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../common/util_cache.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../common/util_cache.c_objects +util_cache.o + + + FILE_$(PRJ_DIR)/../common/util_cache.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../common/util_log.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../common/util_log.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../common/util_log.c_objects util_log.o - FILE_/export/home/db/common/util_log.c_tool + FILE_$(PRJ_DIR)/../common/util_log.c_tool C/C++ compiler - FILE_/export/home/db/common/util_sig.c_dependDone + FILE_$(PRJ_DIR)/../common/util_sig.c_dependDone TRUE - FILE_/export/home/db/common/util_sig.c_dependencies + FILE_$(PRJ_DIR)/../common/util_sig.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/common/util_sig.c_objects + FILE_$(PRJ_DIR)/../common/util_sig.c_objects util_sig.o - FILE_/export/home/db/common/util_sig.c_tool + FILE_$(PRJ_DIR)/../common/util_sig.c_tool C/C++ compiler - FILE_/export/home/db/db/crdel_auto.c_dependDone + FILE_$(PRJ_DIR)/../db/crdel_auto.c_dependDone TRUE - FILE_/export/home/db/db/crdel_auto.c_dependencies + FILE_$(PRJ_DIR)/../db/crdel_auto.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/crdel_auto.c_objects + FILE_$(PRJ_DIR)/../db/crdel_auto.c_objects crdel_auto.o - FILE_/export/home/db/db/crdel_auto.c_tool + FILE_$(PRJ_DIR)/../db/crdel_auto.c_tool C/C++ compiler - FILE_/export/home/db/db/crdel_rec.c_dependDone + FILE_$(PRJ_DIR)/../db/crdel_rec.c_dependDone TRUE - FILE_/export/home/db/db/crdel_rec.c_dependencies + FILE_$(PRJ_DIR)/../db/crdel_rec.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/crdel_rec.c_objects + FILE_$(PRJ_DIR)/../db/crdel_rec.c_objects crdel_rec.o - FILE_/export/home/db/db/crdel_rec.c_tool + FILE_$(PRJ_DIR)/../db/crdel_rec.c_tool C/C++ compiler - FILE_/export/home/db/db/db.c_dependDone + FILE_$(PRJ_DIR)/../db/db.c_dependDone TRUE - FILE_/export/home/db/db/db.c_dependencies + FILE_$(PRJ_DIR)/../db/db.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db.c_objects + FILE_$(PRJ_DIR)/../db/db.c_objects db.o - FILE_/export/home/db/db/db.c_tool + FILE_$(PRJ_DIR)/../db/db.c_tool C/C++ compiler - FILE_/export/home/db/db/db_am.c_dependDone + FILE_$(PRJ_DIR)/../db/db_am.c_dependDone TRUE - FILE_/export/home/db/db/db_am.c_dependencies + FILE_$(PRJ_DIR)/../db/db_am.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_am.c_objects + FILE_$(PRJ_DIR)/../db/db_am.c_objects db_am.o - FILE_/export/home/db/db/db_am.c_tool + FILE_$(PRJ_DIR)/../db/db_am.c_tool C/C++ compiler - FILE_/export/home/db/db/db_auto.c_dependDone + FILE_$(PRJ_DIR)/../db/db_auto.c_dependDone TRUE - FILE_/export/home/db/db/db_auto.c_dependencies + FILE_$(PRJ_DIR)/../db/db_auto.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_auto.c_objects + FILE_$(PRJ_DIR)/../db/db_auto.c_objects db_auto.o - FILE_/export/home/db/db/db_auto.c_tool + FILE_$(PRJ_DIR)/../db/db_auto.c_tool C/C++ compiler - FILE_/export/home/db/db/db_cam.c_dependDone + FILE_$(PRJ_DIR)/../db/db_cam.c_dependDone TRUE - FILE_/export/home/db/db/db_cam.c_dependencies + FILE_$(PRJ_DIR)/../db/db_cam.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_cam.c_objects + FILE_$(PRJ_DIR)/../db/db_cam.c_objects db_cam.o - FILE_/export/home/db/db/db_cam.c_tool + FILE_$(PRJ_DIR)/../db/db_cam.c_tool C/C++ compiler - FILE_/export/home/db/db/db_conv.c_dependDone + FILE_$(PRJ_DIR)/../db/db_conv.c_dependDone TRUE - FILE_/export/home/db/db/db_conv.c_dependencies + FILE_$(PRJ_DIR)/../db/db_conv.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_conv.c_objects + FILE_$(PRJ_DIR)/../db/db_conv.c_objects db_conv.o - FILE_/export/home/db/db/db_conv.c_tool + FILE_$(PRJ_DIR)/../db/db_conv.c_tool C/C++ compiler - FILE_/export/home/db/db/db_dispatch.c_dependDone + FILE_$(PRJ_DIR)/../db/db_dispatch.c_dependDone TRUE - FILE_/export/home/db/db/db_dispatch.c_dependencies + FILE_$(PRJ_DIR)/../db/db_dispatch.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_dispatch.c_objects + FILE_$(PRJ_DIR)/../db/db_dispatch.c_objects db_dispatch.o - FILE_/export/home/db/db/db_dispatch.c_tool + FILE_$(PRJ_DIR)/../db/db_dispatch.c_tool C/C++ compiler - FILE_/export/home/db/db/db_dup.c_dependDone + FILE_$(PRJ_DIR)/../db/db_dup.c_dependDone TRUE - FILE_/export/home/db/db/db_dup.c_dependencies + FILE_$(PRJ_DIR)/../db/db_dup.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_dup.c_objects + FILE_$(PRJ_DIR)/../db/db_dup.c_objects db_dup.o - FILE_/export/home/db/db/db_dup.c_tool + FILE_$(PRJ_DIR)/../db/db_dup.c_tool C/C++ compiler - FILE_/export/home/db/db/db_iface.c_dependDone + FILE_$(PRJ_DIR)/../db/db_iface.c_dependDone TRUE - FILE_/export/home/db/db/db_iface.c_dependencies + FILE_$(PRJ_DIR)/../db/db_iface.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_iface.c_objects + FILE_$(PRJ_DIR)/../db/db_iface.c_objects db_iface.o - FILE_/export/home/db/db/db_iface.c_tool + FILE_$(PRJ_DIR)/../db/db_iface.c_tool C/C++ compiler - FILE_/export/home/db/db/db_join.c_dependDone + FILE_$(PRJ_DIR)/../db/db_join.c_dependDone TRUE - FILE_/export/home/db/db/db_join.c_dependencies + FILE_$(PRJ_DIR)/../db/db_join.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_join.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_join.c_objects + FILE_$(PRJ_DIR)/../db/db_join.c_objects db_join.o - FILE_/export/home/db/db/db_join.c_tool + FILE_$(PRJ_DIR)/../db/db_join.c_tool C/C++ compiler - FILE_/export/home/db/db/db_meta.c_dependDone + FILE_$(PRJ_DIR)/../db/db_meta.c_dependDone TRUE - FILE_/export/home/db/db/db_meta.c_dependencies + FILE_$(PRJ_DIR)/../db/db_meta.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_meta.c_objects + FILE_$(PRJ_DIR)/../db/db_meta.c_objects db_meta.o - FILE_/export/home/db/db/db_meta.c_tool + FILE_$(PRJ_DIR)/../db/db_meta.c_tool C/C++ compiler - FILE_/export/home/db/db/db_method.c_dependDone + FILE_$(PRJ_DIR)/../db/db_method.c_dependDone TRUE - FILE_/export/home/db/db/db_method.c_dependencies + FILE_$(PRJ_DIR)/../db/db_method.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_method.c_objects + FILE_$(PRJ_DIR)/../db/db_method.c_objects db_method.o - FILE_/export/home/db/db/db_method.c_tool + FILE_$(PRJ_DIR)/../db/db_method.c_tool C/C++ compiler - FILE_/export/home/db/db/db_overflow.c_dependDone + FILE_$(PRJ_DIR)/../db/db_open.c_dependDone TRUE - FILE_/export/home/db/db/db_overflow.c_dependencies + FILE_$(PRJ_DIR)/../db/db_open.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/db_verify.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_overflow.c_objects + FILE_$(PRJ_DIR)/../db/db_open.c_objects +db_open.o + + + FILE_$(PRJ_DIR)/../db/db_open.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../db/db_overflow.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../db/db_overflow.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../db/db_overflow.c_objects db_overflow.o - FILE_/export/home/db/db/db_overflow.c_tool + FILE_$(PRJ_DIR)/../db/db_overflow.c_tool C/C++ compiler - FILE_/export/home/db/db/db_pr.c_dependDone + FILE_$(PRJ_DIR)/../db/db_pr.c_dependDone TRUE - FILE_/export/home/db/db/db_pr.c_dependencies + FILE_$(PRJ_DIR)/../db/db_pr.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/db_verify.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_pr.c_objects + FILE_$(PRJ_DIR)/../db/db_pr.c_objects db_pr.o - FILE_/export/home/db/db/db_pr.c_tool + FILE_$(PRJ_DIR)/../db/db_pr.c_tool C/C++ compiler - FILE_/export/home/db/db/db_rec.c_dependDone + FILE_$(PRJ_DIR)/../db/db_rec.c_dependDone TRUE - FILE_/export/home/db/db/db_rec.c_dependencies + FILE_$(PRJ_DIR)/../db/db_rec.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_rec.c_objects + FILE_$(PRJ_DIR)/../db/db_rec.c_objects db_rec.o - FILE_/export/home/db/db/db_rec.c_tool + FILE_$(PRJ_DIR)/../db/db_rec.c_tool C/C++ compiler - FILE_/export/home/db/db/db_reclaim.c_dependDone + FILE_$(PRJ_DIR)/../db/db_reclaim.c_dependDone TRUE - FILE_/export/home/db/db/db_reclaim.c_dependencies + FILE_$(PRJ_DIR)/../db/db_reclaim.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_reclaim.c_objects + FILE_$(PRJ_DIR)/../db/db_reclaim.c_objects db_reclaim.o - FILE_/export/home/db/db/db_reclaim.c_tool + FILE_$(PRJ_DIR)/../db/db_reclaim.c_tool C/C++ compiler - FILE_/export/home/db/db/db_ret.c_dependDone + FILE_$(PRJ_DIR)/../db/db_remove.c_dependDone TRUE - FILE_/export/home/db/db/db_ret.c_dependencies + FILE_$(PRJ_DIR)/../db/db_remove.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_ret.c_objects + FILE_$(PRJ_DIR)/../db/db_remove.c_objects +db_remove.o + + + FILE_$(PRJ_DIR)/../db/db_remove.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../db/db_rename.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../db/db_rename.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../db/db_rename.c_objects +db_rename.o + + + FILE_$(PRJ_DIR)/../db/db_rename.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../db/db_ret.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../db/db_ret.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../db/db_ret.c_objects db_ret.o - FILE_/export/home/db/db/db_ret.c_tool + FILE_$(PRJ_DIR)/../db/db_ret.c_tool C/C++ compiler - FILE_/export/home/db/db/db_upg.c_dependDone + FILE_$(PRJ_DIR)/../db/db_truncate.c_dependDone TRUE - FILE_/export/home/db/db/db_upg.c_dependencies + FILE_$(PRJ_DIR)/../db/db_truncate.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_upg.c_objects + FILE_$(PRJ_DIR)/../db/db_truncate.c_objects +db_truncate.o + + + FILE_$(PRJ_DIR)/../db/db_truncate.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../db/db_upg.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../db/db_upg.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../db/db_upg.c_objects db_upg.o - FILE_/export/home/db/db/db_upg.c_tool + FILE_$(PRJ_DIR)/../db/db_upg.c_tool C/C++ compiler - FILE_/export/home/db/db/db_upg_opd.c_dependDone + FILE_$(PRJ_DIR)/../db/db_upg_opd.c_dependDone TRUE - FILE_/export/home/db/db/db_upg_opd.c_dependencies + FILE_$(PRJ_DIR)/../db/db_upg_opd.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_upg_opd.c_objects + FILE_$(PRJ_DIR)/../db/db_upg_opd.c_objects db_upg_opd.o - FILE_/export/home/db/db/db_upg_opd.c_tool + FILE_$(PRJ_DIR)/../db/db_upg_opd.c_tool C/C++ compiler - FILE_/export/home/db/db/db_vrfy.c_dependDone + FILE_$(PRJ_DIR)/../db/db_vrfy.c_dependDone TRUE - FILE_/export/home/db/db/db_vrfy.c_dependencies + FILE_$(PRJ_DIR)/../db/db_vrfy.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/db_verify.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_vrfy.c_objects + FILE_$(PRJ_DIR)/../db/db_vrfy.c_objects db_vrfy.o - FILE_/export/home/db/db/db_vrfy.c_tool + FILE_$(PRJ_DIR)/../db/db_vrfy.c_tool C/C++ compiler - FILE_/export/home/db/db/db_vrfyutil.c_dependDone + FILE_$(PRJ_DIR)/../db/db_vrfyutil.c_dependDone TRUE - FILE_/export/home/db/db/db_vrfyutil.c_dependencies + FILE_$(PRJ_DIR)/../db/db_vrfyutil.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_verify.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/db/db_vrfyutil.c_objects + FILE_$(PRJ_DIR)/../db/db_vrfyutil.c_objects db_vrfyutil.o - FILE_/export/home/db/db/db_vrfyutil.c_tool + FILE_$(PRJ_DIR)/../db/db_vrfyutil.c_tool C/C++ compiler - FILE_/export/home/db/env/db_salloc.c_dependDone + FILE_$(PRJ_DIR)/../dbreg/dbreg.c_dependDone TRUE - FILE_/export/home/db/env/db_salloc.c_dependencies + FILE_$(PRJ_DIR)/../dbreg/dbreg.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/env/db_salloc.c_objects + FILE_$(PRJ_DIR)/../dbreg/dbreg.c_objects +dbreg.o + + + FILE_$(PRJ_DIR)/../dbreg/dbreg.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_auto.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_auto.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_auto.c_objects +dbreg_auto.o + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_auto.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_rec.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_rec.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_rec.c_objects +dbreg_rec.o + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_rec.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_util.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_util.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_util.c_objects +dbreg_util.o + + + FILE_$(PRJ_DIR)/../dbreg/dbreg_util.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../env/db_salloc.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/db_salloc.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/db_salloc.c_objects db_salloc.o - FILE_/export/home/db/env/db_salloc.c_tool + FILE_$(PRJ_DIR)/../env/db_salloc.c_tool C/C++ compiler - FILE_/export/home/db/env/db_shash.c_dependDone + FILE_$(PRJ_DIR)/../env/db_shash.c_dependDone TRUE - FILE_/export/home/db/env/db_shash.c_dependencies + FILE_$(PRJ_DIR)/../env/db_shash.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/env/db_shash.c_objects + FILE_$(PRJ_DIR)/../env/db_shash.c_objects db_shash.o - FILE_/export/home/db/env/db_shash.c_tool + FILE_$(PRJ_DIR)/../env/db_shash.c_tool C/C++ compiler - FILE_/export/home/db/env/env_method.c_dependDone + FILE_$(PRJ_DIR)/../env/env_file.c_dependDone TRUE - FILE_/export/home/db/env/env_method.c_dependencies + FILE_$(PRJ_DIR)/../env/env_file.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/env/env_method.c_objects + FILE_$(PRJ_DIR)/../env/env_file.c_objects +env_file.o + + + FILE_$(PRJ_DIR)/../env/env_file.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../env/env_method.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../env/env_method.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../env/env_method.c_objects env_method.o - FILE_/export/home/db/env/env_method.c_tool + FILE_$(PRJ_DIR)/../env/env_method.c_tool C/C++ compiler - FILE_/export/home/db/env/env_open.c_dependDone + FILE_$(PRJ_DIR)/../env/env_open.c_dependDone TRUE - FILE_/export/home/db/env/env_open.c_dependencies + FILE_$(PRJ_DIR)/../env/env_open.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/clib_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/env/env_open.c_objects + FILE_$(PRJ_DIR)/../env/env_open.c_objects env_open.o - FILE_/export/home/db/env/env_open.c_tool + FILE_$(PRJ_DIR)/../env/env_open.c_tool C/C++ compiler - FILE_/export/home/db/env/env_recover.c_dependDone + FILE_$(PRJ_DIR)/../env/env_recover.c_dependDone TRUE - FILE_/export/home/db/env/env_recover.c_dependencies + FILE_$(PRJ_DIR)/../env/env_recover.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/env/env_recover.c_objects + FILE_$(PRJ_DIR)/../env/env_recover.c_objects env_recover.o - FILE_/export/home/db/env/env_recover.c_tool + FILE_$(PRJ_DIR)/../env/env_recover.c_tool C/C++ compiler - FILE_/export/home/db/env/env_region.c_dependDone + FILE_$(PRJ_DIR)/../env/env_region.c_dependDone TRUE - FILE_/export/home/db/env/env_region.c_dependencies + FILE_$(PRJ_DIR)/../env/env_region.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/env/env_region.c_objects + FILE_$(PRJ_DIR)/../env/env_region.c_objects env_region.o - FILE_/export/home/db/env/env_region.c_tool + FILE_$(PRJ_DIR)/../env/env_region.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash.c_dependDone + FILE_$(PRJ_DIR)/../fileops/fileops_auto.c_dependDone TRUE - FILE_/export/home/db/hash/hash.c_dependencies + FILE_$(PRJ_DIR)/../fileops/fileops_auto.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash.c_objects + FILE_$(PRJ_DIR)/../fileops/fileops_auto.c_objects +fileops_auto.o + + + FILE_$(PRJ_DIR)/../fileops/fileops_auto.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../fileops/fop_basic.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../fileops/fop_basic.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../fileops/fop_basic.c_objects +fop_basic.o + + + FILE_$(PRJ_DIR)/../fileops/fop_basic.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../fileops/fop_rec.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../fileops/fop_rec.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../fileops/fop_rec.c_objects +fop_rec.o + + + FILE_$(PRJ_DIR)/../fileops/fop_rec.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../fileops/fop_util.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../fileops/fop_util.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../fileops/fop_util.c_objects +fop_util.o + + + FILE_$(PRJ_DIR)/../fileops/fop_util.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../hash/hash.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../hash/hash.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../hash/hash.c_objects hash.o - FILE_/export/home/db/hash/hash.c_tool + FILE_$(PRJ_DIR)/../hash/hash.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_auto.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_auto.c_dependDone TRUE - FILE_/export/home/db/hash/hash_auto.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_auto.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_auto.c_objects + FILE_$(PRJ_DIR)/../hash/hash_auto.c_objects hash_auto.o - FILE_/export/home/db/hash/hash_auto.c_tool + FILE_$(PRJ_DIR)/../hash/hash_auto.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_conv.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_conv.c_dependDone TRUE - FILE_/export/home/db/hash/hash_conv.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_conv.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_conv.c_objects + FILE_$(PRJ_DIR)/../hash/hash_conv.c_objects hash_conv.o - FILE_/export/home/db/hash/hash_conv.c_tool + FILE_$(PRJ_DIR)/../hash/hash_conv.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_dup.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_dup.c_dependDone TRUE - FILE_/export/home/db/hash/hash_dup.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_dup.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_dup.c_objects + FILE_$(PRJ_DIR)/../hash/hash_dup.c_objects hash_dup.o - FILE_/export/home/db/hash/hash_dup.c_tool + FILE_$(PRJ_DIR)/../hash/hash_dup.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_func.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_func.c_dependDone TRUE - FILE_/export/home/db/hash/hash_func.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_func.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_func.c_objects + FILE_$(PRJ_DIR)/../hash/hash_func.c_objects hash_func.o - FILE_/export/home/db/hash/hash_func.c_tool + FILE_$(PRJ_DIR)/../hash/hash_func.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_meta.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_meta.c_dependDone TRUE - FILE_/export/home/db/hash/hash_meta.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_meta.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_meta.c_objects + FILE_$(PRJ_DIR)/../hash/hash_meta.c_objects hash_meta.o - FILE_/export/home/db/hash/hash_meta.c_tool + FILE_$(PRJ_DIR)/../hash/hash_meta.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_method.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_method.c_dependDone TRUE - FILE_/export/home/db/hash/hash_method.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_method.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_method.c_objects + FILE_$(PRJ_DIR)/../hash/hash_method.c_objects hash_method.o - FILE_/export/home/db/hash/hash_method.c_tool + FILE_$(PRJ_DIR)/../hash/hash_method.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_page.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_open.c_dependDone TRUE - FILE_/export/home/db/hash/hash_page.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_open.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_page.c_objects + FILE_$(PRJ_DIR)/../hash/hash_open.c_objects +hash_open.o + + + FILE_$(PRJ_DIR)/../hash/hash_open.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../hash/hash_page.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../hash/hash_page.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../hash/hash_page.c_objects hash_page.o - FILE_/export/home/db/hash/hash_page.c_tool + FILE_$(PRJ_DIR)/../hash/hash_page.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_rec.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_rec.c_dependDone TRUE - FILE_/export/home/db/hash/hash_rec.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_rec.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_rec.c_objects + FILE_$(PRJ_DIR)/../hash/hash_rec.c_objects hash_rec.o - FILE_/export/home/db/hash/hash_rec.c_tool + FILE_$(PRJ_DIR)/../hash/hash_rec.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_reclaim.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_reclaim.c_dependDone TRUE - FILE_/export/home/db/hash/hash_reclaim.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_reclaim.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_reclaim.c_objects + FILE_$(PRJ_DIR)/../hash/hash_reclaim.c_objects hash_reclaim.o - FILE_/export/home/db/hash/hash_reclaim.c_tool + FILE_$(PRJ_DIR)/../hash/hash_reclaim.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_stat.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_stat.c_dependDone TRUE - FILE_/export/home/db/hash/hash_stat.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_stat.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_stat.c_objects + FILE_$(PRJ_DIR)/../hash/hash_stat.c_objects hash_stat.o - FILE_/export/home/db/hash/hash_stat.c_tool + FILE_$(PRJ_DIR)/../hash/hash_stat.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_upgrade.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_upgrade.c_dependDone TRUE - FILE_/export/home/db/hash/hash_upgrade.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_upgrade.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/db_upgrade.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_upgrade.c_objects + FILE_$(PRJ_DIR)/../hash/hash_upgrade.c_objects hash_upgrade.o - FILE_/export/home/db/hash/hash_upgrade.c_tool + FILE_$(PRJ_DIR)/../hash/hash_upgrade.c_tool C/C++ compiler - FILE_/export/home/db/hash/hash_verify.c_dependDone + FILE_$(PRJ_DIR)/../hash/hash_verify.c_dependDone TRUE - FILE_/export/home/db/hash/hash_verify.c_dependencies + FILE_$(PRJ_DIR)/../hash/hash_verify.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_verify.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hash/hash_verify.c_objects + FILE_$(PRJ_DIR)/../hash/hash_verify.c_objects hash_verify.o - FILE_/export/home/db/hash/hash_verify.c_tool + FILE_$(PRJ_DIR)/../hash/hash_verify.c_tool C/C++ compiler - FILE_/export/home/db/hsearch/hsearch.c_dependDone + FILE_$(PRJ_DIR)/../hmac/hmac.c_dependDone TRUE - FILE_/export/home/db/hsearch/hsearch.c_dependencies + FILE_$(PRJ_DIR)/../hmac/hmac.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/hsearch/hsearch.c_objects + FILE_$(PRJ_DIR)/../hmac/hmac.c_objects +hmac.o + + + FILE_$(PRJ_DIR)/../hmac/hmac.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../hmac/sha1.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../hmac/sha1.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../hmac/sha1.c_objects +sha1.o + + + FILE_$(PRJ_DIR)/../hmac/sha1.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../hsearch/hsearch.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../hsearch/hsearch.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../hsearch/hsearch.c_objects hsearch.o - FILE_/export/home/db/hsearch/hsearch.c_tool + FILE_$(PRJ_DIR)/../hsearch/hsearch.c_tool C/C++ compiler - FILE_/export/home/db/include/tcl_db.h_dependDone + FILE_$(PRJ_DIR)/../lock/lock.c_dependDone TRUE - FILE_/export/home/db/lock/lock.c_dependDone -TRUE - - - FILE_/export/home/db/lock/lock.c_dependencies + FILE_$(PRJ_DIR)/../lock/lock.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/lock/lock.c_objects + FILE_$(PRJ_DIR)/../lock/lock.c_objects lock.o - FILE_/export/home/db/lock/lock.c_tool + FILE_$(PRJ_DIR)/../lock/lock.c_tool C/C++ compiler - FILE_/export/home/db/lock/lock_conflict.c_dependDone + FILE_$(PRJ_DIR)/../lock/lock_deadlock.c_dependDone TRUE - FILE_/export/home/db/lock/lock_conflict.c_dependencies + FILE_$(PRJ_DIR)/../lock/lock_deadlock.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/lock/lock_conflict.c_objects -lock_conflict.o - - - FILE_/export/home/db/lock/lock_conflict.c_tool -C/C++ compiler - - - FILE_/export/home/db/lock/lock_deadlock.c_dependDone -TRUE - - - FILE_/export/home/db/lock/lock_deadlock.c_dependencies -$(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ - $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h - - - FILE_/export/home/db/lock/lock_deadlock.c_objects + FILE_$(PRJ_DIR)/../lock/lock_deadlock.c_objects lock_deadlock.o - FILE_/export/home/db/lock/lock_deadlock.c_tool + FILE_$(PRJ_DIR)/../lock/lock_deadlock.c_tool C/C++ compiler - FILE_/export/home/db/lock/lock_method.c_dependDone + FILE_$(PRJ_DIR)/../lock/lock_method.c_dependDone TRUE - FILE_/export/home/db/lock/lock_method.c_dependencies + FILE_$(PRJ_DIR)/../lock/lock_method.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/lock/lock_method.c_objects + FILE_$(PRJ_DIR)/../lock/lock_method.c_objects lock_method.o - FILE_/export/home/db/lock/lock_method.c_tool + FILE_$(PRJ_DIR)/../lock/lock_method.c_tool C/C++ compiler - FILE_/export/home/db/lock/lock_region.c_dependDone + FILE_$(PRJ_DIR)/../lock/lock_region.c_dependDone TRUE - FILE_/export/home/db/lock/lock_region.c_dependencies + FILE_$(PRJ_DIR)/../lock/lock_region.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/lock/lock_region.c_objects + FILE_$(PRJ_DIR)/../lock/lock_region.c_objects lock_region.o - FILE_/export/home/db/lock/lock_region.c_tool + FILE_$(PRJ_DIR)/../lock/lock_region.c_tool C/C++ compiler - FILE_/export/home/db/lock/lock_stat.c_dependDone + FILE_$(PRJ_DIR)/../lock/lock_stat.c_dependDone TRUE - FILE_/export/home/db/lock/lock_stat.c_dependencies + FILE_$(PRJ_DIR)/../lock/lock_stat.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/lock/lock_stat.c_objects + FILE_$(PRJ_DIR)/../lock/lock_stat.c_objects lock_stat.o - FILE_/export/home/db/lock/lock_stat.c_tool + FILE_$(PRJ_DIR)/../lock/lock_stat.c_tool C/C++ compiler - FILE_/export/home/db/lock/lock_util.c_dependDone + FILE_$(PRJ_DIR)/../lock/lock_util.c_dependDone TRUE - FILE_/export/home/db/lock/lock_util.c_dependencies + FILE_$(PRJ_DIR)/../lock/lock_util.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/lock/lock_util.c_objects + FILE_$(PRJ_DIR)/../lock/lock_util.c_objects lock_util.o - FILE_/export/home/db/lock/lock_util.c_tool + FILE_$(PRJ_DIR)/../lock/lock_util.c_tool C/C++ compiler - FILE_/export/home/db/log/log.c_dependDone + FILE_$(PRJ_DIR)/../log/log.c_dependDone TRUE - FILE_/export/home/db/log/log.c_dependencies + FILE_$(PRJ_DIR)/../log/log.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/log/log.c_objects + FILE_$(PRJ_DIR)/../log/log.c_objects log.o - FILE_/export/home/db/log/log.c_tool + FILE_$(PRJ_DIR)/../log/log.c_tool C/C++ compiler - FILE_/export/home/db/log/log_archive.c_dependDone + FILE_$(PRJ_DIR)/../log/log_archive.c_dependDone TRUE - FILE_/export/home/db/log/log_archive.c_dependencies + FILE_$(PRJ_DIR)/../log/log_archive.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/clib_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/log/log_archive.c_objects + FILE_$(PRJ_DIR)/../log/log_archive.c_objects log_archive.o - FILE_/export/home/db/log/log_archive.c_tool + FILE_$(PRJ_DIR)/../log/log_archive.c_tool C/C++ compiler - FILE_/export/home/db/log/log_auto.c_dependDone + FILE_$(PRJ_DIR)/../log/log_compare.c_dependDone TRUE - FILE_/export/home/db/log/log_auto.c_dependencies + FILE_$(PRJ_DIR)/../log/log_compare.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/log/log_auto.c_objects -log_auto.o - - - FILE_/export/home/db/log/log_auto.c_tool -C/C++ compiler - - - FILE_/export/home/db/log/log_compare.c_dependDone -TRUE - - - FILE_/export/home/db/log/log_compare.c_dependencies -$(PRJ_DIR)/db_config.h \ - $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h - - - FILE_/export/home/db/log/log_compare.c_objects + FILE_$(PRJ_DIR)/../log/log_compare.c_objects log_compare.o - FILE_/export/home/db/log/log_compare.c_tool + FILE_$(PRJ_DIR)/../log/log_compare.c_tool C/C++ compiler - FILE_/export/home/db/log/log_findckp.c_dependDone + FILE_$(PRJ_DIR)/../log/log_get.c_dependDone TRUE - FILE_/export/home/db/log/log_findckp.c_dependencies + FILE_$(PRJ_DIR)/../log/log_get.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/log/log_findckp.c_objects -log_findckp.o - - - FILE_/export/home/db/log/log_findckp.c_tool -C/C++ compiler - - - FILE_/export/home/db/log/log_get.c_dependDone -TRUE - - - FILE_/export/home/db/log/log_get.c_dependencies -$(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ - $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h - - - FILE_/export/home/db/log/log_get.c_objects + FILE_$(PRJ_DIR)/../log/log_get.c_objects log_get.o - FILE_/export/home/db/log/log_get.c_tool + FILE_$(PRJ_DIR)/../log/log_get.c_tool C/C++ compiler - FILE_/export/home/db/log/log_method.c_dependDone + FILE_$(PRJ_DIR)/../log/log_method.c_dependDone TRUE - FILE_/export/home/db/log/log_method.c_dependencies + FILE_$(PRJ_DIR)/../log/log_method.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/log/log_method.c_objects + FILE_$(PRJ_DIR)/../log/log_method.c_objects log_method.o - FILE_/export/home/db/log/log_method.c_tool + FILE_$(PRJ_DIR)/../log/log_method.c_tool C/C++ compiler - FILE_/export/home/db/log/log_put.c_dependDone + FILE_$(PRJ_DIR)/../log/log_put.c_dependDone TRUE - FILE_/export/home/db/log/log_put.c_dependencies + FILE_$(PRJ_DIR)/../log/log_put.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/hash.h \ - /export/home/db/include/hash_auto.h \ - /export/home/db/include/hash_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/clib_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/log/log_put.c_objects + FILE_$(PRJ_DIR)/../log/log_put.c_objects log_put.o - FILE_/export/home/db/log/log_put.c_tool + FILE_$(PRJ_DIR)/../log/log_put.c_tool C/C++ compiler - FILE_/export/home/db/log/log_rec.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_alloc.c_dependDone TRUE - FILE_/export/home/db/log/log_rec.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_alloc.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/log/log_rec.c_objects -log_rec.o - - - FILE_/export/home/db/log/log_rec.c_tool -C/C++ compiler - - - FILE_/export/home/db/log/log_register.c_dependDone -TRUE - - - FILE_/export/home/db/log/log_register.c_dependencies -$(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ - $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h - - - FILE_/export/home/db/log/log_register.c_objects -log_register.o - - - FILE_/export/home/db/log/log_register.c_tool -C/C++ compiler - - - FILE_/export/home/db/mp/mp_alloc.c_dependDone -TRUE - - - FILE_/export/home/db/mp/mp_alloc.c_dependencies -$(PRJ_DIR)/db_config.h \ - $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h - - - FILE_/export/home/db/mp/mp_alloc.c_objects + FILE_$(PRJ_DIR)/../mp/mp_alloc.c_objects mp_alloc.o - FILE_/export/home/db/mp/mp_alloc.c_tool + FILE_$(PRJ_DIR)/../mp/mp_alloc.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_bh.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_bh.c_dependDone TRUE - FILE_/export/home/db/mp/mp_bh.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_bh.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/db_page.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_bh.c_objects + FILE_$(PRJ_DIR)/../mp/mp_bh.c_objects mp_bh.o - FILE_/export/home/db/mp/mp_bh.c_tool + FILE_$(PRJ_DIR)/../mp/mp_bh.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_fget.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_fget.c_dependDone TRUE - FILE_/export/home/db/mp/mp_fget.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_fget.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_fget.c_objects + FILE_$(PRJ_DIR)/../mp/mp_fget.c_objects mp_fget.o - FILE_/export/home/db/mp/mp_fget.c_tool + FILE_$(PRJ_DIR)/../mp/mp_fget.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_fopen.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_fopen.c_dependDone TRUE - FILE_/export/home/db/mp/mp_fopen.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_fopen.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_fopen.c_objects + FILE_$(PRJ_DIR)/../mp/mp_fopen.c_objects mp_fopen.o - FILE_/export/home/db/mp/mp_fopen.c_tool + FILE_$(PRJ_DIR)/../mp/mp_fopen.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_fput.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_fput.c_dependDone TRUE - FILE_/export/home/db/mp/mp_fput.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_fput.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_fput.c_objects + FILE_$(PRJ_DIR)/../mp/mp_fput.c_objects mp_fput.o - FILE_/export/home/db/mp/mp_fput.c_tool + FILE_$(PRJ_DIR)/../mp/mp_fput.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_fset.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_fset.c_dependDone TRUE - FILE_/export/home/db/mp/mp_fset.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_fset.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_fset.c_objects + FILE_$(PRJ_DIR)/../mp/mp_fset.c_objects mp_fset.o - FILE_/export/home/db/mp/mp_fset.c_tool + FILE_$(PRJ_DIR)/../mp/mp_fset.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_method.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_method.c_dependDone TRUE - FILE_/export/home/db/mp/mp_method.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_method.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_method.c_objects + FILE_$(PRJ_DIR)/../mp/mp_method.c_objects mp_method.o - FILE_/export/home/db/mp/mp_method.c_tool + FILE_$(PRJ_DIR)/../mp/mp_method.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_region.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_region.c_dependDone TRUE - FILE_/export/home/db/mp/mp_region.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_region.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_region.c_objects + FILE_$(PRJ_DIR)/../mp/mp_region.c_objects mp_region.o - FILE_/export/home/db/mp/mp_region.c_tool + FILE_$(PRJ_DIR)/../mp/mp_region.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_register.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_register.c_dependDone TRUE - FILE_/export/home/db/mp/mp_register.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_register.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_register.c_objects + FILE_$(PRJ_DIR)/../mp/mp_register.c_objects mp_register.o - FILE_/export/home/db/mp/mp_register.c_tool + FILE_$(PRJ_DIR)/../mp/mp_register.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_stat.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_stat.c_dependDone TRUE - FILE_/export/home/db/mp/mp_stat.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_stat.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_stat.c_objects + FILE_$(PRJ_DIR)/../mp/mp_stat.c_objects mp_stat.o - FILE_/export/home/db/mp/mp_stat.c_tool + FILE_$(PRJ_DIR)/../mp/mp_stat.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_sync.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_sync.c_dependDone TRUE - FILE_/export/home/db/mp/mp_sync.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_sync.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_sync.c_objects + FILE_$(PRJ_DIR)/../mp/mp_sync.c_objects mp_sync.o - FILE_/export/home/db/mp/mp_sync.c_tool + FILE_$(PRJ_DIR)/../mp/mp_sync.c_tool C/C++ compiler - FILE_/export/home/db/mp/mp_trickle.c_dependDone + FILE_$(PRJ_DIR)/../mp/mp_trickle.c_dependDone TRUE - FILE_/export/home/db/mp/mp_trickle.c_dependencies + FILE_$(PRJ_DIR)/../mp/mp_trickle.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mp/mp_trickle.c_objects + FILE_$(PRJ_DIR)/../mp/mp_trickle.c_objects mp_trickle.o - FILE_/export/home/db/mp/mp_trickle.c_tool + FILE_$(PRJ_DIR)/../mp/mp_trickle.c_tool C/C++ compiler - FILE_/export/home/db/mutex/mut_tas.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependDone TRUE - FILE_/export/home/db/mutex/mut_tas.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mutex/mut_tas.c_objects + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_objects mut_tas.o - FILE_/export/home/db/mutex/mut_tas.c_tool + FILE_$(PRJ_DIR)/../mutex/mut_tas.c_tool C/C++ compiler - FILE_/export/home/db/mutex/mutex.c_dependDone + FILE_$(PRJ_DIR)/../mutex/mutex.c_dependDone TRUE - FILE_/export/home/db/mutex/mutex.c_dependencies + FILE_$(PRJ_DIR)/../mutex/mutex.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/mutex/mutex.c_objects + FILE_$(PRJ_DIR)/../mutex/mutex.c_objects mutex.o - FILE_/export/home/db/mutex/mutex.c_tool + FILE_$(PRJ_DIR)/../mutex/mutex.c_tool C/C++ compiler - FILE_/export/home/db/os/os_alloc.c_dependDone + FILE_$(PRJ_DIR)/../os/os_alloc.c_dependDone TRUE - FILE_/export/home/db/os/os_alloc.c_dependencies + FILE_$(PRJ_DIR)/../os/os_alloc.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_alloc.c_objects + FILE_$(PRJ_DIR)/../os/os_alloc.c_objects os_alloc.o - FILE_/export/home/db/os/os_alloc.c_tool + FILE_$(PRJ_DIR)/../os/os_alloc.c_tool C/C++ compiler - FILE_/export/home/db/os/os_dir.c_dependDone + FILE_$(PRJ_DIR)/../os/os_clock.c_dependDone TRUE - FILE_/export/home/db/os/os_dir.c_dependencies + FILE_$(PRJ_DIR)/../os/os_clock.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_dir.c_objects + FILE_$(PRJ_DIR)/../os/os_clock.c_objects +os_clock.o + + + FILE_$(PRJ_DIR)/../os/os_clock.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../os/os_dir.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_dir.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_dir.c_objects os_dir.o - FILE_/export/home/db/os/os_dir.c_tool + FILE_$(PRJ_DIR)/../os/os_dir.c_tool C/C++ compiler - FILE_/export/home/db/os/os_errno.c_dependDone + FILE_$(PRJ_DIR)/../os/os_errno.c_dependDone TRUE - FILE_/export/home/db/os/os_errno.c_dependencies + FILE_$(PRJ_DIR)/../os/os_errno.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_errno.c_objects + FILE_$(PRJ_DIR)/../os/os_errno.c_objects os_errno.o - FILE_/export/home/db/os/os_errno.c_tool + FILE_$(PRJ_DIR)/../os/os_errno.c_tool C/C++ compiler - FILE_/export/home/db/os/os_fid.c_dependDone + FILE_$(PRJ_DIR)/../os/os_fid.c_dependDone TRUE - FILE_/export/home/db/os/os_fid.c_dependencies + FILE_$(PRJ_DIR)/../os/os_fid.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_fid.c_objects + FILE_$(PRJ_DIR)/../os/os_fid.c_objects os_fid.o - FILE_/export/home/db/os/os_fid.c_tool + FILE_$(PRJ_DIR)/../os/os_fid.c_tool C/C++ compiler - FILE_/export/home/db/os/os_fsync.c_dependDone + FILE_$(PRJ_DIR)/../os/os_fsync.c_dependDone TRUE - FILE_/export/home/db/os/os_fsync.c_dependencies + FILE_$(PRJ_DIR)/../os/os_fsync.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_fsync.c_objects + FILE_$(PRJ_DIR)/../os/os_fsync.c_objects os_fsync.o - FILE_/export/home/db/os/os_fsync.c_tool + FILE_$(PRJ_DIR)/../os/os_fsync.c_tool C/C++ compiler - FILE_/export/home/db/os/os_handle.c_dependDone + FILE_$(PRJ_DIR)/../os/os_handle.c_dependDone TRUE - FILE_/export/home/db/os/os_handle.c_dependencies + FILE_$(PRJ_DIR)/../os/os_handle.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_handle.c_objects + FILE_$(PRJ_DIR)/../os/os_handle.c_objects os_handle.o - FILE_/export/home/db/os/os_handle.c_tool + FILE_$(PRJ_DIR)/../os/os_handle.c_tool C/C++ compiler - FILE_/export/home/db/os/os_method.c_dependDone + FILE_$(PRJ_DIR)/../os/os_id.c_dependDone TRUE - FILE_/export/home/db/os/os_method.c_dependencies + FILE_$(PRJ_DIR)/../os/os_id.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_method.c_objects + FILE_$(PRJ_DIR)/../os/os_id.c_objects +os_id.o + + + FILE_$(PRJ_DIR)/../os/os_id.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../os/os_method.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../os/os_method.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../os/os_method.c_objects os_method.o - FILE_/export/home/db/os/os_method.c_tool + FILE_$(PRJ_DIR)/../os/os_method.c_tool C/C++ compiler - FILE_/export/home/db/os/os_oflags.c_dependDone + FILE_$(PRJ_DIR)/../os/os_oflags.c_dependDone TRUE - FILE_/export/home/db/os/os_oflags.c_dependencies + FILE_$(PRJ_DIR)/../os/os_oflags.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_oflags.c_objects + FILE_$(PRJ_DIR)/../os/os_oflags.c_objects os_oflags.o - FILE_/export/home/db/os/os_oflags.c_tool + FILE_$(PRJ_DIR)/../os/os_oflags.c_tool C/C++ compiler - FILE_/export/home/db/os/os_open.c_dependDone + FILE_$(PRJ_DIR)/../os/os_open.c_dependDone TRUE - FILE_/export/home/db/os/os_open.c_dependencies + FILE_$(PRJ_DIR)/../os/os_open.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_open.c_objects + FILE_$(PRJ_DIR)/../os/os_open.c_objects os_open.o - FILE_/export/home/db/os/os_open.c_tool + FILE_$(PRJ_DIR)/../os/os_open.c_tool C/C++ compiler - FILE_/export/home/db/os/os_region.c_dependDone + FILE_$(PRJ_DIR)/../os/os_region.c_dependDone TRUE - FILE_/export/home/db/os/os_region.c_dependencies + FILE_$(PRJ_DIR)/../os/os_region.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_region.c_objects + FILE_$(PRJ_DIR)/../os/os_region.c_objects os_region.o - FILE_/export/home/db/os/os_region.c_tool + FILE_$(PRJ_DIR)/../os/os_region.c_tool C/C++ compiler - FILE_/export/home/db/os/os_rename.c_dependDone + FILE_$(PRJ_DIR)/../os/os_rename.c_dependDone TRUE - FILE_/export/home/db/os/os_rename.c_dependencies + FILE_$(PRJ_DIR)/../os/os_rename.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_rename.c_objects + FILE_$(PRJ_DIR)/../os/os_rename.c_objects os_rename.o - FILE_/export/home/db/os/os_rename.c_tool + FILE_$(PRJ_DIR)/../os/os_rename.c_tool C/C++ compiler - FILE_/export/home/db/os/os_root.c_dependDone + FILE_$(PRJ_DIR)/../os/os_root.c_dependDone TRUE - FILE_/export/home/db/os/os_root.c_dependencies + FILE_$(PRJ_DIR)/../os/os_root.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_root.c_objects + FILE_$(PRJ_DIR)/../os/os_root.c_objects os_root.o - FILE_/export/home/db/os/os_root.c_tool + FILE_$(PRJ_DIR)/../os/os_root.c_tool C/C++ compiler - FILE_/export/home/db/os/os_rpath.c_dependDone + FILE_$(PRJ_DIR)/../os/os_rpath.c_dependDone TRUE - FILE_/export/home/db/os/os_rpath.c_dependencies + FILE_$(PRJ_DIR)/../os/os_rpath.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_rpath.c_objects + FILE_$(PRJ_DIR)/../os/os_rpath.c_objects os_rpath.o - FILE_/export/home/db/os/os_rpath.c_tool + FILE_$(PRJ_DIR)/../os/os_rpath.c_tool C/C++ compiler - FILE_/export/home/db/os/os_rw.c_dependDone + FILE_$(PRJ_DIR)/../os/os_rw.c_dependDone TRUE - FILE_/export/home/db/os/os_rw.c_dependencies + FILE_$(PRJ_DIR)/../os/os_rw.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_rw.c_objects + FILE_$(PRJ_DIR)/../os/os_rw.c_objects os_rw.o - FILE_/export/home/db/os/os_rw.c_tool + FILE_$(PRJ_DIR)/../os/os_rw.c_tool C/C++ compiler - FILE_/export/home/db/os/os_seek.c_dependDone + FILE_$(PRJ_DIR)/../os/os_seek.c_dependDone TRUE - FILE_/export/home/db/os/os_seek.c_dependencies + FILE_$(PRJ_DIR)/../os/os_seek.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_seek.c_objects + FILE_$(PRJ_DIR)/../os/os_seek.c_objects os_seek.o - FILE_/export/home/db/os/os_seek.c_tool + FILE_$(PRJ_DIR)/../os/os_seek.c_tool C/C++ compiler - FILE_/export/home/db/os/os_sleep.c_dependDone + FILE_$(PRJ_DIR)/../os/os_sleep.c_dependDone TRUE - FILE_/export/home/db/os/os_sleep.c_dependencies + FILE_$(PRJ_DIR)/../os/os_sleep.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_sleep.c_objects + FILE_$(PRJ_DIR)/../os/os_sleep.c_objects os_sleep.o - FILE_/export/home/db/os/os_sleep.c_tool + FILE_$(PRJ_DIR)/../os/os_sleep.c_tool C/C++ compiler - FILE_/export/home/db/os/os_spin.c_dependDone + FILE_$(PRJ_DIR)/../os/os_spin.c_dependDone TRUE - FILE_/export/home/db/os/os_spin.c_dependencies + FILE_$(PRJ_DIR)/../os/os_spin.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_spin.c_objects + FILE_$(PRJ_DIR)/../os/os_spin.c_objects os_spin.o - FILE_/export/home/db/os/os_spin.c_tool + FILE_$(PRJ_DIR)/../os/os_spin.c_tool C/C++ compiler - FILE_/export/home/db/os/os_stat.c_dependDone + FILE_$(PRJ_DIR)/../os/os_stat.c_dependDone TRUE - FILE_/export/home/db/os/os_stat.c_dependencies + FILE_$(PRJ_DIR)/../os/os_stat.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_stat.c_objects + FILE_$(PRJ_DIR)/../os/os_stat.c_objects os_stat.o - FILE_/export/home/db/os/os_stat.c_tool + FILE_$(PRJ_DIR)/../os/os_stat.c_tool C/C++ compiler - FILE_/export/home/db/os/os_tmpdir.c_dependDone + FILE_$(PRJ_DIR)/../os/os_tmpdir.c_dependDone TRUE - FILE_/export/home/db/os/os_tmpdir.c_dependencies + FILE_$(PRJ_DIR)/../os/os_tmpdir.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_tmpdir.c_objects + FILE_$(PRJ_DIR)/../os/os_tmpdir.c_objects os_tmpdir.o - FILE_/export/home/db/os/os_tmpdir.c_tool + FILE_$(PRJ_DIR)/../os/os_tmpdir.c_tool C/C++ compiler - FILE_/export/home/db/os/os_unlink.c_dependDone + FILE_$(PRJ_DIR)/../os/os_unlink.c_dependDone TRUE - FILE_/export/home/db/os/os_unlink.c_dependencies + FILE_$(PRJ_DIR)/../os/os_unlink.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/os_jump.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os/os_unlink.c_objects + FILE_$(PRJ_DIR)/../os/os_unlink.c_objects os_unlink.o - FILE_/export/home/db/os/os_unlink.c_tool + FILE_$(PRJ_DIR)/../os/os_unlink.c_tool C/C++ compiler - FILE_/export/home/db/os_vxworks/os_abs.c_dependDone + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_abs.c_dependDone TRUE - FILE_/export/home/db/os_vxworks/os_abs.c_dependencies + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_abs.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os_vxworks/os_abs.c_objects -os_abs.o + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_abs.c_objects +os_vx_abs.o - FILE_/export/home/db/os_vxworks/os_abs.c_tool + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_abs.c_tool C/C++ compiler - FILE_/export/home/db/os_vxworks/os_finit.c_dependDone + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_config.c_dependDone TRUE - FILE_/export/home/db/os_vxworks/os_finit.c_dependencies + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_config.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os_vxworks/os_finit.c_objects -os_finit.o + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_config.c_objects +os_vx_config.o - FILE_/export/home/db/os_vxworks/os_finit.c_tool + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_config.c_tool C/C++ compiler - FILE_/export/home/db/os_vxworks/os_map.c_dependDone + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_map.c_dependDone TRUE - FILE_/export/home/db/os_vxworks/os_map.c_dependencies + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_map.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/os_vxworks/os_map.c_objects -os_map.o + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_map.c_objects +os_vx_map.o - FILE_/export/home/db/os_vxworks/os_map.c_tool + FILE_$(PRJ_DIR)/../os_vxworks/os_vx_map.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam.c_dependDone TRUE - FILE_/export/home/db/qam/qam.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam.c_objects + FILE_$(PRJ_DIR)/../qam/qam.c_objects qam.o - FILE_/export/home/db/qam/qam.c_tool + FILE_$(PRJ_DIR)/../qam/qam.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam_auto.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam_auto.c_dependDone TRUE - FILE_/export/home/db/qam/qam_auto.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam_auto.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam_auto.c_objects + FILE_$(PRJ_DIR)/../qam/qam_auto.c_objects qam_auto.o - FILE_/export/home/db/qam/qam_auto.c_tool + FILE_$(PRJ_DIR)/../qam/qam_auto.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam_conv.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam_conv.c_dependDone TRUE - FILE_/export/home/db/qam/qam_conv.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam_conv.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam_conv.c_objects + FILE_$(PRJ_DIR)/../qam/qam_conv.c_objects qam_conv.o - FILE_/export/home/db/qam/qam_conv.c_tool + FILE_$(PRJ_DIR)/../qam/qam_conv.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam_files.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam_files.c_dependDone TRUE - FILE_/export/home/db/qam/qam_files.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam_files.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/btree.h \ - /export/home/db/include/btree_auto.h \ - /export/home/db/include/btree_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam_files.c_objects + FILE_$(PRJ_DIR)/../qam/qam_files.c_objects qam_files.o - FILE_/export/home/db/qam/qam_files.c_tool + FILE_$(PRJ_DIR)/../qam/qam_files.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam_method.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam_method.c_dependDone TRUE - FILE_/export/home/db/qam/qam_method.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam_method.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam_method.c_objects + FILE_$(PRJ_DIR)/../qam/qam_method.c_objects qam_method.o - FILE_/export/home/db/qam/qam_method.c_tool + FILE_$(PRJ_DIR)/../qam/qam_method.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam_open.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam_open.c_dependDone TRUE - FILE_/export/home/db/qam/qam_open.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam_open.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam_open.c_objects + FILE_$(PRJ_DIR)/../qam/qam_open.c_objects qam_open.o - FILE_/export/home/db/qam/qam_open.c_tool + FILE_$(PRJ_DIR)/../qam/qam_open.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam_rec.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam_rec.c_dependDone TRUE - FILE_/export/home/db/qam/qam_rec.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam_rec.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam_rec.c_objects + FILE_$(PRJ_DIR)/../qam/qam_rec.c_objects qam_rec.o - FILE_/export/home/db/qam/qam_rec.c_tool + FILE_$(PRJ_DIR)/../qam/qam_rec.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam_stat.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam_stat.c_dependDone TRUE - FILE_/export/home/db/qam/qam_stat.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam_stat.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam_stat.c_objects + FILE_$(PRJ_DIR)/../qam/qam_stat.c_objects qam_stat.o - FILE_/export/home/db/qam/qam_stat.c_tool + FILE_$(PRJ_DIR)/../qam/qam_stat.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam_upgrade.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam_upgrade.c_dependDone TRUE - FILE_/export/home/db/qam/qam_upgrade.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam_upgrade.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_swap.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/db_upgrade.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam_upgrade.c_objects + FILE_$(PRJ_DIR)/../qam/qam_upgrade.c_objects qam_upgrade.o - FILE_/export/home/db/qam/qam_upgrade.c_tool + FILE_$(PRJ_DIR)/../qam/qam_upgrade.c_tool C/C++ compiler - FILE_/export/home/db/qam/qam_verify.c_dependDone + FILE_$(PRJ_DIR)/../qam/qam_verify.c_dependDone TRUE - FILE_/export/home/db/qam/qam_verify.c_dependencies + FILE_$(PRJ_DIR)/../qam/qam_verify.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_verify.h \ - /export/home/db/include/qam.h \ - /export/home/db/include/qam_auto.h \ - /export/home/db/include/qam_ext.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/qam/qam_verify.c_objects + FILE_$(PRJ_DIR)/../qam/qam_verify.c_objects qam_verify.o - FILE_/export/home/db/qam/qam_verify.c_tool + FILE_$(PRJ_DIR)/../qam/qam_verify.c_tool C/C++ compiler - FILE_/export/home/db/rpc_client/client.c_dependDone + FILE_$(PRJ_DIR)/../rep/rep_method.c_dependDone TRUE - FILE_/export/home/db/rpc_client/client.c_dependencies + FILE_$(PRJ_DIR)/../rep/rep_method.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/rpc_client/client.c_objects + FILE_$(PRJ_DIR)/../rep/rep_method.c_objects +rep_method.o + + + FILE_$(PRJ_DIR)/../rep/rep_method.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../rep/rep_record.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rep/rep_record.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rep/rep_record.c_objects +rep_record.o + + + FILE_$(PRJ_DIR)/../rep/rep_record.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../rep/rep_region.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rep/rep_region.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rep/rep_region.c_objects +rep_region.o + + + FILE_$(PRJ_DIR)/../rep/rep_region.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../rep/rep_util.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rep/rep_util.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rep/rep_util.c_objects +rep_util.o + + + FILE_$(PRJ_DIR)/../rep/rep_util.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../rpc_client/client.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../rpc_client/client.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../rpc_client/client.c_objects client.o - FILE_/export/home/db/rpc_client/client.c_tool + FILE_$(PRJ_DIR)/../rpc_client/client.c_tool C/C++ compiler - FILE_/export/home/db/rpc_client/db_server_clnt.c_dependDone + FILE_$(PRJ_DIR)/../rpc_client/db_server_clnt.c_dependDone TRUE - FILE_/export/home/db/rpc_client/db_server_clnt.c_dependencies -$(PRJ_DIR)/db_config.h /export/home/db/include/db_server.h + FILE_$(PRJ_DIR)/../rpc_client/db_server_clnt.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h - FILE_/export/home/db/rpc_client/db_server_clnt.c_objects + FILE_$(PRJ_DIR)/../rpc_client/db_server_clnt.c_objects db_server_clnt.o - FILE_/export/home/db/rpc_client/db_server_clnt.c_tool + FILE_$(PRJ_DIR)/../rpc_client/db_server_clnt.c_tool C/C++ compiler - FILE_/export/home/db/rpc_client/gen_client.c_dependDone + FILE_$(PRJ_DIR)/../rpc_client/gen_client.c_dependDone TRUE - FILE_/export/home/db/rpc_client/gen_client.c_dependencies + FILE_$(PRJ_DIR)/../rpc_client/gen_client.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/mp.h \ - /export/home/db/include/mp_ext.h \ - /export/home/db/include/rpc_client_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/gen_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/rpc_client/gen_client.c_objects + FILE_$(PRJ_DIR)/../rpc_client/gen_client.c_objects gen_client.o - FILE_/export/home/db/rpc_client/gen_client.c_tool + FILE_$(PRJ_DIR)/../rpc_client/gen_client.c_tool C/C++ compiler - FILE_/export/home/db/rpc_client/gen_client_ret.c_dependDone + FILE_$(PRJ_DIR)/../rpc_client/gen_client_ret.c_dependDone TRUE - FILE_/export/home/db/rpc_client/gen_client_ret.c_dependencies + FILE_$(PRJ_DIR)/../rpc_client/gen_client_ret.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/rpc_client/gen_client_ret.c_objects + FILE_$(PRJ_DIR)/../rpc_client/gen_client_ret.c_objects gen_client_ret.o - FILE_/export/home/db/rpc_client/gen_client_ret.c_tool + FILE_$(PRJ_DIR)/../rpc_client/gen_client_ret.c_tool C/C++ compiler - FILE_/export/home/db/rpc_server/db_server_xdr.c_dependDone + FILE_$(PRJ_DIR)/../rpc_server/c/db_server_xdr.c_dependDone TRUE - FILE_/export/home/db/rpc_server/db_server_xdr.c_dependencies -$(PRJ_DIR)/db_config.h /export/home/db/include/db_server.h + FILE_$(PRJ_DIR)/../rpc_server/c/db_server_xdr.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h - FILE_/export/home/db/rpc_server/db_server_xdr.c_objects + FILE_$(PRJ_DIR)/../rpc_server/c/db_server_xdr.c_objects db_server_xdr.o - FILE_/export/home/db/rpc_server/db_server_xdr.c_tool + FILE_$(PRJ_DIR)/../rpc_server/c/db_server_xdr.c_tool C/C++ compiler - FILE_/export/home/db/txn/txn.c_dependDone + FILE_$(PRJ_DIR)/../txn/txn.c_dependDone TRUE - FILE_/export/home/db/txn/txn.c_dependencies + FILE_$(PRJ_DIR)/../txn/txn.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_shash.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/lock.h \ - /export/home/db/include/lock_ext.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/txn/txn.c_objects + FILE_$(PRJ_DIR)/../txn/txn.c_objects txn.o - FILE_/export/home/db/txn/txn.c_tool + FILE_$(PRJ_DIR)/../txn/txn.c_tool C/C++ compiler - FILE_/export/home/db/txn/txn_auto.c_dependDone + FILE_$(PRJ_DIR)/../txn/txn_auto.c_dependDone TRUE - FILE_/export/home/db/txn/txn_auto.c_dependencies + FILE_$(PRJ_DIR)/../txn/txn_auto.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/txn/txn_auto.c_objects + FILE_$(PRJ_DIR)/../txn/txn_auto.c_objects txn_auto.o - FILE_/export/home/db/txn/txn_auto.c_tool + FILE_$(PRJ_DIR)/../txn/txn_auto.c_tool C/C++ compiler - FILE_/export/home/db/txn/txn_rec.c_dependDone + FILE_$(PRJ_DIR)/../txn/txn_method.c_dependDone TRUE - FILE_/export/home/db/txn/txn_rec.c_dependencies + FILE_$(PRJ_DIR)/../txn/txn_method.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/txn/txn_rec.c_objects + FILE_$(PRJ_DIR)/../txn/txn_method.c_objects +txn_method.o + + + FILE_$(PRJ_DIR)/../txn/txn_method.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../txn/txn_rec.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_rec.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_rec.c_objects txn_rec.o - FILE_/export/home/db/txn/txn_rec.c_tool + FILE_$(PRJ_DIR)/../txn/txn_rec.c_tool C/C++ compiler - FILE_/export/home/db/txn/txn_region.c_dependDone + FILE_$(PRJ_DIR)/../txn/txn_recover.c_dependDone TRUE - FILE_/export/home/db/txn/txn_region.c_dependencies + FILE_$(PRJ_DIR)/../txn/txn_recover.c_dependencies $(PRJ_DIR)/db_config.h \ - /export/home/db/include/db_server.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h \ - /export/home/db/include/gen_client_ext.h \ - /export/home/db/include/rpc_client_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/txn/txn_region.c_objects + FILE_$(PRJ_DIR)/../txn/txn_recover.c_objects +txn_recover.o + + + FILE_$(PRJ_DIR)/../txn/txn_recover.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../txn/txn_region.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_region.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_region.c_objects txn_region.o - FILE_/export/home/db/txn/txn_region.c_tool + FILE_$(PRJ_DIR)/../txn/txn_region.c_tool C/C++ compiler - FILE_/export/home/db/xa/xa.c_dependDone + FILE_$(PRJ_DIR)/../txn/txn_stat.c_dependDone TRUE - FILE_/export/home/db/xa/xa.c_dependencies + FILE_$(PRJ_DIR)/../txn/txn_stat.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/db_page.h \ - /export/home/db/include/log.h \ - /export/home/db/include/log_auto.h \ - /export/home/db/include/log_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/db_am.h \ - /export/home/db/include/db_dispatch.h \ - /export/home/db/include/db_auto.h \ - /export/home/db/include/crdel_auto.h \ - /export/home/db/include/db_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/xa/xa.c_objects + FILE_$(PRJ_DIR)/../txn/txn_stat.c_objects +txn_stat.o + + + FILE_$(PRJ_DIR)/../txn/txn_stat.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../txn/txn_util.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../txn/txn_util.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../txn/txn_util.c_objects +txn_util.o + + + FILE_$(PRJ_DIR)/../txn/txn_util.c_tool +C/C++ compiler + + + FILE_$(PRJ_DIR)/../xa/xa.c_dependDone +TRUE + + + FILE_$(PRJ_DIR)/../xa/xa.c_dependencies +$(PRJ_DIR)/db_config.h \ + $(PRJ_DIR)/db_int.h \ + $(PRJ_DIR)/db.h + + + FILE_$(PRJ_DIR)/../xa/xa.c_objects xa.o - FILE_/export/home/db/xa/xa.c_tool + FILE_$(PRJ_DIR)/../xa/xa.c_tool C/C++ compiler - FILE_/export/home/db/xa/xa_db.c_dependDone + FILE_$(PRJ_DIR)/../xa/xa_db.c_dependDone TRUE - FILE_/export/home/db/xa/xa_db.c_dependencies + FILE_$(PRJ_DIR)/../xa/xa_db.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/xa_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/xa/xa_db.c_objects + FILE_$(PRJ_DIR)/../xa/xa_db.c_objects xa_db.o - FILE_/export/home/db/xa/xa_db.c_tool + FILE_$(PRJ_DIR)/../xa/xa_db.c_tool C/C++ compiler - FILE_/export/home/db/xa/xa_map.c_dependDone + FILE_$(PRJ_DIR)/../xa/xa_map.c_dependDone TRUE - FILE_/export/home/db/xa/xa_map.c_dependencies + FILE_$(PRJ_DIR)/../xa/xa_map.c_dependencies $(PRJ_DIR)/db_config.h \ $(PRJ_DIR)/db_int.h \ - $(PRJ_DIR)/db.h \ - /export/home/db/include/queue.h \ - /export/home/db/include/shqueue.h \ - /export/home/db/include/debug.h \ - /export/home/db/include/mutex.h \ - /export/home/db/include/region.h \ - /export/home/db/include/mutex_ext.h \ - /export/home/db/include/env_ext.h \ - /export/home/db/include/os.h \ - /export/home/db/include/os_ext.h \ - /export/home/db/include/common_ext.h \ - /export/home/db/include/txn.h \ - /export/home/db/include/xa.h \ - /export/home/db/include/txn_auto.h \ - /export/home/db/include/txn_ext.h \ - /export/home/db/include/xa_ext.h + $(PRJ_DIR)/db.h - FILE_/export/home/db/xa/xa_map.c_objects + FILE_$(PRJ_DIR)/../xa/xa_map.c_objects xa_map.o - FILE_/export/home/db/xa/xa_map.c_tool + FILE_$(PRJ_DIR)/../xa/xa_map.c_tool C/C++ compiler PROJECT_FILES -/export/home/db/hsearch/hsearch.c \ - /export/home/db/mp/mp_trickle.c \ - /export/home/db/mp/mp_bh.c \ - /export/home/db/mp/mp_fget.c \ - /export/home/db/mp/mp_fopen.c \ - /export/home/db/mp/mp_fput.c \ - /export/home/db/mp/mp_fset.c \ - /export/home/db/mp/mp_method.c \ - /export/home/db/mp/mp_region.c \ - /export/home/db/mp/mp_register.c \ - /export/home/db/mp/mp_stat.c \ - /export/home/db/mp/mp_sync.c \ - /export/home/db/mp/mp_alloc.c \ - /export/home/db/db/crdel_rec.c \ - /export/home/db/db/db.c \ - /export/home/db/db/db_am.c \ - /export/home/db/db/db_auto.c \ - /export/home/db/db/db_cam.c \ - /export/home/db/db/db_conv.c \ - /export/home/db/db/db_dispatch.c \ - /export/home/db/db/db_dup.c \ - /export/home/db/db/db_iface.c \ - /export/home/db/db/db_join.c \ - /export/home/db/db/db_meta.c \ - /export/home/db/db/db_method.c \ - /export/home/db/db/db_overflow.c \ - /export/home/db/db/db_pr.c \ - /export/home/db/db/db_rec.c \ - /export/home/db/db/db_reclaim.c \ - /export/home/db/db/db_ret.c \ - /export/home/db/db/crdel_auto.c \ - /export/home/db/clib/getopt.c \ - /export/home/db/clib/snprintf.c \ - /export/home/db/clib/strcasecmp.c \ - /export/home/db/os/os_unlink.c \ - /export/home/db/os/os_alloc.c \ - /export/home/db/os/os_dir.c \ - /export/home/db/os/os_errno.c \ - /export/home/db/os/os_fid.c \ - /export/home/db/os/os_fsync.c \ - /export/home/db/os/os_handle.c \ - /export/home/db/os/os_method.c \ - /export/home/db/os/os_oflags.c \ - /export/home/db/os/os_open.c \ - /export/home/db/os/os_region.c \ - /export/home/db/os/os_rename.c \ - /export/home/db/os/os_root.c \ - /export/home/db/os/os_rpath.c \ - /export/home/db/os/os_rw.c \ - /export/home/db/os/os_seek.c \ - /export/home/db/os/os_spin.c \ - /export/home/db/os/os_stat.c \ - /export/home/db/os/os_tmpdir.c \ - /export/home/db/qam/qam_upgrade.c \ - /export/home/db/qam/qam_auto.c \ - /export/home/db/qam/qam_conv.c \ - /export/home/db/qam/qam_method.c \ - /export/home/db/qam/qam_open.c \ - /export/home/db/qam/qam_rec.c \ - /export/home/db/qam/qam_stat.c \ - /export/home/db/qam/qam.c \ - /export/home/db/hash/hash_upgrade.c \ - /export/home/db/hash/hash_auto.c \ - /export/home/db/hash/hash_conv.c \ - /export/home/db/hash/hash_dup.c \ - /export/home/db/hash/hash_func.c \ - /export/home/db/hash/hash_meta.c \ - /export/home/db/hash/hash_method.c \ - /export/home/db/hash/hash_page.c \ - /export/home/db/hash/hash_rec.c \ - /export/home/db/hash/hash_reclaim.c \ - /export/home/db/hash/hash_stat.c \ - /export/home/db/hash/hash.c \ - /export/home/db/xa/xa_map.c \ - /export/home/db/xa/xa_db.c \ - /export/home/db/xa/xa.c \ - /export/home/db/btree/btree_auto.c \ - /export/home/db/btree/bt_conv.c \ - /export/home/db/btree/bt_curadj.c \ - /export/home/db/btree/bt_cursor.c \ - /export/home/db/btree/bt_delete.c \ - /export/home/db/btree/bt_method.c \ - /export/home/db/btree/bt_open.c \ - /export/home/db/btree/bt_put.c \ - /export/home/db/btree/bt_rec.c \ - /export/home/db/btree/bt_reclaim.c \ - /export/home/db/btree/bt_recno.c \ - /export/home/db/btree/bt_rsearch.c \ - /export/home/db/btree/bt_search.c \ - /export/home/db/btree/bt_split.c \ - /export/home/db/btree/bt_stat.c \ - /export/home/db/btree/bt_upgrade.c \ - /export/home/db/btree/bt_compare.c \ - /export/home/db/common/db_log2.c \ - /export/home/db/common/db_err.c \ - /export/home/db/common/db_getlong.c \ - /export/home/db/common/db_byteorder.c \ - /export/home/db/env/env_region.c \ - /export/home/db/env/db_shash.c \ - /export/home/db/env/env_method.c \ - /export/home/db/env/env_open.c \ - /export/home/db/env/env_recover.c \ - /export/home/db/env/db_salloc.c \ - /export/home/db/lock/lock_util.c \ - /export/home/db/lock/lock_conflict.c \ - /export/home/db/lock/lock_deadlock.c \ - /export/home/db/lock/lock_region.c \ - /export/home/db/lock/lock.c \ - /export/home/db/txn/txn_region.c \ - /export/home/db/txn/txn_auto.c \ - /export/home/db/txn/txn_rec.c \ - /export/home/db/txn/txn.c \ - /export/home/db/log/log_register.c \ - /export/home/db/log/log_archive.c \ - /export/home/db/log/log_auto.c \ - /export/home/db/log/log_compare.c \ - /export/home/db/log/log_findckp.c \ - /export/home/db/log/log_get.c \ - /export/home/db/log/log_method.c \ - /export/home/db/log/log_put.c \ - /export/home/db/log/log_rec.c \ - /export/home/db/log/log.c \ - /export/home/db/mutex/mut_tas.c \ - /export/home/db/mutex/mutex.c \ - /export/home/db/clib/vsnprintf.c \ - /export/home/db/common/util_log.c \ - /export/home/db/common/util_sig.c \ - /export/home/db/os/os_sleep.c \ - /export/home/db/btree/bt_verify.c \ - /export/home/db/hash/hash_verify.c \ - /export/home/db/qam/qam_verify.c \ - /export/home/db/db/db_upg_opd.c \ - /export/home/db/rpc_client/gen_client_ret.c \ - /export/home/db/rpc_client/db_server_clnt.c \ - /export/home/db/rpc_client/gen_client.c \ - /export/home/db/rpc_client/client.c \ - /export/home/db/include/tcl_db.h \ - /export/home/db/rpc_server/db_server_xdr.c \ - /export/home/db/os_vxworks/os_map.c \ - /export/home/db/db/db_vrfy.c \ - /export/home/db/db/db_upg.c \ - /export/home/db/db/db_vrfyutil.c \ - /export/home/db/os_vxworks/os_finit.c \ - /export/home/db/os_vxworks/os_abs.c \ - /export/home/db/lock/lock_method.c \ - /export/home/db/lock/lock_stat.c \ - /export/home/db/qam/qam_files.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 \ + $(PRJ_DIR)/../btree/bt_delete.c \ + $(PRJ_DIR)/../btree/bt_method.c \ + $(PRJ_DIR)/../btree/bt_open.c \ + $(PRJ_DIR)/../btree/bt_put.c \ + $(PRJ_DIR)/../btree/bt_rec.c \ + $(PRJ_DIR)/../btree/bt_reclaim.c \ + $(PRJ_DIR)/../btree/bt_recno.c \ + $(PRJ_DIR)/../btree/bt_rsearch.c \ + $(PRJ_DIR)/../btree/bt_search.c \ + $(PRJ_DIR)/../btree/bt_split.c \ + $(PRJ_DIR)/../btree/bt_stat.c \ + $(PRJ_DIR)/../btree/bt_upgrade.c \ + $(PRJ_DIR)/../btree/bt_verify.c \ + $(PRJ_DIR)/../btree/btree_auto.c \ + $(PRJ_DIR)/../clib/getopt.c \ + $(PRJ_DIR)/../clib/snprintf.c \ + $(PRJ_DIR)/../clib/strcasecmp.c \ + $(PRJ_DIR)/../clib/strdup.c \ + $(PRJ_DIR)/../clib/vsnprintf.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/util_arg.c \ + $(PRJ_DIR)/../common/util_cache.c \ + $(PRJ_DIR)/../common/util_log.c \ + $(PRJ_DIR)/../common/util_sig.c \ + $(PRJ_DIR)/../db/crdel_auto.c \ + $(PRJ_DIR)/../db/crdel_rec.c \ + $(PRJ_DIR)/../db/db.c \ + $(PRJ_DIR)/../db/db_am.c \ + $(PRJ_DIR)/../db/db_auto.c \ + $(PRJ_DIR)/../db/db_cam.c \ + $(PRJ_DIR)/../db/db_conv.c \ + $(PRJ_DIR)/../db/db_dispatch.c \ + $(PRJ_DIR)/../db/db_dup.c \ + $(PRJ_DIR)/../db/db_iface.c \ + $(PRJ_DIR)/../db/db_join.c \ + $(PRJ_DIR)/../db/db_meta.c \ + $(PRJ_DIR)/../db/db_method.c \ + $(PRJ_DIR)/../db/db_open.c \ + $(PRJ_DIR)/../db/db_overflow.c \ + $(PRJ_DIR)/../db/db_pr.c \ + $(PRJ_DIR)/../db/db_rec.c \ + $(PRJ_DIR)/../db/db_reclaim.c \ + $(PRJ_DIR)/../db/db_remove.c \ + $(PRJ_DIR)/../db/db_rename.c \ + $(PRJ_DIR)/../db/db_ret.c \ + $(PRJ_DIR)/../db/db_truncate.c \ + $(PRJ_DIR)/../db/db_upg.c \ + $(PRJ_DIR)/../db/db_upg_opd.c \ + $(PRJ_DIR)/../db/db_vrfy.c \ + $(PRJ_DIR)/../db/db_vrfyutil.c \ + $(PRJ_DIR)/../dbreg/dbreg.c \ + $(PRJ_DIR)/../dbreg/dbreg_auto.c \ + $(PRJ_DIR)/../dbreg/dbreg_rec.c \ + $(PRJ_DIR)/../dbreg/dbreg_util.c \ + $(PRJ_DIR)/../env/db_salloc.c \ + $(PRJ_DIR)/../env/db_shash.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)/../fileops/fileops_auto.c \ + $(PRJ_DIR)/../fileops/fop_basic.c \ + $(PRJ_DIR)/../fileops/fop_rec.c \ + $(PRJ_DIR)/../fileops/fop_util.c \ + $(PRJ_DIR)/../hash/hash.c \ + $(PRJ_DIR)/../hash/hash_auto.c \ + $(PRJ_DIR)/../hash/hash_conv.c \ + $(PRJ_DIR)/../hash/hash_dup.c \ + $(PRJ_DIR)/../hash/hash_func.c \ + $(PRJ_DIR)/../hash/hash_meta.c \ + $(PRJ_DIR)/../hash/hash_method.c \ + $(PRJ_DIR)/../hash/hash_open.c \ + $(PRJ_DIR)/../hash/hash_page.c \ + $(PRJ_DIR)/../hash/hash_rec.c \ + $(PRJ_DIR)/../hash/hash_reclaim.c \ + $(PRJ_DIR)/../hash/hash_stat.c \ + $(PRJ_DIR)/../hash/hash_upgrade.c \ + $(PRJ_DIR)/../hash/hash_verify.c \ + $(PRJ_DIR)/../hmac/hmac.c \ + $(PRJ_DIR)/../hmac/sha1.c \ + $(PRJ_DIR)/../hsearch/hsearch.c \ + $(PRJ_DIR)/../lock/lock.c \ + $(PRJ_DIR)/../lock/lock_deadlock.c \ + $(PRJ_DIR)/../lock/lock_method.c \ + $(PRJ_DIR)/../lock/lock_region.c \ + $(PRJ_DIR)/../lock/lock_stat.c \ + $(PRJ_DIR)/../lock/lock_util.c \ + $(PRJ_DIR)/../log/log.c \ + $(PRJ_DIR)/../log/log_archive.c \ + $(PRJ_DIR)/../log/log_compare.c \ + $(PRJ_DIR)/../log/log_get.c \ + $(PRJ_DIR)/../log/log_method.c \ + $(PRJ_DIR)/../log/log_put.c \ + $(PRJ_DIR)/../mp/mp_alloc.c \ + $(PRJ_DIR)/../mp/mp_bh.c \ + $(PRJ_DIR)/../mp/mp_fget.c \ + $(PRJ_DIR)/../mp/mp_fopen.c \ + $(PRJ_DIR)/../mp/mp_fput.c \ + $(PRJ_DIR)/../mp/mp_fset.c \ + $(PRJ_DIR)/../mp/mp_method.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_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_fsync.c \ + $(PRJ_DIR)/../os/os_handle.c \ + $(PRJ_DIR)/../os/os_id.c \ + $(PRJ_DIR)/../os/os_method.c \ + $(PRJ_DIR)/../os/os_oflags.c \ + $(PRJ_DIR)/../os/os_open.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 \ + $(PRJ_DIR)/../os/os_spin.c \ + $(PRJ_DIR)/../os/os_stat.c \ + $(PRJ_DIR)/../os/os_tmpdir.c \ + $(PRJ_DIR)/../os/os_unlink.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)/../qam/qam.c \ + $(PRJ_DIR)/../qam/qam_auto.c \ + $(PRJ_DIR)/../qam/qam_conv.c \ + $(PRJ_DIR)/../qam/qam_files.c \ + $(PRJ_DIR)/../qam/qam_method.c \ + $(PRJ_DIR)/../qam/qam_open.c \ + $(PRJ_DIR)/../qam/qam_rec.c \ + $(PRJ_DIR)/../qam/qam_stat.c \ + $(PRJ_DIR)/../qam/qam_upgrade.c \ + $(PRJ_DIR)/../qam/qam_verify.c \ + $(PRJ_DIR)/../rep/rep_method.c \ + $(PRJ_DIR)/../rep/rep_record.c \ + $(PRJ_DIR)/../rep/rep_region.c \ + $(PRJ_DIR)/../rep/rep_util.c \ + $(PRJ_DIR)/../rpc_client/client.c \ + $(PRJ_DIR)/../rpc_client/db_server_clnt.c \ + $(PRJ_DIR)/../rpc_client/gen_client.c \ + $(PRJ_DIR)/../rpc_client/gen_client_ret.c \ + $(PRJ_DIR)/../rpc_server/c/db_server_xdr.c \ + $(PRJ_DIR)/../txn/txn.c \ + $(PRJ_DIR)/../txn/txn_auto.c \ + $(PRJ_DIR)/../txn/txn_method.c \ + $(PRJ_DIR)/../txn/txn_rec.c \ + $(PRJ_DIR)/../txn/txn_recover.c \ + $(PRJ_DIR)/../txn/txn_region.c \ + $(PRJ_DIR)/../txn/txn_stat.c \ + $(PRJ_DIR)/../txn/txn_util.c \ + $(PRJ_DIR)/../xa/xa.c \ + $(PRJ_DIR)/../xa/xa_db.c \ + $(PRJ_DIR)/../xa/xa_map.c userComments BerkeleyDB - diff --git a/bdb/build_vxworks/BerkeleyDB.wsp b/bdb/build_vxworks/BerkeleyDB.wsp index cffcf00dec9..ce2e71b0eb3 100644 --- a/bdb/build_vxworks/BerkeleyDB.wsp +++ b/bdb/build_vxworks/BerkeleyDB.wsp @@ -10,12 +10,17 @@ Workspace projectList $(PRJ_DIR)/BerkeleyDB.wpj \ - $(PRJ_DIR)/ex_access/ex_access.wpj \ - $(PRJ_DIR)/ex_btrec/ex_btrec.wpj \ - $(PRJ_DIR)/ex_env/ex_env.wpj \ - $(PRJ_DIR)/ex_mpool/ex_mpool.wpj \ - $(PRJ_DIR)/ex_tpcb/ex_tpcb.wpj \ - $(PRJ_DIR)/ex_dbclient/ex_dbclient.wpj + $(PRJ_DIR)/db_archive/db_archive.wpj \ + $(PRJ_DIR)/db_checkpoint/db_checkpoint.wpj \ + $(PRJ_DIR)/db_deadlock/db_deadlock.wpj \ + $(PRJ_DIR)/db_dump/db_dump.wpj \ + $(PRJ_DIR)/db_load/db_load.wpj \ + $(PRJ_DIR)/db_printlog/db_printlog.wpj \ + $(PRJ_DIR)/db_recover/db_recover.wpj \ + $(PRJ_DIR)/db_stat/db_stat.wpj \ + $(PRJ_DIR)/db_upgrade/db_upgrade.wpj \ + $(PRJ_DIR)/db_verify/db_verify.wpj \ + $(PRJ_DIR)/dbdemo/dbdemo.wpj userComments diff --git a/bdb/build_vxworks/BerkeleyDB/Makefile.custom b/bdb/build_vxworks/BerkeleyDB/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/BerkeleyDB/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/BerkeleyDB/component.cdf b/bdb/build_vxworks/BerkeleyDB/component.cdf new file mode 100755 index 00000000000..4b3e6f101c3 --- /dev/null +++ b/bdb/build_vxworks/BerkeleyDB/component.cdf @@ -0,0 +1,1220 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_BERKELEYDB { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES 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 \ + bt_verify.o \ + btree_auto.o \ + client.o \ + 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_remove.o \ + db_rename.o \ + db_ret.o \ + db_salloc.o \ + db_server_clnt.o \ + db_server_xdr.o \ + db_shash.o \ + db_truncate.o \ + db_upg.o \ + db_upg_opd.o \ + db_vrfy.o \ + db_vrfyutil.o \ + dbreg.o \ + dbreg_auto.o \ + dbreg_rec.o \ + dbreg_util.o \ + env_file.o \ + env_method.o \ + env_open.o \ + env_recover.o \ + env_region.o \ + fileops_auto.o \ + fop_basic.o \ + fop_rec.o \ + fop_util.o \ + gen_client.o \ + gen_client_ret.o \ + getopt.o \ + hash.o \ + hash_auto.o \ + hash_conv.o \ + hash_dup.o \ + hash_func.o \ + hash_meta.o \ + hash_method.o \ + hash_open.o \ + hash_page.o \ + hash_rec.o \ + hash_reclaim.o \ + hash_stat.o \ + hash_upgrade.o \ + hash_verify.o \ + hmac.o \ + hsearch.o \ + lock.o \ + lock_deadlock.o \ + lock_method.o \ + lock_region.o \ + lock_stat.o \ + lock_util.o \ + log.o \ + log_archive.o \ + log_compare.o \ + log_get.o \ + log_method.o \ + log_put.o \ + mp_alloc.o \ + mp_bh.o \ + mp_fget.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 \ + mut_tas.o \ + mutex.o \ + os_alloc.o \ + os_clock.o \ + os_dir.o \ + os_errno.o \ + os_fid.o \ + os_fsync.o \ + os_handle.o \ + os_id.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_unlink.o \ + os_vx_abs.o \ + os_vx_config.o \ + os_vx_map.o \ + qam.o \ + qam_auto.o \ + qam_conv.o \ + qam_files.o \ + qam_method.o \ + qam_open.o \ + qam_rec.o \ + qam_stat.o \ + qam_upgrade.o \ + qam_verify.o \ + rep_method.o \ + rep_record.o \ + rep_region.o \ + rep_util.o \ + sha1.o \ + snprintf.o \ + strcasecmp.o \ + strdup.o \ + txn.o \ + txn_auto.o \ + txn_method.o \ + txn_rec.o \ + txn_recover.o \ + txn_region.o \ + txn_stat.o \ + txn_util.o \ + util_arg.o \ + util_cache.o \ + util_log.o \ + util_sig.o \ + vsnprintf.o \ + xa.o \ + xa_db.o \ + xa_map.o + NAME BerkeleyDB + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module bt_compare.o { + + NAME bt_compare.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_compare.c +} + +Module bt_conv.o { + + NAME bt_conv.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_conv.c +} + +Module bt_curadj.o { + + NAME bt_curadj.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_curadj.c +} + +Module bt_cursor.o { + + NAME bt_cursor.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_cursor.c +} + +Module bt_delete.o { + + NAME bt_delete.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_delete.c +} + +Module bt_method.o { + + NAME bt_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_method.c +} + +Module bt_open.o { + + NAME bt_open.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_open.c +} + +Module bt_put.o { + + NAME bt_put.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_put.c +} + +Module bt_rec.o { + + NAME bt_rec.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_rec.c +} + +Module bt_reclaim.o { + + NAME bt_reclaim.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_reclaim.c +} + +Module bt_recno.o { + + NAME bt_recno.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_recno.c +} + +Module bt_rsearch.o { + + NAME bt_rsearch.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_rsearch.c +} + +Module bt_search.o { + + NAME bt_search.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_search.c +} + +Module bt_split.o { + + NAME bt_split.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_split.c +} + +Module bt_stat.o { + + NAME bt_stat.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_stat.c +} + +Module bt_upgrade.o { + + NAME bt_upgrade.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_upgrade.c +} + +Module bt_verify.o { + + NAME bt_verify.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/bt_verify.c +} + +Module btree_auto.o { + + NAME btree_auto.o + SRC_PATH_NAME $(PRJ_DIR)/../../btree/btree_auto.c +} + +Module getopt.o { + + NAME getopt.o + SRC_PATH_NAME $(PRJ_DIR)/../../clib/getopt.c +} + +Module snprintf.o { + + NAME snprintf.o + SRC_PATH_NAME $(PRJ_DIR)/../../clib/snprintf.c +} + +Module strcasecmp.o { + + NAME strcasecmp.o + SRC_PATH_NAME $(PRJ_DIR)/../../clib/strcasecmp.c +} + +Module strdup.o { + + NAME strdup.o + SRC_PATH_NAME $(PRJ_DIR)/../../clib/strdup.c +} + +Module vsnprintf.o { + + NAME vsnprintf.o + SRC_PATH_NAME $(PRJ_DIR)/../../clib/vsnprintf.c +} + +Module db_byteorder.o { + + NAME db_byteorder.o + SRC_PATH_NAME $(PRJ_DIR)/../../common/db_byteorder.c +} + +Module db_err.o { + + NAME db_err.o + SRC_PATH_NAME $(PRJ_DIR)/../../common/db_err.c +} + +Module db_getlong.o { + + NAME db_getlong.o + SRC_PATH_NAME $(PRJ_DIR)/../../common/db_getlong.c +} + +Module db_idspace.o { + + NAME db_idspace.o + SRC_PATH_NAME $(PRJ_DIR)/../../common/db_idspace.c +} + +Module db_log2.o { + + NAME db_log2.o + SRC_PATH_NAME $(PRJ_DIR)/../../common/db_log2.c +} + +Module util_arg.o { + + NAME util_arg.o + SRC_PATH_NAME $(PRJ_DIR)/../../common/util_arg.c +} + +Module util_cache.o { + + NAME util_cache.o + SRC_PATH_NAME $(PRJ_DIR)/../../common/util_cache.c +} + +Module util_log.o { + + NAME util_log.o + SRC_PATH_NAME $(PRJ_DIR)/../../common/util_log.c +} + +Module util_sig.o { + + NAME util_sig.o + SRC_PATH_NAME $(PRJ_DIR)/../../common/util_sig.c +} + +Module crdel_auto.o { + + NAME crdel_auto.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/crdel_auto.c +} + +Module crdel_rec.o { + + NAME crdel_rec.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/crdel_rec.c +} + +Module db.o { + + NAME db.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db.c +} + +Module db_am.o { + + NAME db_am.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_am.c +} + +Module db_auto.o { + + NAME db_auto.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_auto.c +} + +Module db_cam.o { + + NAME db_cam.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_cam.c +} + +Module db_conv.o { + + NAME db_conv.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_conv.c +} + +Module db_dispatch.o { + + NAME db_dispatch.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_dispatch.c +} + +Module db_dup.o { + + NAME db_dup.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_dup.c +} + +Module db_iface.o { + + NAME db_iface.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_iface.c +} + +Module db_join.o { + + NAME db_join.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_join.c +} + +Module db_meta.o { + + NAME db_meta.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_meta.c +} + +Module db_method.o { + + NAME db_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_method.c +} + +Module db_open.o { + + NAME db_open.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_open.c +} + +Module db_overflow.o { + + NAME db_overflow.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_overflow.c +} + +Module db_pr.o { + + NAME db_pr.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_pr.c +} + +Module db_rec.o { + + NAME db_rec.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_rec.c +} + +Module db_reclaim.o { + + NAME db_reclaim.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_reclaim.c +} + +Module db_remove.o { + + NAME db_remove.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_remove.c +} + +Module db_rename.o { + + NAME db_rename.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_rename.c +} + +Module db_ret.o { + + NAME db_ret.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_ret.c +} + +Module db_truncate.o { + + NAME db_truncate.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_truncate.c +} + +Module db_upg.o { + + NAME db_upg.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_upg.c +} + +Module db_upg_opd.o { + + NAME db_upg_opd.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_upg_opd.c +} + +Module db_vrfy.o { + + NAME db_vrfy.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_vrfy.c +} + +Module db_vrfyutil.o { + + NAME db_vrfyutil.o + SRC_PATH_NAME $(PRJ_DIR)/../../db/db_vrfyutil.c +} + +Module dbreg.o { + + NAME dbreg.o + SRC_PATH_NAME $(PRJ_DIR)/../../dbreg/dbreg.c +} + +Module dbreg_auto.o { + + NAME dbreg_auto.o + SRC_PATH_NAME $(PRJ_DIR)/../../dbreg/dbreg_auto.c +} + +Module dbreg_rec.o { + + NAME dbreg_rec.o + SRC_PATH_NAME $(PRJ_DIR)/../../dbreg/dbreg_rec.c +} + +Module dbreg_util.o { + + NAME dbreg_util.o + SRC_PATH_NAME $(PRJ_DIR)/../../dbreg/dbreg_util.c +} + +Module db_salloc.o { + + NAME db_salloc.o + SRC_PATH_NAME $(PRJ_DIR)/../../env/db_salloc.c +} + +Module db_shash.o { + + NAME db_shash.o + SRC_PATH_NAME $(PRJ_DIR)/../../env/db_shash.c +} + +Module env_file.o { + + NAME env_file.o + SRC_PATH_NAME $(PRJ_DIR)/../../env/env_file.c +} + +Module env_method.o { + + NAME env_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../env/env_method.c +} + +Module env_open.o { + + NAME env_open.o + SRC_PATH_NAME $(PRJ_DIR)/../../env/env_open.c +} + +Module env_recover.o { + + NAME env_recover.o + SRC_PATH_NAME $(PRJ_DIR)/../../env/env_recover.c +} + +Module env_region.o { + + NAME env_region.o + SRC_PATH_NAME $(PRJ_DIR)/../../env/env_region.c +} + +Module fileops_auto.o { + + NAME fileops_auto.o + SRC_PATH_NAME $(PRJ_DIR)/../../fileops/fileops_auto.c +} + +Module fop_basic.o { + + NAME fop_basic.o + SRC_PATH_NAME $(PRJ_DIR)/../../fileops/fop_basic.c +} + +Module fop_rec.o { + + NAME fop_rec.o + SRC_PATH_NAME $(PRJ_DIR)/../../fileops/fop_rec.c +} + +Module fop_util.o { + + NAME fop_util.o + SRC_PATH_NAME $(PRJ_DIR)/../../fileops/fop_util.c +} + +Module hash.o { + + NAME hash.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash.c +} + +Module hash_auto.o { + + NAME hash_auto.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_auto.c +} + +Module hash_conv.o { + + NAME hash_conv.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_conv.c +} + +Module hash_dup.o { + + NAME hash_dup.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_dup.c +} + +Module hash_func.o { + + NAME hash_func.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_func.c +} + +Module hash_meta.o { + + NAME hash_meta.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_meta.c +} + +Module hash_method.o { + + NAME hash_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_method.c +} + +Module hash_open.o { + + NAME hash_open.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_open.c +} + +Module hash_page.o { + + NAME hash_page.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_page.c +} + +Module hash_rec.o { + + NAME hash_rec.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_rec.c +} + +Module hash_reclaim.o { + + NAME hash_reclaim.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_reclaim.c +} + +Module hash_stat.o { + + NAME hash_stat.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_stat.c +} + +Module hash_upgrade.o { + + NAME hash_upgrade.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_upgrade.c +} + +Module hash_verify.o { + + NAME hash_verify.o + SRC_PATH_NAME $(PRJ_DIR)/../../hash/hash_verify.c +} + +Module hmac.o { + + NAME hmac.o + SRC_PATH_NAME $(PRJ_DIR)/../../hmac/hmac.c +} + +Module sha1.o { + + NAME sha1.o + SRC_PATH_NAME $(PRJ_DIR)/../../hmac/sha1.c +} + +Module hsearch.o { + + NAME hsearch.o + SRC_PATH_NAME $(PRJ_DIR)/../../hsearch/hsearch.c +} + +Module lock.o { + + NAME lock.o + SRC_PATH_NAME $(PRJ_DIR)/../../lock/lock.c +} + +Module lock_deadlock.o { + + NAME lock_deadlock.o + SRC_PATH_NAME $(PRJ_DIR)/../../lock/lock_deadlock.c +} + +Module lock_method.o { + + NAME lock_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../lock/lock_method.c +} + +Module lock_region.o { + + NAME lock_region.o + SRC_PATH_NAME $(PRJ_DIR)/../../lock/lock_region.c +} + +Module lock_stat.o { + + NAME lock_stat.o + SRC_PATH_NAME $(PRJ_DIR)/../../lock/lock_stat.c +} + +Module lock_util.o { + + NAME lock_util.o + SRC_PATH_NAME $(PRJ_DIR)/../../lock/lock_util.c +} + +Module log.o { + + NAME log.o + SRC_PATH_NAME $(PRJ_DIR)/../../log/log.c +} + +Module log_archive.o { + + NAME log_archive.o + SRC_PATH_NAME $(PRJ_DIR)/../../log/log_archive.c +} + +Module log_compare.o { + + NAME log_compare.o + SRC_PATH_NAME $(PRJ_DIR)/../../log/log_compare.c +} + +Module log_get.o { + + NAME log_get.o + SRC_PATH_NAME $(PRJ_DIR)/../../log/log_get.c +} + +Module log_method.o { + + NAME log_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../log/log_method.c +} + +Module log_put.o { + + NAME log_put.o + SRC_PATH_NAME $(PRJ_DIR)/../../log/log_put.c +} + +Module mp_alloc.o { + + NAME mp_alloc.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_alloc.c +} + +Module mp_bh.o { + + NAME mp_bh.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_bh.c +} + +Module mp_fget.o { + + NAME mp_fget.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_fget.c +} + +Module mp_fopen.o { + + NAME mp_fopen.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_fopen.c +} + +Module mp_fput.o { + + NAME mp_fput.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_fput.c +} + +Module mp_fset.o { + + NAME mp_fset.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_fset.c +} + +Module mp_method.o { + + NAME mp_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_method.c +} + +Module mp_region.o { + + NAME mp_region.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_region.c +} + +Module mp_register.o { + + NAME mp_register.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_register.c +} + +Module mp_stat.o { + + NAME mp_stat.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_stat.c +} + +Module mp_sync.o { + + NAME mp_sync.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_sync.c +} + +Module mp_trickle.o { + + NAME mp_trickle.o + SRC_PATH_NAME $(PRJ_DIR)/../../mp/mp_trickle.c +} + +Module mut_tas.o { + + NAME mut_tas.o + SRC_PATH_NAME $(PRJ_DIR)/../../mutex/mut_tas.c +} + +Module mutex.o { + + NAME mutex.o + SRC_PATH_NAME $(PRJ_DIR)/../../mutex/mutex.c +} + +Module os_alloc.o { + + NAME os_alloc.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_alloc.c +} + +Module os_clock.o { + + NAME os_clock.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_clock.c +} + +Module os_dir.o { + + NAME os_dir.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_dir.c +} + +Module os_errno.o { + + NAME os_errno.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_errno.c +} + +Module os_fid.o { + + NAME os_fid.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_fid.c +} + +Module os_fsync.o { + + NAME os_fsync.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_fsync.c +} + +Module os_handle.o { + + NAME os_handle.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_handle.c +} + +Module os_id.o { + + NAME os_id.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_id.c +} + +Module os_method.o { + + NAME os_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_method.c +} + +Module os_oflags.o { + + NAME os_oflags.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_oflags.c +} + +Module os_open.o { + + NAME os_open.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_open.c +} + +Module os_region.o { + + NAME os_region.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_region.c +} + +Module os_rename.o { + + NAME os_rename.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_rename.c +} + +Module os_root.o { + + NAME os_root.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_root.c +} + +Module os_rpath.o { + + NAME os_rpath.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_rpath.c +} + +Module os_rw.o { + + NAME os_rw.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_rw.c +} + +Module os_seek.o { + + NAME os_seek.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_seek.c +} + +Module os_sleep.o { + + NAME os_sleep.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_sleep.c +} + +Module os_spin.o { + + NAME os_spin.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_spin.c +} + +Module os_stat.o { + + NAME os_stat.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_stat.c +} + +Module os_tmpdir.o { + + NAME os_tmpdir.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_tmpdir.c +} + +Module os_unlink.o { + + NAME os_unlink.o + SRC_PATH_NAME $(PRJ_DIR)/../../os/os_unlink.c +} + +Module os_vx_abs.o { + + NAME os_vx_abs.o + SRC_PATH_NAME $(PRJ_DIR)/../../os_vxworks/os_vx_abs.c +} + +Module os_vx_config.o { + + NAME os_vx_config.o + SRC_PATH_NAME $(PRJ_DIR)/../../os_vxworks/os_vx_config.c +} + +Module os_vx_map.o { + + NAME os_vx_map.o + SRC_PATH_NAME $(PRJ_DIR)/../../os_vxworks/os_vx_map.c +} + +Module qam.o { + + NAME qam.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam.c +} + +Module qam_auto.o { + + NAME qam_auto.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam_auto.c +} + +Module qam_conv.o { + + NAME qam_conv.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam_conv.c +} + +Module qam_files.o { + + NAME qam_files.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam_files.c +} + +Module qam_method.o { + + NAME qam_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam_method.c +} + +Module qam_open.o { + + NAME qam_open.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam_open.c +} + +Module qam_rec.o { + + NAME qam_rec.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam_rec.c +} + +Module qam_stat.o { + + NAME qam_stat.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam_stat.c +} + +Module qam_upgrade.o { + + NAME qam_upgrade.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam_upgrade.c +} + +Module qam_verify.o { + + NAME qam_verify.o + SRC_PATH_NAME $(PRJ_DIR)/../../qam/qam_verify.c +} + +Module rep_method.o { + + NAME rep_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../rep/rep_method.c +} + +Module rep_record.o { + + NAME rep_record.o + SRC_PATH_NAME $(PRJ_DIR)/../../rep/rep_record.c +} + +Module rep_region.o { + + NAME rep_region.o + SRC_PATH_NAME $(PRJ_DIR)/../../rep/rep_region.c +} + +Module rep_util.o { + + NAME rep_util.o + SRC_PATH_NAME $(PRJ_DIR)/../../rep/rep_util.c +} + +Module client.o { + + NAME client.o + SRC_PATH_NAME $(PRJ_DIR)/../../rpc_client/client.c +} + +Module db_server_clnt.o { + + NAME db_server_clnt.o + SRC_PATH_NAME $(PRJ_DIR)/../../rpc_client/db_server_clnt.c +} + +Module gen_client.o { + + NAME gen_client.o + SRC_PATH_NAME $(PRJ_DIR)/../../rpc_client/gen_client.c +} + +Module gen_client_ret.o { + + NAME gen_client_ret.o + SRC_PATH_NAME $(PRJ_DIR)/../../rpc_client/gen_client_ret.c +} + +Module db_server_xdr.o { + + NAME db_server_xdr.o + SRC_PATH_NAME $(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c +} + +Module txn.o { + + NAME txn.o + SRC_PATH_NAME $(PRJ_DIR)/../../txn/txn.c +} + +Module txn_auto.o { + + NAME txn_auto.o + SRC_PATH_NAME $(PRJ_DIR)/../../txn/txn_auto.c +} + +Module txn_method.o { + + NAME txn_method.o + SRC_PATH_NAME $(PRJ_DIR)/../../txn/txn_method.c +} + +Module txn_rec.o { + + NAME txn_rec.o + SRC_PATH_NAME $(PRJ_DIR)/../../txn/txn_rec.c +} + +Module txn_recover.o { + + NAME txn_recover.o + SRC_PATH_NAME $(PRJ_DIR)/../../txn/txn_recover.c +} + +Module txn_region.o { + + NAME txn_region.o + SRC_PATH_NAME $(PRJ_DIR)/../../txn/txn_region.c +} + +Module txn_stat.o { + + NAME txn_stat.o + SRC_PATH_NAME $(PRJ_DIR)/../../txn/txn_stat.c +} + +Module txn_util.o { + + NAME txn_util.o + SRC_PATH_NAME $(PRJ_DIR)/../../txn/txn_util.c +} + +Module xa.o { + + NAME xa.o + SRC_PATH_NAME $(PRJ_DIR)/../../xa/xa.c +} + +Module xa_db.o { + + NAME xa_db.o + SRC_PATH_NAME $(PRJ_DIR)/../../xa/xa_db.c +} + +Module xa_map.o { + + NAME xa_map.o + SRC_PATH_NAME $(PRJ_DIR)/../../xa/xa_map.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/BerkeleyDB/component.wpj b/bdb/build_vxworks/BerkeleyDB/component.wpj new file mode 100755 index 00000000000..3207bb293e8 --- /dev/null +++ b/bdb/build_vxworks/BerkeleyDB/component.wpj @@ -0,0 +1,6764 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.0 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_compare.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_compare.c_objects +bt_compare.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_compare.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_conv.c_objects +bt_conv.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_conv.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_curadj.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_curadj.c_objects +bt_curadj.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_curadj.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_cursor.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_cursor.c_objects +bt_cursor.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_cursor.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_delete.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_delete.c_objects +bt_delete.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_delete.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_method.c_objects +bt_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_open.c_objects +bt_open.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_put.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_put.c_objects +bt_put.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_put.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rec.c_objects +bt_rec.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_reclaim.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_reclaim.c_objects +bt_reclaim.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_reclaim.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_recno.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_recno.c_objects +bt_recno.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_recno.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rsearch.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rsearch.c_objects +bt_rsearch.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rsearch.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_search.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_search.c_objects +bt_search.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_search.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_split.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_split.c_objects +bt_split.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_split.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_stat.c_objects +bt_stat.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_upgrade.c_objects +bt_upgrade.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_upgrade.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_verify.c_objects +bt_verify.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_verify.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/btree_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/btree_auto.c_objects +btree_auto.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../btree/btree_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/getopt.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/getopt.c_objects +getopt.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/getopt.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/snprintf.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/snprintf.c_objects +snprintf.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/snprintf.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/strcasecmp.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/strcasecmp.c_objects +strcasecmp.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/strcasecmp.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/strdup.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/strdup.c_objects +strdup.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/strdup.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/vsnprintf.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/vsnprintf.c_objects +vsnprintf.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../clib/vsnprintf.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_byteorder.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_byteorder.c_objects +db_byteorder.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_byteorder.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_err.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_err.c_objects +db_err.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_err.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_getlong.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_getlong.c_objects +db_getlong.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_getlong.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_idspace.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_idspace.c_objects +db_idspace.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_idspace.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_log2.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_log2.c_objects +db_log2.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/db_log2.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_arg.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_arg.c_objects +util_arg.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_arg.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_cache.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_cache.c_objects +util_cache.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_cache.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_log.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_log.c_objects +util_log.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_log.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_sig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_sig.c_objects +util_sig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../common/util_sig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_auto.c_objects +crdel_auto.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_rec.c_objects +crdel_rec.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db.c_objects +db.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_am.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_am.c_objects +db_am.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_am.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_auto.c_objects +db_auto.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_cam.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_cam.c_objects +db_cam.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_cam.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_conv.c_objects +db_conv.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_conv.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_dispatch.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_dispatch.c_objects +db_dispatch.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_dispatch.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_dup.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_dup.c_objects +db_dup.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_dup.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_iface.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_iface.c_objects +db_iface.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_iface.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_join.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_join.c_objects +db_join.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_join.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_meta.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_meta.c_objects +db_meta.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_meta.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_method.c_objects +db_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_open.c_objects +db_open.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_overflow.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_overflow.c_objects +db_overflow.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_overflow.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_pr.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_pr.c_objects +db_pr.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_pr.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_rec.c_objects +db_rec.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_reclaim.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_reclaim.c_objects +db_reclaim.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_reclaim.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_remove.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_remove.c_objects +db_remove.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_remove.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_rename.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_rename.c_objects +db_rename.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_rename.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_ret.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_ret.c_objects +db_ret.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_ret.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_truncate.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_truncate.c_objects +db_truncate.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_truncate.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg.c_objects +db_upg.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg_opd.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg_opd.c_objects +db_upg_opd.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg_opd.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfy.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfy.c_objects +db_vrfy.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfy.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfyutil.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfyutil.c_objects +db_vrfyutil.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfyutil.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg.c_objects +dbreg.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_auto.c_objects +dbreg_auto.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_rec.c_objects +dbreg_rec.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_util.c_objects +dbreg_util.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/db_salloc.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/db_salloc.c_objects +db_salloc.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/db_salloc.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/db_shash.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/db_shash.c_objects +db_shash.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/db_shash.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_file.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_file.c_objects +env_file.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_file.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_method.c_objects +env_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_open.c_objects +env_open.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_recover.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_recover.c_objects +env_recover.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_recover.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_region.c_objects +env_region.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../env/env_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fileops_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fileops_auto.c_objects +fileops_auto.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fileops_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_basic.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_basic.c_objects +fop_basic.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_basic.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_rec.c_objects +fop_rec.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_util.c_objects +fop_util.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash.c_objects +hash.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_auto.c_objects +hash_auto.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_conv.c_objects +hash_conv.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_conv.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_dup.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_dup.c_objects +hash_dup.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_dup.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_func.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_func.c_objects +hash_func.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_func.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_meta.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_meta.c_objects +hash_meta.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_meta.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_method.c_objects +hash_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_open.c_objects +hash_open.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_page.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_page.c_objects +hash_page.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_page.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_rec.c_objects +hash_rec.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_reclaim.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_reclaim.c_objects +hash_reclaim.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_reclaim.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_stat.c_objects +hash_stat.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_upgrade.c_objects +hash_upgrade.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_upgrade.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_verify.c_objects +hash_verify.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_verify.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hmac/hmac.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hmac/hmac.c_objects +hmac.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hmac/hmac.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hmac/sha1.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hmac/sha1.c_objects +sha1.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hmac/sha1.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hsearch/hsearch.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hsearch/hsearch.c_objects +hsearch.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../hsearch/hsearch.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock.c_objects +lock.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_deadlock.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_deadlock.c_objects +lock_deadlock.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_deadlock.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_method.c_objects +lock_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_region.c_objects +lock_region.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_stat.c_objects +lock_stat.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_util.c_objects +lock_util.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log.c_objects +log.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_archive.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_archive.c_objects +log_archive.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_archive.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_compare.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_compare.c_objects +log_compare.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_compare.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_get.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_get.c_objects +log_get.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_get.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_method.c_objects +log_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_put.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_put.c_objects +log_put.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../log/log_put.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_alloc.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_alloc.c_objects +mp_alloc.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_alloc.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_bh.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_bh.c_objects +mp_bh.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_bh.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fget.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fget.c_objects +mp_fget.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fget.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fopen.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fopen.c_objects +mp_fopen.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fopen.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fput.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fput.c_objects +mp_fput.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fput.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fset.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fset.c_objects +mp_fset.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fset.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_method.c_objects +mp_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_region.c_objects +mp_region.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_register.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_register.c_objects +mp_register.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_register.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_stat.c_objects +mp_stat.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_sync.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_sync.c_objects +mp_sync.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_sync.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_trickle.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_trickle.c_objects +mp_trickle.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_trickle.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mutex/mut_tas.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mutex/mut_tas.c_objects +mut_tas.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mutex/mut_tas.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mutex/mutex.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mutex/mutex.c_objects +mutex.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../mutex/mutex.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_alloc.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_alloc.c_objects +os_alloc.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_alloc.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_clock.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_clock.c_objects +os_clock.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_clock.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_dir.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_dir.c_objects +os_dir.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_dir.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_errno.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_errno.c_objects +os_errno.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_errno.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_fid.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_fid.c_objects +os_fid.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_fid.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_fsync.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_fsync.c_objects +os_fsync.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_fsync.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_handle.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_handle.c_objects +os_handle.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_handle.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_id.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_id.c_objects +os_id.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_id.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_method.c_objects +os_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_oflags.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_oflags.c_objects +os_oflags.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_oflags.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_open.c_objects +os_open.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_region.c_objects +os_region.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_rename.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_rename.c_objects +os_rename.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_rename.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_root.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_root.c_objects +os_root.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_root.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_rpath.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_rpath.c_objects +os_rpath.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_rpath.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_rw.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_rw.c_objects +os_rw.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_rw.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_seek.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_seek.c_objects +os_seek.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_seek.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_sleep.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_sleep.c_objects +os_sleep.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_sleep.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_spin.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_spin.c_objects +os_spin.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_spin.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_stat.c_objects +os_stat.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_tmpdir.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_tmpdir.c_objects +os_tmpdir.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_tmpdir.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_unlink.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_unlink.c_objects +os_unlink.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os/os_unlink.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_abs.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_abs.c_objects +os_vx_abs.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_abs.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_config.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_config.c_objects +os_vx_config.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_config.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_map.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_map.c_objects +os_vx_map.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_map.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam.c_objects +qam.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_auto.c_objects +qam_auto.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_conv.c_objects +qam_conv.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_conv.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_files.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_files.c_objects +qam_files.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_files.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_method.c_objects +qam_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_open.c_objects +qam_open.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_rec.c_objects +qam_rec.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_stat.c_objects +qam_stat.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_upgrade.c_objects +qam_upgrade.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_upgrade.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_verify.c_objects +qam_verify.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_verify.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_method.c_objects +rep_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_record.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_record.c_objects +rep_record.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_record.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_region.c_objects +rep_region.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_util.c_objects +rep_util.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/client.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/client.c_objects +client.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/client.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/db_server_clnt.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/db_server_clnt.c_objects +db_server_clnt.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/db_server_clnt.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client.c_objects +gen_client.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client_ret.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client_ret.c_objects +gen_client_ret.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client_ret.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c_objects +db_server_xdr.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn.c_objects +txn.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_auto.c_objects +txn_auto.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_method.c_objects +txn_method.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_rec.c_objects +txn_rec.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_recover.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_recover.c_objects +txn_recover.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_recover.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_region.c_objects +txn_region.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_stat.c_objects +txn_stat.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_util.c_objects +txn_util.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../xa/xa.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../xa/xa.c_objects +xa.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../xa/xa.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_db.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_db.c_objects +xa_db.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_db.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_map.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_map.c_objects +xa_map.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_map.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 \ + -I$(PRJ_DIR)/.. \ + -I$(PRJ_DIR)/../.. \ + -DDEBUG \ + -DDIAGNOSTIC + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_compare.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_compare.c_objects +bt_compare.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_compare.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_conv.c_objects +bt_conv.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_conv.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_curadj.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_curadj.c_objects +bt_curadj.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_curadj.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_cursor.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_cursor.c_objects +bt_cursor.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_cursor.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_delete.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_delete.c_objects +bt_delete.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_delete.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_method.c_objects +bt_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_open.c_objects +bt_open.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_put.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_put.c_objects +bt_put.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_put.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_rec.c_objects +bt_rec.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_reclaim.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_reclaim.c_objects +bt_reclaim.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_reclaim.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_recno.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_recno.c_objects +bt_recno.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_recno.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_rsearch.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_rsearch.c_objects +bt_rsearch.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_rsearch.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_search.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_search.c_objects +bt_search.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_search.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_split.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_split.c_objects +bt_split.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_split.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_stat.c_objects +bt_stat.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_upgrade.c_objects +bt_upgrade.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_upgrade.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_verify.c_objects +bt_verify.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/bt_verify.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/btree_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/btree_auto.c_objects +btree_auto.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../btree/btree_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/getopt.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/getopt.c_objects +getopt.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/getopt.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/snprintf.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/snprintf.c_objects +snprintf.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/snprintf.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/strcasecmp.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/strcasecmp.c_objects +strcasecmp.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/strcasecmp.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/strdup.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/strdup.c_objects +strdup.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/strdup.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/vsnprintf.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/vsnprintf.c_objects +vsnprintf.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../clib/vsnprintf.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_byteorder.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_byteorder.c_objects +db_byteorder.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_byteorder.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_err.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_err.c_objects +db_err.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_err.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_getlong.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_getlong.c_objects +db_getlong.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_getlong.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_idspace.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_idspace.c_objects +db_idspace.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_idspace.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_log2.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_log2.c_objects +db_log2.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/db_log2.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_arg.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_arg.c_objects +util_arg.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_arg.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_cache.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_cache.c_objects +util_cache.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_cache.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_log.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_log.c_objects +util_log.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_log.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_sig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_sig.c_objects +util_sig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../common/util_sig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/crdel_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/crdel_auto.c_objects +crdel_auto.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/crdel_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/crdel_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/crdel_rec.c_objects +crdel_rec.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/crdel_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db.c_objects +db.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_am.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_am.c_objects +db_am.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_am.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_auto.c_objects +db_auto.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_cam.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_cam.c_objects +db_cam.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_cam.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_conv.c_objects +db_conv.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_conv.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_dispatch.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_dispatch.c_objects +db_dispatch.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_dispatch.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_dup.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_dup.c_objects +db_dup.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_dup.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_iface.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_iface.c_objects +db_iface.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_iface.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_join.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_join.c_objects +db_join.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_join.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_meta.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_meta.c_objects +db_meta.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_meta.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_method.c_objects +db_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_open.c_objects +db_open.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_overflow.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_overflow.c_objects +db_overflow.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_overflow.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_pr.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_pr.c_objects +db_pr.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_pr.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_rec.c_objects +db_rec.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_reclaim.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_reclaim.c_objects +db_reclaim.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_reclaim.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_remove.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_remove.c_objects +db_remove.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_remove.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_rename.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_rename.c_objects +db_rename.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_rename.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_ret.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_ret.c_objects +db_ret.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_ret.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_truncate.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_truncate.c_objects +db_truncate.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_truncate.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_upg.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_upg.c_objects +db_upg.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_upg.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_upg_opd.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_upg_opd.c_objects +db_upg_opd.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_upg_opd.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_vrfy.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_vrfy.c_objects +db_vrfy.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_vrfy.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_vrfyutil.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_vrfyutil.c_objects +db_vrfyutil.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../db/db_vrfyutil.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg.c_objects +dbreg.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg_auto.c_objects +dbreg_auto.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg_rec.c_objects +dbreg_rec.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg_util.c_objects +dbreg_util.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../dbreg/dbreg_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/db_salloc.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/db_salloc.c_objects +db_salloc.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/db_salloc.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/db_shash.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/db_shash.c_objects +db_shash.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/db_shash.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_file.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_file.c_objects +env_file.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_file.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_method.c_objects +env_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_open.c_objects +env_open.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_recover.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_recover.c_objects +env_recover.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_recover.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_region.c_objects +env_region.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../env/env_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fileops_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fileops_auto.c_objects +fileops_auto.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fileops_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fop_basic.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fop_basic.c_objects +fop_basic.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fop_basic.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fop_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fop_rec.c_objects +fop_rec.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fop_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fop_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fop_util.c_objects +fop_util.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../fileops/fop_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash.c_objects +hash.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_auto.c_objects +hash_auto.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_conv.c_objects +hash_conv.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_conv.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_dup.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_dup.c_objects +hash_dup.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_dup.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_func.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_func.c_objects +hash_func.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_func.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_meta.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_meta.c_objects +hash_meta.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_meta.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_method.c_objects +hash_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_open.c_objects +hash_open.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_page.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_page.c_objects +hash_page.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_page.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_rec.c_objects +hash_rec.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_reclaim.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_reclaim.c_objects +hash_reclaim.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_reclaim.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_stat.c_objects +hash_stat.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_upgrade.c_objects +hash_upgrade.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_upgrade.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_verify.c_objects +hash_verify.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hash/hash_verify.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hmac/hmac.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hmac/hmac.c_objects +hmac.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hmac/hmac.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hmac/sha1.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hmac/sha1.c_objects +sha1.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hmac/sha1.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hsearch/hsearch.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hsearch/hsearch.c_objects +hsearch.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../hsearch/hsearch.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock.c_objects +lock.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_deadlock.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_deadlock.c_objects +lock_deadlock.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_deadlock.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_method.c_objects +lock_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_region.c_objects +lock_region.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_stat.c_objects +lock_stat.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_util.c_objects +lock_util.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../lock/lock_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log.c_objects +log.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_archive.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_archive.c_objects +log_archive.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_archive.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_compare.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_compare.c_objects +log_compare.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_compare.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_get.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_get.c_objects +log_get.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_get.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_method.c_objects +log_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_put.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_put.c_objects +log_put.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../log/log_put.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_alloc.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_alloc.c_objects +mp_alloc.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_alloc.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_bh.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_bh.c_objects +mp_bh.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_bh.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fget.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fget.c_objects +mp_fget.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fget.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fopen.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fopen.c_objects +mp_fopen.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fopen.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fput.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fput.c_objects +mp_fput.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fput.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fset.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fset.c_objects +mp_fset.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_fset.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_method.c_objects +mp_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_region.c_objects +mp_region.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_register.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_register.c_objects +mp_register.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_register.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_stat.c_objects +mp_stat.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_sync.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_sync.c_objects +mp_sync.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_sync.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_trickle.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_trickle.c_objects +mp_trickle.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mp/mp_trickle.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mutex/mut_tas.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mutex/mut_tas.c_objects +mut_tas.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mutex/mut_tas.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mutex/mutex.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mutex/mutex.c_objects +mutex.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../mutex/mutex.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_alloc.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_alloc.c_objects +os_alloc.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_alloc.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_clock.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_clock.c_objects +os_clock.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_clock.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_dir.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_dir.c_objects +os_dir.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_dir.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_errno.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_errno.c_objects +os_errno.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_errno.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_fid.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_fid.c_objects +os_fid.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_fid.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_fsync.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_fsync.c_objects +os_fsync.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_fsync.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_handle.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_handle.c_objects +os_handle.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_handle.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_id.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_id.c_objects +os_id.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_id.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_method.c_objects +os_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_oflags.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_oflags.c_objects +os_oflags.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_oflags.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_open.c_objects +os_open.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_region.c_objects +os_region.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_rename.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_rename.c_objects +os_rename.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_rename.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_root.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_root.c_objects +os_root.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_root.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_rpath.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_rpath.c_objects +os_rpath.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_rpath.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_rw.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_rw.c_objects +os_rw.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_rw.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_seek.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_seek.c_objects +os_seek.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_seek.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_sleep.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_sleep.c_objects +os_sleep.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_sleep.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_spin.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_spin.c_objects +os_spin.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_spin.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_stat.c_objects +os_stat.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_tmpdir.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_tmpdir.c_objects +os_tmpdir.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_tmpdir.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_unlink.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_unlink.c_objects +os_unlink.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os/os_unlink.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_abs.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_abs.c_objects +os_vx_abs.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_abs.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_config.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_config.c_objects +os_vx_config.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_config.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_map.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_map.c_objects +os_vx_map.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_map.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam.c_objects +qam.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_auto.c_objects +qam_auto.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_conv.c_objects +qam_conv.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_conv.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_files.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_files.c_objects +qam_files.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_files.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_method.c_objects +qam_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_open.c_objects +qam_open.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_open.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_rec.c_objects +qam_rec.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_stat.c_objects +qam_stat.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_upgrade.c_objects +qam_upgrade.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_upgrade.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_verify.c_objects +qam_verify.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../qam/qam_verify.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_method.c_objects +rep_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_record.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_record.c_objects +rep_record.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_record.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_region.c_objects +rep_region.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_util.c_objects +rep_util.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rep/rep_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/client.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/client.c_objects +client.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/client.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/db_server_clnt.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/db_server_clnt.c_objects +db_server_clnt.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/db_server_clnt.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/gen_client.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/gen_client.c_objects +gen_client.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/gen_client.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/gen_client_ret.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/gen_client_ret.c_objects +gen_client_ret.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_client/gen_client_ret.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c_objects +db_server_xdr.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn.c_objects +txn.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_auto.c_objects +txn_auto.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_auto.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_method.c_objects +txn_method.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_method.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_rec.c_objects +txn_rec.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_rec.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_recover.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_recover.c_objects +txn_recover.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_recover.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_region.c_objects +txn_region.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_region.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_stat.c_objects +txn_stat.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_util.c_objects +txn_util.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../txn/txn_util.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../xa/xa.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../xa/xa.c_objects +xa.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../xa/xa.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../xa/xa_db.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../xa/xa_db.c_objects +xa_db.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../xa/xa_db.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../xa/xa_map.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../xa/xa_map.c_objects +xa_map.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../../xa/xa_map.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 \ + -I$(PRJ_DIR)/.. \ + -I$(PRJ_DIR)/../.. + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_compare.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_compare.c_objects +bt_compare.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_compare.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_conv.c_objects +bt_conv.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_conv.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_curadj.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_curadj.c_objects +bt_curadj.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_curadj.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_cursor.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_cursor.c_objects +bt_cursor.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_cursor.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_delete.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_delete.c_objects +bt_delete.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_delete.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_method.c_objects +bt_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_open.c_objects +bt_open.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_open.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_put.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_put.c_objects +bt_put.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_put.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rec.c_objects +bt_rec.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rec.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_reclaim.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_reclaim.c_objects +bt_reclaim.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_reclaim.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_recno.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_recno.c_objects +bt_recno.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_recno.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rsearch.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rsearch.c_objects +bt_rsearch.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_rsearch.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_search.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_search.c_objects +bt_search.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_search.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_split.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_split.c_objects +bt_split.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_split.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_stat.c_objects +bt_stat.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_stat.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_upgrade.c_objects +bt_upgrade.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_upgrade.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_verify.c_objects +bt_verify.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/bt_verify.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/btree_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/btree_auto.c_objects +btree_auto.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../btree/btree_auto.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/getopt.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/getopt.c_objects +getopt.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/getopt.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/snprintf.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/snprintf.c_objects +snprintf.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/snprintf.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/strcasecmp.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/strcasecmp.c_objects +strcasecmp.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/strcasecmp.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/strdup.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/strdup.c_objects +strdup.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/strdup.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/vsnprintf.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/vsnprintf.c_objects +vsnprintf.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../clib/vsnprintf.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_byteorder.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_byteorder.c_objects +db_byteorder.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_byteorder.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_err.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_err.c_objects +db_err.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_err.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_getlong.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_getlong.c_objects +db_getlong.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_getlong.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_idspace.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_idspace.c_objects +db_idspace.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_idspace.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_log2.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_log2.c_objects +db_log2.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/db_log2.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_arg.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_arg.c_objects +util_arg.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_arg.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_cache.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_cache.c_objects +util_cache.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_cache.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_log.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_log.c_objects +util_log.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_log.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_sig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_sig.c_objects +util_sig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../common/util_sig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_auto.c_objects +crdel_auto.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_auto.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_rec.c_objects +crdel_rec.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/crdel_rec.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db.c_objects +db.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_am.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_am.c_objects +db_am.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_am.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_auto.c_objects +db_auto.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_auto.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_cam.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_cam.c_objects +db_cam.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_cam.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_conv.c_objects +db_conv.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_conv.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_dispatch.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_dispatch.c_objects +db_dispatch.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_dispatch.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_dup.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_dup.c_objects +db_dup.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_dup.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_iface.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_iface.c_objects +db_iface.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_iface.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_join.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_join.c_objects +db_join.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_join.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_meta.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_meta.c_objects +db_meta.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_meta.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_method.c_objects +db_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_open.c_objects +db_open.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_open.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_overflow.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_overflow.c_objects +db_overflow.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_overflow.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_pr.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_pr.c_objects +db_pr.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_pr.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_rec.c_objects +db_rec.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_rec.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_reclaim.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_reclaim.c_objects +db_reclaim.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_reclaim.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_remove.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_remove.c_objects +db_remove.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_remove.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_rename.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_rename.c_objects +db_rename.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_rename.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_ret.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_ret.c_objects +db_ret.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_ret.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_truncate.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_truncate.c_objects +db_truncate.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_truncate.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg.c_objects +db_upg.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg_opd.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg_opd.c_objects +db_upg_opd.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_upg_opd.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfy.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfy.c_objects +db_vrfy.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfy.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfyutil.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfyutil.c_objects +db_vrfyutil.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../db/db_vrfyutil.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg.c_objects +dbreg.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_auto.c_objects +dbreg_auto.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_auto.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_rec.c_objects +dbreg_rec.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_rec.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_util.c_objects +dbreg_util.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../dbreg/dbreg_util.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/db_salloc.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/db_salloc.c_objects +db_salloc.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/db_salloc.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/db_shash.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/db_shash.c_objects +db_shash.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/db_shash.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_file.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_file.c_objects +env_file.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_file.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_method.c_objects +env_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_open.c_objects +env_open.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_open.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_recover.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_recover.c_objects +env_recover.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_recover.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_region.c_objects +env_region.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../env/env_region.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fileops_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fileops_auto.c_objects +fileops_auto.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fileops_auto.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_basic.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_basic.c_objects +fop_basic.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_basic.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_rec.c_objects +fop_rec.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_rec.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_util.c_objects +fop_util.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../fileops/fop_util.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash.c_objects +hash.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_auto.c_objects +hash_auto.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_auto.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_conv.c_objects +hash_conv.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_conv.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_dup.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_dup.c_objects +hash_dup.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_dup.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_func.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_func.c_objects +hash_func.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_func.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_meta.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_meta.c_objects +hash_meta.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_meta.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_method.c_objects +hash_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_open.c_objects +hash_open.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_open.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_page.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_page.c_objects +hash_page.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_page.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_rec.c_objects +hash_rec.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_rec.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_reclaim.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_reclaim.c_objects +hash_reclaim.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_reclaim.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_stat.c_objects +hash_stat.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_stat.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_upgrade.c_objects +hash_upgrade.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_upgrade.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_verify.c_objects +hash_verify.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hash/hash_verify.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hmac/hmac.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hmac/hmac.c_objects +hmac.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hmac/hmac.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hmac/sha1.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hmac/sha1.c_objects +sha1.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hmac/sha1.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hsearch/hsearch.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hsearch/hsearch.c_objects +hsearch.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../hsearch/hsearch.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock.c_objects +lock.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_deadlock.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_deadlock.c_objects +lock_deadlock.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_deadlock.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_method.c_objects +lock_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_region.c_objects +lock_region.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_region.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_stat.c_objects +lock_stat.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_stat.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_util.c_objects +lock_util.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../lock/lock_util.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log.c_objects +log.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_archive.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_archive.c_objects +log_archive.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_archive.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_compare.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_compare.c_objects +log_compare.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_compare.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_get.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_get.c_objects +log_get.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_get.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_method.c_objects +log_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_put.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_put.c_objects +log_put.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../log/log_put.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_alloc.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_alloc.c_objects +mp_alloc.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_alloc.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_bh.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_bh.c_objects +mp_bh.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_bh.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fget.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fget.c_objects +mp_fget.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fget.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fopen.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fopen.c_objects +mp_fopen.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fopen.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fput.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fput.c_objects +mp_fput.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fput.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fset.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fset.c_objects +mp_fset.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_fset.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_method.c_objects +mp_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_region.c_objects +mp_region.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_region.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_register.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_register.c_objects +mp_register.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_register.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_stat.c_objects +mp_stat.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_stat.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_sync.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_sync.c_objects +mp_sync.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_sync.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_trickle.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_trickle.c_objects +mp_trickle.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mp/mp_trickle.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mutex/mut_tas.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mutex/mut_tas.c_objects +mut_tas.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mutex/mut_tas.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mutex/mutex.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mutex/mutex.c_objects +mutex.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../mutex/mutex.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_alloc.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_alloc.c_objects +os_alloc.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_alloc.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_clock.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_clock.c_objects +os_clock.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_clock.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_dir.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_dir.c_objects +os_dir.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_dir.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_errno.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_errno.c_objects +os_errno.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_errno.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_fid.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_fid.c_objects +os_fid.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_fid.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_fsync.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_fsync.c_objects +os_fsync.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_fsync.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_handle.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_handle.c_objects +os_handle.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_handle.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_id.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_id.c_objects +os_id.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_id.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_method.c_objects +os_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_oflags.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_oflags.c_objects +os_oflags.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_oflags.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_open.c_objects +os_open.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_open.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_region.c_objects +os_region.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_region.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_rename.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_rename.c_objects +os_rename.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_rename.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_root.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_root.c_objects +os_root.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_root.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_rpath.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_rpath.c_objects +os_rpath.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_rpath.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_rw.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_rw.c_objects +os_rw.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_rw.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_seek.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_seek.c_objects +os_seek.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_seek.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_sleep.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_sleep.c_objects +os_sleep.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_sleep.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_spin.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_spin.c_objects +os_spin.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_spin.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_stat.c_objects +os_stat.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_stat.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_tmpdir.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_tmpdir.c_objects +os_tmpdir.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_tmpdir.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_unlink.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_unlink.c_objects +os_unlink.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os/os_unlink.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_abs.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_abs.c_objects +os_vx_abs.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_abs.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_config.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_config.c_objects +os_vx_config.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_config.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_map.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_map.c_objects +os_vx_map.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../os_vxworks/os_vx_map.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam.c_objects +qam.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_auto.c_objects +qam_auto.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_auto.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_conv.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_conv.c_objects +qam_conv.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_conv.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_files.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_files.c_objects +qam_files.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_files.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_method.c_objects +qam_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_open.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_open.c_objects +qam_open.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_open.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_rec.c_objects +qam_rec.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_rec.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_stat.c_objects +qam_stat.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_stat.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_upgrade.c_objects +qam_upgrade.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_upgrade.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_verify.c_objects +qam_verify.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../qam/qam_verify.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_method.c_objects +rep_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_record.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_record.c_objects +rep_record.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_record.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_region.c_objects +rep_region.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_region.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_util.c_objects +rep_util.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rep/rep_util.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/client.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/client.c_objects +client.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/client.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/db_server_clnt.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/db_server_clnt.c_objects +db_server_clnt.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/db_server_clnt.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client.c_objects +gen_client.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client_ret.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client_ret.c_objects +gen_client_ret.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_client/gen_client_ret.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c_objects +db_server_xdr.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn.c_objects +txn.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_auto.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_auto.c_objects +txn_auto.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_auto.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_method.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_method.c_objects +txn_method.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_method.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_rec.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_rec.c_objects +txn_rec.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_rec.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_recover.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_recover.c_objects +txn_recover.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_recover.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_region.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_region.c_objects +txn_region.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_region.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_stat.c_objects +txn_stat.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_stat.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_util.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_util.c_objects +txn_util.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../txn/txn_util.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../xa/xa.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../xa/xa.c_objects +xa.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../xa/xa.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_db.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_db.c_objects +xa_db.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_db.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_map.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_map.c_objects +xa_map.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../../xa/xa_map.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM \ + -I$(PRJ_DIR)/.. \ + -I$(PRJ_DIR)/../.. \ + -DDEBUG \ + -DDIAGNOSTIC + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUMgnu.debug PENTIUM2gnu.debug PENTIUM2gnu.release + + + COMPONENT_COM_TYPE + + + + PROJECT_FILES +$(PRJ_DIR)/../../btree/bt_compare.c \ + $(PRJ_DIR)/../../btree/bt_conv.c \ + $(PRJ_DIR)/../../btree/bt_curadj.c \ + $(PRJ_DIR)/../../btree/bt_cursor.c \ + $(PRJ_DIR)/../../btree/bt_delete.c \ + $(PRJ_DIR)/../../btree/bt_method.c \ + $(PRJ_DIR)/../../btree/bt_open.c \ + $(PRJ_DIR)/../../btree/bt_put.c \ + $(PRJ_DIR)/../../btree/bt_rec.c \ + $(PRJ_DIR)/../../btree/bt_reclaim.c \ + $(PRJ_DIR)/../../btree/bt_recno.c \ + $(PRJ_DIR)/../../btree/bt_rsearch.c \ + $(PRJ_DIR)/../../btree/bt_search.c \ + $(PRJ_DIR)/../../btree/bt_split.c \ + $(PRJ_DIR)/../../btree/bt_stat.c \ + $(PRJ_DIR)/../../btree/bt_upgrade.c \ + $(PRJ_DIR)/../../btree/bt_verify.c \ + $(PRJ_DIR)/../../btree/btree_auto.c \ + $(PRJ_DIR)/../../clib/getopt.c \ + $(PRJ_DIR)/../../clib/snprintf.c \ + $(PRJ_DIR)/../../clib/strcasecmp.c \ + $(PRJ_DIR)/../../clib/strdup.c \ + $(PRJ_DIR)/../../clib/vsnprintf.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/util_arg.c \ + $(PRJ_DIR)/../../common/util_cache.c \ + $(PRJ_DIR)/../../common/util_log.c \ + $(PRJ_DIR)/../../common/util_sig.c \ + $(PRJ_DIR)/../../db/crdel_auto.c \ + $(PRJ_DIR)/../../db/crdel_rec.c \ + $(PRJ_DIR)/../../db/db.c \ + $(PRJ_DIR)/../../db/db_am.c \ + $(PRJ_DIR)/../../db/db_auto.c \ + $(PRJ_DIR)/../../db/db_cam.c \ + $(PRJ_DIR)/../../db/db_conv.c \ + $(PRJ_DIR)/../../db/db_dispatch.c \ + $(PRJ_DIR)/../../db/db_dup.c \ + $(PRJ_DIR)/../../db/db_iface.c \ + $(PRJ_DIR)/../../db/db_join.c \ + $(PRJ_DIR)/../../db/db_meta.c \ + $(PRJ_DIR)/../../db/db_method.c \ + $(PRJ_DIR)/../../db/db_open.c \ + $(PRJ_DIR)/../../db/db_overflow.c \ + $(PRJ_DIR)/../../db/db_pr.c \ + $(PRJ_DIR)/../../db/db_rec.c \ + $(PRJ_DIR)/../../db/db_reclaim.c \ + $(PRJ_DIR)/../../db/db_remove.c \ + $(PRJ_DIR)/../../db/db_rename.c \ + $(PRJ_DIR)/../../db/db_ret.c \ + $(PRJ_DIR)/../../db/db_truncate.c \ + $(PRJ_DIR)/../../db/db_upg.c \ + $(PRJ_DIR)/../../db/db_upg_opd.c \ + $(PRJ_DIR)/../../db/db_vrfy.c \ + $(PRJ_DIR)/../../db/db_vrfyutil.c \ + $(PRJ_DIR)/../../dbreg/dbreg.c \ + $(PRJ_DIR)/../../dbreg/dbreg_auto.c \ + $(PRJ_DIR)/../../dbreg/dbreg_rec.c \ + $(PRJ_DIR)/../../dbreg/dbreg_util.c \ + $(PRJ_DIR)/../../env/db_salloc.c \ + $(PRJ_DIR)/../../env/db_shash.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)/../../fileops/fileops_auto.c \ + $(PRJ_DIR)/../../fileops/fop_basic.c \ + $(PRJ_DIR)/../../fileops/fop_rec.c \ + $(PRJ_DIR)/../../fileops/fop_util.c \ + $(PRJ_DIR)/../../hash/hash.c \ + $(PRJ_DIR)/../../hash/hash_auto.c \ + $(PRJ_DIR)/../../hash/hash_conv.c \ + $(PRJ_DIR)/../../hash/hash_dup.c \ + $(PRJ_DIR)/../../hash/hash_func.c \ + $(PRJ_DIR)/../../hash/hash_meta.c \ + $(PRJ_DIR)/../../hash/hash_method.c \ + $(PRJ_DIR)/../../hash/hash_open.c \ + $(PRJ_DIR)/../../hash/hash_page.c \ + $(PRJ_DIR)/../../hash/hash_rec.c \ + $(PRJ_DIR)/../../hash/hash_reclaim.c \ + $(PRJ_DIR)/../../hash/hash_stat.c \ + $(PRJ_DIR)/../../hash/hash_upgrade.c \ + $(PRJ_DIR)/../../hash/hash_verify.c \ + $(PRJ_DIR)/../../hmac/hmac.c \ + $(PRJ_DIR)/../../hmac/sha1.c \ + $(PRJ_DIR)/../../hsearch/hsearch.c \ + $(PRJ_DIR)/../../lock/lock.c \ + $(PRJ_DIR)/../../lock/lock_deadlock.c \ + $(PRJ_DIR)/../../lock/lock_method.c \ + $(PRJ_DIR)/../../lock/lock_region.c \ + $(PRJ_DIR)/../../lock/lock_stat.c \ + $(PRJ_DIR)/../../lock/lock_util.c \ + $(PRJ_DIR)/../../log/log.c \ + $(PRJ_DIR)/../../log/log_archive.c \ + $(PRJ_DIR)/../../log/log_compare.c \ + $(PRJ_DIR)/../../log/log_get.c \ + $(PRJ_DIR)/../../log/log_method.c \ + $(PRJ_DIR)/../../log/log_put.c \ + $(PRJ_DIR)/../../mp/mp_alloc.c \ + $(PRJ_DIR)/../../mp/mp_bh.c \ + $(PRJ_DIR)/../../mp/mp_fget.c \ + $(PRJ_DIR)/../../mp/mp_fopen.c \ + $(PRJ_DIR)/../../mp/mp_fput.c \ + $(PRJ_DIR)/../../mp/mp_fset.c \ + $(PRJ_DIR)/../../mp/mp_method.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_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_fsync.c \ + $(PRJ_DIR)/../../os/os_handle.c \ + $(PRJ_DIR)/../../os/os_id.c \ + $(PRJ_DIR)/../../os/os_method.c \ + $(PRJ_DIR)/../../os/os_oflags.c \ + $(PRJ_DIR)/../../os/os_open.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 \ + $(PRJ_DIR)/../../os/os_spin.c \ + $(PRJ_DIR)/../../os/os_stat.c \ + $(PRJ_DIR)/../../os/os_tmpdir.c \ + $(PRJ_DIR)/../../os/os_unlink.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)/../../qam/qam.c \ + $(PRJ_DIR)/../../qam/qam_auto.c \ + $(PRJ_DIR)/../../qam/qam_conv.c \ + $(PRJ_DIR)/../../qam/qam_files.c \ + $(PRJ_DIR)/../../qam/qam_method.c \ + $(PRJ_DIR)/../../qam/qam_open.c \ + $(PRJ_DIR)/../../qam/qam_rec.c \ + $(PRJ_DIR)/../../qam/qam_stat.c \ + $(PRJ_DIR)/../../qam/qam_upgrade.c \ + $(PRJ_DIR)/../../qam/qam_verify.c \ + $(PRJ_DIR)/../../rep/rep_method.c \ + $(PRJ_DIR)/../../rep/rep_record.c \ + $(PRJ_DIR)/../../rep/rep_region.c \ + $(PRJ_DIR)/../../rep/rep_util.c \ + $(PRJ_DIR)/../../rpc_client/client.c \ + $(PRJ_DIR)/../../rpc_client/db_server_clnt.c \ + $(PRJ_DIR)/../../rpc_client/gen_client.c \ + $(PRJ_DIR)/../../rpc_client/gen_client_ret.c \ + $(PRJ_DIR)/../../rpc_server/c/db_server_xdr.c \ + $(PRJ_DIR)/../../txn/txn.c \ + $(PRJ_DIR)/../../txn/txn_auto.c \ + $(PRJ_DIR)/../../txn/txn_method.c \ + $(PRJ_DIR)/../../txn/txn_rec.c \ + $(PRJ_DIR)/../../txn/txn_recover.c \ + $(PRJ_DIR)/../../txn/txn_region.c \ + $(PRJ_DIR)/../../txn/txn_stat.c \ + $(PRJ_DIR)/../../txn/txn_util.c \ + $(PRJ_DIR)/../../xa/xa.c \ + $(PRJ_DIR)/../../xa/xa_db.c \ + $(PRJ_DIR)/../../xa/xa_map.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUMgnu.debug + + + WCC__LIST +PENTIUMgnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_archive/db_archive.c b/bdb/build_vxworks/db_archive/db_archive.c new file mode 100644 index 00000000000..5e43f32cd8e --- /dev/null +++ b/bdb/build_vxworks/db_archive/db_archive.c @@ -0,0 +1,195 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_archive.c,v 11.36 2002/03/28 20:13:34 bostic Exp $"; +#endif + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include +#include +#include +#include +#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(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_archive", args, &argc, &argv); + return (db_archive_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_archive_main(argc, argv) + int argc; + char *argv[]; +{ + extern char *optarg; + extern int optind, __db_getopt_reset; + const char *progname = "db_archive"; + DB_ENV *dbenv; + u_int32_t flags; + int ch, e_close, exitval, ret, verbose; + char **file, *home, **list, *passwd; + + if ((ret = db_archive_version_check(progname)) != 0) + return (ret); + + flags = 0; + e_close = exitval = verbose = 0; + home = passwd = NULL; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "ah:lP:sVv")) != EOF) + switch (ch) { + case 'a': + LF_SET(DB_ARCH_ABS); + break; + case 'h': + home = optarg; + break; + case 'l': + LF_SET(DB_ARCH_LOG); + 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 's': + LF_SET(DB_ARCH_DATA); + break; + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case 'v': + verbose = 1; + break; + case '?': + default: + return (db_archive_usage()); + } + argc -= optind; + argv += optind; + + if (argc != 0) + return (db_archive_usage()); + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* + * 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)); + goto shutdown; + } + e_close = 1; + + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, progname); + + if (verbose) + (void)dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, 1); + + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto shutdown; + } + /* + * 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 && + (ret = dbenv->open(dbenv, home, DB_CREATE | + DB_INIT_LOG | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } + + /* Get the list of names. */ + if ((ret = dbenv->log_archive(dbenv, &list, flags)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->log_archive"); + goto shutdown; + } + + /* Print the list of names. */ + if (list != NULL) { + for (file = list; *file != NULL; ++file) + printf("%s\n", *file); + free(list); + } + + if (0) { +shutdown: exitval = 1; + } + if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +int +db_archive_usage() +{ + (void)fprintf(stderr, + "usage: db_archive [-alsVv] [-h home] [-P password]\n"); + return (EXIT_FAILURE); +} + +int +db_archive_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} diff --git a/bdb/build_vxworks/db_archive/db_archive.wpj b/bdb/build_vxworks/db_archive/db_archive.wpj new file mode 100755 index 00000000000..06091bb6b5f --- /dev/null +++ b/bdb/build_vxworks/db_archive/db_archive.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_archive.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_archive.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_archive.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_archive.c_dependDone +FALSE + + + FILE_db_archive.c_dependencies + + + + FILE_db_archive.c_objects +db_archive.o + + + FILE_db_archive.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_archive.c + + + userComments +db_archive + diff --git a/bdb/build_vxworks/db_archive/db_archive/Makefile.custom b/bdb/build_vxworks/db_archive/db_archive/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_archive/db_archive/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_archive/db_archive/component.cdf b/bdb/build_vxworks/db_archive/db_archive/component.cdf new file mode 100755 index 00000000000..cf88762cbc5 --- /dev/null +++ b/bdb/build_vxworks/db_archive/db_archive/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_ARCHIVE { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_archive.o + NAME db_archive + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_archive.o { + + NAME db_archive.o + SRC_PATH_NAME $PRJ_DIR/../db_archive.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_archive/db_archive/component.wpj b/bdb/build_vxworks/db_archive/db_archive/component.wpj new file mode 100755 index 00000000000..e50d91592e6 --- /dev/null +++ b/bdb/build_vxworks/db_archive/db_archive/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_objects +db_archive.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_objects +db_archive.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_archive.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_archive.c_objects +db_archive.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_archive.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_objects +db_archive.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_archive.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_checkpoint/db_checkpoint.c b/bdb/build_vxworks/db_checkpoint/db_checkpoint.c new file mode 100644 index 00000000000..1e5a45a6fe5 --- /dev/null +++ b/bdb/build_vxworks/db_checkpoint/db_checkpoint.c @@ -0,0 +1,258 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_checkpoint.c,v 11.46 2002/08/08 03:50:31 bostic Exp $"; +#endif + +#ifndef NO_SYSTEM_INCLUDES +#include + +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#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(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_checkpoint", args, &argc, &argv); + return (db_checkpoint_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_checkpoint_main(argc, argv) + int argc; + char *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, e_close, exitval, once, ret, verbose; + char *home, *logfile, *passwd; + + if ((ret = db_checkpoint_version_check(progname)) != 0) + return (ret); + + /* + * !!! + * Don't allow a fully unsigned 32-bit number, some compilers get + * upset and require it to be specified in hexadecimal and so on. + */ +#define MAX_UINT32_T 2147483647 + + kbytes = minutes = 0; + e_close = exitval = once = verbose = 0; + flags = 0; + home = logfile = passwd = NULL; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "1h:k:L:P:p:Vv")) != EOF) + switch (ch) { + case '1': + once = 1; + flags = DB_FORCE; + break; + case 'h': + home = optarg; + break; + case 'k': + if (__db_getlong(NULL, progname, + optarg, 1, (long)MAX_UINT32_T, &argval)) + return (EXIT_FAILURE); + kbytes = argval; + break; + 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 'p': + if (__db_getlong(NULL, progname, + optarg, 1, (long)MAX_UINT32_T, &argval)) + return (EXIT_FAILURE); + minutes = argval; + break; + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case 'v': + verbose = 1; + break; + case '?': + default: + return (db_checkpoint_usage()); + } + argc -= optind; + argv += optind; + + if (argc != 0) + return (db_checkpoint_usage()); + + if (once == 0 && kbytes == 0 && minutes == 0) { + (void)fprintf(stderr, + "%s: at least one of -1, -k and -p must be specified\n", + progname); + return (EXIT_FAILURE); + } + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* Log our process ID. */ + if (logfile != NULL && __db_util_logset(progname, logfile)) + goto shutdown; + + /* + * 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)); + goto shutdown; + } + e_close = 1; + + 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; + } + /* 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"); + goto shutdown; + } + + /* + * If we have only a time delay, then we'll sleep the right amount + * to wake up when a checkpoint is necessary. If we have a "kbytes" + * field set, then we'll check every 30 seconds. + */ + seconds = kbytes != 0 ? 30 : minutes * 60; + while (!__db_util_interrupted()) { + if (verbose) { + (void)time(&now); + dbenv->errx(dbenv, "checkpoint: %s", ctime(&now)); + } + + if ((ret = dbenv->txn_checkpoint(dbenv, + kbytes, minutes, flags)) != 0) { + dbenv->err(dbenv, ret, "txn_checkpoint"); + goto shutdown; + } + + if (once) + break; + + (void)__os_sleep(dbenv, seconds, 0); + } + + if (0) { +shutdown: exitval = 1; + } + + /* Clean up the logfile. */ + if (logfile != NULL) + remove(logfile); + + /* Clean up the environment. */ + if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +int +db_checkpoint_usage() +{ + (void)fprintf(stderr, "%s\n\t%s\n", + "usage: db_checkpoint [-1Vv]", + "[-h home] [-k kbytes] [-L file] [-P password] [-p min]"); + return (EXIT_FAILURE); +} + +int +db_checkpoint_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} diff --git a/bdb/build_vxworks/db_checkpoint/db_checkpoint.wpj b/bdb/build_vxworks/db_checkpoint/db_checkpoint.wpj new file mode 100755 index 00000000000..cae4317821b --- /dev/null +++ b/bdb/build_vxworks/db_checkpoint/db_checkpoint.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_checkpoint.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_checkpoint.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_checkpoint.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_checkpoint.c_dependDone +FALSE + + + FILE_db_checkpoint.c_dependencies + + + + FILE_db_checkpoint.c_objects +db_checkpoint.o + + + FILE_db_checkpoint.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_checkpoint.c + + + userComments +db_checkpoint + diff --git a/bdb/build_vxworks/db_checkpoint/db_checkpoint/Makefile.custom b/bdb/build_vxworks/db_checkpoint/db_checkpoint/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_checkpoint/db_checkpoint/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_checkpoint/db_checkpoint/component.cdf b/bdb/build_vxworks/db_checkpoint/db_checkpoint/component.cdf new file mode 100755 index 00000000000..ea05c3a6182 --- /dev/null +++ b/bdb/build_vxworks/db_checkpoint/db_checkpoint/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_CHECKPOINT { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_checkpoint.o + NAME db_checkpoint + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_checkpoint.o { + + NAME db_checkpoint.o + SRC_PATH_NAME $PRJ_DIR/../db_checkpoint.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_checkpoint/db_checkpoint/component.wpj b/bdb/build_vxworks/db_checkpoint/db_checkpoint/component.wpj new file mode 100755 index 00000000000..3b5daa113e1 --- /dev/null +++ b/bdb/build_vxworks/db_checkpoint/db_checkpoint/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_objects +db_checkpoint.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_objects +db_checkpoint.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_checkpoint.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_checkpoint.c_objects +db_checkpoint.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_checkpoint.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_objects +db_checkpoint.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_checkpoint.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_config.h b/bdb/build_vxworks/db_config.h index cccfc4a7cf6..642d9927f67 100644 --- a/bdb/build_vxworks/db_config.h +++ b/bdb/build_vxworks/db_config.h @@ -1,231 +1,337 @@ -/* - * $Id: db_config.h,v 1.4 2000/12/12 18:39:26 bostic Exp $ - */ - -/* Define if building VxWorks */ -#define HAVE_VXWORKS 1 - -/* Define to empty if the keyword does not work. */ -/* #undef const */ - -/* Define if your struct stat has st_blksize. */ -#define HAVE_ST_BLKSIZE 1 - -/* Define to `int' if doesn't define. */ -/* #undef mode_t */ - -/* Define to `long' if doesn't define. */ -/* #undef off_t */ - -/* Define to `int' if doesn't define. */ -/* #undef pid_t */ - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ - -/* Define if the `S_IS*' macros in do not work properly. */ -/* #undef STAT_MACROS_BROKEN */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -/* #undef TIME_WITH_SYS_TIME */ - -/* !!! - * WORDS_BIGENDIAN is the ONLY option in this file that may be edited - * for VxWorks. - * - * The user must set this according to VxWork's target arch. We use an - * x86 (little-endian) target. - */ -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ - +/* DO NOT EDIT: automatically built by dist/s_vxworks. */ /* !!! * The CONFIG_TEST option may be added using the Tornado project build. * DO NOT modify it here. */ -/* Define if you are building a version for running the test suite. */ +/* Define to 1 if you want to build a version for running the test suite. */ /* #undef CONFIG_TEST */ /* !!! * The DEBUG option may be added using the Tornado project build. * DO NOT modify it here. */ -/* Define if you want a debugging version. */ +/* Define to 1 if you want a debugging version. */ /* #undef DEBUG */ -/* Define if you want a version that logs read operations. */ +/* Define to 1 if you want a version that logs read operations. */ /* #undef DEBUG_ROP */ -/* Define if you want a version that logs write operations. */ +/* Define to 1 if you want a version that logs write operations. */ /* #undef DEBUG_WOP */ /* !!! * The DIAGNOSTIC option may be added using the Tornado project build. * DO NOT modify it here. */ -/* Define if you want a version with run-time diagnostic checking. */ +/* Define to 1 if you want a version with run-time diagnostic checking. */ /* #undef DIAGNOSTIC */ -/* Define if you want to mask harmless unitialized memory read/writes. */ -/* #undef UMRW */ +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 -/* Define if fcntl/F_SETFD denies child access to file descriptors. */ -/* #undef HAVE_FCNTL_F_SETFD */ +/* Define to 1 if Berkeley DB release includes strong cryptography. */ +/* #undef HAVE_CRYPTO */ -/* Define if building big-file environment (e.g., AIX, HP/UX, Solaris). */ -/* #undef HAVE_FILE_OFFSET_BITS */ +/* Define to 1 if you have the `directio' function. */ +/* #undef HAVE_DIRECTIO */ -/* Mutex possibilities. */ -/* #undef HAVE_MUTEX_68K_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_AIX_CHECK_LOCK */ -/* #undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_HPPA_MSEM_INIT */ -/* #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_MACOS */ -/* #undef HAVE_MUTEX_MSEM_INIT */ -/* #undef HAVE_MUTEX_PPC_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_PTHREADS */ -/* #undef HAVE_MUTEX_RELIANTUNIX_INITSPIN */ -/* #undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY */ -/* #undef HAVE_MUTEX_SEMA_INIT */ -/* #undef HAVE_MUTEX_SGI_INIT_LOCK */ -/* #undef HAVE_MUTEX_SOLARIS_LOCK_TRY */ -/* #undef HAVE_MUTEX_SOLARIS_LWP */ -/* #undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY */ -#define HAVE_MUTEX_THREADS 1 -/* #undef HAVE_MUTEX_UI_THREADS */ -/* #undef HAVE_MUTEX_UTS_CC_ASSEMBLY */ -/* #undef HAVE_MUTEX_VMS */ -#define HAVE_MUTEX_VXWORKS 1 -/* #undef HAVE_MUTEX_WIN16 */ -/* #undef HAVE_MUTEX_WIN32 */ -/* #undef HAVE_MUTEX_X86_GCC_ASSEMBLY */ - -/* Define if building on QNX. */ -/* #undef HAVE_QNX */ - -/* !!! - * The HAVE_RPC option may be added using the Tornado project build. - * DO NOT modify it here. - */ -/* Define if building RPC client/server. */ -/* #undef HAVE_RPC */ - -/* Define if your sprintf returns a pointer, not a length. */ -/* #undef SPRINTF_RET_CHARPNT */ - -/* Define if you have the getcwd function. */ -#define HAVE_GETCWD 1 - -/* Define if you have the getopt function. */ -/* #undef HAVE_GETOPT */ - -/* Define if you have the getuid function. */ -/* #undef HAVE_GETUID */ - -/* Define if you have the memcmp function. */ -#define HAVE_MEMCMP 1 - -/* Define if you have the memcpy function. */ -#define HAVE_MEMCPY 1 - -/* Define if you have the memmove function. */ -#define HAVE_MEMMOVE 1 - -/* Define if you have the mlock function. */ -#define HAVE_MLOCK 1 - -/* Define if you have the mmap function. */ -/* #undef HAVE_MMAP */ - -/* Define if you have the munlock function. */ -#define HAVE_MUNLOCK 1 - -/* Define if you have the munmap function. */ -/* #undef HAVE_MUNMAP */ - -/* Define if you have the pread function. */ -/* #undef HAVE_PREAD */ - -/* Define if you have the pstat_getdynamic function. */ -/* #undef HAVE_PSTAT_GETDYNAMIC */ - -/* Define if you have the pwrite function. */ -/* #undef HAVE_PWRITE */ - -/* Define if you have the qsort function. */ -#define HAVE_QSORT 1 - -/* Define if you have the raise function. */ -#define HAVE_RAISE 1 - -/* Define if you have the sched_yield function. */ -#define HAVE_SCHED_YIELD 1 - -/* Define if you have the select function. */ -#define HAVE_SELECT 1 - -/* Define if you have the shmget function. */ -/* #undef HAVE_SHMGET */ - -/* Define if you have the snprintf function. */ -/* #undef HAVE_SNPRINTF */ - -/* Define if you have the strcasecmp function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the strerror function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the strtoul function. */ -#define HAVE_STRTOUL 1 - -/* Define if you have the sysconf function. */ -/* #undef HAVE_SYSCONF */ - -/* Define if you have the vsnprintf function. */ -/* #undef HAVE_VSNPRINTF */ - -/* Define if you have the yield function. */ -/* #undef HAVE_YIELD */ - -/* Define if you have the header file. */ +/* Define to 1 if you have the header file, and it defines `DIR'. + */ #define HAVE_DIRENT_H 1 -/* Define if you have the header file. */ -/* #undef HAVE_NDIR_H */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ -/* Define if you have the header file. */ -/* #undef HAVE_SYS_DIR_H */ +/* Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines. */ +#define HAVE_EXIT_SUCCESS 1 -/* Define if you have the header file. */ -/* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */ +/* #undef HAVE_FCNTL_F_SETFD */ -/* Define if you have the header file. */ -/* #undef HAVE_SYS_SELECT_H */ +/* Define to 1 if allocated filesystem blocks are not zeroed. */ +#define HAVE_FILESYSTEM_NOTZERO 1 -/* Define if you have the header file. */ -/* #undef HAVE_SYS_TIME_H */ +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 -/* Define if you have the nsl library (-lnsl). */ +/* Define to 1 if you have the `getopt' function. */ +/* #undef HAVE_GETOPT */ + +/* 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 you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the `nsl' library (-lnsl). */ /* #undef HAVE_LIBNSL */ -/* - * !!! - * The following is not part of the automatic configuration setup, but - * provides necessary VxWorks information. - */ -#include "vxWorks.h" +/* 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 `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 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 msem_XXX mutexes on systems other than HP-UX. */ +/* #undef HAVE_MUTEX_MSEM_INIT */ + +/* Define to 1 to use the GCC compiler and Apple PowerPC assembly language. */ +/* #undef HAVE_MUTEX_PPC_APPLE_GCC_ASSEMBLY */ + +/* Define to 1 to use the GCC compiler and generic PowerPC assembly language. + */ +/* #undef HAVE_MUTEX_PPC_GENERIC_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 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. */ +#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 */ + +/* 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. */ +#define HAVE_MUTEX_VXWORKS 1 + +/* Define to 1 to use Windows mutexes. */ +/* #undef HAVE_MUTEX_WIN32 */ + +/* 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 `pstat_getdynamic' function. */ +/* #undef HAVE_PSTAT_GETDYNAMIC */ + +/* 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 you have the `qsort' function. */ +#define HAVE_QSORT 1 + +/* Define to 1 if you have the `raise' function. */ +#define HAVE_RAISE 1 + +/* Define to 1 if building RPC client/server. */ +/* #undef HAVE_RPC */ + +/* Define to 1 if you have the `sched_yield' function. */ +#define HAVE_SCHED_YIELD 1 + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `shmget' function. */ +/* #undef HAVE_SHMGET */ + +/* Define to 1 if you have the `snprintf' function. */ +/* #undef HAVE_SNPRINTF */ + +/* 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 `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 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 `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if `st_blksize' is member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 + +/* 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, 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. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TIME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TYPES_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if unlink of file with open file descriptors will fail. */ +#define HAVE_UNLINK_WITH_OPEN_FAILURE 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define to 1 if building VxWorks. */ +#define HAVE_VXWORKS 1 + +/* Define to 1 if you have the `yield' function. */ +/* #undef HAVE_YIELD */ + +/* Define to 1 if you have the `_fstati64' function. */ +/* #undef HAVE__FSTATI64 */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "support@sleepycat.com" + +/* 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.1.24" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "db-4.1.24" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "4.1.24" + +/* 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 unitialized 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 */ /* - * VxWorks does not have getpid(). + * Exit success/failure macros. */ -#define getpid() taskIdSelf() +#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 @@ -237,6 +343,10 @@ #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 @@ -255,6 +365,7 @@ #endif #ifndef HAVE_STRCASECMP #define strcasecmp __db_Cstrcasecmp +#define strncasecmp __db_Cstrncasecmp #endif #ifndef HAVE_STRERROR #define strerror __db_Cstrerror @@ -262,3 +373,10 @@ #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 "vxWorks.h" diff --git a/bdb/build_vxworks/db_deadlock/db_deadlock.c b/bdb/build_vxworks/db_deadlock/db_deadlock.c new file mode 100644 index 00000000000..3e9f4ba7b02 --- /dev/null +++ b/bdb/build_vxworks/db_deadlock/db_deadlock.c @@ -0,0 +1,249 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_deadlock.c,v 11.38 2002/08/08 03:50:32 bostic Exp $"; +#endif + +#ifndef NO_SYSTEM_INCLUDES +#include + +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#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(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_deadlock", args, &argc, &argv); + return (db_deadlock_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_deadlock_main(argc, argv) + int argc; + char *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; + long secs, usecs; + int ch, e_close, exitval, ret, verbose; + char *home, *logfile, *str; + + if ((ret = db_deadlock_version_check(progname)) != 0) + return (ret); + + atype = DB_LOCK_DEFAULT; + home = logfile = NULL; + secs = usecs = 0; + e_close = exitval = verbose = 0; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "a:h:L:t:Vvw")) != EOF) + switch (ch) { + case 'a': + switch (optarg[0]) { + case 'e': + atype = DB_LOCK_EXPIRE; + break; + case 'm': + atype = DB_LOCK_MAXLOCKS; + break; + case 'n': + atype = DB_LOCK_MINLOCKS; + break; + case 'o': + atype = DB_LOCK_OLDEST; + break; + case 'w': + atype = DB_LOCK_MINWRITE; + break; + case 'y': + atype = DB_LOCK_YOUNGEST; + break; + default: + return (db_deadlock_usage()); + /* NOTREACHED */ + } + if (optarg[1] != '\0') + return (db_deadlock_usage()); + break; + case 'h': + home = optarg; + break; + case 'L': + logfile = optarg; + break; + case 't': + if ((str = strchr(optarg, '.')) != NULL) { + *str++ = '\0'; + if (*str != '\0' && __db_getlong( + NULL, progname, str, 0, LONG_MAX, &usecs)) + return (EXIT_FAILURE); + } + if (*optarg != '\0' && __db_getlong( + NULL, progname, optarg, 0, LONG_MAX, &secs)) + return (EXIT_FAILURE); + if (secs == 0 && usecs == 0) + 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()); + } + argc -= optind; + argv += optind; + + if (argc != 0) + return (db_deadlock_usage()); + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* Log our process ID. */ + if (logfile != NULL && __db_util_logset(progname, logfile)) + goto shutdown; + + /* + * 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)); + goto shutdown; + } + e_close = 1; + + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, progname); + + 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_JOINENV | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } + + while (!__db_util_interrupted()) { + if (verbose) { + (void)time(&now); + dbenv->errx(dbenv, "running at %.24s", ctime(&now)); + } + + if ((ret = dbenv->lock_detect(dbenv, 0, atype, NULL)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->lock_detect"); + goto shutdown; + } + + /* Make a pass every "secs" secs and "usecs" usecs. */ + if (secs == 0 && usecs == 0) + break; + (void)__os_sleep(dbenv, secs, usecs); + } + + if (0) { +shutdown: exitval = 1; + } + + /* Clean up the logfile. */ + if (logfile != NULL) + remove(logfile); + + /* Clean up the environment. */ + if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +int +db_deadlock_usage() +{ + (void)fprintf(stderr, "%s\n\t%s\n", + "usage: db_deadlock [-Vv]", + "[-a e | m | n | o | w | y] [-h home] [-L file] [-t sec.usec]"); + return (EXIT_FAILURE); +} + +int +db_deadlock_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} diff --git a/bdb/build_vxworks/db_deadlock/db_deadlock.wpj b/bdb/build_vxworks/db_deadlock/db_deadlock.wpj new file mode 100755 index 00000000000..10cc2dc6cb6 --- /dev/null +++ b/bdb/build_vxworks/db_deadlock/db_deadlock.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_deadlock.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_deadlock.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_deadlock.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_deadlock.c_dependDone +FALSE + + + FILE_db_deadlock.c_dependencies + + + + FILE_db_deadlock.c_objects +db_deadlock.o + + + FILE_db_deadlock.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_deadlock.c + + + userComments +db_deadlock + diff --git a/bdb/build_vxworks/db_deadlock/db_deadlock/Makefile.custom b/bdb/build_vxworks/db_deadlock/db_deadlock/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_deadlock/db_deadlock/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_deadlock/db_deadlock/component.cdf b/bdb/build_vxworks/db_deadlock/db_deadlock/component.cdf new file mode 100755 index 00000000000..efc498475bf --- /dev/null +++ b/bdb/build_vxworks/db_deadlock/db_deadlock/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_DEADLOCK { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_deadlock.o + NAME db_deadlock + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_deadlock.o { + + NAME db_deadlock.o + SRC_PATH_NAME $PRJ_DIR/../db_deadlock.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_deadlock/db_deadlock/component.wpj b/bdb/build_vxworks/db_deadlock/db_deadlock/component.wpj new file mode 100755 index 00000000000..f9a1b82cd9c --- /dev/null +++ b/bdb/build_vxworks/db_deadlock/db_deadlock/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_objects +db_deadlock.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_objects +db_deadlock.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_deadlock.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_deadlock.c_objects +db_deadlock.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_deadlock.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_objects +db_deadlock.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_deadlock.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_dump/db_dump.c b/bdb/build_vxworks/db_dump/db_dump.c new file mode 100644 index 00000000000..60e987c48b9 --- /dev/null +++ b/bdb/build_vxworks/db_dump/db_dump.c @@ -0,0 +1,626 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_dump.c,v 11.80 2002/08/08 03:50:34 bostic Exp $"; +#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" + +int db_dump_db_init __P((DB_ENV *, char *, int, u_int32_t, int *)); +int db_dump_dump __P((DB *, int, 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(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_dump", args, &argc, &argv); + return (db_dump_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_dump_main(argc, argv) + int argc; + char *argv[]; +{ + extern char *optarg; + extern int optind, __db_getopt_reset; + const char *progname = "db_dump"; + DB_ENV *dbenv; + DB *dbp; + u_int32_t cache; + int ch, d_close; + int e_close, exitval, keyflag, lflag, nflag, pflag, private; + int ret, Rflag, rflag, resize, subs; + char *dopt, *home, *passwd, *subname; + + if ((ret = db_dump_version_check(progname)) != 0) + return (ret); + + dbp = NULL; + d_close = e_close = exitval = lflag = nflag = pflag = rflag = Rflag = 0; + keyflag = 0; + cache = MEGABYTE; + private = 0; + dopt = home = passwd = subname = NULL; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "d:f:h:klNpP:rRs:V")) != EOF) + switch (ch) { + case 'd': + dopt = optarg; + break; + case 'f': + if (freopen(optarg, "w", stdout) == NULL) { + fprintf(stderr, "%s: %s: reopen: %s\n", + progname, optarg, strerror(errno)); + return (EXIT_FAILURE); + } + break; + case 'h': + home = optarg; + break; + case 'k': + keyflag = 1; + break; + case 'l': + lflag = 1; + break; + case 'N': + nflag = 1; + 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 'p': + pflag = 1; + break; + case 's': + subname = optarg; + break; + case 'R': + Rflag = 1; + /* DB_AGGRESSIVE requires DB_SALVAGE */ + /* FALLTHROUGH */ + case 'r': + rflag = 1; + break; + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case '?': + default: + return (db_dump_usage()); + } + argc -= optind; + argv += optind; + + if (argc != 1) + return (db_dump_usage()); + + if (dopt != NULL && pflag) { + fprintf(stderr, + "%s: the -d and -p options may not both be specified\n", + progname); + return (EXIT_FAILURE); + } + if (lflag && subname != NULL) { + fprintf(stderr, + "%s: the -l and -s options may not both be specified\n", + progname); + return (EXIT_FAILURE); + } + + if (keyflag && rflag) { + fprintf(stderr, "%s: %s", + "the -k and -r or -R options may not both be specified\n", + progname); + return (EXIT_FAILURE); + } + + if (subname != NULL && rflag) { + fprintf(stderr, "%s: %s", + "the -s and -r or R options may not both be specified\n", + progname); + return (EXIT_FAILURE); + } + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* + * Create an environment object and initialize it for error + * reporting. + */ +retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { + fprintf(stderr, + "%s: db_env_create: %s\n", progname, db_strerror(ret)); + goto err; + } + e_close = 1; + + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, progname); + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto err; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto err; + } + } + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto err; + } + + /* Initialize the environment. */ + if (db_dump_db_init(dbenv, home, rflag, cache, &private) != 0) + goto err; + + /* Create the DB object and open the file. */ + if ((ret = db_create(&dbp, dbenv, 0)) != 0) { + dbenv->err(dbenv, ret, "db_create"); + goto err; + } + d_close = 1; + + /* + * If we're salvaging, don't do an open; it might not be safe. + * Dispatch now into the salvager. + */ + if (rflag) { + if ((ret = dbp->verify(dbp, argv[0], NULL, stdout, + DB_SALVAGE | + (Rflag ? DB_AGGRESSIVE : 0) | + (pflag ? DB_PRINTABLE : 0))) != 0) + goto err; + exitval = 0; + goto done; + } + + if ((ret = dbp->open(dbp, NULL, + argv[0], subname, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbp->err(dbp, ret, "open: %s", argv[0]); + goto err; + } + if (private != 0) { + if ((ret = __db_util_cache(dbenv, dbp, &cache, &resize)) != 0) + goto err; + if (resize) { + (void)dbp->close(dbp, 0); + d_close = 0; + + (void)dbenv->close(dbenv, 0); + e_close = 0; + goto retry; + } + } + + if (dopt != NULL) { + if (__db_dump(dbp, dopt, NULL)) { + dbp->err(dbp, ret, "__db_dump: %s", argv[0]); + goto err; + } + } else if (lflag) { + if (db_dump_is_sub(dbp, &subs)) + goto err; + if (subs == 0) { + dbp->errx(dbp, + "%s: does not contain multiple databases", argv[0]); + goto err; + } + if (db_dump_show_subs(dbp)) + goto err; + } else { + subs = 0; + if (subname == NULL && db_dump_is_sub(dbp, &subs)) + goto err; + if (subs) { + if (db_dump_dump_sub(dbenv, dbp, argv[0], pflag, keyflag)) + goto err; + } else + if (__db_prheader(dbp, NULL, pflag, keyflag, stdout, + __db_verify_callback, NULL, 0) || + db_dump_dump(dbp, pflag, keyflag)) + goto err; + } + + if (0) { +err: exitval = 1; + } +done: if (d_close && (ret = dbp->close(dbp, 0)) != 0) { + exitval = 1; + dbenv->err(dbenv, ret, "close"); + } + if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +/* + * db_init -- + * Initialize the environment. + */ +int +db_dump_db_init(dbenv, home, is_salvage, cache, is_privatep) + DB_ENV *dbenv; + char *home; + int is_salvage; + u_int32_t cache; + int *is_privatep; +{ + int ret; + + /* + * Try and use the underlying environment when opening a database. + * 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 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 + * that in CDB, too, this will configure our environment + * appropriately, and our cursors will (correctly) do locking as CDB + * read cursors. + * + * If we are doing a salvage, the verification code will protest + * if we initialize transactions, logging, or locking; do an + * explicit DB_INIT_MPOOL to try to join any existing environment + * before we create our own. + */ + *is_privatep = 0; + if (dbenv->open(dbenv, home, + DB_USE_ENVIRON | (is_salvage ? DB_INIT_MPOOL : DB_JOINENV), 0) == 0) + return (0); + + /* + * An environment is required because we may be trying to look at + * databases in directories other than the current one. We could + * avoid using an environment iff the -h option wasn't specified, + * but that seems like more work than it's worth. + * + * No environment exists (or, at least no environment that includes + * an mpool region exists). Create one, but make it private so that + * no files are actually created. + */ + *is_privatep = 1; + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) == 0 && + (ret = dbenv->open(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) == 0) + return (0); + + /* An environment is required. */ + dbenv->err(dbenv, ret, "open"); + return (1); +} + +/* + * is_sub -- + * Return if the database contains subdatabases. + */ +int +db_dump_is_sub(dbp, yesno) + DB *dbp; + int *yesno; +{ + DB_BTREE_STAT *btsp; + DB_HASH_STAT *hsp; + int ret; + + switch (dbp->type) { + case DB_BTREE: + case DB_RECNO: + if ((ret = dbp->stat(dbp, &btsp, DB_FAST_STAT)) != 0) { + dbp->err(dbp, ret, "DB->stat"); + return (ret); + } + *yesno = btsp->bt_metaflags & BTM_SUBDB ? 1 : 0; + free(btsp); + break; + case DB_HASH: + if ((ret = dbp->stat(dbp, &hsp, DB_FAST_STAT)) != 0) { + dbp->err(dbp, ret, "DB->stat"); + return (ret); + } + *yesno = hsp->hash_metaflags & DB_HASH_SUBDB ? 1 : 0; + free(hsp); + break; + case DB_QUEUE: + break; + default: + dbp->errx(dbp, "unknown database type"); + return (1); + } + return (0); +} + +/* + * dump_sub -- + * Dump out the records for a DB containing subdatabases. + */ +int +db_dump_dump_sub(dbenv, parent_dbp, parent_name, pflag, keyflag) + DB_ENV *dbenv; + DB *parent_dbp; + char *parent_name; + int pflag, keyflag; +{ + DB *dbp; + DBC *dbcp; + DBT key, data; + int ret; + char *subdb; + + /* + * Get a cursor and step through the database, dumping out each + * subdatabase. + */ + if ((ret = parent_dbp->cursor(parent_dbp, NULL, &dbcp, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->cursor"); + return (1); + } + + memset(&key, 0, sizeof(key)); + memset(&data, 0, sizeof(data)); + while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0) { + /* Nul terminate the subdatabase name. */ + if ((subdb = malloc(key.size + 1)) == NULL) { + dbenv->err(dbenv, ENOMEM, NULL); + return (1); + } + memcpy(subdb, key.data, key.size); + subdb[key.size] = '\0'; + + /* Create the DB object and open the file. */ + if ((ret = db_create(&dbp, dbenv, 0)) != 0) { + dbenv->err(dbenv, ret, "db_create"); + free(subdb); + return (1); + } + if ((ret = dbp->open(dbp, NULL, + parent_name, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) + dbp->err(dbp, ret, + "DB->open: %s:%s", parent_name, subdb); + if (ret == 0 && + (__db_prheader(dbp, subdb, pflag, keyflag, stdout, + __db_verify_callback, NULL, 0) || + db_dump_dump(dbp, pflag, keyflag))) + ret = 1; + (void)dbp->close(dbp, 0); + free(subdb); + if (ret != 0) + return (1); + } + if (ret != DB_NOTFOUND) { + dbp->err(dbp, ret, "DBcursor->get"); + return (1); + } + + if ((ret = dbcp->c_close(dbcp)) != 0) { + dbp->err(dbp, ret, "DBcursor->close"); + return (1); + } + + return (0); +} + +/* + * show_subs -- + * Display the subdatabases for a database. + */ +int +db_dump_show_subs(dbp) + DB *dbp; +{ + DBC *dbcp; + DBT key, data; + int ret; + + /* + * Get a cursor and step through the database, printing out the key + * of each key/data pair. + */ + if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) { + dbp->err(dbp, ret, "DB->cursor"); + return (1); + } + + memset(&key, 0, sizeof(key)); + memset(&data, 0, sizeof(data)); + while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0) { + if ((ret = __db_prdbt(&key, 1, NULL, stdout, + __db_verify_callback, 0, NULL)) != 0) { + dbp->errx(dbp, NULL); + return (1); + } + } + if (ret != DB_NOTFOUND) { + dbp->err(dbp, ret, "DBcursor->get"); + return (1); + } + + if ((ret = dbcp->c_close(dbcp)) != 0) { + dbp->err(dbp, ret, "DBcursor->close"); + return (1); + } + return (0); +} + +/* + * dump -- + * Dump out the records for a DB. + */ +int +db_dump_dump(dbp, pflag, keyflag) + DB *dbp; + int pflag, keyflag; +{ + DBC *dbcp; + DBT key, data; + DBT keyret, dataret; + db_recno_t recno; + int is_recno, failed, ret; + void *pointer; + + /* + * Get a cursor and step through the database, printing out each + * key/data pair. + */ + if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) { + dbp->err(dbp, ret, "DB->cursor"); + return (1); + } + + failed = 0; + memset(&key, 0, sizeof(key)); + memset(&data, 0, sizeof(data)); + data.data = malloc(1024 * 1024); + if (data.data == NULL) { + dbp->err(dbp, ENOMEM, "bulk get buffer"); + failed = 1; + goto err; + } + data.ulen = 1024 * 1024; + data.flags = DB_DBT_USERMEM; + is_recno = (dbp->type == DB_RECNO || dbp->type == DB_QUEUE); + keyflag = is_recno ? keyflag : 1; + if (is_recno) { + keyret.data = &recno; + keyret.size = sizeof(recno); + } + +retry: + while ((ret = + dbcp->c_get(dbcp, &key, &data, DB_NEXT | DB_MULTIPLE_KEY)) == 0) { + DB_MULTIPLE_INIT(pointer, &data); + for (;;) { + if (is_recno) + DB_MULTIPLE_RECNO_NEXT(pointer, &data, + recno, dataret.data, dataret.size); + else + DB_MULTIPLE_KEY_NEXT(pointer, + &data, keyret.data, + keyret.size, dataret.data, dataret.size); + + if (dataret.data == NULL) + break; + + if ((keyflag && (ret = __db_prdbt(&keyret, + pflag, " ", stdout, __db_verify_callback, + is_recno, NULL)) != 0) || (ret = + __db_prdbt(&dataret, pflag, " ", stdout, + __db_verify_callback, 0, NULL)) != 0) { + dbp->errx(dbp, NULL); + failed = 1; + goto err; + } + } + } + if (ret == ENOMEM) { + data.data = realloc(data.data, data.size); + if (data.data == NULL) { + dbp->err(dbp, ENOMEM, "bulk get buffer"); + failed = 1; + goto err; + } + data.ulen = data.size; + goto retry; + } + + if (ret != DB_NOTFOUND) { + dbp->err(dbp, ret, "DBcursor->get"); + failed = 1; + } + +err: if (data.data != NULL) + free(data.data); + + if ((ret = dbcp->c_close(dbcp)) != 0) { + dbp->err(dbp, ret, "DBcursor->close"); + failed = 1; + } + + (void)__db_prfooter(stdout, __db_verify_callback); + return (failed); +} + +/* + * usage -- + * Display the usage message. + */ +int +db_dump_usage() +{ + (void)fprintf(stderr, "%s\n\t%s\n", + "usage: db_dump [-klNprRV]", + "[-d ahr] [-f output] [-h home] [-P password] [-s database] db_file"); + return (EXIT_FAILURE); +} + +int +db_dump_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} diff --git a/bdb/build_vxworks/db_dump/db_dump.wpj b/bdb/build_vxworks/db_dump/db_dump.wpj new file mode 100755 index 00000000000..6813766e5f1 --- /dev/null +++ b/bdb/build_vxworks/db_dump/db_dump.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_dump.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_dump.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_dump.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_dump.c_dependDone +FALSE + + + FILE_db_dump.c_dependencies + + + + FILE_db_dump.c_objects +db_dump.o + + + FILE_db_dump.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_dump.c + + + userComments +db_dump + diff --git a/bdb/build_vxworks/db_dump/db_dump/Makefile.custom b/bdb/build_vxworks/db_dump/db_dump/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_dump/db_dump/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_dump/db_dump/component.cdf b/bdb/build_vxworks/db_dump/db_dump/component.cdf new file mode 100755 index 00000000000..5c1d4ccf308 --- /dev/null +++ b/bdb/build_vxworks/db_dump/db_dump/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_DUMP { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_dump.o + NAME db_dump + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_dump.o { + + NAME db_dump.o + SRC_PATH_NAME $PRJ_DIR/../db_dump.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_dump/db_dump/component.wpj b/bdb/build_vxworks/db_dump/db_dump/component.wpj new file mode 100755 index 00000000000..e234641f498 --- /dev/null +++ b/bdb/build_vxworks/db_dump/db_dump/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_objects +db_dump.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_objects +db_dump.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_dump.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_dump.c_objects +db_dump.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_dump.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_objects +db_dump.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_dump.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_load/db_load.c b/bdb/build_vxworks/db_load/db_load.c new file mode 100644 index 00000000000..6eedae590b1 --- /dev/null +++ b/bdb/build_vxworks/db_load/db_load.c @@ -0,0 +1,1247 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_load.c,v 11.71 2002/08/08 03:50:36 bostic Exp $"; +#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" + +typedef struct { /* XXX: Globals. */ + const char *progname; /* Program name. */ + char *hdrbuf; /* Input file header. */ + u_long lineno; /* Input file line number. */ + u_long origline; /* Original file line number. */ + int endodata; /* Reached the end of a database. */ + int endofile; /* Reached the end of the input. */ + int version; /* Input version. */ + char *home; /* Env home. */ + char *passwd; /* Env passwd. */ + int private; /* Private env. */ + u_int32_t cache; /* Env cache size. */ +} LDG; + +void 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 **)); +int db_load_db_init __P((DB_ENV *, char *, u_int32_t, int *)); +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_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 *)); + +#define G(f) ((LDG *)dbenv->app_private)->f + + /* Flags to the load function. */ +#define LDF_NOHEADER 0x01 /* No dump header. */ +#define LDF_NOOVERWRITE 0x02 /* Don't overwrite existing rows. */ +#define LDF_PASSWORD 0x04 /* Encrypt created databases. */ + +int +db_load(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_load", args, &argc, &argv); + return (db_load_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_load_main(argc, argv) + int argc; + char *argv[]; +{ + extern char *optarg; + extern int optind, __db_getopt_reset; + DBTYPE dbtype; + DB_ENV *dbenv; + LDG ldg; + u_int32_t ldf; + int ch, existed, exitval, ret; + char **clist, **clp; + + ldg.progname = "db_load"; + ldg.lineno = 0; + ldg.endodata = ldg.endofile = 0; + ldg.version = 1; + ldg.cache = MEGABYTE; + ldg.hdrbuf = NULL; + ldg.home = NULL; + ldg.passwd = NULL; + + if ((ret = db_load_version_check(ldg.progname)) != 0) + return (ret); + + ldf = 0; + exitval = 0; + dbtype = DB_UNKNOWN; + + /* Allocate enough room for configuration arguments. */ + if ((clp = clist = (char **)calloc(argc + 1, sizeof(char *))) == NULL) { + fprintf(stderr, "%s: %s\n", ldg.progname, strerror(ENOMEM)); + return (EXIT_FAILURE); + } + + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "c:f:h:nP:Tt:V")) != EOF) + switch (ch) { + case 'c': + *clp++ = optarg; + break; + case 'f': + if (freopen(optarg, "r", stdin) == NULL) { + fprintf(stderr, "%s: %s: reopen: %s\n", + ldg.progname, optarg, strerror(errno)); + return (EXIT_FAILURE); + } + break; + case 'h': + ldg.home = optarg; + break; + case 'n': + ldf |= LDF_NOOVERWRITE; + break; + case 'P': + ldg.passwd = strdup(optarg); + memset(optarg, 0, strlen(optarg)); + if (ldg.passwd == NULL) { + fprintf(stderr, "%s: strdup: %s\n", + ldg.progname, strerror(errno)); + return (EXIT_FAILURE); + } + ldf |= LDF_PASSWORD; + break; + case 'T': + ldf |= LDF_NOHEADER; + break; + case 't': + if (strcmp(optarg, "btree") == 0) { + dbtype = DB_BTREE; + break; + } + if (strcmp(optarg, "hash") == 0) { + dbtype = DB_HASH; + break; + } + if (strcmp(optarg, "recno") == 0) { + dbtype = DB_RECNO; + break; + } + if (strcmp(optarg, "queue") == 0) { + dbtype = DB_QUEUE; + break; + } + return (db_load_usage()); + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case '?': + default: + return (db_load_usage()); + } + argc -= optind; + argv += optind; + + if (argc != 1) + return (db_load_usage()); + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* + * Create an environment object initialized for error reporting, and + * then open it. + */ + if (db_load_env_create(&dbenv, &ldg) != 0) + goto shutdown; + + while (!ldg.endofile) + if (db_load_load(dbenv, argv[0], dbtype, clist, ldf, + &ldg, &existed) != 0) + goto shutdown; + + if (0) { +shutdown: exitval = 1; + } + if ((ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", ldg.progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + free(clist); + + /* + * Return 0 on success, 1 if keys existed already, and 2 on failure. + * + * Technically, this is wrong, because exit of anything other than + * 0 is implementation-defined by the ANSI C standard. I don't see + * any good solutions that don't involve API changes. + */ + return (exitval == 0 ? (existed == 0 ? 0 : 1) : 2); +} + +/* + * load -- + * Load a database. + */ +int +db_load_load(dbenv, name, argtype, clist, flags, ldg, existedp) + DB_ENV *dbenv; + char *name, **clist; + DBTYPE argtype; + u_int flags; + LDG *ldg; + int *existedp; +{ + DB *dbp; + DBT key, rkey, data, *readp, *writep; + DBTYPE dbtype; + DB_TXN *ctxn, *txn; + db_recno_t recno, datarecno; + u_int32_t put_flags; + int ascii_recno, checkprint, hexkeys, keyflag, keys, resize, ret, rval; + char *subdb; + + *existedp = 0; + + put_flags = LF_ISSET(LDF_NOOVERWRITE) ? DB_NOOVERWRITE : 0; + G(endodata) = 0; + + subdb = NULL; + ctxn = txn = NULL; + memset(&key, 0, sizeof(DBT)); + memset(&data, 0, sizeof(DBT)); + memset(&rkey, 0, sizeof(DBT)); + +retry_db: + /* Create the DB object. */ + if ((ret = db_create(&dbp, dbenv, 0)) != 0) { + dbenv->err(dbenv, ret, "db_create"); + goto err; + } + + dbtype = DB_UNKNOWN; + keys = -1; + hexkeys = -1; + keyflag = -1; + /* Read the header -- if there's no header, we expect flat text. */ + if (LF_ISSET(LDF_NOHEADER)) { + checkprint = 1; + dbtype = argtype; + } else { + if (db_load_rheader(dbenv, + dbp, &dbtype, &subdb, &checkprint, &keys) != 0) + goto err; + if (G(endofile)) + goto done; + } + + /* + * Apply command-line configuration changes. (We apply command-line + * configuration changes to all databases that are loaded, e.g., all + * subdatabases.) + */ + if (db_load_configure(dbenv, dbp, clist, &subdb, &keyflag)) + goto err; + + if (keys != 1) { + if (keyflag == 1) { + dbp->err(dbp, EINVAL, "No keys specified in file"); + goto err; + } + } + else if (keyflag == 0) { + dbp->err(dbp, EINVAL, "Keys specified in file"); + goto err; + } + else + keyflag = 1; + + if (dbtype == DB_BTREE || dbtype == DB_HASH) { + if (keyflag == 0) + dbp->err(dbp, + EINVAL, "Btree and Hash must specify keys"); + else + keyflag = 1; + } + + if (argtype != DB_UNKNOWN) { + + if (dbtype == DB_RECNO || dbtype == DB_QUEUE) + if (keyflag != 1 && argtype != DB_RECNO && + argtype != DB_QUEUE) { + dbenv->errx(dbenv, + "improper database type conversion specified"); + goto err; + } + dbtype = argtype; + } + + if (dbtype == DB_UNKNOWN) { + dbenv->errx(dbenv, "no database type specified"); + goto err; + } + + if (keyflag == -1) + keyflag = 0; + + /* + * Recno keys have only been printed in hexadecimal starting + * with db_dump format version 3 (DB 3.2). + * + * !!! + * Note that version is set in db_load_rheader(), which must be called before + * this assignment. + */ + hexkeys = (G(version) >= 3 && keyflag == 1 && checkprint == 0); + + if (keyflag == 1 && (dbtype == DB_RECNO || dbtype == DB_QUEUE)) + ascii_recno = 1; + else + ascii_recno = 0; + + /* If configured with a password, encrypt databases we create. */ + if (LF_ISSET(LDF_PASSWORD) && + (ret = dbp->set_flags(dbp, DB_ENCRYPT)) != 0) { + dbp->err(dbp, ret, "DB->set_flags: DB_ENCRYPT"); + goto err; + } + + /* 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) { + dbp->err(dbp, ret, "DB->open: %s", name); + goto err; + } + if (ldg->private != 0) { + if ((ret = + __db_util_cache(dbenv, dbp, &ldg->cache, &resize)) != 0) + goto err; + if (resize) { + dbp->close(dbp, 0); + dbp = NULL; + dbenv->close(dbenv, 0); + if ((ret = db_load_env_create(&dbenv, ldg)) != 0) + goto err; + goto retry_db; + } + } + + /* Initialize the key/data pair. */ + readp = &key; + writep = &key; + if (dbtype == DB_RECNO || dbtype == DB_QUEUE) { + key.size = sizeof(recno); + if (keyflag) { + key.data = &datarecno; + if (checkprint) { + readp = &rkey; + goto key_data; + } + } + else + key.data = &recno; + } else +key_data: if ((readp->data = + (void *)malloc(readp->ulen = 1024)) == NULL) { + dbenv->err(dbenv, ENOMEM, NULL); + goto err; + } + if ((data.data = (void *)malloc(data.ulen = 1024)) == NULL) { + dbenv->err(dbenv, ENOMEM, NULL); + goto err; + } + + if (TXN_ON(dbenv) && + (ret = dbenv->txn_begin(dbenv, NULL, &txn, 0)) != 0) + goto err; + + /* Get each key/data pair and add them to the database. */ + for (recno = 1; !__db_util_interrupted(); ++recno) { + if (!keyflag) + if (checkprint) { + if (db_load_dbt_rprint(dbenv, &data)) + goto err; + } else { + if (db_load_dbt_rdump(dbenv, &data)) + goto err; + } + else + if (checkprint) { + if (db_load_dbt_rprint(dbenv, readp)) + goto err; + if (!G(endodata) && db_load_dbt_rprint(dbenv, &data)) + goto fmt; + } else { + if (ascii_recno) { + if (db_load_dbt_rrecno(dbenv, readp, hexkeys)) + goto err; + } else + if (db_load_dbt_rdump(dbenv, readp)) + goto err; + if (!G(endodata) && db_load_dbt_rdump(dbenv, &data)) { +fmt: dbenv->errx(dbenv, + "odd number of key/data pairs"); + goto err; + } + } + if (G(endodata)) + break; + if (readp != writep) { + if (sscanf(readp->data, "%ud", &datarecno) != 1) + dbenv->errx(dbenv, + "%s: non-integer key at line: %d", + name, !keyflag ? recno : recno * 2 - 1); + if (datarecno == 0) + dbenv->errx(dbenv, "%s: zero key at line: %d", + name, + !keyflag ? recno : recno * 2 - 1); + } +retry: if (txn != NULL) + if ((ret = dbenv->txn_begin(dbenv, txn, &ctxn, 0)) != 0) + goto err; + switch (ret = dbp->put(dbp, ctxn, writep, &data, put_flags)) { + case 0: + if (ctxn != NULL) { + if ((ret = + ctxn->commit(ctxn, DB_TXN_NOSYNC)) != 0) + goto err; + ctxn = NULL; + } + break; + case DB_KEYEXIST: + *existedp = 1; + dbenv->errx(dbenv, + "%s: line %d: key already exists, not loaded:", + name, + !keyflag ? recno : recno * 2 - 1); + + (void)__db_prdbt(&key, checkprint, 0, stderr, + __db_verify_callback, 0, NULL); + break; + case DB_LOCK_DEADLOCK: + /* If we have a child txn, retry--else it's fatal. */ + if (ctxn != NULL) { + if ((ret = ctxn->abort(ctxn)) != 0) + goto err; + ctxn = NULL; + goto retry; + } + /* FALLTHROUGH */ + default: + dbenv->err(dbenv, ret, NULL); + if (ctxn != NULL) { + (void)ctxn->abort(ctxn); + ctxn = NULL; + } + goto err; + } + if (ctxn != NULL) { + if ((ret = ctxn->abort(ctxn)) != 0) + goto err; + ctxn = NULL; + } + } +done: rval = 0; + DB_ASSERT(ctxn == NULL); + if (txn != NULL && (ret = txn->commit(txn, 0)) != 0) { + txn = NULL; + goto err; + } + + if (0) { +err: rval = 1; + DB_ASSERT(ctxn == NULL); + if (txn != NULL) + (void)txn->abort(txn); + } + + /* Close the database. */ + if (dbp != NULL && (ret = dbp->close(dbp, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->close"); + rval = 1; + } + + if (G(hdrbuf) != NULL) + free(G(hdrbuf)); + G(hdrbuf) = NULL; + /* Free allocated memory. */ + if (subdb != NULL) + free(subdb); + if (dbtype != DB_RECNO && dbtype != DB_QUEUE) + free(key.data); + if (rkey.data != NULL) + free(rkey.data); + free(data.data); + + return (rval); +} + +/* + * db_init -- + * Initialize the environment. + */ +int +db_load_db_init(dbenv, home, cache, is_private) + DB_ENV *dbenv; + char *home; + u_int32_t cache; + int *is_private; +{ + u_int32_t flags; + int ret; + + *is_private = 0; + /* We may be loading into a live environment. Try and join. */ + flags = DB_USE_ENVIRON | + DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN; + if (dbenv->open(dbenv, home, flags, 0) == 0) + return (0); + + /* + * We're trying to load a database. + * + * An environment is required because we may be trying to look at + * databases in directories other than the current one. We could + * avoid using an environment iff the -h option wasn't specified, + * but that seems like more work than it's worth. + * + * No environment exists (or, at least no environment that includes + * an mpool region exists). Create one, but make it private so that + * no files are actually created. + */ + LF_CLR(DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN); + LF_SET(DB_CREATE | DB_PRIVATE); + *is_private = 1; + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) { + dbenv->err(dbenv, ret, "set_cachesize"); + return (1); + } + if ((ret = dbenv->open(dbenv, home, flags, 0)) == 0) + return (0); + + /* An environment is required. */ + dbenv->err(dbenv, ret, "DB_ENV->open"); + return (1); +} + +#define FLAG(name, value, keyword, flag) \ + if (strcmp(name, keyword) == 0) { \ + switch (*value) { \ + case '1': \ + if ((ret = dbp->set_flags(dbp, flag)) != 0) { \ + dbp->err(dbp, ret, "%s: set_flags: %s", \ + G(progname), name); \ + return (1); \ + } \ + break; \ + case '0': \ + break; \ + default: \ + db_load_badnum(dbenv); \ + return (1); \ + } \ + continue; \ + } +#define NUMBER(name, value, keyword, func) \ + if (strcmp(name, keyword) == 0) { \ + if (__db_getlong(dbp, \ + NULL, value, 1, LONG_MAX, &val) != 0) \ + return (1); \ + if ((ret = dbp->func(dbp, val)) != 0) \ + goto nameerr; \ + continue; \ + } +#define STRING(name, value, keyword, func) \ + if (strcmp(name, keyword) == 0) { \ + if ((ret = dbp->func(dbp, value[0])) != 0) \ + goto nameerr; \ + continue; \ + } + +/* + * configure -- + * Handle command-line configuration options. + */ +int +db_load_configure(dbenv, dbp, clp, subdbp, keysp) + DB_ENV *dbenv; + DB *dbp; + char **clp, **subdbp; + int *keysp; +{ + long val; + int ret, savech; + char *name, *value; + + for (; (name = *clp) != NULL; *--value = savech, ++clp) { + if ((value = strchr(name, '=')) == NULL) { + dbp->errx(dbp, + "command-line configuration uses name=value format"); + return (1); + } + savech = *value; + *value++ = '\0'; + + if (strcmp(name, "database") == 0 || + strcmp(name, "subdatabase") == 0) { + if (*subdbp != NULL) + free(*subdbp); + if ((*subdbp = strdup(value)) == NULL) { + dbp->err(dbp, ENOMEM, NULL); + return (1); + } + continue; + } + if (strcmp(name, "keys") == 0) { + if (strcmp(value, "1") == 0) + *keysp = 1; + else if (strcmp(value, "0") == 0) + *keysp = 0; + else { + db_load_badnum(dbenv); + return (1); + } + continue; + } + +#ifdef notyet + NUMBER(name, value, "bt_maxkey", set_bt_maxkey); +#endif + NUMBER(name, value, "bt_minkey", set_bt_minkey); + NUMBER(name, value, "db_lorder", set_lorder); + NUMBER(name, value, "db_pagesize", set_pagesize); + FLAG(name, value, "chksum", DB_CHKSUM_SHA1); + FLAG(name, value, "duplicates", DB_DUP); + FLAG(name, value, "dupsort", DB_DUPSORT); + NUMBER(name, value, "h_ffactor", set_h_ffactor); + NUMBER(name, value, "h_nelem", set_h_nelem); + NUMBER(name, value, "re_len", set_re_len); + STRING(name, value, "re_pad", set_re_pad); + FLAG(name, value, "recnum", DB_RECNUM); + FLAG(name, value, "renumber", DB_RENUMBER); + + dbp->errx(dbp, + "unknown command-line configuration keyword \"%s\"", name); + return (1); + } + return (0); + +nameerr: + dbp->err(dbp, ret, "%s: %s=%s", G(progname), name, value); + return (1); +} + +/* + * rheader -- + * Read the header message. + */ +int +db_load_rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp) + DB_ENV *dbenv; + DB *dbp; + DBTYPE *dbtypep; + char **subdbp; + int *checkprintp, *keysp; +{ + long val; + int ch, first, hdr, linelen, buflen, ret, start; + char *buf, *name, *p, *value; + + *dbtypep = DB_UNKNOWN; + *checkprintp = 0; + name = p = NULL; + + /* + * We start with a smallish buffer; most headers are small. + * We may need to realloc it for a large subdatabase name. + */ + buflen = 4096; + if (G(hdrbuf) == NULL) { + hdr = 0; + if ((buf = (char *)malloc(buflen)) == NULL) { +memerr: dbp->errx(dbp, "could not allocate buffer %d", buflen); + return (1); + } + G(hdrbuf) = buf; + G(origline) = G(lineno); + } else { + hdr = 1; + buf = G(hdrbuf); + G(lineno) = G(origline); + } + + start = 0; + for (first = 1;; first = 0) { + ++G(lineno); + + /* Read a line, which may be of arbitrary length, into buf. */ + linelen = 0; + buf = &G(hdrbuf)[start]; + if (hdr == 0) { + for (;;) { + if ((ch = getchar()) == EOF) { + if (!first || ferror(stdin)) + goto badfmt; + G(endofile) = 1; + break; + } + + if (ch == '\n') + break; + + buf[linelen++] = ch; + + /* If the buffer is too small, double it. */ + if (linelen + start == buflen) { + G(hdrbuf) = (char *)realloc(G(hdrbuf), + buflen *= 2); + if (G(hdrbuf) == NULL) + goto memerr; + buf = &G(hdrbuf)[start]; + } + } + if (G(endofile) == 1) + break; + buf[linelen++] = '\0'; + } else + linelen = strlen(buf) + 1; + start += linelen; + + if (name != NULL) { + *p = '='; + free(name); + name = NULL; + } + /* If we don't see the expected information, it's an error. */ + if ((name = strdup(buf)) == NULL) + goto memerr; + if ((p = strchr(name, '=')) == NULL) + goto badfmt; + *p++ = '\0'; + + value = p--; + + if (name[0] == '\0' || value[0] == '\0') + goto badfmt; + + if (strcmp(name, "HEADER") == 0) + break; + if (strcmp(name, "VERSION") == 0) { + /* + * Version 1 didn't have a "VERSION" header line. We + * only support versions 1, 2, and 3 of the dump format. + */ + G(version) = atoi(value); + + if (G(version) > 3) { + dbp->errx(dbp, + "line %lu: VERSION %d is unsupported", + G(lineno), G(version)); + goto err; + } + continue; + } + if (strcmp(name, "format") == 0) { + if (strcmp(value, "bytevalue") == 0) { + *checkprintp = 0; + continue; + } + if (strcmp(value, "print") == 0) { + *checkprintp = 1; + continue; + } + goto badfmt; + } + if (strcmp(name, "type") == 0) { + if (strcmp(value, "btree") == 0) { + *dbtypep = DB_BTREE; + continue; + } + if (strcmp(value, "hash") == 0) { + *dbtypep = DB_HASH; + continue; + } + if (strcmp(value, "recno") == 0) { + *dbtypep = DB_RECNO; + continue; + } + if (strcmp(value, "queue") == 0) { + *dbtypep = DB_QUEUE; + continue; + } + dbp->errx(dbp, "line %lu: unknown type", G(lineno)); + goto err; + } + if (strcmp(name, "database") == 0 || + strcmp(name, "subdatabase") == 0) { + if ((ret = db_load_convprintable(dbenv, value, subdbp)) != 0) { + dbp->err(dbp, ret, "error reading db name"); + goto err; + } + continue; + } + if (strcmp(name, "keys") == 0) { + if (strcmp(value, "1") == 0) + *keysp = 1; + else if (strcmp(value, "0") == 0) + *keysp = 0; + else { + db_load_badnum(dbenv); + goto err; + } + continue; + } + +#ifdef notyet + NUMBER(name, value, "bt_maxkey", set_bt_maxkey); +#endif + NUMBER(name, value, "bt_minkey", set_bt_minkey); + NUMBER(name, value, "db_lorder", set_lorder); + NUMBER(name, value, "db_pagesize", set_pagesize); + NUMBER(name, value, "extentsize", set_q_extentsize); + FLAG(name, value, "chksum", DB_CHKSUM_SHA1); + FLAG(name, value, "duplicates", DB_DUP); + FLAG(name, value, "dupsort", DB_DUPSORT); + NUMBER(name, value, "h_ffactor", set_h_ffactor); + NUMBER(name, value, "h_nelem", set_h_nelem); + NUMBER(name, value, "re_len", set_re_len); + STRING(name, value, "re_pad", set_re_pad); + FLAG(name, value, "recnum", DB_RECNUM); + FLAG(name, value, "renumber", DB_RENUMBER); + + dbp->errx(dbp, + "unknown input-file header configuration keyword \"%s\"", + name); + goto err; + } + ret = 0; + if (0) { +nameerr: + dbp->err(dbp, ret, "%s: %s=%s", G(progname), name, value); + ret = 1; + } + if (0) +err: ret = 1; + if (0) { +badfmt: + dbp->errx(dbp, "line %lu: unexpected format", G(lineno)); + ret = 1; + } + if (name != NULL) { + *p = '='; + free(name); + } + return (ret); +} + +/* + * convprintable -- + * Convert a printable-encoded string into a newly allocated string. + * + * In an ideal world, this would probably share code with dbt_rprint, but + * that's set up to read character-by-character (to avoid large memory + * allocations that aren't likely to be a problem here), and this has fewer + * special cases to deal with. + * + * Note that despite the printable encoding, the char * interface to this + * function (which is, not coincidentally, also used for database naming) + * means that outstr cannot contain any nuls. + */ +int +db_load_convprintable(dbenv, instr, outstrp) + DB_ENV *dbenv; + char *instr, **outstrp; +{ + char c, *outstr; + int e1, e2; + + /* + * Just malloc a string big enough for the whole input string; + * the output string will be smaller (or of equal length). + */ + if ((outstr = (char *)malloc(strlen(instr))) == NULL) + return (ENOMEM); + + *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; + } else + *outstr++ = *instr; + + *outstr = '\0'; + + return (0); +} + +/* + * dbt_rprint -- + * Read a printable line into a DBT structure. + */ +int +db_load_dbt_rprint(dbenv, dbtp) + DB_ENV *dbenv; + DBT *dbtp; +{ + u_int32_t len; + u_int8_t *p; + int c1, c2, e, escape, first; + char buf[32]; + + ++G(lineno); + + first = 1; + e = 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); + } + if (first) { + first = 0; + if (G(version) > 1) { + if (c1 != ' ') { + buf[0] = c1; + if (fgets(buf + 1, + sizeof(buf) - 1, stdin) == NULL || + strcmp(buf, "DATA=END\n") != 0) { + db_load_badend(dbenv); + return (1); + } + G(endodata) = 1; + return (0); + } + continue; + } + } + 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); + } + escape = 0; + } else + if (c1 == '\\') { + escape = 1; + continue; + } + if (len >= dbtp->ulen - 10) { + dbtp->ulen *= 2; + if ((dbtp->data = + (void *)realloc(dbtp->data, dbtp->ulen)) == NULL) { + dbenv->err(dbenv, ENOMEM, NULL); + return (1); + } + p = (u_int8_t *)dbtp->data + len; + } + ++len; + *p++ = c1; + } + dbtp->size = len; + + return (0); +} + +/* + * dbt_rdump -- + * Read a byte dump line into a DBT structure. + */ +int +db_load_dbt_rdump(dbenv, dbtp) + DB_ENV *dbenv; + DBT *dbtp; +{ + u_int32_t len; + u_int8_t *p; + int c1, c2, e, 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); + } + if (first) { + first = 0; + if (G(version) > 1) { + if (c1 != ' ') { + buf[0] = c1; + if (fgets(buf + 1, + sizeof(buf) - 1, stdin) == NULL || + strcmp(buf, "DATA=END\n") != 0) { + db_load_badend(dbenv); + return (1); + } + G(endodata) = 1; + return (0); + } + continue; + } + } + if ((c2 = getchar()) == EOF) { + db_load_badend(dbenv); + return (1); + } + if (len >= dbtp->ulen - 10) { + dbtp->ulen *= 2; + if ((dbtp->data = + (void *)realloc(dbtp->data, dbtp->ulen)) == NULL) { + dbenv->err(dbenv, ENOMEM, NULL); + return (1); + } + 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); + } + dbtp->size = len; + + return (0); +} + +/* + * dbt_rrecno -- + * Read a record number dump line into a DBT structure. + */ +int +db_load_dbt_rrecno(dbenv, dbtp, ishex) + DB_ENV *dbenv; + DBT *dbtp; + int ishex; +{ + char buf[32], *p, *q; + + ++G(lineno); + + if (fgets(buf, sizeof(buf), stdin) == NULL) { + G(endofile) = G(endodata) = 1; + return (0); + } + + if (strcmp(buf, "DATA=END\n") == 0) { + G(endodata) = 1; + return (0); + } + + if (buf[0] != ' ') + goto bad; + + /* + * If we're expecting a hex key, do an in-place conversion + * of hex to straight ASCII before calling __db_getulong(). + */ + if (ishex) { + for (p = q = buf + 1; *q != '\0' && *q != '\n';) { + /* + * 0-9 in hex are 0x30-0x39, so this is easy. + * We should alternate between 3's and [0-9], and + * if the [0-9] are something unexpected, + * __db_getulong will fail, so we only need to catch + * end-of-string conditions. + */ + if (*q++ != '3') + goto bad; + if (*q == '\n' || *q == '\0') + goto bad; + *p++ = *q++; + } + *p = '\0'; + } + + if (__db_getulong(NULL, + G(progname), buf + 1, 0, 0, (u_long *)dbtp->data)) { +bad: db_load_badend(dbenv); + return (1); + } + + dbtp->size = sizeof(db_recno_t); + return (0); +} + +/* + * 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); + } + + dbenv->errx(dbenv, "unexpected hexadecimal value"); + *errorp = 1; + + return (0); +} + +/* + * badnum -- + * Display the bad number message. + */ +void +db_load_badnum(dbenv) + DB_ENV *dbenv; +{ + dbenv->errx(dbenv, + "boolean name=value pairs require a value of 0 or 1"); +} + +/* + * badend -- + * Display the bad end to input message. + */ +void +db_load_badend(dbenv) + DB_ENV *dbenv; +{ + dbenv->errx(dbenv, "unexpected end of input data or key/data pair"); +} + +/* + * usage -- + * Display the usage message. + */ +int +db_load_usage() +{ + (void)fprintf(stderr, "%s\n\t%s\n", + "usage: db_load [-nTV] [-c name=value] [-f file]", + "[-h home] [-P password] [-t btree | hash | recno | queue] db_file"); + return (EXIT_FAILURE); +} + +int +db_load_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} + +int +db_load_env_create(dbenvp, ldg) + DB_ENV **dbenvp; + LDG *ldg; +{ + DB_ENV *dbenv; + int ret; + + if ((ret = db_env_create(dbenvp, 0)) != 0) { + fprintf(stderr, + "%s: db_env_create: %s\n", ldg->progname, db_strerror(ret)); + return (ret); + } + dbenv = *dbenvp; + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, ldg->progname); + if (ldg->passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + ldg->passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + return (ret); + } + if ((ret = db_load_db_init(dbenv, ldg->home, ldg->cache, &ldg->private)) != 0) + return (ret); + dbenv->app_private = ldg; + + return (0); +} diff --git a/bdb/build_vxworks/db_load/db_load.wpj b/bdb/build_vxworks/db_load/db_load.wpj new file mode 100755 index 00000000000..59e194ae386 --- /dev/null +++ b/bdb/build_vxworks/db_load/db_load.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_load.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_load.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_load.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_load.c_dependDone +FALSE + + + FILE_db_load.c_dependencies + + + + FILE_db_load.c_objects +db_load.o + + + FILE_db_load.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_load.c + + + userComments +db_load + diff --git a/bdb/build_vxworks/db_load/db_load/Makefile.custom b/bdb/build_vxworks/db_load/db_load/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_load/db_load/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_load/db_load/component.cdf b/bdb/build_vxworks/db_load/db_load/component.cdf new file mode 100755 index 00000000000..7d1d2bc9586 --- /dev/null +++ b/bdb/build_vxworks/db_load/db_load/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_LOAD { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_load.o + NAME db_load + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_load.o { + + NAME db_load.o + SRC_PATH_NAME $PRJ_DIR/../db_load.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_load/db_load/component.wpj b/bdb/build_vxworks/db_load/db_load/component.wpj new file mode 100755 index 00000000000..216e7d9786c --- /dev/null +++ b/bdb/build_vxworks/db_load/db_load/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_objects +db_load.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_objects +db_load.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_load.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_load.c_objects +db_load.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_load.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_load.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_load.c_objects +db_load.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_load.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_load.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_printlog/db_printlog.c b/bdb/build_vxworks/db_printlog/db_printlog.c new file mode 100644 index 00000000000..380e29021f5 --- /dev/null +++ b/bdb/build_vxworks/db_printlog/db_printlog.c @@ -0,0 +1,375 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_printlog.c,v 11.52 2002/08/08 03:50:38 bostic Exp $"; +#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" +#include "dbinc/fop.h" +#include "dbinc/hash.h" +#include "dbinc/log.h" +#include "dbinc/qam.h" +#include "dbinc/rep.h" +#include "dbinc/txn.h" + +int db_printlog_main __P((int, char *[])); +int db_printlog_usage __P((void)); +int db_printlog_version_check __P((const char *)); +int db_printlog_print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops)); +int db_printlog_open_rep_db __P((DB_ENV *, DB **, DBC **)); + +int +db_printlog(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_printlog", args, &argc, &argv); + return (db_printlog_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_printlog_main(argc, argv) + int argc; + char *argv[]; +{ + extern char *optarg; + extern int optind, __db_getopt_reset; + const char *progname = "db_printlog"; + DB *dbp; + DBC *dbc; + DB_ENV *dbenv; + DB_LOGC *logc; + int (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t dtabsize; + DBT data, keydbt; + DB_LSN key; + int ch, e_close, exitval, nflag, rflag, ret, repflag; + char *home, *passwd; + + if ((ret = db_printlog_version_check(progname)) != 0) + return (ret); + + dbp = NULL; + dbc = NULL; + logc = NULL; + e_close = exitval = nflag = rflag = repflag = 0; + home = passwd = NULL; + dtabsize = 0; + dtab = NULL; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "h:NP:rRV")) != EOF) + switch (ch) { + case 'h': + home = optarg; + break; + case 'N': + nflag = 1; + 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 'r': + rflag = 1; + break; + case 'R': + repflag = 1; + break; + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case '?': + default: + return (db_printlog_usage()); + } + argc -= optind; + argv += optind; + + if (argc > 0) + return (db_printlog_usage()); + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* + * 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)); + goto shutdown; + } + e_close = 1; + + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, progname); + + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto shutdown; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto shutdown; + } + } + + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto shutdown; + } + + /* + * Set up an app-specific dispatch function so that we can gracefully + * handle app-specific log records. + */ + if ((ret = dbenv->set_app_dispatch(dbenv, db_printlog_print_app_record)) != 0) { + dbenv->err(dbenv, ret, "app_dispatch"); + goto shutdown; + } + + /* + * An environment is required, but as all we're doing is reading log + * files, we create one if it doesn't already exist. If we create + * it, create it private so it automatically goes away when we're done. + * If we are reading the replication database, do not open the env + * with logging, because we don't want to log the opens. + */ + if (repflag) { + if ((ret = dbenv->open(dbenv, home, + DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0 && + (ret = dbenv->open(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) + != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } + } else if ((ret = dbenv->open(dbenv, home, + DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 && + (ret = dbenv->open(dbenv, home, + DB_CREATE | DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } + + /* Initialize print callbacks. */ + if ((ret = __bam_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __dbreg_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __crdel_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __db_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __fop_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __qam_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __ham_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (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) + goto shutdown; + } else if ((ret = dbenv->log_cursor(dbenv, &logc, 0)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->log_cursor"); + goto shutdown; + } + + memset(&data, 0, sizeof(data)); + memset(&keydbt, 0, sizeof(keydbt)); + while (!__db_util_interrupted()) { + if (repflag) { + ret = dbc->c_get(dbc, + &keydbt, &data, rflag ? DB_PREV : DB_NEXT); + if (ret == 0) + key = ((REP_CONTROL *)keydbt.data)->lsn; + } else + ret = logc->get(logc, + &key, &data, rflag ? DB_PREV : DB_NEXT); + if (ret != 0) { + if (ret == DB_NOTFOUND) + break; + dbenv->err(dbenv, + ret, repflag ? "DB_LOGC->get" : "DBC->get"); + goto shutdown; + } + + ret = __db_dispatch(dbenv, + dtab, dtabsize, &data, &key, DB_TXN_PRINT, NULL); + + /* + * XXX + * Just in case the underlying routines don't flush. + */ + (void)fflush(stdout); + + if (ret != 0) { + dbenv->err(dbenv, ret, "tx: dispatch"); + goto shutdown; + } + } + + if (0) { +shutdown: exitval = 1; + } + if (logc != NULL && (ret = logc->close(logc, 0)) != 0) + exitval = 1; + + if (dbc != NULL && (ret = dbc->c_close(dbc)) != 0) + exitval = 1; + + if (dbp != NULL && (ret = dbp->close(dbp, 0)) != 0) + exitval = 1; + + /* + * The dtab is allocated by __db_add_recovery (called by *_init_print) + * using the library malloc function (__os_malloc). It thus needs to be + * freed using the corresponding free (__os_free). + */ + if (dtab != NULL) + __os_free(dbenv, dtab); + if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +int +db_printlog_usage() +{ + fprintf(stderr, "%s\n", + "usage: db_printlog [-NrV] [-h home] [-P password]"); + return (EXIT_FAILURE); +} + +int +db_printlog_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} + +/* Print an unknown, application-specific log record as best we can. */ +int +db_printlog_print_app_record(dbenv, dbt, lsnp, op) + DB_ENV *dbenv; + DBT *dbt; + DB_LSN *lsnp; + db_recops op; +{ + int ch; + u_int32_t i, rectype; + + DB_ASSERT(op == DB_TXN_PRINT); + COMPQUIET(dbenv, NULL); + + /* + * Fetch the rectype, which always must be at the beginning of the + * record (if dispatching is to work at all). + */ + memcpy(&rectype, dbt->data, sizeof(rectype)); + + /* + * Applications may wish to customize the output here based on the + * rectype. We just print the entire log record in the generic + * mixed-hex-and-printable format we use for binary data. + */ + printf("[%lu][%lu]application specific record: rec: %lu\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)rectype); + printf("\tdata: "); + for (i = 0; i < dbt->size; i++) { + ch = ((u_int8_t *)dbt->data)[i]; + printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch); + } + printf("\n\n"); + + return (0); +} + +int +db_printlog_open_rep_db(dbenv, dbpp, dbcp) + DB_ENV *dbenv; + DB **dbpp; + DBC **dbcp; +{ + int ret; + + DB *dbp; + *dbpp = NULL; + *dbcp = NULL; + + if ((ret = db_create(dbpp, dbenv, 0)) != 0) { + dbenv->err(dbenv, ret, "db_create"); + return (ret); + } + + dbp = *dbpp; + if ((ret = + dbp->open(dbp, NULL, "__db.rep.db", NULL, DB_BTREE, 0, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->open"); + goto err; + } + + if ((ret = dbp->cursor(dbp, NULL, dbcp, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->cursor"); + goto err; + } + + return (0); + +err: if (*dbpp != NULL) + (void)(*dbpp)->close(*dbpp, 0); + return (ret); +} diff --git a/bdb/build_vxworks/db_printlog/db_printlog.wpj b/bdb/build_vxworks/db_printlog/db_printlog.wpj new file mode 100755 index 00000000000..514122e6125 --- /dev/null +++ b/bdb/build_vxworks/db_printlog/db_printlog.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_printlog.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_printlog.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_printlog.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_printlog.c_dependDone +FALSE + + + FILE_db_printlog.c_dependencies + + + + FILE_db_printlog.c_objects +db_printlog.o + + + FILE_db_printlog.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_printlog.c + + + userComments +db_printlog + diff --git a/bdb/build_vxworks/db_printlog/db_printlog/Makefile.custom b/bdb/build_vxworks/db_printlog/db_printlog/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_printlog/db_printlog/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_printlog/db_printlog/component.cdf b/bdb/build_vxworks/db_printlog/db_printlog/component.cdf new file mode 100755 index 00000000000..57c645259a4 --- /dev/null +++ b/bdb/build_vxworks/db_printlog/db_printlog/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_PRINTLOG { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_printlog.o + NAME db_printlog + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_printlog.o { + + NAME db_printlog.o + SRC_PATH_NAME $PRJ_DIR/../db_printlog.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_printlog/db_printlog/component.wpj b/bdb/build_vxworks/db_printlog/db_printlog/component.wpj new file mode 100755 index 00000000000..81d2447459d --- /dev/null +++ b/bdb/build_vxworks/db_printlog/db_printlog/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_objects +db_printlog.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_objects +db_printlog.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_printlog.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_printlog.c_objects +db_printlog.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_printlog.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_objects +db_printlog.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_printlog.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_recover/db_recover.c b/bdb/build_vxworks/db_recover/db_recover.c new file mode 100644 index 00000000000..055964c8508 --- /dev/null +++ b/bdb/build_vxworks/db_recover/db_recover.c @@ -0,0 +1,328 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_recover.c,v 11.33 2002/03/28 20:13:42 bostic Exp $"; +#endif + +#ifndef NO_SYSTEM_INCLUDES +#include + +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + +#include +#include +#include +#endif + +#include "db_int.h" +#include "dbinc/txn.h" + +int db_recover_main __P((int, char *[])); +int db_recover_read_timestamp __P((const char *, char *, time_t *)); +int db_recover_usage __P((void)); +int db_recover_version_check __P((const char *)); + +int +db_recover(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_recover", args, &argc, &argv); + return (db_recover_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_recover_main(argc, argv) + int argc; + char *argv[]; +{ + extern char *optarg; + extern int optind, __db_getopt_reset; + const char *progname = "db_recover"; + DB_ENV *dbenv; + DB_TXNREGION *region; + time_t now, 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) + return (ret); + + home = passwd = NULL; + timestamp = 0; + exitval = fatal_recover = retain_env = verbose = 0; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "ceh:P:t:Vv")) != EOF) + switch (ch) { + case 'c': + fatal_recover = 1; + break; + case 'e': + retain_env = 1; + break; + case 'h': + home = 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 ((ret = + db_recover_read_timestamp(progname, optarg, ×tamp)) != 0) + return (ret); + break; + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case 'v': + verbose = 1; + break; + case '?': + default: + return (db_recover_usage()); + } + argc -= optind; + argv += optind; + + if (argc != 0) + return (db_recover_usage()); + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* + * 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 (EXIT_FAILURE); + } + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, progname); + if (verbose) { + (void)dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, 1); + (void)dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, 1); + } + if (timestamp && + (ret = dbenv->set_tx_timestamp(dbenv, ×tamp)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->set_timestamp"); + goto shutdown; + } + + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto shutdown; + } + + /* + * Initialize the environment -- we don't actually do anything + * else, that all that's needed to run recovery. + * + * Note that unless the caller specified the -e option, we use a + * private environment, as we're about to create a region, and we + * don't want to to leave it around. If we leave the region around, + * the application that should create it will simply join it instead, + * and will then be running with incorrectly sized (and probably + * terribly small) caches. Applications that use -e should almost + * certainly use DB_CONFIG files in the directory. + */ + flags = 0; + LF_SET(DB_CREATE | DB_INIT_LOCK | 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); + if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->open"); + goto shutdown; + } + + if (verbose) { + (void)time(&now); + region = ((DB_TXNMGR *)dbenv->tx_handle)->reginfo.primary; + dbenv->errx(dbenv, "Recovery complete at %.24s", ctime(&now)); + dbenv->errx(dbenv, "%s %lx %s [%lu][%lu]", + "Maximum transaction id", (u_long)region->last_txnid, + "Recovery checkpoint", (u_long)region->last_ckp.file, + (u_long)region->last_ckp.offset); + } + + if (0) { +shutdown: exitval = 1; + } + + /* Clean up the environment. */ + if ((ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; + +/* + * read_timestamp -- + * Convert a time argument to Epoch seconds. + * + * Copyright (c) 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. 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. + */ +int +db_recover_read_timestamp(progname, arg, timep) + const char *progname; + char *arg; + time_t *timep; +{ + struct tm *t; + time_t now; + int yearset; + char *p; + /* Start with the current time. */ + (void)time(&now); + if ((t = localtime(&now)) == NULL) { + fprintf(stderr, + "%s: localtime: %s\n", progname, strerror(errno)); + return (EXIT_FAILURE); + } + /* [[CC]YY]MMDDhhmm[.SS] */ + if ((p = strchr(arg, '.')) == NULL) + t->tm_sec = 0; /* Seconds defaults to 0. */ + else { + if (strlen(p + 1) != 2) + goto terr; + *p++ = '\0'; + t->tm_sec = ATOI2(p); + } + + yearset = 0; + switch(strlen(arg)) { + case 12: /* CCYYMMDDhhmm */ + t->tm_year = ATOI2(arg); + t->tm_year *= 100; + yearset = 1; + /* FALLTHROUGH */ + case 10: /* YYMMDDhhmm */ + if (yearset) { + yearset = ATOI2(arg); + t->tm_year += yearset; + } else { + yearset = ATOI2(arg); + if (yearset < 69) + t->tm_year = yearset + 2000; + else + t->tm_year = yearset + 1900; + } + t->tm_year -= 1900; /* Convert to UNIX time. */ + /* FALLTHROUGH */ + case 8: /* MMDDhhmm */ + t->tm_mon = ATOI2(arg); + --t->tm_mon; /* Convert from 01-12 to 00-11 */ + t->tm_mday = ATOI2(arg); + t->tm_hour = ATOI2(arg); + t->tm_min = ATOI2(arg); + break; + default: + goto terr; + } + + t->tm_isdst = -1; /* Figure out DST. */ + + *timep = mktime(t); + if (*timep == -1) { +terr: fprintf(stderr, + "%s: out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]", + progname); + return (EXIT_FAILURE); + } + return (0); +} + +int +db_recover_usage() +{ + (void)fprintf(stderr, "%s\n", +"usage: db_recover [-ceVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]"); + return (EXIT_FAILURE); +} + +int +db_recover_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} diff --git a/bdb/build_vxworks/db_recover/db_recover.wpj b/bdb/build_vxworks/db_recover/db_recover.wpj new file mode 100755 index 00000000000..2df7234233a --- /dev/null +++ b/bdb/build_vxworks/db_recover/db_recover.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_recover.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_recover.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_recover.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_recover.c_dependDone +FALSE + + + FILE_db_recover.c_dependencies + + + + FILE_db_recover.c_objects +db_recover.o + + + FILE_db_recover.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_recover.c + + + userComments +db_recover + diff --git a/bdb/build_vxworks/db_recover/db_recover/Makefile.custom b/bdb/build_vxworks/db_recover/db_recover/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_recover/db_recover/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_recover/db_recover/component.cdf b/bdb/build_vxworks/db_recover/db_recover/component.cdf new file mode 100755 index 00000000000..d322bf4a8fd --- /dev/null +++ b/bdb/build_vxworks/db_recover/db_recover/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_RECOVER { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_recover.o + NAME db_recover + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_recover.o { + + NAME db_recover.o + SRC_PATH_NAME $PRJ_DIR/../db_recover.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_recover/db_recover/component.wpj b/bdb/build_vxworks/db_recover/db_recover/component.wpj new file mode 100755 index 00000000000..0daf9f6ca1e --- /dev/null +++ b/bdb/build_vxworks/db_recover/db_recover/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_objects +db_recover.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_objects +db_recover.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_recover.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_recover.c_objects +db_recover.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_recover.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_objects +db_recover.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_recover.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_stat/db_stat.c b/bdb/build_vxworks/db_stat/db_stat.c new file mode 100644 index 00000000000..5e9348fa04a --- /dev/null +++ b/bdb/build_vxworks/db_stat/db_stat.c @@ -0,0 +1,1282 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_stat.c,v 11.125 2002/08/08 15:26:15 bostic Exp $"; +#endif + +#ifndef NO_SYSTEM_INCLUDES +#include + +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + +#include +#include +#include +#include +#endif + +#include "db_int.h" +#include "dbinc/db_page.h" + +#define PCT(f, t, pgsize) \ + ((t) == 0 ? 0 : \ + (((double)(((t) * (pgsize)) - (f)) / ((t) * (pgsize))) * 100)) + +typedef enum { T_NOTSET, + T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_REP, T_TXN } test_t; + +int db_stat_argcheck __P((char *, const char *)); +int db_stat_btree_stats __P((DB_ENV *, DB *, DB_BTREE_STAT *, int)); +int db_stat_db_init __P((DB_ENV *, char *, test_t, u_int32_t, int *)); +void db_stat_dl __P((const char *, u_long)); +void db_stat_dl_bytes __P((const char *, u_long, u_long, u_long)); +int db_stat_env_stats __P((DB_ENV *, u_int32_t)); +int db_stat_hash_stats __P((DB_ENV *, DB *, int)); +int db_stat_lock_stats __P((DB_ENV *, char *, u_int32_t)); +int db_stat_log_stats __P((DB_ENV *, u_int32_t)); +int db_stat_main __P((int, char *[])); +int db_stat_mpool_stats __P((DB_ENV *, char *, u_int32_t)); +void db_stat_prflags __P((u_int32_t, const FN *)); +int db_stat_queue_stats __P((DB_ENV *, DB *, int)); +int db_stat_rep_stats __P((DB_ENV *, u_int32_t)); +int db_stat_txn_compare __P((const void *, const void *)); +int db_stat_txn_stats __P((DB_ENV *, u_int32_t)); +int db_stat_usage __P((void)); +int db_stat_version_check __P((const char *)); + +int +db_stat(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_stat", args, &argc, &argv); + return (db_stat_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_stat_main(argc, argv) + int argc; + char *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; + test_t ttype; + u_int32_t cache; + int ch, checked, d_close, e_close, exitval, fast, flags; + int nflag, private, resize, ret; + char *db, *home, *internal, *passwd, *subdb; + + if ((ret = db_stat_version_check(progname)) != 0) + return (ret); + + dbp = NULL; + ttype = T_NOTSET; + cache = MEGABYTE; + d_close = e_close = exitval = fast = flags = nflag = private = 0; + db = home = internal = passwd = subdb = NULL; + + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "C:cd:efh:lM:mNP:rs:tVZ")) != EOF) + switch (ch) { + case 'C': + if (ttype != T_NOTSET) + goto argcombo; + ttype = T_LOCK; + if (!db_stat_argcheck(internal = optarg, "Aclmop")) + return (db_stat_usage()); + break; + case 'c': + if (ttype != T_NOTSET) + goto argcombo; + ttype = T_LOCK; + break; + case 'd': + if (ttype != T_DB && ttype != T_NOTSET) + goto argcombo; + ttype = T_DB; + db = optarg; + break; + case 'e': + if (ttype != T_NOTSET) + goto argcombo; + ttype = T_ENV; + break; + case 'f': + fast = DB_FAST_STAT; + break; + case 'h': + home = optarg; + break; + case 'l': + if (ttype != T_NOTSET) + goto argcombo; + ttype = T_LOG; + break; + case 'M': + if (ttype != T_NOTSET) + goto argcombo; + ttype = T_MPOOL; + if (!db_stat_argcheck(internal = optarg, "Ahm")) + return (db_stat_usage()); + break; + case 'm': + if (ttype != T_NOTSET) + goto argcombo; + ttype = T_MPOOL; + break; + case 'N': + nflag = 1; + 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 'r': + if (ttype != T_NOTSET) + goto argcombo; + ttype = T_REP; + break; + case 's': + if (ttype != T_DB && ttype != T_NOTSET) + goto argcombo; + ttype = T_DB; + subdb = optarg; + break; + case 't': + if (ttype != T_NOTSET) { +argcombo: fprintf(stderr, + "%s: illegal option combination\n", + progname); + return (EXIT_FAILURE); + } + ttype = T_TXN; + break; + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case 'Z': + flags |= DB_STAT_CLEAR; + break; + case '?': + default: + return (db_stat_usage()); + } + argc -= optind; + argv += optind; + + switch (ttype) { + case T_DB: + if (db == NULL) + return (db_stat_usage()); + break; + case T_NOTSET: + return (db_stat_usage()); + /* NOTREACHED */ + default: + if (fast != 0) + return (db_stat_usage()); + break; + } + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* + * Create an environment object and initialize it for error + * reporting. + */ +retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { + fprintf(stderr, + "%s: db_env_create: %s\n", progname, db_strerror(ret)); + goto shutdown; + } + e_close = 1; + + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, progname); + + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto shutdown; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto shutdown; + } + } + + if (passwd != NULL && + (ret = dbenv->set_encrypt(dbenv, passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto shutdown; + } + + /* Initialize the environment. */ + if (db_stat_db_init(dbenv, home, ttype, cache, &private) != 0) + goto shutdown; + + switch (ttype) { + case T_DB: + /* Create the DB object and open the file. */ + if (flags != 0) + return (db_stat_usage()); + if ((ret = db_create(&dbp, dbenv, 0)) != 0) { + dbenv->err(dbenv, ret, "db_create"); + goto shutdown; + } + d_close = 1; + + if ((ret = dbp->open(dbp, + NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbp->err(dbp, ret, "DB->open: %s", db); + goto shutdown; + } + + /* Check if cache is too small for this DB's pagesize. */ + if (private) { + if ((ret = + __db_util_cache(dbenv, dbp, &cache, &resize)) != 0) + goto shutdown; + if (resize) { + (void)dbp->close(dbp, 0); + d_close = 0; + + (void)dbenv->close(dbenv, 0); + e_close = 0; + goto retry; + } + } + + /* + * 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. + */ + checked = 0; + if (subdb == NULL && dbp->type == DB_BTREE) { + if ((ret = dbp->stat(dbp, &sp, DB_FAST_STAT)) != 0) { + dbp->err(dbp, ret, "DB->stat"); + goto shutdown; + } + checked = 1; + } + + 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 shutdown; + } + if ((ret = dbp->open(alt_dbp, NULL, + db, subdb, DB_UNKNOWN, 0, 0)) != 0) { + dbenv->err(dbenv, + ret, "DB->open: %s:%s", db, subdb); + (void)alt_dbp->close(alt_dbp, 0); + goto shutdown; + } + + (void)dbp->close(dbp, 0); + dbp = alt_dbp; + + /* Need to run again to update counts */ + checked = 0; + } + + switch (dbp->type) { + case DB_BTREE: + case DB_RECNO: + if (db_stat_btree_stats( + dbenv, dbp, checked == 1 ? sp : NULL, fast)) + goto shutdown; + break; + case DB_HASH: + if (db_stat_hash_stats(dbenv, dbp, fast)) + goto shutdown; + break; + case DB_QUEUE: + if (db_stat_queue_stats(dbenv, dbp, fast)) + goto shutdown; + break; + case DB_UNKNOWN: + dbenv->errx(dbenv, "Unknown database type."); + goto shutdown; + } + break; + case T_ENV: + if (db_stat_env_stats(dbenv, flags)) + goto shutdown; + break; + case T_LOCK: + if (db_stat_lock_stats(dbenv, internal, flags)) + goto shutdown; + break; + case T_LOG: + if (db_stat_log_stats(dbenv, flags)) + goto shutdown; + break; + case T_MPOOL: + if (db_stat_mpool_stats(dbenv, internal, flags)) + goto shutdown; + break; + case T_REP: + if (db_stat_rep_stats(dbenv, flags)) + goto shutdown; + break; + case T_TXN: + if (db_stat_txn_stats(dbenv, flags)) + goto shutdown; + break; + case T_NOTSET: + dbenv->errx(dbenv, "Unknown statistics flag."); + goto shutdown; + } + + if (0) { +shutdown: exitval = 1; + } + if (d_close && (ret = dbp->close(dbp, 0)) != 0) { + exitval = 1; + dbenv->err(dbenv, ret, "close"); + } + if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +/* + * env_stats -- + * Display environment statistics. + */ +int +db_stat_env_stats(dbenv, flags) + DB_ENV *dbenv; + u_int32_t flags; +{ + REGENV renv; + REGION *rp, regs[1024]; + int n, ret; + const char *lable; + + n = sizeof(regs) / sizeof(regs[0]); + if ((ret = __db_e_stat(dbenv, &renv, regs, &n, flags)) != 0) { + dbenv->err(dbenv, ret, "__db_e_stat"); + return (1); + } + + printf("%d.%d.%d\tEnvironment version.\n", + renv.majver, renv.minver, renv.patch); + printf("%lx\tMagic number.\n", (u_long)renv.magic); + printf("%d\tPanic value.\n", renv.envpanic); + + /* Adjust the reference count for us... */ + printf("%d\tReferences.\n", renv.refcnt - 1); + + db_stat_dl("Locks granted without waiting.\n", + (u_long)renv.mutex.mutex_set_nowait); + db_stat_dl("Locks granted after waiting.\n", + (u_long)renv.mutex.mutex_set_wait); + + while (n > 0) { + printf("%s\n", DB_LINE); + rp = ®s[--n]; + switch (rp->type) { + case REGION_TYPE_ENV: + lable = "Environment"; + break; + case REGION_TYPE_LOCK: + lable = "Lock"; + break; + case REGION_TYPE_LOG: + lable = "Log"; + break; + case REGION_TYPE_MPOOL: + lable = "Mpool"; + break; + case REGION_TYPE_MUTEX: + lable = "Mutex"; + break; + case REGION_TYPE_TXN: + lable = "Txn"; + break; + case INVALID_REGION_TYPE: + default: + lable = "Invalid"; + break; + } + printf("%s Region: %d.\n", lable, rp->id); + db_stat_dl_bytes("Size", (u_long)0, (u_long)0, (u_long)rp->size); + printf("%ld\tSegment ID.\n", rp->segid); + db_stat_dl("Locks granted without waiting.\n", + (u_long)rp->mutex.mutex_set_nowait); + db_stat_dl("Locks granted after waiting.\n", + (u_long)rp->mutex.mutex_set_wait); + } + + return (0); +} + +/* + * btree_stats -- + * Display btree/recno statistics. + */ +int +db_stat_btree_stats(dbenv, dbp, msp, fast) + DB_ENV *dbenv; + DB *dbp; + DB_BTREE_STAT *msp; + int fast; +{ + static const FN fn[] = { + { BTM_DUP, "duplicates" }, + { BTM_FIXEDLEN, "fixed-length" }, + { BTM_RECNO, "recno" }, + { BTM_RECNUM, "record-numbers" }, + { BTM_RENUMBER, "renumber" }, + { BTM_SUBDB, "multiple-databases" }, + { 0, NULL } + }; + DB_BTREE_STAT *sp; + int ret; + + COMPQUIET(dbenv, NULL); + + if (msp != NULL) + sp = msp; + else if ((ret = dbp->stat(dbp, &sp, fast)) != 0) { + dbp->err(dbp, ret, "DB->stat"); + return (1); + } + + printf("%lx\tBtree magic number.\n", (u_long)sp->bt_magic); + printf("%lu\tBtree version number.\n", (u_long)sp->bt_version); + db_stat_prflags(sp->bt_metaflags, fn); + if (dbp->type == DB_BTREE) { +#ifdef NOT_IMPLEMENTED + db_stat_dl("Maximum keys per-page.\n", (u_long)sp->bt_maxkey); +#endif + db_stat_dl("Minimum keys per-page.\n", (u_long)sp->bt_minkey); + } + if (dbp->type == DB_RECNO) { + db_stat_dl("Fixed-length record size.\n", (u_long)sp->bt_re_len); + if (isprint(sp->bt_re_pad) && !isspace(sp->bt_re_pad)) + printf("%c\tFixed-length record pad.\n", + (int)sp->bt_re_pad); + else + printf("0x%x\tFixed-length record pad.\n", + (int)sp->bt_re_pad); + } + db_stat_dl("Underlying database page size.\n", (u_long)sp->bt_pagesize); + db_stat_dl("Number of levels in the tree.\n", (u_long)sp->bt_levels); + db_stat_dl(dbp->type == DB_BTREE ? + "Number of unique keys in the tree.\n" : + "Number of records in the tree.\n", (u_long)sp->bt_nkeys); + db_stat_dl("Number of data items in the tree.\n", (u_long)sp->bt_ndata); + + db_stat_dl("Number of tree internal pages.\n", (u_long)sp->bt_int_pg); + db_stat_dl("Number of bytes free in tree internal pages", + (u_long)sp->bt_int_pgfree); + printf(" (%.0f%% ff).\n", + PCT(sp->bt_int_pgfree, sp->bt_int_pg, sp->bt_pagesize)); + + db_stat_dl("Number of tree leaf pages.\n", (u_long)sp->bt_leaf_pg); + db_stat_dl("Number of bytes free in tree leaf pages", + (u_long)sp->bt_leaf_pgfree); + printf(" (%.0f%% ff).\n", + PCT(sp->bt_leaf_pgfree, sp->bt_leaf_pg, sp->bt_pagesize)); + + db_stat_dl("Number of tree duplicate pages.\n", (u_long)sp->bt_dup_pg); + db_stat_dl("Number of bytes free in tree duplicate pages", + (u_long)sp->bt_dup_pgfree); + printf(" (%.0f%% ff).\n", + PCT(sp->bt_dup_pgfree, sp->bt_dup_pg, sp->bt_pagesize)); + + db_stat_dl("Number of tree overflow pages.\n", (u_long)sp->bt_over_pg); + db_stat_dl("Number of bytes free in tree overflow pages", + (u_long)sp->bt_over_pgfree); + printf(" (%.0f%% ff).\n", + PCT(sp->bt_over_pgfree, sp->bt_over_pg, sp->bt_pagesize)); + + db_stat_dl("Number of pages on the free list.\n", (u_long)sp->bt_free); + + free(sp); + + return (0); +} + +/* + * hash_stats -- + * Display hash statistics. + */ +int +db_stat_hash_stats(dbenv, dbp, fast) + DB_ENV *dbenv; + DB *dbp; + int fast; +{ + static const FN fn[] = { + { DB_HASH_DUP, "duplicates" }, + { DB_HASH_SUBDB,"multiple-databases" }, + { 0, NULL } + }; + DB_HASH_STAT *sp; + int ret; + + COMPQUIET(dbenv, NULL); + + if ((ret = dbp->stat(dbp, &sp, fast)) != 0) { + dbp->err(dbp, ret, "DB->stat"); + return (1); + } + + printf("%lx\tHash magic number.\n", (u_long)sp->hash_magic); + printf("%lu\tHash version number.\n", (u_long)sp->hash_version); + db_stat_prflags(sp->hash_metaflags, fn); + db_stat_dl("Underlying database page size.\n", (u_long)sp->hash_pagesize); + db_stat_dl("Specified fill factor.\n", (u_long)sp->hash_ffactor); + db_stat_dl("Number of keys in the database.\n", (u_long)sp->hash_nkeys); + db_stat_dl("Number of data items in the database.\n", (u_long)sp->hash_ndata); + + db_stat_dl("Number of hash buckets.\n", (u_long)sp->hash_buckets); + db_stat_dl("Number of bytes free on bucket pages", (u_long)sp->hash_bfree); + printf(" (%.0f%% ff).\n", + PCT(sp->hash_bfree, sp->hash_buckets, sp->hash_pagesize)); + + db_stat_dl("Number of overflow pages.\n", (u_long)sp->hash_bigpages); + db_stat_dl("Number of bytes free in overflow pages", + (u_long)sp->hash_big_bfree); + printf(" (%.0f%% ff).\n", + PCT(sp->hash_big_bfree, sp->hash_bigpages, sp->hash_pagesize)); + + db_stat_dl("Number of bucket overflow pages.\n", (u_long)sp->hash_overflows); + db_stat_dl("Number of bytes free in bucket overflow pages", + (u_long)sp->hash_ovfl_free); + printf(" (%.0f%% ff).\n", + PCT(sp->hash_ovfl_free, sp->hash_overflows, sp->hash_pagesize)); + + db_stat_dl("Number of duplicate pages.\n", (u_long)sp->hash_dup); + db_stat_dl("Number of bytes free in duplicate pages", + (u_long)sp->hash_dup_free); + printf(" (%.0f%% ff).\n", + PCT(sp->hash_dup_free, sp->hash_dup, sp->hash_pagesize)); + + db_stat_dl("Number of pages on the free list.\n", (u_long)sp->hash_free); + + free(sp); + + return (0); +} + +/* + * queue_stats -- + * Display queue statistics. + */ +int +db_stat_queue_stats(dbenv, dbp, fast) + DB_ENV *dbenv; + DB *dbp; + int fast; +{ + DB_QUEUE_STAT *sp; + int ret; + + COMPQUIET(dbenv, NULL); + + if ((ret = dbp->stat(dbp, &sp, fast)) != 0) { + dbp->err(dbp, ret, "DB->stat"); + return (1); + } + + printf("%lx\tQueue magic number.\n", (u_long)sp->qs_magic); + printf("%lu\tQueue version number.\n", (u_long)sp->qs_version); + db_stat_dl("Fixed-length record size.\n", (u_long)sp->qs_re_len); + if (isprint(sp->qs_re_pad) && !isspace(sp->qs_re_pad)) + printf("%c\tFixed-length record pad.\n", (int)sp->qs_re_pad); + else + printf("0x%x\tFixed-length record pad.\n", (int)sp->qs_re_pad); + db_stat_dl("Underlying database page size.\n", (u_long)sp->qs_pagesize); + if (sp->qs_extentsize != 0) + db_stat_dl("Underlying database extent size.\n", + (u_long)sp->qs_extentsize); + db_stat_dl("Number of records in the database.\n", (u_long)sp->qs_nkeys); + db_stat_dl("Number of database pages.\n", (u_long)sp->qs_pages); + db_stat_dl("Number of bytes free in database pages", (u_long)sp->qs_pgfree); + printf(" (%.0f%% ff).\n", + PCT(sp->qs_pgfree, sp->qs_pages, sp->qs_pagesize)); + printf("%lu\tFirst undeleted record.\n", (u_long)sp->qs_first_recno); + printf( + "%lu\tNext available record number.\n", (u_long)sp->qs_cur_recno); + + free(sp); + + return (0); +} + +/* + * lock_stats -- + * Display lock statistics. + */ +int +db_stat_lock_stats(dbenv, internal, flags) + DB_ENV *dbenv; + char *internal; + u_int32_t flags; +{ + DB_LOCK_STAT *sp; + int ret; + + if (internal != NULL) { + if ((ret = + dbenv->lock_dump_region(dbenv, internal, stdout)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } + return (0); + } + + if ((ret = dbenv->lock_stat(dbenv, &sp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } + + db_stat_dl("Last allocated locker ID.\n", (u_long)sp->st_id); + db_stat_dl("Current maximum unused locker ID.\n", (u_long)sp->st_cur_maxid); + db_stat_dl("Number of lock modes.\n", (u_long)sp->st_nmodes); + db_stat_dl("Maximum number of locks possible.\n", (u_long)sp->st_maxlocks); + db_stat_dl("Maximum number of lockers possible.\n", (u_long)sp->st_maxlockers); + db_stat_dl("Maximum number of lock objects possible.\n", + (u_long)sp->st_maxobjects); + db_stat_dl("Number of current locks.\n", (u_long)sp->st_nlocks); + db_stat_dl("Maximum number of locks at any one time.\n", + (u_long)sp->st_maxnlocks); + db_stat_dl("Number of current lockers.\n", (u_long)sp->st_nlockers); + db_stat_dl("Maximum number of lockers at any one time.\n", + (u_long)sp->st_maxnlockers); + db_stat_dl("Number of current lock objects.\n", (u_long)sp->st_nobjects); + db_stat_dl("Maximum number of lock objects at any one time.\n", + (u_long)sp->st_maxnobjects); + db_stat_dl("Total number of locks requested.\n", (u_long)sp->st_nrequests); + db_stat_dl("Total number of locks released.\n", (u_long)sp->st_nreleases); + db_stat_dl( + "Total number of lock requests failing because DB_LOCK_NOWAIT was set.\n", + (u_long)sp->st_nnowaits); + db_stat_dl( + "Total number of locks not immediately available due to conflicts.\n", + (u_long)sp->st_nconflicts); + db_stat_dl("Number of deadlocks.\n", (u_long)sp->st_ndeadlocks); + db_stat_dl("Lock timeout value.\n", (u_long)sp->st_locktimeout); + db_stat_dl("Number of locks that have timed out.\n", + (u_long)sp->st_nlocktimeouts); + db_stat_dl("Transaction timeout value.\n", (u_long)sp->st_txntimeout); + db_stat_dl("Number of transactions that have timed out.\n", + (u_long)sp->st_ntxntimeouts); + + db_stat_dl_bytes("The size of the lock region.", + (u_long)0, (u_long)0, (u_long)sp->st_regsize); + db_stat_dl("The number of region locks granted after waiting.\n", + (u_long)sp->st_region_wait); + db_stat_dl("The number of region locks granted without waiting.\n", + (u_long)sp->st_region_nowait); + + free(sp); + + return (0); +} + +/* + * log_stats -- + * Display log statistics. + */ +int +db_stat_log_stats(dbenv, flags) + DB_ENV *dbenv; + u_int32_t flags; +{ + DB_LOG_STAT *sp; + int ret; + + if ((ret = dbenv->log_stat(dbenv, &sp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } + + printf("%lx\tLog magic number.\n", (u_long)sp->st_magic); + printf("%lu\tLog version number.\n", (u_long)sp->st_version); + db_stat_dl_bytes("Log record cache size", + (u_long)0, (u_long)0, (u_long)sp->st_lg_bsize); + printf("%#o\tLog file mode.\n", sp->st_mode); + if (sp->st_lg_size % MEGABYTE == 0) + printf("%luMb\tCurrent log file size.\n", + (u_long)sp->st_lg_size / MEGABYTE); + else if (sp->st_lg_size % 1024 == 0) + printf("%luKb\tCurrent log file size.\n", + (u_long)sp->st_lg_size / 1024); + else + printf("%lu\tCurrent log file size.\n", + (u_long)sp->st_lg_size); + db_stat_dl_bytes("Log bytes written", + (u_long)0, (u_long)sp->st_w_mbytes, (u_long)sp->st_w_bytes); + db_stat_dl_bytes("Log bytes written since last checkpoint", + (u_long)0, (u_long)sp->st_wc_mbytes, (u_long)sp->st_wc_bytes); + db_stat_dl("Total log file writes.\n", (u_long)sp->st_wcount); + db_stat_dl("Total log file write due to overflow.\n", + (u_long)sp->st_wcount_fill); + db_stat_dl("Total log file flushes.\n", (u_long)sp->st_scount); + printf("%lu\tCurrent log file number.\n", (u_long)sp->st_cur_file); + printf("%lu\tCurrent log file offset.\n", (u_long)sp->st_cur_offset); + printf("%lu\tOn-disk log file number.\n", (u_long)sp->st_disk_file); + printf("%lu\tOn-disk log file offset.\n", (u_long)sp->st_disk_offset); + + db_stat_dl("Max commits in a log flush.\n", (u_long)sp->st_maxcommitperflush); + db_stat_dl("Min commits in a log flush.\n", (u_long)sp->st_mincommitperflush); + + db_stat_dl_bytes("Log region size", + (u_long)0, (u_long)0, (u_long)sp->st_regsize); + db_stat_dl("The number of region locks granted after waiting.\n", + (u_long)sp->st_region_wait); + db_stat_dl("The number of region locks granted without waiting.\n", + (u_long)sp->st_region_nowait); + + free(sp); + + return (0); +} + +/* + * mpool_stats -- + * Display mpool statistics. + */ +int +db_stat_mpool_stats(dbenv, internal, flags) + DB_ENV *dbenv; + char *internal; + u_int32_t flags; +{ + DB_MPOOL_FSTAT **fsp; + DB_MPOOL_STAT *gsp; + int ret; + + if (internal != NULL) { + if ((ret = + dbenv->memp_dump_region(dbenv, internal, stdout)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } + return (0); + } + + if ((ret = dbenv->memp_stat(dbenv, &gsp, &fsp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } + + db_stat_dl_bytes("Total cache size", + (u_long)gsp->st_gbytes, (u_long)0, (u_long)gsp->st_bytes); + db_stat_dl("Number of caches.\n", (u_long)gsp->st_ncache); + db_stat_dl_bytes("Pool individual cache size", + (u_long)0, (u_long)0, (u_long)gsp->st_regsize); + db_stat_dl("Requested pages mapped into the process' address space.\n", + (u_long)gsp->st_map); + db_stat_dl("Requested pages found in the cache", (u_long)gsp->st_cache_hit); + if (gsp->st_cache_hit + gsp->st_cache_miss != 0) + printf(" (%.0f%%)", ((double)gsp->st_cache_hit / + (gsp->st_cache_hit + gsp->st_cache_miss)) * 100); + printf(".\n"); + db_stat_dl("Requested pages not found in the cache.\n", + (u_long)gsp->st_cache_miss); + db_stat_dl("Pages created in the cache.\n", (u_long)gsp->st_page_create); + db_stat_dl("Pages read into the cache.\n", (u_long)gsp->st_page_in); + db_stat_dl("Pages written from the cache to the backing file.\n", + (u_long)gsp->st_page_out); + db_stat_dl("Clean pages forced from the cache.\n", + (u_long)gsp->st_ro_evict); + db_stat_dl("Dirty pages forced from the cache.\n", + (u_long)gsp->st_rw_evict); + db_stat_dl("Dirty pages written by trickle-sync thread.\n", + (u_long)gsp->st_page_trickle); + db_stat_dl("Current total page count.\n", + (u_long)gsp->st_pages); + db_stat_dl("Current clean page count.\n", + (u_long)gsp->st_page_clean); + db_stat_dl("Current dirty page count.\n", + (u_long)gsp->st_page_dirty); + db_stat_dl("Number of hash buckets used for page location.\n", + (u_long)gsp->st_hash_buckets); + db_stat_dl("Total number of times hash chains searched for a page.\n", + (u_long)gsp->st_hash_searches); + db_stat_dl("The longest hash chain searched for a page.\n", + (u_long)gsp->st_hash_longest); + db_stat_dl("Total number of hash buckets examined for page location.\n", + (u_long)gsp->st_hash_examined); + db_stat_dl("The number of hash bucket locks granted without waiting.\n", + (u_long)gsp->st_hash_nowait); + db_stat_dl("The number of hash bucket locks granted after waiting.\n", + (u_long)gsp->st_hash_wait); + db_stat_dl("The maximum number of times any hash bucket lock was waited for.\n", + (u_long)gsp->st_hash_max_wait); + db_stat_dl("The number of region locks granted without waiting.\n", + (u_long)gsp->st_region_nowait); + db_stat_dl("The number of region locks granted after waiting.\n", + (u_long)gsp->st_region_wait); + db_stat_dl("The number of page allocations.\n", + (u_long)gsp->st_alloc); + db_stat_dl("The number of hash buckets examined during allocations\n", + (u_long)gsp->st_alloc_buckets); + db_stat_dl("The max number of hash buckets examined for an allocation\n", + (u_long)gsp->st_alloc_max_buckets); + db_stat_dl("The number of pages examined during allocations\n", + (u_long)gsp->st_alloc_pages); + db_stat_dl("The max number of pages examined for an allocation\n", + (u_long)gsp->st_alloc_max_pages); + + for (; fsp != NULL && *fsp != NULL; ++fsp) { + printf("%s\n", DB_LINE); + printf("Pool File: %s\n", (*fsp)->file_name); + db_stat_dl("Page size.\n", (u_long)(*fsp)->st_pagesize); + db_stat_dl("Requested pages mapped into the process' address space.\n", + (u_long)(*fsp)->st_map); + db_stat_dl("Requested pages found in the cache", + (u_long)(*fsp)->st_cache_hit); + if ((*fsp)->st_cache_hit + (*fsp)->st_cache_miss != 0) + printf(" (%.0f%%)", ((double)(*fsp)->st_cache_hit / + ((*fsp)->st_cache_hit + (*fsp)->st_cache_miss)) * + 100); + printf(".\n"); + db_stat_dl("Requested pages not found in the cache.\n", + (u_long)(*fsp)->st_cache_miss); + db_stat_dl("Pages created in the cache.\n", + (u_long)(*fsp)->st_page_create); + db_stat_dl("Pages read into the cache.\n", + (u_long)(*fsp)->st_page_in); + db_stat_dl("Pages written from the cache to the backing file.\n", + (u_long)(*fsp)->st_page_out); + } + + free(gsp); + + return (0); +} + +/* + * rep_stats -- + * Display replication statistics. + */ +int +db_stat_rep_stats(dbenv, flags) + DB_ENV *dbenv; + u_int32_t flags; +{ + DB_REP_STAT *sp; + int is_client, ret; + const char *p; + + if ((ret = dbenv->rep_stat(dbenv, &sp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } + + is_client = 0; + switch (sp->st_status) { + case DB_REP_MASTER: + printf("Environment configured as a replication master.\n"); + break; + case DB_REP_CLIENT: + printf("Environment configured as a replication client.\n"); + is_client = 1; + break; + case DB_REP_LOGSONLY: + printf("Environment configured as a logs-only replica.\n"); + is_client = 1; + break; + default: + printf("Environment not configured for replication.\n"); + break; + } + + printf("%lu/%lu\t%s\n", + (u_long)sp->st_next_lsn.file, (u_long)sp->st_next_lsn.offset, + is_client ? "Next LSN expected." : "Next LSN to be used."); + p = sp->st_waiting_lsn.file == 0 ? + "Not waiting for any missed log records." : + "LSN of first missed log record being waited for."; + printf("%lu/%lu\t%s\n", + (u_long)sp->st_waiting_lsn.file, (u_long)sp->st_waiting_lsn.offset, + p); + + db_stat_dl("Number of duplicate master conditions detected.\n", + (u_long)sp->st_dupmasters); + if (sp->st_env_id != DB_EID_INVALID) + db_stat_dl("Current environment ID.\n", (u_long)sp->st_env_id); + else + printf("No current environment ID.\n"); + db_stat_dl("Current environment priority.\n", (u_long)sp->st_env_priority); + db_stat_dl("Current generation number.\n", (u_long)sp->st_gen); + db_stat_dl("Number of duplicate log records received.\n", + (u_long)sp->st_log_duplicated); + db_stat_dl("Number of log records currently queued.\n", + (u_long)sp->st_log_queued); + db_stat_dl("Maximum number of log records ever queued at once.\n", + (u_long)sp->st_log_queued_max); + db_stat_dl("Total number of log records queued.\n", + (u_long)sp->st_log_queued_total); + db_stat_dl("Number of log records received and appended to the log.\n", + (u_long)sp->st_log_records); + db_stat_dl("Number of log records missed and requested.\n", + (u_long)sp->st_log_requested); + if (sp->st_master != DB_EID_INVALID) + db_stat_dl("Current master ID.\n", (u_long)sp->st_master); + else + printf("No current master ID.\n"); + db_stat_dl("Number of times the master has changed.\n", + (u_long)sp->st_master_changes); + db_stat_dl("Number of messages received with a bad generation number.\n", + (u_long)sp->st_msgs_badgen); + db_stat_dl("Number of messages received and processed.\n", + (u_long)sp->st_msgs_processed); + db_stat_dl("Number of messages ignored due to pending recovery.\n", + (u_long)sp->st_msgs_recover); + db_stat_dl("Number of failed message sends.\n", + (u_long)sp->st_msgs_send_failures); + db_stat_dl("Number of messages sent.\n", (u_long)sp->st_msgs_sent); + db_stat_dl("Number of new site messages received.\n", (u_long)sp->st_newsites); + db_stat_dl("Transmission limited.\n", (u_long)sp->st_nthrottles); + db_stat_dl("Number of outdated conditions detected.\n", + (u_long)sp->st_outdated); + db_stat_dl("Number of transactions applied.\n", (u_long)sp->st_txns_applied); + + db_stat_dl("Number of elections held.\n", (u_long)sp->st_elections); + db_stat_dl("Number of elections won.\n", (u_long)sp->st_elections_won); + + if (sp->st_election_status == 0) + printf("No election in progress.\n"); + else { + db_stat_dl("Current election phase.\n", (u_long)sp->st_election_status); + db_stat_dl("Election winner.\n", + (u_long)sp->st_election_cur_winner); + db_stat_dl("Election generation number.\n", + (u_long)sp->st_election_gen); + printf("%lu/%lu\tMaximum LSN of election winner.\n", + (u_long)sp->st_election_lsn.file, + (u_long)sp->st_election_lsn.offset); + db_stat_dl("Number of sites expected to participate in elections.\n", + (u_long)sp->st_election_nsites); + db_stat_dl("Election priority.\n", (u_long)sp->st_election_priority); + db_stat_dl("Election tiebreaker value.\n", + (u_long)sp->st_election_tiebreaker); + db_stat_dl("Votes received this election round.\n", + (u_long)sp->st_election_votes); + } + + free(sp); + + return (0); +} + +/* + * txn_stats -- + * Display transaction statistics. + */ +int +db_stat_txn_stats(dbenv, flags) + DB_ENV *dbenv; + u_int32_t flags; +{ + DB_TXN_STAT *sp; + u_int32_t i; + int ret; + const char *p; + + if ((ret = dbenv->txn_stat(dbenv, &sp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } + + p = sp->st_last_ckp.file == 0 ? + "No checkpoint LSN." : "File/offset for last checkpoint LSN."; + printf("%lu/%lu\t%s\n", + (u_long)sp->st_last_ckp.file, (u_long)sp->st_last_ckp.offset, p); + if (sp->st_time_ckp == 0) + printf("0\tNo checkpoint timestamp.\n"); + else + printf("%.24s\tCheckpoint timestamp.\n", + ctime(&sp->st_time_ckp)); + printf("%lx\tLast transaction ID allocated.\n", + (u_long)sp->st_last_txnid); + db_stat_dl("Maximum number of active transactions possible.\n", + (u_long)sp->st_maxtxns); + db_stat_dl("Active transactions.\n", (u_long)sp->st_nactive); + db_stat_dl("Maximum active transactions.\n", (u_long)sp->st_maxnactive); + db_stat_dl("Number of transactions begun.\n", (u_long)sp->st_nbegins); + db_stat_dl("Number of transactions aborted.\n", (u_long)sp->st_naborts); + db_stat_dl("Number of transactions committed.\n", (u_long)sp->st_ncommits); + db_stat_dl("Number of transactions restored.\n", (u_long)sp->st_nrestores); + + db_stat_dl_bytes("Transaction region size", + (u_long)0, (u_long)0, (u_long)sp->st_regsize); + db_stat_dl("The number of region locks granted after waiting.\n", + (u_long)sp->st_region_wait); + db_stat_dl("The number of region locks granted without waiting.\n", + (u_long)sp->st_region_nowait); + + qsort(sp->st_txnarray, + sp->st_nactive, sizeof(sp->st_txnarray[0]), db_stat_txn_compare); + for (i = 0; i < sp->st_nactive; ++i) { + printf("\tid: %lx; begin LSN: file/offset %lu/%lu", + (u_long)sp->st_txnarray[i].txnid, + (u_long)sp->st_txnarray[i].lsn.file, + (u_long)sp->st_txnarray[i].lsn.offset); + if (sp->st_txnarray[i].parentid == 0) + printf("\n"); + else + printf(" parent: %lx\n", + (u_long)sp->st_txnarray[i].parentid); + } + + free(sp); + + return (0); +} + +int +db_stat_txn_compare(a1, b1) + const void *a1, *b1; +{ + const DB_TXN_ACTIVE *a, *b; + + a = a1; + b = b1; + + if (a->txnid > b->txnid) + return (1); + if (a->txnid < b->txnid) + return (-1); + return (0); +} + +/* + * dl -- + * Display a big value. + */ +void +db_stat_dl(msg, value) + const char *msg; + u_long value; +{ + /* + * Two formats: if less than 10 million, display as the number, if + * greater than 10 million display as ###M. + */ + if (value < 10000000) + printf("%lu\t%s", value, msg); + else + printf("%luM\t%s", value / 1000000, msg); +} + +/* + * dl_bytes -- + * Display a big number of bytes. + */ +void +db_stat_dl_bytes(msg, gbytes, mbytes, bytes) + const char *msg; + u_long gbytes, mbytes, bytes; +{ + const char *sep; + + /* Normalize the values. */ + while (bytes >= MEGABYTE) { + ++mbytes; + bytes -= MEGABYTE; + } + while (mbytes >= GIGABYTE / MEGABYTE) { + ++gbytes; + mbytes -= GIGABYTE / MEGABYTE; + } + + sep = ""; + if (gbytes > 0) { + printf("%luGB", gbytes); + sep = " "; + } + if (mbytes > 0) { + printf("%s%luMB", sep, mbytes); + sep = " "; + } + if (bytes >= 1024) { + printf("%s%luKB", sep, bytes / 1024); + bytes %= 1024; + sep = " "; + } + if (bytes > 0) + printf("%s%luB", sep, bytes); + + printf("\t%s.\n", msg); +} + +/* + * prflags -- + * Print out flag values. + */ +void +db_stat_prflags(flags, fnp) + u_int32_t flags; + const FN *fnp; +{ + const char *sep; + + sep = "\t"; + printf("Flags:"); + for (; fnp->mask != 0; ++fnp) + if (fnp->mask & flags) { + printf("%s%s", sep, fnp->name); + sep = ", "; + } + printf("\n"); +} + +/* + * db_init -- + * Initialize the environment. + */ +int +db_stat_db_init(dbenv, home, ttype, cache, is_private) + DB_ENV *dbenv; + char *home; + test_t ttype; + u_int32_t cache; + int *is_private; +{ + u_int32_t oflags; + int ret; + + /* + * If our environment open fails, and we're trying to look at a + * shared region, it's a hard failure. + * + * We will probably just drop core if the environment we join does + * not include a memory pool. This is probably acceptable; trying + * to use an existing environment that does not contain a memory + * pool to look at a database can be safely construed as operator + * error, I think. + */ + *is_private = 0; + if ((ret = + dbenv->open(dbenv, home, DB_JOINENV | DB_USE_ENVIRON, 0)) == 0) + return (0); + if (ttype != T_DB && ttype != T_LOG) { + dbenv->err(dbenv, ret, "DB_ENV->open%s%s", + home == NULL ? "" : ": ", home == NULL ? "" : home); + return (1); + } + + /* + * We're looking at a database or set of log files and no environment + * exists. Create one, but make it private so no files are actually + * created. Declare a reasonably large cache so that we don't fail + * when reporting statistics on large databases. + * + * An environment is required to look at databases because we may be + * trying to look at databases in directories other than the current + * one. + */ + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) { + dbenv->err(dbenv, ret, "set_cachesize"); + return (1); + } + *is_private = 1; + oflags = DB_CREATE | DB_PRIVATE | DB_USE_ENVIRON; + if (ttype == T_DB) + oflags |= DB_INIT_MPOOL; + if (ttype == T_LOG) + oflags |= DB_INIT_LOG; + if ((ret = dbenv->open(dbenv, home, oflags, 0)) == 0) + return (0); + + /* An environment is required. */ + dbenv->err(dbenv, ret, "open"); + return (1); +} + +/* + * argcheck -- + * Return if argument flags are okay. + */ +int +db_stat_argcheck(arg, ok_args) + char *arg; + const char *ok_args; +{ + for (; *arg != '\0'; ++arg) + if (strchr(ok_args, *arg) == NULL) + return (0); + return (1); +} + +int +db_stat_usage() +{ + fprintf(stderr, "%s\n\t%s\n", + "usage: db_stat [-celmNrtVZ] [-C Aclmop]", + "[-d file [-f] [-s database]] [-h home] [-M Ahlm] [-P password]"); + return (EXIT_FAILURE); +} + +int +db_stat_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} diff --git a/bdb/build_vxworks/db_stat/db_stat.wpj b/bdb/build_vxworks/db_stat/db_stat.wpj new file mode 100755 index 00000000000..ba78c4cc3fd --- /dev/null +++ b/bdb/build_vxworks/db_stat/db_stat.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_stat.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_stat.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_stat.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_stat.c_dependDone +FALSE + + + FILE_db_stat.c_dependencies + + + + FILE_db_stat.c_objects +db_stat.o + + + FILE_db_stat.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_stat.c + + + userComments +db_stat + diff --git a/bdb/build_vxworks/db_stat/db_stat/Makefile.custom b/bdb/build_vxworks/db_stat/db_stat/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_stat/db_stat/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_stat/db_stat/component.cdf b/bdb/build_vxworks/db_stat/db_stat/component.cdf new file mode 100755 index 00000000000..728544eabff --- /dev/null +++ b/bdb/build_vxworks/db_stat/db_stat/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_STAT { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_stat.o + NAME db_stat + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_stat.o { + + NAME db_stat.o + SRC_PATH_NAME $PRJ_DIR/../db_stat.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_stat/db_stat/component.wpj b/bdb/build_vxworks/db_stat/db_stat/component.wpj new file mode 100755 index 00000000000..2020d712dee --- /dev/null +++ b/bdb/build_vxworks/db_stat/db_stat/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_objects +db_stat.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_objects +db_stat.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_stat.c_objects +db_stat.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_stat.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_objects +db_stat.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_stat.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_upgrade/db_upgrade.c b/bdb/build_vxworks/db_upgrade/db_upgrade.c new file mode 100644 index 00000000000..6f9138b59b9 --- /dev/null +++ b/bdb/build_vxworks/db_upgrade/db_upgrade.c @@ -0,0 +1,205 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_upgrade.c,v 1.31 2002/03/28 20:13:47 bostic Exp $"; +#endif + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include +#include +#include +#include +#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(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_upgrade", args, &argc, &argv); + return (db_upgrade_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_upgrade_main(argc, argv) + int argc; + char *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, e_close, exitval, nflag, ret, t_ret; + char *home, *passwd; + + if ((ret = db_upgrade_version_check(progname)) != 0) + return (ret); + + dbenv = NULL; + flags = nflag = 0; + e_close = exitval = 0; + home = passwd = NULL; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "h:NP:sV")) != EOF) + switch (ch) { + case 'h': + home = optarg; + break; + case 'N': + nflag = 1; + 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 's': + LF_SET(DB_DUPSORT); + break; + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case '?': + default: + return (db_upgrade_usage()); + } + argc -= optind; + argv += optind; + + if (argc <= 0) + return (db_upgrade_usage()); + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* + * 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)); + goto shutdown; + } + e_close = 1; + + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, progname); + + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto shutdown; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto shutdown; + } + } + + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto shutdown; + } + + /* + * 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 && + (ret = dbenv->open(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } + + for (; !__db_util_interrupted() && argv[0] != NULL; ++argv) { + if ((ret = db_create(&dbp, dbenv, 0)) != 0) { + fprintf(stderr, + "%s: db_create: %s\n", progname, db_strerror(ret)); + goto shutdown; + } + dbp->set_errfile(dbp, stderr); + dbp->set_errpfx(dbp, progname); + if ((ret = dbp->upgrade(dbp, argv[0], flags)) != 0) + dbp->err(dbp, ret, "DB->upgrade: %s", argv[0]); + if ((t_ret = dbp->close(dbp, 0)) != 0 && ret == 0) { + dbenv->err(dbenv, ret, "DB->close: %s", argv[0]); + ret = t_ret; + } + if (ret != 0) + goto shutdown; + } + + if (0) { +shutdown: exitval = 1; + } + if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +int +db_upgrade_usage() +{ + fprintf(stderr, "%s\n", + "usage: db_upgrade [-NsV] [-h home] [-P password] db_file ..."); + return (EXIT_FAILURE); +} + +int +db_upgrade_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} diff --git a/bdb/build_vxworks/db_upgrade/db_upgrade.wpj b/bdb/build_vxworks/db_upgrade/db_upgrade.wpj new file mode 100755 index 00000000000..65f834d62d7 --- /dev/null +++ b/bdb/build_vxworks/db_upgrade/db_upgrade.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_upgrade.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_upgrade.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_upgrade.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_upgrade.c_dependDone +FALSE + + + FILE_db_upgrade.c_dependencies + + + + FILE_db_upgrade.c_objects +db_upgrade.o + + + FILE_db_upgrade.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_upgrade.c + + + userComments +db_upgrade + diff --git a/bdb/build_vxworks/db_upgrade/db_upgrade/Makefile.custom b/bdb/build_vxworks/db_upgrade/db_upgrade/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_upgrade/db_upgrade/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_upgrade/db_upgrade/component.cdf b/bdb/build_vxworks/db_upgrade/db_upgrade/component.cdf new file mode 100755 index 00000000000..7bbdebd4999 --- /dev/null +++ b/bdb/build_vxworks/db_upgrade/db_upgrade/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_UPGRADE { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_upgrade.o + NAME db_upgrade + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_upgrade.o { + + NAME db_upgrade.o + SRC_PATH_NAME $PRJ_DIR/../db_upgrade.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_upgrade/db_upgrade/component.wpj b/bdb/build_vxworks/db_upgrade/db_upgrade/component.wpj new file mode 100755 index 00000000000..1cc5f303e5d --- /dev/null +++ b/bdb/build_vxworks/db_upgrade/db_upgrade/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_objects +db_upgrade.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_objects +db_upgrade.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_upgrade.c_objects +db_upgrade.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_upgrade.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_objects +db_upgrade.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_upgrade.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/db_verify/db_verify.c b/bdb/build_vxworks/db_verify/db_verify.c new file mode 100644 index 00000000000..cfa31195a85 --- /dev/null +++ b/bdb/build_vxworks/db_verify/db_verify.c @@ -0,0 +1,263 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char copyright[] = + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; +static const char revid[] = + "$Id: db_verify.c,v 1.38 2002/08/08 03:51:38 bostic Exp $"; +#endif + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include +#include +#include +#include +#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(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("db_verify", args, &argc, &argv); + return (db_verify_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +db_verify_main(argc, argv) + int argc; + char *argv[]; +{ + extern char *optarg; + extern int optind, __db_getopt_reset; + const char *progname = "db_verify"; + DB *dbp, *dbp1; + DB_ENV *dbenv; + u_int32_t cache; + int ch, d_close, e_close, exitval, nflag, oflag, private; + int quiet, resize, ret, t_ret; + char *home, *passwd; + + if ((ret = db_verify_version_check(progname)) != 0) + return (ret); + + dbenv = NULL; + cache = MEGABYTE; + d_close = e_close = exitval = nflag = oflag = quiet = 0; + home = passwd = NULL; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "h:NoP:qV")) != EOF) + switch (ch) { + case 'h': + home = optarg; + break; + case 'N': + nflag = 1; + 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 'o': + oflag = 1; + break; + case 'q': + quiet = 1; + break; + case 'V': + printf("%s\n", db_version(NULL, NULL, NULL)); + return (EXIT_SUCCESS); + case '?': + default: + return (db_verify_usage()); + } + argc -= optind; + argv += optind; + + if (argc <= 0) + return (db_verify_usage()); + + /* Handle possible interruptions. */ + __db_util_siginit(); + + /* + * Create an environment object and initialize it for error + * reporting. + */ +retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { + fprintf(stderr, + "%s: db_env_create: %s\n", progname, db_strerror(ret)); + goto shutdown; + } + e_close = 1; + + if (!quiet) { + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, progname); + } + + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto shutdown; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto shutdown; + } + } + + if (passwd != NULL && + (ret = dbenv->set_encrypt(dbenv, passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto shutdown; + } + /* + * Attach to an mpool if it exists, but if that fails, attach to a + * private region. In the latter case, declare a reasonably large + * cache so that we don't fail when verifying large databases. + */ + private = 0; + if ((ret = + dbenv->open(dbenv, home, DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0) { + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) { + dbenv->err(dbenv, ret, "set_cachesize"); + goto shutdown; + } + private = 1; + if ((ret = dbenv->open(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } + } + + 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; + } + d_close = 1; + + /* + * We create a 2nd dbp to this database to get its pagesize + * because the dbp we're using for verify cannot be opened. + */ + if (private) { + if ((ret = db_create(&dbp1, dbenv, 0)) != 0) { + dbenv->err( + dbenv, ret, "%s: db_create", progname); + goto shutdown; + } + + if ((ret = dbp1->open(dbp1, NULL, + argv[0], NULL, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->open: %s", argv[0]); + (void)dbp1->close(dbp1, 0); + goto shutdown; + } + /* + * If we get here, we can check the cache/page. + * !!! + * If we have to retry with an env with a larger + * cache, we jump out of this loop. However, we + * will still be working on the same argv when we + * get back into the for-loop. + */ + ret = __db_util_cache(dbenv, dbp1, &cache, &resize); + (void)dbp1->close(dbp1, 0); + if (ret != 0) + goto shutdown; + + if (resize) { + (void)dbp->close(dbp, 0); + d_close = 0; + + (void)dbenv->close(dbenv, 0); + e_close = 0; + goto retry; + } + } + if ((ret = dbp->verify(dbp, + argv[0], NULL, NULL, oflag ? DB_NOORDERCHK : 0)) != 0) + dbp->err(dbp, ret, "DB->verify: %s", argv[0]); + if ((t_ret = dbp->close(dbp, 0)) != 0 && ret == 0) { + dbenv->err(dbenv, ret, "DB->close: %s", argv[0]); + ret = t_ret; + } + d_close = 0; + if (ret != 0) + goto shutdown; + } + + if (0) { +shutdown: exitval = 1; + } + + if (d_close && (ret = dbp->close(dbp, 0)) != 0) { + exitval = 1; + dbenv->err(dbenv, ret, "close"); + } + if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { + exitval = 1; + fprintf(stderr, + "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + } + + /* Resend any caught signal. */ + __db_util_sigresend(); + + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +int +db_verify_usage() +{ + fprintf(stderr, "%s\n", + "usage: db_verify [-NoqV] [-h home] [-P password] db_file ..."); + return (EXIT_FAILURE); +} + +int +db_verify_version_check(progname) + const char *progname; +{ + 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 || v_patch != DB_VERSION_PATCH) { + fprintf(stderr, + "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", + progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, + DB_VERSION_PATCH, v_major, v_minor, v_patch); + return (EXIT_FAILURE); + } + return (0); +} diff --git a/bdb/build_vxworks/db_verify/db_verify.wpj b/bdb/build_vxworks/db_verify/db_verify.wpj new file mode 100755 index 00000000000..d807c9853bf --- /dev/null +++ b/bdb/build_vxworks/db_verify/db_verify.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +db_verify.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/db_verify.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_verify.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_db_verify.c_dependDone +FALSE + + + FILE_db_verify.c_dependencies + + + + FILE_db_verify.c_objects +db_verify.o + + + FILE_db_verify.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/db_verify.c + + + userComments +db_verify + diff --git a/bdb/build_vxworks/db_verify/db_verify/Makefile.custom b/bdb/build_vxworks/db_verify/db_verify/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/db_verify/db_verify/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/db_verify/db_verify/component.cdf b/bdb/build_vxworks/db_verify/db_verify/component.cdf new file mode 100755 index 00000000000..f29f8246b57 --- /dev/null +++ b/bdb/build_vxworks/db_verify/db_verify/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DB_VERIFY { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES db_verify.o + NAME db_verify + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module db_verify.o { + + NAME db_verify.o + SRC_PATH_NAME $PRJ_DIR/../db_verify.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/db_verify/db_verify/component.wpj b/bdb/build_vxworks/db_verify/db_verify/component.wpj new file mode 100755 index 00000000000..aca3ae8cb75 --- /dev/null +++ b/bdb/build_vxworks/db_verify/db_verify/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_objects +db_verify.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_objects +db_verify.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_verify.c_objects +db_verify.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_verify.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_objects +db_verify.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../db_verify.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/dbdemo/README b/bdb/build_vxworks/dbdemo/README new file mode 100644 index 00000000000..1a2c7c7d073 --- /dev/null +++ b/bdb/build_vxworks/dbdemo/README @@ -0,0 +1,39 @@ +This README describes the steps needed to run a demo example of BerkeleyDB. + +1. Read the pages in the Reference Guide that describe building + BerkeleyDB on VxWorks: + + $(WIND_BASE)/target/src/BerkeleyDB/docs/ref/build_vxworks/intro.html + $(WIND_BASE)/target/src/BerkeleyDB/docs/ref/build_vxworks/notes.html + $(WIND_BASE)/target/src/BerkeleyDB/docs/ref/build_vxworks/faq.html + +2. Launch Tornado 2.0 and open up the BerkeleyDB project. + +3. Add the demo project to that workspace: + + $(WIND_BASE)/target/src/BerkeleyDB/build_vxworks/demo/dbdemo.wpj + +4. Build BerkeleyDB as described in the Reference Guide. + +5. Build the dbdemo project. + +6. Download BerkeleyDB onto the target. + +7. Download the dbdemo project onto the target. + +8. Open a windsh to the target and run the demo: + + -> dbdemo "/" + + Where pathname is a pathname string pointing to a directory that the + demo can create a database in. That directory should already exist. + The dbname is the name for the database. For example: + + -> dbdemo "/tmp/demo.db" + +9. The demo program will ask for input. You can type in any string. + The program will add an entry to the database with that string as + the key and the reverse of that string as the data item for that key. + It will continue asking for input until you hit ^D or enter "quit". + Upon doing so, the demo program will display all the keys you have + entered as input and their data items. diff --git a/bdb/build_vxworks/dbdemo/dbdemo.c b/bdb/build_vxworks/dbdemo/dbdemo.c new file mode 100644 index 00000000000..6dd2a25c54e --- /dev/null +++ b/bdb/build_vxworks/dbdemo/dbdemo.c @@ -0,0 +1,178 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: ex_access.c,v 11.22 2002/09/03 12:54:26 bostic Exp $ + */ + +#include + +#include +#include +#include + +#ifdef _WIN32 +extern int getopt(int, char * const *, const char *); +#else +#include +#endif + +#include +#include + +#define DATABASE "access.db" +int dbdemo_main __P((int, char *[])); +int dbdemo_usage __P((void)); + +int +dbdemo(args) + char *args; +{ + int argc; + char **argv; + + __db_util_arg("dbdemo", args, &argc, &argv); + return (dbdemo_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS); +} + +#include +#define ERROR_RETURN ERROR + +int +dbdemo_main(argc, argv) + int argc; + char *argv[]; +{ + extern int optind, __db_getopt_reset; + DB *dbp; + DBC *dbcp; + DBT key, data; + u_int32_t len; + int ch, ret, rflag; + char *database, *p, *t, buf[1024], rbuf[1024]; + const char *progname = "dbdemo"; /* Program name. */ + + rflag = 0; + __db_getopt_reset = 1; + while ((ch = getopt(argc, argv, "r")) != EOF) + switch (ch) { + case 'r': + rflag = 1; + break; + case '?': + default: + return (dbdemo_usage()); + } + argc -= optind; + argv += optind; + + /* Accept optional database name. */ + database = *argv == NULL ? DATABASE : argv[0]; + + /* Optionally discard the database. */ + if (rflag) + (void)remove(database); + + /* Create and initialize database object, open the database. */ + if ((ret = db_create(&dbp, NULL, 0)) != 0) { + fprintf(stderr, + "%s: db_create: %s\n", progname, db_strerror(ret)); + return (EXIT_FAILURE); + } + dbp->set_errfile(dbp, stderr); + dbp->set_errpfx(dbp, progname); + if ((ret = dbp->set_pagesize(dbp, 1024)) != 0) { + dbp->err(dbp, ret, "set_pagesize"); + goto err1; + } + if ((ret = dbp->set_cachesize(dbp, 0, 32 * 1024, 0)) != 0) { + dbp->err(dbp, ret, "set_cachesize"); + goto err1; + } + if ((ret = dbp->open(dbp, + NULL, database, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) { + dbp->err(dbp, ret, "%s: open", database); + goto err1; + } + + /* + * Insert records into the database, where the key is the user + * input and the data is the user input in reverse order. + */ + memset(&key, 0, sizeof(DBT)); + memset(&data, 0, sizeof(DBT)); + for (;;) { + printf("input> "); + fflush(stdout); + if (fgets(buf, sizeof(buf), stdin) == NULL) + break; + if (strcmp(buf, "exit\n") == 0 || strcmp(buf, "quit\n") == 0) + break; + if ((len = strlen(buf)) <= 1) + continue; + for (t = rbuf, p = buf + (len - 2); p >= buf;) + *t++ = *p--; + *t++ = '\0'; + + key.data = buf; + data.data = rbuf; + data.size = key.size = len - 1; + + switch (ret = + dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE)) { + case 0: + break; + default: + dbp->err(dbp, ret, "DB->put"); + if (ret != DB_KEYEXIST) + goto err1; + break; + } + } + printf("\n"); + + /* Acquire a cursor for the database. */ + if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) { + dbp->err(dbp, ret, "DB->cursor"); + goto err1; + } + + /* Initialize the key/data pair so the flags aren't set. */ + memset(&key, 0, sizeof(key)); + memset(&data, 0, sizeof(data)); + + /* Walk through the database and print out the key/data pairs. */ + while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0) + printf("%.*s : %.*s\n", + (int)key.size, (char *)key.data, + (int)data.size, (char *)data.data); + if (ret != DB_NOTFOUND) { + dbp->err(dbp, ret, "DBcursor->get"); + goto err2; + } + + /* Close everything down. */ + if ((ret = dbcp->c_close(dbcp)) != 0) { + dbp->err(dbp, ret, "DBcursor->close"); + goto err1; + } + if ((ret = dbp->close(dbp, 0)) != 0) { + fprintf(stderr, + "%s: DB->close: %s\n", progname, db_strerror(ret)); + return (EXIT_FAILURE); + } + return (EXIT_SUCCESS); + +err2: (void)dbcp->c_close(dbcp); +err1: (void)dbp->close(dbp, 0); + return (EXIT_FAILURE); +} + +int +dbdemo_usage() +{ + (void)fprintf(stderr, "usage: ex_access [-r] [database]\n"); + return (EXIT_FAILURE); +} diff --git a/bdb/build_vxworks/dbdemo/dbdemo.wpj b/bdb/build_vxworks/dbdemo/dbdemo.wpj new file mode 100755 index 00000000000..52eec5ed945 --- /dev/null +++ b/bdb/build_vxworks/dbdemo/dbdemo.wpj @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +dbdemo.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/dbdemo.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_dbdemo.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + FILE_dbdemo.c_dependDone +FALSE + + + FILE_dbdemo.c_dependencies + + + + FILE_dbdemo.c_objects +dbdemo.o + + + FILE_dbdemo.c_tool +C/C++ compiler + + + PROJECT_FILES +$(PRJ_DIR)/dbdemo.c + + + userComments +dbdemo + diff --git a/bdb/build_vxworks/dbdemo/dbdemo/Makefile.custom b/bdb/build_vxworks/dbdemo/dbdemo/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/build_vxworks/dbdemo/dbdemo/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/build_vxworks/dbdemo/dbdemo/component.cdf b/bdb/build_vxworks/dbdemo/dbdemo/component.cdf new file mode 100755 index 00000000000..188b63bfa4a --- /dev/null +++ b/bdb/build_vxworks/dbdemo/dbdemo/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_DBDEMO { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES dbdemo.o + NAME dbdemo + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module dbdemo.o { + + NAME dbdemo.o + SRC_PATH_NAME $PRJ_DIR/../dbdemo.c +} + +/* Parameter information */ + diff --git a/bdb/build_vxworks/dbdemo/dbdemo/component.wpj b/bdb/build_vxworks/dbdemo/dbdemo/component.wpj new file mode 100755 index 00000000000..b51ebce106e --- /dev/null +++ b/bdb/build_vxworks/dbdemo/dbdemo/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_objects +dbdemo.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_objects +dbdemo.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../dbdemo.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../dbdemo.c_objects +dbdemo.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../dbdemo.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_objects +dbdemo.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../dbdemo.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/build_vxworks/ex_access/ex_access.wpj b/bdb/build_vxworks/ex_access/ex_access.wpj deleted file mode 100644 index bbbad47a253..00000000000 --- a/bdb/build_vxworks/ex_access/ex_access.wpj +++ /dev/null @@ -1,244 +0,0 @@ -Document file - DO NOT EDIT - - BUILD_PENTIUMgnu_MACRO_AR -ar386 - - - BUILD_PENTIUMgnu_MACRO_ARCHIVE -$(PRJ_DIR)/PENTIUMgnu/ex_access.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. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM \ - -I/export/home/db/build_vxworks - - - BUILD_PENTIUMgnu_MACRO_CFLAGS_AS --g \ - -mpentium \ - -ansi \ - -nostdinc \ - -fvolatile \ - -nostdlib \ - -fno-builtin \ - -fno-defer-pop \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM - - - BUILD_PENTIUMgnu_MACRO_CPP -cc386 -E -P -xc - - - BUILD_PENTIUMgnu_MACRO_LD -ld386 - - - 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_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_ex_access.out - - - - BUILD_RULE_objects - - - - BUILD_SIMSPARCSOLARISgnu_BUILDRULE -ex_access.out - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AR -arsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE -$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_access.a - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AS -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CC -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS --g \ - -ansi \ - -nostdinc \ - -DRW_MULTI_THREAD \ - -D_REENTRANT \ - -fvolatile \ - -fno-builtin \ - -I/export/home/db/build_vxworks \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS --g \ - -ansi \ - -nostdinc \ - -fvolatile \ - -fno-builtin \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CPP -ccsimso -E -P -xc - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS --N - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS --nostdlib -r - - - BUILD_SIMSPARCSOLARISgnu_MACRO_NM -nmsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO --D - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR --I - - - BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE -sizesimso - - - BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH -{$(WIND_BASE)/target/h/} \ - {$(WIND_BASE)/target/src/} \ - {$(WIND_BASE)/target/config/} - - - BUILD_SIMSPARCSOLARISgnu_TC -::tc_SIMSPARCSOLARISgnu - - - BUILD__CURRENT -PENTIUMgnu - - - BUILD__LIST -SIMSPARCSOLARISgnu PENTIUMgnu - - - CORE_INFO_TYPE -::prj_vxApp - - - CORE_INFO_VERSION -2.0 - - - FILE_/export/home/db/examples_c/ex_access.c_dependDone -TRUE - - - FILE_/export/home/db/examples_c/ex_access.c_dependencies -/export/home/db/build_vxworks/db_config.h /export/home/db/build_vxworks/db.h - - - FILE_/export/home/db/examples_c/ex_access.c_objects -ex_access.o - - - FILE_/export/home/db/examples_c/ex_access.c_tool -C/C++ compiler - - - PROJECT_FILES -/export/home/db/examples_c/ex_access.c - - - userComments -ex_access - - diff --git a/bdb/build_vxworks/ex_btrec/ex_btrec.wpj b/bdb/build_vxworks/ex_btrec/ex_btrec.wpj deleted file mode 100644 index 801ca6808e2..00000000000 --- a/bdb/build_vxworks/ex_btrec/ex_btrec.wpj +++ /dev/null @@ -1,250 +0,0 @@ -Document file - DO NOT EDIT - - BUILD_PENTIUMgnu_MACRO_AR -ar386 - - - BUILD_PENTIUMgnu_MACRO_ARCHIVE -$(PRJ_DIR)/PENTIUMgnu/ex_btrec.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. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM \ - -I/export/home/db/build_vxworks - - - BUILD_PENTIUMgnu_MACRO_CFLAGS_AS --g \ - -mpentium \ - -ansi \ - -nostdinc \ - -fvolatile \ - -nostdlib \ - -fno-builtin \ - -fno-defer-pop \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM - - - BUILD_PENTIUMgnu_MACRO_CPP -cc386 -E -P -xc - - - BUILD_PENTIUMgnu_MACRO_LD -ld386 - - - 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_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_ex_btrec.out - - - - BUILD_RULE_objects - - - - BUILD_SIMSPARCSOLARISgnu_BUILDRULE -ex_btrec.out - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AR -arsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE -$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_btrec.a - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AS -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CC -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS --g \ - -ansi \ - -nostdinc \ - -DRW_MULTI_THREAD \ - -D_REENTRANT \ - -fvolatile \ - -fno-builtin \ - -I/export/home/db/build_vxworks \ - -I/export/home/db/build_vxworks \ - -I/export/home/db/include \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS --g \ - -ansi \ - -nostdinc \ - -fvolatile \ - -fno-builtin \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CPP -ccsimso -E -P -xc - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS --N - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS --nostdlib -r - - - BUILD_SIMSPARCSOLARISgnu_MACRO_NM -nmsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO --D - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR --I - - - BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE -sizesimso - - - BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH -{$(WIND_BASE)/target/h/} \ - {$(WIND_BASE)/target/src/} \ - {$(WIND_BASE)/target/config/} - - - BUILD_SIMSPARCSOLARISgnu_TC -::tc_SIMSPARCSOLARISgnu - - - BUILD__CURRENT -PENTIUMgnu - - - BUILD__LIST -SIMSPARCSOLARISgnu PENTIUMgnu - - - CORE_INFO_TYPE -::prj_vxApp - - - CORE_INFO_VERSION -2.0 - - - FILE_/export/home/db/examples_c/ex_btrec.c_dependDone -TRUE - - - FILE_/export/home/db/examples_c/ex_btrec.c_dependencies -/export/home/db/build_vxworks/db_config.h /export/home/db/build_vxworks/db.h - - - FILE_/export/home/db/examples_c/ex_btrec.c_objects -ex_btrec.o - - - FILE_/export/home/db/examples_c/ex_btrec.c_tool -C/C++ compiler - - - PROJECT_FILES -/export/home/db/examples_c/ex_btrec.c - - - userComments -ex_btrec - - diff --git a/bdb/build_vxworks/ex_dbclient/ex_dbclient.wpj b/bdb/build_vxworks/ex_dbclient/ex_dbclient.wpj deleted file mode 100644 index fdb721406ad..00000000000 --- a/bdb/build_vxworks/ex_dbclient/ex_dbclient.wpj +++ /dev/null @@ -1,266 +0,0 @@ -Document file - DO NOT EDIT - - BUILD_PENTIUMgnu_BUILDRULE -ex_dbclient.out - - - BUILD_PENTIUMgnu_MACRO_AR -ar386 - - - BUILD_PENTIUMgnu_MACRO_ARCHIVE -$(PRJ_DIR)/PENTIUMgnu/ex_dbclient.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/export/home/db/build_vxworks \ - -I/export/home/db/include \ - -I. \ - -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. \ - -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_ex_dbclient.out - - - - BUILD_RULE_objects - - - - BUILD_SIMSPARCSOLARISgnu_BUILDRULE -ex_dbclient.out - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AR -arsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE -$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_dbclient.a - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AS -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CC -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS --g \ - -ansi \ - -nostdinc \ - -DRW_MULTI_THREAD \ - -D_REENTRANT \ - -fvolatile \ - -fno-builtin \ - -I/export/home/db/build_vxworks \ - -I/export/home/db/include \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS --g \ - -ansi \ - -nostdinc \ - -fvolatile \ - -fno-builtin \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CPP -ccsimso -E -P -xc - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS --N - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS --nostdlib -r - - - BUILD_SIMSPARCSOLARISgnu_MACRO_NM -nmsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO --D - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR --I - - - BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE -sizesimso - - - BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH -{$(WIND_BASE)/target/h/} \ - {$(WIND_BASE)/target/src/} \ - {$(WIND_BASE)/target/config/} - - - BUILD_SIMSPARCSOLARISgnu_TC -::tc_SIMSPARCSOLARISgnu - - - BUILD__CURRENT -PENTIUMgnu - - - BUILD__LIST -SIMSPARCSOLARISgnu PENTIUMgnu - - - CORE_INFO_TYPE -::prj_vxApp - - - CORE_INFO_VERSION -2.0 - - - FILE_/export/home/db/examples_c/ex_dbclient.c_dependDone -TRUE - - - FILE_/export/home/db/examples_c/ex_dbclient.c_dependencies -/export/home/db/build_vxworks/db_config.h /export/home/db/build_vxworks/db.h - - - FILE_/export/home/db/examples_c/ex_dbclient.c_objects -ex_dbclient.o - - - FILE_/export/home/db/examples_c/ex_dbclient.c_tool -C/C++ compiler - - - PROJECT_FILES -/export/home/db/examples_c/ex_dbclient.c - - - userComments -RPC Client example - - diff --git a/bdb/build_vxworks/ex_env/ex_env.wpj b/bdb/build_vxworks/ex_env/ex_env.wpj deleted file mode 100644 index 7229ffa1309..00000000000 --- a/bdb/build_vxworks/ex_env/ex_env.wpj +++ /dev/null @@ -1,248 +0,0 @@ -Document file - DO NOT EDIT - - BUILD_PENTIUMgnu_MACRO_AR -ar386 - - - BUILD_PENTIUMgnu_MACRO_ARCHIVE -$(PRJ_DIR)/PENTIUMgnu/ex_env.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. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM \ - -I/export/home/db/build_vxworks - - - BUILD_PENTIUMgnu_MACRO_CFLAGS_AS --g \ - -mpentium \ - -ansi \ - -nostdinc \ - -fvolatile \ - -nostdlib \ - -fno-builtin \ - -fno-defer-pop \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM - - - BUILD_PENTIUMgnu_MACRO_CPP -cc386 -E -P -xc - - - BUILD_PENTIUMgnu_MACRO_LD -ld386 - - - 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_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_ex_env.out - - - - BUILD_RULE_objects - - - - BUILD_SIMSPARCSOLARISgnu_BUILDRULE -ex_env.out - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AR -arsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE -$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_env.a - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AS -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CC -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS --g \ - -ansi \ - -nostdinc \ - -DRW_MULTI_THREAD \ - -D_REENTRANT \ - -fvolatile \ - -fno-builtin \ - -I/export/home/db/build_vxworks \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS --g \ - -ansi \ - -nostdinc \ - -fvolatile \ - -fno-builtin \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CPP -ccsimso -E -P -xc - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS --N - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS --nostdlib -r - - - BUILD_SIMSPARCSOLARISgnu_MACRO_NM -nmsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO --D - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR --I - - - BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE -sizesimso - - - BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH -{$(WIND_BASE)/target/h/} \ - {$(WIND_BASE)/target/src/} \ - {$(WIND_BASE)/target/config/} - - - BUILD_SIMSPARCSOLARISgnu_TC -::tc_SIMSPARCSOLARISgnu - - - BUILD__CURRENT -PENTIUMgnu - - - BUILD__LIST -SIMSPARCSOLARISgnu PENTIUMgnu - - - CORE_INFO_TYPE -::prj_vxApp - - - CORE_INFO_VERSION -2.0 - - - FILE_/export/home/db/examples_c/ex_env.c_dependDone -TRUE - - - FILE_/export/home/db/examples_c/ex_env.c_dependencies -/export/home/db/build_vxworks/db_config.h /export/home/db/build_vxworks/db.h - - - FILE_/export/home/db/examples_c/ex_env.c_objects -ex_env.o - - - FILE_/export/home/db/examples_c/ex_env.c_tool -C/C++ compiler - - - PROJECT_FILES -/export/home/db/examples_c/ex_env.c - - - userComments -ex_env - - diff --git a/bdb/build_vxworks/ex_mpool/ex_mpool.wpj b/bdb/build_vxworks/ex_mpool/ex_mpool.wpj deleted file mode 100644 index 6dd9ed4db27..00000000000 --- a/bdb/build_vxworks/ex_mpool/ex_mpool.wpj +++ /dev/null @@ -1,248 +0,0 @@ -Document file - DO NOT EDIT - - BUILD_PENTIUMgnu_MACRO_AR -ar386 - - - BUILD_PENTIUMgnu_MACRO_ARCHIVE -$(PRJ_DIR)/PENTIUMgnu/ex_mpool.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. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM \ - -I/export/home/db/build_vxworks - - - BUILD_PENTIUMgnu_MACRO_CFLAGS_AS --g \ - -mpentium \ - -ansi \ - -nostdinc \ - -fvolatile \ - -nostdlib \ - -fno-builtin \ - -fno-defer-pop \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM - - - BUILD_PENTIUMgnu_MACRO_CPP -cc386 -E -P -xc - - - BUILD_PENTIUMgnu_MACRO_LD -ld386 - - - 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_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_ex_mpool.out - - - - BUILD_RULE_objects - - - - BUILD_SIMSPARCSOLARISgnu_BUILDRULE -ex_mpool.out - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AR -arsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE -$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_mpool.a - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AS -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CC -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS --g \ - -ansi \ - -nostdinc \ - -DRW_MULTI_THREAD \ - -D_REENTRANT \ - -fvolatile \ - -fno-builtin \ - -I/export/home/db/build_vxworks \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS --g \ - -ansi \ - -nostdinc \ - -fvolatile \ - -fno-builtin \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CPP -ccsimso -E -P -xc - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS --N - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS --nostdlib -r - - - BUILD_SIMSPARCSOLARISgnu_MACRO_NM -nmsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO --D - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR --I - - - BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE -sizesimso - - - BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH -{$(WIND_BASE)/target/h/} \ - {$(WIND_BASE)/target/src/} \ - {$(WIND_BASE)/target/config/} - - - BUILD_SIMSPARCSOLARISgnu_TC -::tc_SIMSPARCSOLARISgnu - - - BUILD__CURRENT -PENTIUMgnu - - - BUILD__LIST -SIMSPARCSOLARISgnu PENTIUMgnu - - - CORE_INFO_TYPE -::prj_vxApp - - - CORE_INFO_VERSION -2.0 - - - FILE_/export/home/db/examples_c/ex_mpool.c_dependDone -TRUE - - - FILE_/export/home/db/examples_c/ex_mpool.c_dependencies -/export/home/db/build_vxworks/db_config.h /export/home/db/build_vxworks/db.h - - - FILE_/export/home/db/examples_c/ex_mpool.c_objects -ex_mpool.o - - - FILE_/export/home/db/examples_c/ex_mpool.c_tool -C/C++ compiler - - - PROJECT_FILES -/export/home/db/examples_c/ex_mpool.c - - - userComments -ex_mpool - - diff --git a/bdb/build_vxworks/ex_tpcb/ex_tpcb.wpj b/bdb/build_vxworks/ex_tpcb/ex_tpcb.wpj deleted file mode 100644 index 91de499dcf5..00000000000 --- a/bdb/build_vxworks/ex_tpcb/ex_tpcb.wpj +++ /dev/null @@ -1,261 +0,0 @@ -Document file - DO NOT EDIT - - BUILD_PENTIUMgnu_BUILDRULE -ex_tpcb.out - - - BUILD_PENTIUMgnu_MACRO_AR -ar386 - - - BUILD_PENTIUMgnu_MACRO_ARCHIVE -$(PRJ_DIR)/PENTIUMgnu/ex_tpcb.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. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM \ - -I/export/home/db/build_vxworks \ - -DVERY_TINY - - - BUILD_PENTIUMgnu_MACRO_CFLAGS_AS --g \ - -mpentium \ - -ansi \ - -nostdinc \ - -fvolatile \ - -nostdlib \ - -fno-builtin \ - -fno-defer-pop \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=PENTIUM - - - BUILD_PENTIUMgnu_MACRO_CPP -cc386 -E -P -xc - - - BUILD_PENTIUMgnu_MACRO_LD -ld386 - - - 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_ex_tpcb.out - - - - BUILD_RULE_objects - - - - BUILD_SIMSPARCSOLARISgnu_BUILDRULE -ex_tpcb.out - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AR -arsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE -$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_tpcb.a - - - BUILD_SIMSPARCSOLARISgnu_MACRO_AS -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CC -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS --g \ - -ansi \ - -nostdinc \ - -DRW_MULTI_THREAD \ - -D_REENTRANT \ - -fvolatile \ - -fno-builtin \ - -I/export/home/db/build_vxworks \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS --g \ - -ansi \ - -nostdinc \ - -fvolatile \ - -fno-builtin \ - -P \ - -x \ - assembler-with-cpp \ - -I. \ - -I$(WIND_BASE)/target/h \ - -DCPU=SIMSPARCSOLARIS - - - BUILD_SIMSPARCSOLARISgnu_MACRO_CPP -ccsimso -E -P -xc - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD -ccsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS --N - - - BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS --nostdlib -r - - - BUILD_SIMSPARCSOLARISgnu_MACRO_NM -nmsimso - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO --D - - - BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR --I - - - BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS - - - - BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE -sizesimso - - - BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH -{$(WIND_BASE)/target/h/} \ - {$(WIND_BASE)/target/src/} \ - {$(WIND_BASE)/target/config/} - - - BUILD_SIMSPARCSOLARISgnu_TC -::tc_SIMSPARCSOLARISgnu - - - BUILD__CURRENT -PENTIUMgnu - - - BUILD__LIST -SIMSPARCSOLARISgnu PENTIUMgnu - - - CORE_INFO_TYPE -::prj_vxApp - - - CORE_INFO_VERSION -2.0 - - - FILE_/export/home/db/examples_c/ex_tpcb.c_dependDone -TRUE - - - FILE_/export/home/db/examples_c/ex_tpcb.c_dependencies -/export/home/db/build_vxworks/db_config.h /export/home/db/build_vxworks/db.h - - - FILE_/export/home/db/examples_c/ex_tpcb.c_objects -ex_tpcb.o - - - FILE_/export/home/db/examples_c/ex_tpcb.c_tool -C/C++ compiler - - - PROJECT_FILES -/export/home/db/examples_c/ex_tpcb.c - - - userComments -ex_tpcb - - diff --git a/bdb/build_win32/Berkeley_DB.dsw b/bdb/build_win32/Berkeley_DB.dsw index 482ac7537f0..a413ff983c2 100644 --- a/bdb/build_win32/Berkeley_DB.dsw +++ b/bdb/build_win32/Berkeley_DB.dsw @@ -1,51 +1,9 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 +Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### -Project: "DB_DLL"=.\db_dll.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "DB_Static"=.\db_static.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "db_archive"=.\db_archive.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 DB_Static - End Project Dependency -}}} - -############################################################################### - -Project: "db_buildall"=.\db_buildall.dsp - Package Owner=<4> +Project: "build_all"=.\build_all.dsp - Package Owner=<4> Package=<5> {{{ @@ -125,6 +83,25 @@ Package=<4> Begin Project Dependency Project_Dep_Name excxx_tpcb End Project Dependency + Begin Project Dependency + Project_Dep_Name db_lib + End Project Dependency + Begin Project Dependency +}}} + +############################################################################### + +Project: "db_archive"=.\db_archive.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name db_lib + End Project Dependency }}} ############################################################################### @@ -138,10 +115,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -158,9 +132,18 @@ Package=<4> Begin Project Dependency Project_Dep_Name DB_DLL End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static - End Project Dependency +}}} + +############################################################################### + +Project: "db_dll"=.\db_dll.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ }}} ############################################################################### @@ -174,10 +157,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -198,6 +178,24 @@ Package=<4> ############################################################################### +Project: "db_lib"=.\db_lib.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 db_static + End Project Dependency +}}} + +############################################################################### + Project: "db_load"=.\db_load.dsp - Package Owner=<4> Package=<5> @@ -207,10 +205,22 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL + Project_Dep_Name db_lib End Project Dependency +}}} + +############################################################################### + +Project: "db_perf"=.\db_perf.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -225,10 +235,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -243,10 +250,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -261,15 +265,24 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib 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> @@ -294,7 +307,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name db_buildall + Project_Dep_Name build_all End Project Dependency Begin Project Dependency Project_Dep_Name db_tcl @@ -312,10 +325,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -330,10 +340,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -348,10 +355,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -366,10 +370,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_Static - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_DLL + Project_Dep_Name db_lib End Project Dependency }}} @@ -384,10 +385,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -402,10 +400,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -420,10 +415,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -438,10 +430,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -456,10 +445,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -474,10 +460,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -492,10 +475,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -510,10 +490,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -528,10 +505,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} @@ -546,10 +520,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name DB_DLL - End Project Dependency - Begin Project Dependency - Project_Dep_Name DB_Static + Project_Dep_Name db_lib End Project Dependency }}} diff --git a/bdb/build_win32/app_dsp.src b/bdb/build_win32/app_dsp.src index 064ea7ef51a..ff98d39ec79 100644 --- a/bdb/build_win32/app_dsp.src +++ b/bdb/build_win32/app_dsp.src @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="@project_name@" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -17,17 +17,14 @@ CFG=@project_name@ - Win32 Debug Static !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 Release Static" (based on\ - "Win32 (x86) Console Application") -!MESSAGE "@project_name@ - Win32 Debug Static" (based on\ - "Win32 (x86) Console Application") +!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 Release Static" (based on "Win32 (x86) Console Application") +!MESSAGE "@project_name@ - Win32 Debug Static" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -47,7 +44,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -71,7 +68,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -95,8 +92,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Release_static" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -120,8 +117,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug_static" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/bdb/build_win32/build_all.dsp b/bdb/build_win32/build_all.dsp new file mode 100644 index 00000000000..7ae1f9bb031 --- /dev/null +++ b/bdb/build_win32/build_all.dsp @@ -0,0 +1,96 @@ +# 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) Generic Project" 0x010a + +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 Release Static" (based on "Win32 (x86) External Target") +!MESSAGE "build_all - Win32 Debug Static" (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 Release Static" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_static" +# PROP BASE Intermediate_Dir "Release_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_static" +# PROP Intermediate_Dir "Release_static" +# PROP Cmd_Line "echo DB Release Static version built." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "build_all - Win32 Debug Static" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_static" +# PROP BASE Intermediate_Dir "Debug_Static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_static" +# PROP Intermediate_Dir "Debug_Static" +# PROP Cmd_Line "echo DB Debug Static version built." +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "build_all - Win32 Release" +# Name "build_all - Win32 Debug" +# Name "build_all - Win32 Release Static" +# Name "build_all - Win32 Debug Static" +# End Target +# End Project diff --git a/bdb/build_win32/db_buildall.dsp b/bdb/build_win32/db_buildall.dsp deleted file mode 100644 index 58990dbb867..00000000000 --- a/bdb/build_win32/db_buildall.dsp +++ /dev/null @@ -1,128 +0,0 @@ -# Microsoft Developer Studio Project File - Name="db_buildall" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=db_buildall - 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_buildall.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_buildall.mak" CFG="db_buildall - Win32 Debug Static" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "db_buildall - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "db_buildall - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE "db_buildall - Win32 Release Static" (based on\ - "Win32 (x86) External Target") -!MESSAGE "db_buildall - Win32 Debug Static" (based on\ - "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "db_buildall - 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_buildall.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "db_buildall.exe" -# PROP BASE Bsc_Name "db_buildall.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "echo DB release version built." -# PROP Rebuild_Opt "" -# PROP Target_File "db_buildall.exe" -# PROP Bsc_Name "db_buildall.bsc" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "db_buildall - 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_buildall.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "db_buildall.exe" -# PROP BASE Bsc_Name "db_buildall.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "echo DB debug version built." -# PROP Rebuild_Opt "" -# PROP Target_File "db_buildall.exe" -# PROP Bsc_Name "db_buildall.bsc" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "db_buildall - Win32 Release Static" - -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_static" -# PROP BASE Intermediate_Dir "Release_static" -# PROP BASE Cmd_Line "echo DB release version built." -# PROP BASE Rebuild_Opt "" -# PROP BASE Target_File "db_buildall.exe" -# PROP BASE Bsc_Name "db_buildall.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_static" -# PROP Intermediate_Dir "Release_static" -# PROP Cmd_Line "echo DB release version built." -# PROP Rebuild_Opt "" -# PROP Target_File "db_buildall.exe" -# PROP Bsc_Name "db_buildall.bsc" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "db_buildall - Win32 Debug Static" - -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_static" -# PROP BASE Intermediate_Dir "Debug_static" -# PROP BASE Cmd_Line "echo DB debug version built." -# PROP BASE Rebuild_Opt "" -# PROP BASE Target_File "db_buildall.exe" -# PROP BASE Bsc_Name "db_buildall.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_static" -# PROP Intermediate_Dir "Debug_static" -# PROP Cmd_Line "echo DB debug version built." -# PROP Rebuild_Opt "" -# PROP Target_File "db_buildall.exe" -# PROP Bsc_Name "db_buildall.bsc" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "db_buildall - Win32 Release" -# Name "db_buildall - Win32 Debug" -# Name "db_buildall - Win32 Release Static" -# Name "db_buildall - Win32 Debug Static" - -!IF "$(CFG)" == "db_buildall - Win32 Release" - -!ELSEIF "$(CFG)" == "db_buildall - Win32 Debug" - -!ELSEIF "$(CFG)" == "db_buildall - Win32 Release Static" - -!ELSEIF "$(CFG)" == "db_buildall - Win32 Debug Static" - -!ENDIF - -# End Target -# End Project diff --git a/bdb/build_win32/db_config.h b/bdb/build_win32/db_config.h index 8b12d64c3c9..76ce0b5095f 100644 --- a/bdb/build_win32/db_config.h +++ b/bdb/build_win32/db_config.h @@ -1,42 +1,8 @@ -/* - * $Id: db_config.h,v 11.24 2000/12/12 18:39:26 bostic Exp $ - */ - -/* Define to empty if the keyword does not work. */ -/* #undef const */ - -/* Define if your struct stat has st_blksize. */ -/* #undef HAVE_ST_BLKSIZE */ - -/* Define to `int' if doesn't define. */ -/* #undef mode_t */ - -/* Define to `long' if doesn't define. */ -/* #undef off_t */ - -/* Define to `int' if doesn't define. */ -/* #undef pid_t */ - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ - -/* Define if the `S_IS*' macros in do not work properly. */ -/* #undef STAT_MACROS_BROKEN */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -/* #undef TIME_WITH_SYS_TIME */ - -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ - -/* Define if you are building a version for running the test suite. */ +/* DO NOT EDIT: automatically built by dist/s_win32. */ +/* Define to 1 if you want to build a version for running the test suite. */ /* #undef CONFIG_TEST */ -/* Define if you want a debugging version. */ +/* Define to 1 if you want a debugging version. */ /* #undef DEBUG */ #if defined(_DEBUG) #if !defined(DEBUG) @@ -44,160 +10,360 @@ #endif #endif -/* Define if you want a version that logs read operations. */ +/* Define to 1 if you want a version that logs read operations. */ /* #undef DEBUG_ROP */ -/* Define if you want a version that logs write operations. */ +/* Define to 1 if you want a version that logs write operations. */ /* #undef DEBUG_WOP */ -/* Define if you want a version with run-time diagnostic checking. */ +/* Define to 1 if you want a version with run-time diagnostic checking. */ /* #undef DIAGNOSTIC */ -/* Define if you want to mask harmless unitialized memory read/writes. */ -/* #undef UMRW */ +/* Define to 1 if you have the `clock_gettime' function. */ +/* #undef HAVE_CLOCK_GETTIME */ -/* Define if fcntl/F_SETFD denies child access to file descriptors. */ -/* #undef HAVE_FCNTL_F_SETFD */ +/* Define to 1 if Berkeley DB release includes strong cryptography. */ +/* #undef HAVE_CRYPTO */ -/* Define if building big-file environment (e.g., AIX, HP/UX, Solaris). */ -/* #undef HAVE_FILE_OFFSET_BITS */ +/* Define to 1 if you have the `directio' function. */ +/* #undef HAVE_DIRECTIO */ -/* Mutex possibilities. */ -/* #undef HAVE_MUTEX_68K_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_AIX_CHECK_LOCK */ -/* #undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_HPPA_MSEM_INIT */ -/* #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_MACOS */ -/* #undef HAVE_MUTEX_MSEM_INIT */ -/* #undef HAVE_MUTEX_PPC_GCC_ASSEMBLY */ -/* #undef HAVE_MUTEX_PTHREADS */ -/* #undef HAVE_MUTEX_RELIANTUNIX_INITSPIN */ -/* #undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY */ -/* #undef HAVE_MUTEX_SEMA_INIT */ -/* #undef HAVE_MUTEX_SGI_INIT_LOCK */ -/* #undef HAVE_MUTEX_SOLARIS_LOCK_TRY */ -/* #undef HAVE_MUTEX_SOLARIS_LWP */ -/* #undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY */ -#define HAVE_MUTEX_THREADS 1 -/* #undef HAVE_MUTEX_UI_THREADS */ -/* #undef HAVE_MUTEX_UTS_CC_ASSEMBLY */ -/* #undef HAVE_MUTEX_VMS */ -/* #undef HAVE_MUTEX_VXWORKS */ -/* #undef HAVE_MUTEX_WIN16 */ -#define HAVE_MUTEX_WIN32 1 -/* #undef HAVE_MUTEX_X86_GCC_ASSEMBLY */ - -/* Define if building on QNX. */ -/* #undef HAVE_QNX */ - -/* Define if building RPC client/server. */ -/* #undef HAVE_RPC */ - -/* Define if your sprintf returns a pointer, not a length. */ -/* #undef SPRINTF_RET_CHARPNT */ - -/* Define if you have the getcwd function. */ -#define HAVE_GETCWD 1 - -/* Define if you have the getopt function. */ -/* #undef HAVE_GETOPT */ - -/* Define if you have the getuid function. */ -/* #undef HAVE_GETUID */ - -/* Define if you have the memcmp function. */ -#define HAVE_MEMCMP 1 - -/* Define if you have the memcpy function. */ -#define HAVE_MEMCPY 1 - -/* Define if you have the memmove function. */ -#define HAVE_MEMMOVE 1 - -/* Define if you have the mlock function. */ -/* #undef HAVE_MLOCK */ - -/* Define if you have the mmap function. */ -/* #undef HAVE_MMAP */ - -/* Define if you have the munlock function. */ -/* #undef HAVE_MUNLOCK */ - -/* Define if you have the munmap function. */ -/* #undef HAVE_MUNMAP */ - -/* Define if you have the pread function. */ -/* #undef HAVE_PREAD */ - -/* Define if you have the pstat_getdynamic function. */ -/* #undef HAVE_PSTAT_GETDYNAMIC */ - -/* Define if you have the pwrite function. */ -/* #undef HAVE_PWRITE */ - -/* Define if you have the qsort function. */ -#define HAVE_QSORT 1 - -/* Define if you have the raise function. */ -#define HAVE_RAISE 1 - -/* Define if you have the sched_yield function. */ -/* #undef HAVE_SCHED_YIELD */ - -/* Define if you have the select function. */ -/* #undef HAVE_SELECT */ - -/* Define if you have the shmget function. */ -/* #undef HAVE_SHMGET */ - -/* Define if you have the snprintf function. */ -#define HAVE_SNPRINTF 1 - -/* Define if you have the strcasecmp function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the strerror function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the strtoul function. */ -#define HAVE_STRTOUL 1 - -/* Define if you have the sysconf function. */ -/* #undef HAVE_SYSCONF */ - -/* Define if you have the vsnprintf function. */ -#define HAVE_VSNPRINTF 1 - -/* Define if you have the yield function. */ -/* #undef HAVE_YIELD */ - -/* Define if you have the header file. */ +/* Define to 1 if you have the header file, and it defines `DIR'. + */ /* #undef HAVE_DIRENT_H */ -/* Define if you have the header file. */ +/* 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 fcntl/F_SETFD denies child access to file descriptors. */ +/* #undef HAVE_FCNTL_F_SETFD */ + +/* Define to 1 if allocated filesystem blocks are not zeroed. */ +#define HAVE_FILESYSTEM_NOTZERO 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getopt' function. */ +/* #undef HAVE_GETOPT */ + +/* 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 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 `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 `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 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 msem_XXX mutexes on systems other than HP-UX. */ +/* #undef HAVE_MUTEX_MSEM_INIT */ + +/* Define to 1 to use the GCC compiler and Apple PowerPC assembly language. */ +/* #undef HAVE_MUTEX_PPC_APPLE_GCC_ASSEMBLY */ + +/* Define to 1 to use the GCC compiler and generic PowerPC assembly language. + */ +/* #undef HAVE_MUTEX_PPC_GENERIC_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 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 if fast mutexes are available. */ +#define HAVE_MUTEX_THREADS 1 + +/* Define to 1 to configure mutexes intra-process only. */ +/* #undef HAVE_MUTEX_THREAD_ONLY */ + +/* 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 Windows mutexes. */ +#define HAVE_MUTEX_WIN32 1 + +/* 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 if you have the header file. */ +/* 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 `pstat_getdynamic' function. */ +/* #undef HAVE_PSTAT_GETDYNAMIC */ + +/* 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 you have the `qsort' function. */ +#define HAVE_QSORT 1 + +/* Define to 1 if you have the `raise' function. */ +#define HAVE_RAISE 1 + +/* 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 `snprintf' function. */ +#define HAVE_SNPRINTF 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 `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 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 `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 if you have the header file. */ +/* Define to 1 if you have the header file, and it defines `DIR'. + */ /* #undef HAVE_SYS_NDIR_H */ -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_SELECT_H */ -/* Define if you have the header file. */ +/* 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 if you have the nsl library (-lnsl). */ -/* #undef HAVE_LIBNSL */ +/* 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 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 "support@sleepycat.com" + +/* 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.1.24" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "db-4.1.24" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "4.1.24" + +/* 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 unitialized 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 */ + +/* + * 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 /* * XXX - * The following is not part of the automatic configuration setup, - * but provides the information necessary to build DB on Windows. + * The following is not part of the automatic configuration setup, but + * provides the information necessary to build Berkeley DB on Windows. */ #include #include @@ -214,10 +380,6 @@ #include #include -#if defined(__cplusplus) -#include -#endif - /* * To build Tcl interface libraries, the include path must be configured to * use the directory containing , usually the include directory in @@ -231,9 +393,14 @@ #include /* - * Win32 has fsync, getcwd, snprintf and vsnprintf, but under different names. + * All of the necessary includes have been included, ignore the #includes + * in the Berkeley DB source files. + */ +#define NO_SYSTEM_INCLUDES + +/* + * Win32 has getcwd, snprintf and vsnprintf, but under different names. */ -#define fsync(fd) _commit(fd) #define getcwd(buf, size) _getcwd(buf, size) #define snprintf _snprintf #define vsnprintf _vsnprintf @@ -251,8 +418,6 @@ extern int getopt(int, char * const *, const char *); } #endif -#define NO_SYSTEM_INCLUDES - /* * We use DB_WIN32 much as one would use _WIN32, to determine that we're * using an operating system environment that supports Win32 calls diff --git a/bdb/build_win32/db_cxx.h b/bdb/build_win32/db_cxx.h new file mode 100644 index 00000000000..1b72f310f82 --- /dev/null +++ b/bdb/build_win32/db_cxx.h @@ -0,0 +1,796 @@ +/* DO NOT EDIT: automatically built by dist/s_win32. */ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: db_cxx.in,v 11.113 2002/08/23 13:02:27 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 +#define __DB_OSTREAMCLASS std::ostream +#else +#include +#define __DB_OSTREAMCLASS ostream +#endif + +#include "db.h" +#include "cxx_common.h" +#include "cxx_except.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 Dbt; // forward +class DbTxn; // forward + +// These classes are not defined here and should be invisible +// to the user, but some compilers require forward references. +// There is one for each use of the DEFINE_DB_CLASS macro. + +class DbImp; +class DbEnvImp; +class DbMpoolFileImp; +class DbTxnImp; + +// DEFINE_DB_CLASS defines an imp_ data member and imp() accessor. +// The underlying type is a pointer to an opaque *Imp class, that +// gets converted to the correct implementation class by the implementation. +// +// Since these defines use "private/public" labels, and leave the access +// being "private", we always use these by convention before any data +// members in the private section of a class. Keeping them in the +// private section also emphasizes that they are off limits to user code. +// +#define DEFINE_DB_CLASS(name) \ + public: class name##Imp* imp() { return (imp_); } \ + public: const class name##Imp* constimp() const { return (imp_); } \ + private: class name##Imp* imp_ + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// 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(disable: 4201 4514) + +#endif + +// 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); +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Lock classes +// + +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 classes +// + +class _exported DbLsn : protected DB_LSN +{ + friend class DbEnv; // friendship needed to cast to base class + friend class DbLogc; // friendship needed to cast to base class +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Memory pool classes +// + +class _exported DbMpoolFile +{ + friend class DbEnv; + +private: + // Put this first to allow inlining with some C++ compilers (g++-2.95) + DEFINE_DB_CLASS(DbMpoolFile); + +public: + int close(u_int32_t flags); + int get(db_pgno_t *pgnoaddr, u_int32_t flags, void *pagep); + void last_pgno(db_pgno_t *pgnoaddr); + int open(const char *file, u_int32_t flags, int mode, size_t pagesize); + int put(void *pgaddr, u_int32_t flags); + void refcnt(db_pgno_t *pgnoaddr); + int set(void *pgaddr, u_int32_t flags); + int set_clear_len(u_int32_t len); + int set_fileid(u_int8_t *fileid); + int set_ftype(int ftype); + int set_lsn_offset(int32_t offset); + int set_pgcookie(DBT *dbt); + void set_unlink(int); + int sync(); + + virtual DB_MPOOLFILE *get_DB_MPOOLFILE() + { + return (DB_MPOOLFILE *)imp(); + } + + virtual const DB_MPOOLFILE *get_const_DB_MPOOLFILE() const + { + return (const DB_MPOOLFILE *)constimp(); + } + +private: + // 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]; +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Transaction classes +// + +class _exported DbTxn +{ + friend class DbEnv; + +private: + // Put this first to allow inlining with some C++ compilers (g++-2.95) + DEFINE_DB_CLASS(DbTxn); + +public: + int abort(); + int commit(u_int32_t flags); + int discard(u_int32_t flags); + u_int32_t id(); + int prepare(u_int8_t *gid); + int set_timeout(db_timeout_t timeout, u_int32_t flags); + + virtual DB_TXN *get_DB_TXN() + { + return (DB_TXN *)imp(); + } + + virtual const DB_TXN *get_const_DB_TXN() const + { + return (const DB_TXN *)constimp(); + } + + 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: + // 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 &); +}; + +// +// 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; + +private: + // Put this first to allow inlining with some C++ compilers (g++-2.95) + DEFINE_DB_CLASS(DbEnv); + +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 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 void *get_app_private() const; + virtual int open(const char *, u_int32_t, int); + virtual int remove(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_cachesize(u_int32_t, u_int32_t, int); + virtual int set_data_dir(const char *); + virtual int set_encrypt(const char *, int); + virtual void set_errcall(void (*)(const char *, char *)); + virtual void set_errfile(FILE *); + virtual void set_errpfx(const char *); + virtual int set_flags(u_int32_t, int); + virtual int set_feedback(void (*)(DbEnv *, int, int)); + virtual int set_lg_bsize(u_int32_t); + virtual int set_lg_dir(const char *); + virtual int set_lg_max(u_int32_t); + virtual int set_lg_regionmax(u_int32_t); + virtual int set_lk_conflicts(u_int8_t *, int); + virtual int set_lk_detect(u_int32_t); + virtual int set_lk_max(u_int32_t); + virtual int set_lk_max_lockers(u_int32_t); + virtual int set_lk_max_locks(u_int32_t); + virtual int set_lk_max_objects(u_int32_t); + virtual int set_mp_mmapsize(size_t); + virtual int set_paniccall(void (*)(DbEnv *, int)); + virtual int set_rpc_server(void *, char *, long, long, u_int32_t); + virtual int set_shm_key(long); + virtual int set_timeout(db_timeout_t timeout, u_int32_t flags); + virtual int set_tmp_dir(const char *); + virtual int set_tas_spins(u_int32_t); + virtual int set_tx_max(u_int32_t); + virtual int set_app_dispatch(int (*)(DbEnv *, + Dbt *, DbLsn *, db_recops)); + virtual int set_tx_timestamp(time_t *); + virtual int set_verbose(u_int32_t which, int onoff); + + // 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 void set_error_stream(__DB_OSTREAMCLASS *); + + // used internally + static void runtime_error(const char *caller, int err, + int error_policy); + static void runtime_error_dbt(const char *caller, Dbt *dbt, + int error_policy); + static void runtime_error_lock_get(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_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_stat(DB_LOG_STAT **spp, 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_sync(DbLsn *lsn); + virtual int memp_trickle(int pct, int *nwrotep); + + // 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); + + // Replication functions + // + virtual int rep_elect(int, int, u_int32_t, int *); + virtual int rep_process_message(Dbt *, Dbt *, int *); + virtual int rep_start(Dbt *, u_int32_t); + virtual int rep_stat(DB_REP_STAT **statp, u_int32_t flags); + virtual int set_rep_limit(u_int32_t, u_int32_t); + virtual int set_rep_transport(u_int32_t, + int (*)(DbEnv *, const Dbt *, const Dbt *, int, u_int32_t)); + + // Conversion functions + // + virtual DB_ENV *get_DB_ENV() + { + return (DB_ENV *)imp(); + } + + virtual const DB_ENV *get_const_DB_ENV() const + { + return (const DB_ENV *)constimp(); + } + + static DbEnv* get_DbEnv(DB_ENV *dbenv) + { + return (DbEnv *)dbenv->api1_internal; + } + + static const DbEnv* get_const_DbEnv(const DB_ENV *dbenv) + { + return (const DbEnv *)dbenv->api1_internal; + } + + // 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 void _stream_error_function(const char *, char *); + 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 int _rep_send_intercept(DB_ENV *env, + const DBT *cntrl, const DBT *data, + int id, u_int32_t flags); + +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 + int construct_error_; + u_int32_t construct_flags_; + int (*app_dispatch_callback_)(DbEnv *, Dbt *, DbLsn *, db_recops); + void (*feedback_callback_)(DbEnv *, int, int); + 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 *, int, u_int32_t); + + // class data + static __DB_OSTREAMCLASS *error_stream_; +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Table access classes +// + +// +// Represents a database table = a set of keys with associated values. +// +class _exported Db +{ + friend class DbEnv; + +private: + // Put this first to allow inlining with some C++ compilers (g++-2.95) + DEFINE_DB_CLASS(Db); + +public: + Db(DbEnv*, u_int32_t); // create a Db object, then call open() + virtual ~Db(); // does *not* call close. + + // 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 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_type(DBTYPE *); + 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 set_bt_maxkey(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 set_cachesize(u_int32_t, u_int32_t, int); + virtual int set_cache_priority(DB_CACHE_PRIORITY); + virtual int set_dup_compare(dup_compare_fcn_type); /*deprecated*/ + virtual int set_dup_compare(int (*)(Db *, const Dbt *, const Dbt *)); + virtual int set_encrypt(const char *, int); + virtual void set_errcall(void (*)(const char *, char *)); + virtual void set_errfile(FILE *); + virtual void set_errpfx(const char *); + virtual int set_feedback(void (*)(Db *, int, int)); + virtual int set_flags(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 set_h_nelem(u_int32_t); + virtual int set_lorder(int); + virtual int set_pagesize(u_int32_t); + virtual int set_paniccall(void (*)(DbEnv *, int)); + virtual int set_re_delim(int); + virtual int set_re_len(u_int32_t); + virtual int set_re_pad(int); + virtual int set_re_source(char *); + virtual int set_q_extentsize(u_int32_t); + virtual int stat(void *sp, 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_OSTREAMCLASS *, u_int32_t); + + // These additional methods are not in the C interface, and + // are only available for C++. + // + virtual void set_error_stream(__DB_OSTREAMCLASS *); + + virtual DB *get_DB() + { + return (DB *)imp(); + } + + virtual const DB *get_const_DB() const + { + return (const DB *)constimp(); + } + + 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 + DbEnv *env_; + 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); +}; + +// +// A chunk of data, maybe a key or value. +// +class _exported Dbt : private DBT +{ + friend class Dbc; + friend class Db; + friend class DbEnv; + friend class DbLogc; + +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. +}; + +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 &); +}; + +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 &); +}; +#endif /* !_DB_CXX_H_ */ diff --git a/bdb/build_win32/db_java_xa.dsp b/bdb/build_win32/db_java_xa.dsp new file mode 100644 index 00000000000..9c700ffeed4 --- /dev/null +++ b/bdb/build_win32/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/bdb/build_win32/db_java_xaj.mak b/bdb/build_win32/db_java_xaj.mak new file mode 100644 index 00000000000..c2dbc920d17 --- /dev/null +++ b/bdb/build_win32/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/bdb/build_win32/db_lib.dsp b/bdb/build_win32/db_lib.dsp new file mode 100644 index 00000000000..a7fb4157909 --- /dev/null +++ b/bdb/build_win32/db_lib.dsp @@ -0,0 +1,92 @@ +# Microsoft Developer Studio Project File - Name="db_lib" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=db_lib - Win32 Debug Static +!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_lib.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_lib.mak" CFG="db_lib - Win32 Debug Static" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "db_lib - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "db_lib - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE "db_lib - Win32 Release Static" (based on "Win32 (x86) Generic Project") +!MESSAGE "db_lib - Win32 Debug Static" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "db_lib - 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 Target_Dir "" + +!ELSEIF "$(CFG)" == "db_lib - 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 Target_Dir "" + +!ELSEIF "$(CFG)" == "db_lib - Win32 Release Static" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_static" +# PROP BASE Intermediate_Dir "Release_static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_static" +# PROP Intermediate_Dir "Release_static" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "db_lib - Win32 Debug Static" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_static" +# PROP BASE Intermediate_Dir "Debug_Static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_static" +# PROP Intermediate_Dir "Debug_Static" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "db_lib - Win32 Release" +# Name "db_lib - Win32 Debug" +# Name "db_lib - Win32 Release Static" +# Name "db_lib - Win32 Debug Static" +# End Target +# End Project diff --git a/bdb/build_win32/db_perf.dsp b/bdb/build_win32/db_perf.dsp new file mode 100644 index 00000000000..21b79ed9e19 --- /dev/null +++ b/bdb/build_win32/db_perf.dsp @@ -0,0 +1,216 @@ +# 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 Static +!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 Static" +!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 Release Static" (based on "Win32 (x86) Console Application") +!MESSAGE "db_perf - Win32 Debug Static" (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" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /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 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Release/libdb41.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt" + +!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" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /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 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 Debug/libdb41d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no + +!ELSEIF "$(CFG)" == "db_perf - Win32 Release Static" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_static" +# PROP Intermediate_Dir "Release_static" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /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_static/libdb41.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Release_static/libdb41s.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "db_perf - Win32 Debug Static" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_static" +# PROP Intermediate_Dir "Debug_static" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /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_static/libdb41d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no +# ADD LINK32 Debug_static/libdb41sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no + +!ENDIF + +# Begin Target + +# Name "db_perf - Win32 Release" +# Name "db_perf - Win32 Debug" +# Name "db_perf - Win32 Release Static" +# Name "db_perf - Win32 Debug Static" +# Begin Source File + +SOURCE=..\test_perf\db_perf.c +# End Source File +# Begin Source File + +SOURCE=..\test_perf\perf_cache_check.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_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_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/bdb/build_win32/db_test.dsp b/bdb/build_win32/db_test.dsp index e1bb9056824..f014aa95bcf 100644 --- a/bdb/build_win32/db_test.dsp +++ b/bdb/build_win32/db_test.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="db_test" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -22,6 +22,7 @@ CFG=db_test - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -41,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -49,9 +50,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Release/libdb41.lib /nologo /subsystem:console /machine:I386 # Begin Special Build Tool -SOURCE=$(InputPath) +SOURCE="$(InputPath)" PostBuild_Desc=Copy built executable files. PostBuild_Cmds=copy Release\*.exe . # End Special Build Tool @@ -60,8 +61,8 @@ PostBuild_Cmds=copy Release\*.exe . # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "db_recov" -# PROP BASE Intermediate_Dir "db_recov" +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 @@ -70,7 +71,7 @@ PostBuild_Cmds=copy Release\*.exe . # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -78,9 +79,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Debug/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"Debug/dbkill.exe" /fixed:no +# ADD LINK32 Debug/libdb41d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"Debug/dbkill.exe" /fixed:no # Begin Special Build Tool -SOURCE=$(InputPath) +SOURCE="$(InputPath)" PostBuild_Desc=Copy built executable files. PostBuild_Cmds=copy Debug\*.exe . # End Special Build Tool diff --git a/bdb/build_win32/db_test.src b/bdb/build_win32/db_test.src new file mode 100644 index 00000000000..73479d3856a --- /dev/null +++ b/bdb/build_win32/db_test.src @@ -0,0 +1,97 @@ +# 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 + +# 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 "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 Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /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 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Release/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib /nologo /subsystem:console /machine:I386 +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy Release\*.exe . +# End Special Build Tool + +!ELSEIF "$(CFG)" == "@project_name@ - 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 Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /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 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 Debug/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"Debug/dbkill.exe" /fixed:no +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copy built executable files. +PostBuild_Cmds=copy Debug\*.exe . +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "@project_name@ - Win32 Release" +# Name "@project_name@ - Win32 Debug" +@SOURCE_FILES@ +# End Target +# End Project diff --git a/bdb/build_win32/dbkill.cpp b/bdb/build_win32/dbkill.cpp index 24709f37201..23dc87b0e85 100644 --- a/bdb/build_win32/dbkill.cpp +++ b/bdb/build_win32/dbkill.cpp @@ -1,10 +1,10 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1999, 2000 + * Copyright (c) 1999-2002 * Sleepycat Software. All rights reserved. * - * $Id: dbkill.cpp,v 11.4 2000/05/02 17:08:31 dda Exp $ + * $Id: dbkill.cpp,v 11.7 2002/01/11 15:51:27 bostic Exp $ */ /* * Kill - @@ -74,7 +74,7 @@ usage_exit() { fprintf(stderr, "Usage: kill [ -sig ] pid\n"); fprintf(stderr, " for win32, sig must be or 0, 15 (TERM)\n"); - exit(1); + exit(EXIT_FAILURE); } int @@ -117,15 +117,15 @@ main(int argc, char **argv) hProcess = OpenProcess(accessflag, FALSE, pid); if (hProcess == NULL) { fprintf(stderr, "dbkill: %s: no such process\n", argv[1]); - exit(1); + exit(EXIT_FAILURE); } if (sig == 0) - exit(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(1); + exit(EXIT_FAILURE); } - return 0; + return EXIT_SUCCESS; } diff --git a/bdb/build_win32/dynamic_dsp.src b/bdb/build_win32/dynamic_dsp.src index d9881eda331..a92906a51f4 100644 --- a/bdb/build_win32/dynamic_dsp.src +++ b/bdb/build_win32/dynamic_dsp.src @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="@project_name@" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 @@ -13,19 +13,16 @@ CFG=@project_name@ - Win32 Debug !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 Static" +!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 Release Static" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE "@project_name@ - Win32 Debug Static" (based on\ - "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -46,9 +43,9 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /I "../dbinc" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /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 @@ -72,74 +69,18 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "DB_CREATE_DLL" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /YX"config.h" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "DB_CREATE_DLL" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /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 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" /d "_AFXDLL" +# 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 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no - -!ELSEIF "$(CFG)" == "@project_name@ - Win32 Release Static" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "DB_DLL__" -# PROP BASE Intermediate_Dir "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" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /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 /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" -# ADD LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" - -!ELSEIF "$(CFG)" == "@project_name@ - Win32 Debug Static" - -# PROP BASE Use_MFC 2 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "DB_DLL_0" -# PROP BASE Intermediate_Dir "DB_DLL_0" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 2 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "DB_CREATE_DLL" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /YX"config.h" /FD /c -# SUBTRACT BASE CPP /Fr -# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "DB_CREATE_DLL" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /YX"config.h" /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" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no -# ADD LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no !ENDIF @@ -147,8 +88,6 @@ LINK32=link.exe # Name "@project_name@ - Win32 Release" # Name "@project_name@ - Win32 Debug" -# Name "@project_name@ - Win32 Release Static" -# Name "@project_name@ - Win32 Debug Static" @SOURCE_FILES@ # End Target # End Project diff --git a/bdb/build_win32/java_dsp.src b/bdb/build_win32/java_dsp.src index eff251a44f4..15941bcab67 100644 --- a/bdb/build_win32/java_dsp.src +++ b/bdb/build_win32/java_dsp.src @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="@project_name@" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 @@ -17,12 +17,12 @@ 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 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "@project_name@ - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -43,9 +43,9 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /YX /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 @@ -53,25 +53,22 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 Release/libdb32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb_java@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" +# ADD LINK32 Release/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb_java@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" # Begin Custom Build - Compiling java files using javac ProjDir=. InputPath=.\Release\libdb_java@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll -SOURCE=$(InputPath) +SOURCE="$(InputPath)" "force_compilation.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - cd $(ProjDir)\..\java\src\com\sleepycat\db - mkdir ..\..\..\..\classes + mkdir $(ProjDir)\Release\classes echo compiling Berkeley DB classes - javac -d ../../../../classes -classpath "$(CLASSPATH);../../../../classes"\ - *.java + javac -g -d $(ProjDir)/Release/classes -classpath "$(CLASSPATH);$(ProjDir)/Release/classes" ..\java\src\com\sleepycat\db\*.java echo compiling examples - cd ..\examples - javac -d ../../../../classes -classpath "$(CLASSPATH);../../../../classes"\ - *.java - echo creating jar file - cd ..\..\..\..\classes - jar cf db.jar com\sleepycat\db\*.class + javac -g -d $(ProjDir)/Release/classes -classpath "$(CLASSPATH);$(ProjDir)/Release/classes" ..\java\src\com\sleepycat\examples\*.java + echo creating jar files + cd $(ProjDir)\Release\classes + jar cf ../db.jar com\sleepycat\db\*.class + jar cf ../dbexamples.jar com\sleepycat\examples\*.class echo Java build finished # End Custom Build @@ -90,10 +87,10 @@ SOURCE=$(InputPath) # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /D "_WINDLL" /D "_AFXDLL" /YX"config.h" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /D "_WINDLL" /D "_AFXDLL" /YX"config.h" /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 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" /d "_AFXDLL" BSC32=bscmake.exe @@ -101,25 +98,22 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Debug/libdb32d.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb_java@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no +# ADD LINK32 Debug/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb_java@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no # Begin Custom Build - Compiling java files using javac ProjDir=. InputPath=.\Debug\libdb_java@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll -SOURCE=$(InputPath) +SOURCE="$(InputPath)" "force_compilation.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - cd $(ProjDir)\..\java\src\com\sleepycat\db - mkdir ..\..\..\..\classes + mkdir $(ProjDir)\Debug\classes echo compiling Berkeley DB classes - javac -g -d ../../../../classes -classpath "$(CLASSPATH);../../../../classes"\ - *.java + javac -g -d $(ProjDir)/Debug/classes -classpath "$(CLASSPATH);$(ProjDir)/Debug/classes" ..\java\src\com\sleepycat\db\*.java echo compiling examples - javac -g -d ../../../../classes -classpath "$(CLASSPATH);../../../../classes"\ - *.java - cd ..\examples - echo creating jar file - cd ..\..\..\..\classes - jar cf db.jar com\sleepycat\db\*.class + javac -g -d $(ProjDir)/Debug/classes -classpath "$(CLASSPATH);$(ProjDir)/Debug/classes" ..\java\src\com\sleepycat\examples\*.java + echo creating jar files + cd $(ProjDir)\Debug\classes + jar cf ../db.jar com\sleepycat\db\*.class + jar cf ../dbexamples.jar com\sleepycat\examples\*.class echo Java build finished # End Custom Build diff --git a/bdb/build_win32/libdb.def b/bdb/build_win32/libdb.def index a3b4cb3b26b..afcb092382e 100644 --- a/bdb/build_win32/libdb.def +++ b/bdb/build_win32/libdb.def @@ -1,151 +1,128 @@ -; $Id: libdb.def,v 11.21 2001/01/04 15:07:33 dda Exp $ +; DO NOT EDIT: automatically built by dist/s_win32. + +DESCRIPTION 'Berkeley DB 4.1 Library' -DESCRIPTION 'Berkeley DB 3.2 Library' EXPORTS - lock_get @1 - lock_id @2 - lock_put @3 - lock_vec @4 - log_compare @5 - log_file @6 - log_flush @7 - log_get @8 - log_put @9 - log_register @10 - log_unregister @11 - memp_fclose @12 - memp_fget @13 - memp_fopen @14 - memp_fput @15 - memp_fset @16 - memp_fsync @17 - memp_register @18 - memp_sync @19 - txn_abort @20 - txn_begin @21 - txn_checkpoint @22 - txn_commit @23 - txn_prepare @24 - db_version @25 - memp_stat @26 - log_archive @27 - lock_detect @28 - txn_id @29 - txn_stat @30 - memp_trickle @31 - log_stat @32 - lock_stat @33 - db_create @34 - db_env_create @35 - db_strerror @36 - db_xa_switch @37 - db_env_set_func_close @38 - db_env_set_func_dirfree @39 - db_env_set_func_dirlist @40 - db_env_set_func_exists @41 - db_env_set_func_free @42 - db_env_set_func_fsync @43 - db_env_set_func_ioinfo @44 - db_env_set_func_malloc @45 - db_env_set_func_map @46 - db_env_set_func_open @47 - db_env_set_func_read @48 - db_env_set_func_realloc @49 - db_env_set_func_rename @50 - db_env_set_func_sleep @51 - db_env_set_func_unlink @52 - db_env_set_func_unmap @53 - db_env_set_func_write @54 - db_env_set_func_yield @55 -; FREE @56 - db_env_set_pageyield @57 - db_env_set_panicstate @58 - db_env_set_region_init @59 - db_env_set_tas_spins @60 -; these are only for testing - __db_loadme @201 - __ham_func2 @202 - __ham_func3 @203 - __ham_func4 @204 - __ham_func5 @205 - __db_hcreate @206 - __db_hsearch @207 - __db_hdestroy @208 - __db_dbm_init @209 - __db_dbm_delete @210 - __db_dbm_fetch @211 - __db_dbm_store @212 - __db_dbm_firstkey @213 - __db_dbm_nextkey @214 - __db_dbm_close @215 - __db_ndbm_open @216 - __db_ndbm_store @217 - __db_ndbm_rdonly @218 - __db_ndbm_pagfno @219 - __db_ndbm_nextkey @220 - __db_ndbm_firstkey @221 - __db_ndbm_fetch @222 - __db_ndbm_error @223 - __db_ndbm_dirfno @224 - __db_ndbm_delete @225 - __db_ndbm_close @226 - __db_ndbm_clearerr @227 - __lock_dump_region @228 - __memp_dump_region @229 - __os_closehandle @230 - __os_openhandle @231 - __os_strdup @232 - __db_r_attach @233 - __db_r_detach @234 - __db_tas_mutex_init @235 - __db_tas_mutex_lock @236 - __db_tas_mutex_unlock @237 - __os_read @238 - __os_write @239 - __os_open @240 - __os_ioinfo @241 - __os_free @242 - __os_malloc @243 - __os_freestr @244 - __os_calloc @245 - __ham_test @246 -; these are needed for linking tools - __db_dump @401 - __db_rpath @402 - __db_dispatch @403 - __db_err @404 - __db_init_print @405 - __txn_init_print @406 - __log_init_print @407 - __ham_init_print @408 - __bam_init_print @409 - __db_jump @410 - __ham_pgin @411 - __ham_pgout @412 - __bam_pgin @413 - __bam_pgout @414 - __db_omode @415 - __db_prdbt @416 - __os_sleep @417 - __db_e_stat @420 - __db_getlong @421 - __os_get_errno @422 - __os_set_errno @423 - __ham_get_meta @424 - __ham_release_meta @425 - __qam_init_print @426 - __crdel_init_print @427 - __qam_pgin_out @428 - __db_pgin @429 - __db_pgout @430 - __db_getulong @431 - __db_util_sigresend @432 - __db_util_siginit @433 - __db_util_interrupted @434 - __db_util_logset @435 - __db_prheader @436 - __db_prfooter @437 - __db_verify_callback @438 - __db_verify_internal @439 - __os_yield @440 - __db_global_values @441 + db_create @1 + db_env_create @2 + db_strerror @3 + db_version @4 + db_xa_switch @5 + log_compare @6 + txn_abort @7 + txn_begin @8 + txn_commit @9 + db_env_set_func_close @10 + db_env_set_func_dirfree @11 + db_env_set_func_dirlist @12 + db_env_set_func_exists @13 + db_env_set_func_free @14 + db_env_set_func_fsync @15 + db_env_set_func_ioinfo @16 + db_env_set_func_malloc @17 + db_env_set_func_map @18 + db_env_set_func_open @19 + db_env_set_func_read @20 + db_env_set_func_realloc @21 + db_env_set_func_rename @22 + db_env_set_func_seek @23 + db_env_set_func_sleep @24 + db_env_set_func_unlink @25 + db_env_set_func_unmap @26 + db_env_set_func_write @27 + db_env_set_func_yield @28 + __db_add_recovery @29 + __db_dbm_close @30 + __db_dbm_delete @31 + __db_dbm_fetch @32 + __db_dbm_firstkey @33 + __db_dbm_init @34 + __db_dbm_nextkey @35 + __db_dbm_store @36 + __db_hcreate @37 + __db_hdestroy @38 + __db_hsearch @39 + __db_loadme @40 + __db_ndbm_clearerr @41 + __db_ndbm_close @42 + __db_ndbm_delete @43 + __db_ndbm_dirfno @44 + __db_ndbm_error @45 + __db_ndbm_fetch @46 + __db_ndbm_firstkey @47 + __db_ndbm_nextkey @48 + __db_ndbm_open @49 + __db_ndbm_pagfno @50 + __db_ndbm_rdonly @51 + __db_ndbm_store @52 + __db_panic @53 + __db_r_attach @54 + __db_r_detach @55 + __db_win32_mutex_init @56 + __db_win32_mutex_lock @57 + __db_win32_mutex_unlock @58 + __ham_func2 @59 + __ham_func3 @60 + __ham_func4 @61 + __ham_func5 @62 + __ham_test @63 + __lock_dump_region @64 + __memp_dump_region @65 + __os_calloc @66 + __os_closehandle @67 + __os_free @68 + __os_ioinfo @69 + __os_malloc @70 + __os_open @71 + __os_openhandle @72 + __os_read @73 + __os_realloc @74 + __os_strdup @75 + __os_umalloc @76 + __os_write @77 + __bam_init_print @78 + __bam_pgin @79 + __bam_pgout @80 + __crdel_init_print @81 + __db_dispatch @82 + __db_dump @83 + __db_e_stat @84 + __db_err @85 + __db_getlong @86 + __db_getulong @87 + __db_global_values @88 + __db_init_print @89 + __db_inmemdbflags @90 + __db_isbigendian @91 + __db_omode @92 + __db_overwrite @93 + __db_pgin @94 + __db_pgout @95 + __db_prdbt @96 + __db_prfooter @97 + __db_prheader @98 + __db_rpath @99 + __db_util_cache @100 + __db_util_interrupted @101 + __db_util_logset @102 + __db_util_siginit @103 + __db_util_sigresend @104 + __db_verify_callback @105 + __db_verify_internal @106 + __dbreg_init_print @107 + __fop_init_print @108 + __ham_get_meta @109 + __ham_init_print @110 + __ham_pgin @111 + __ham_pgout @112 + __ham_release_meta @113 + __os_clock @114 + __os_get_errno @115 + __os_id @116 + __os_set_errno @117 + __os_sleep @118 + __os_ufree @119 + __os_yield @120 + __qam_init_print @121 + __qam_pgin_out @122 + __txn_init_print @123 diff --git a/bdb/build_win32/libdb_tcl.def b/bdb/build_win32/libdb_tcl.def index a18459beaba..b6323c66bc6 100644 --- a/bdb/build_win32/libdb_tcl.def +++ b/bdb/build_win32/libdb_tcl.def @@ -1,16 +1,11 @@ -; $Id: libdb_tcl.def,v 11.2 1999/11/21 23:10:00 bostic Exp $ +; $Id: libdb_tcl.def,v 11.5 2002/04/03 12:01:27 mjc Exp $ DESCRIPTION 'Berkeley DB TCL interface Library' EXPORTS Db_tcl_Init - bdb_DbmCommand - bdb_HCommand - bdb_NdbmOpen - bdb_RandCommand db_Cmd dbc_Cmd env_Cmd - ndbm_Cmd tcl_EnvRemove tcl_LockDetect tcl_LockGet @@ -22,9 +17,7 @@ EXPORTS tcl_LogFlush tcl_LogGet tcl_LogPut - tcl_LogRegister tcl_LogStat - tcl_LogUnregister tcl_Mp tcl_MpStat tcl_MpSync @@ -32,4 +25,3 @@ EXPORTS tcl_Txn tcl_TxnCheckpoint tcl_TxnStat - txn_Cmd diff --git a/bdb/build_win32/libdbrc.src b/bdb/build_win32/libdbrc.src index 82a93068c8b..3e5d8deec6f 100644 --- a/bdb/build_win32/libdbrc.src +++ b/bdb/build_win32/libdbrc.src @@ -20,7 +20,7 @@ BEGIN VALUE "FileDescription", "Berkeley DB 3.0 DLL\0" VALUE "FileVersion", "%MAJOR%.%MINOR%.%PATCH%\0" VALUE "InternalName", "libdb.dll\0" - VALUE "LegalCopyright", "Copyright © Sleepycat Software Inc. 1997, 1998, 1999, 2000\0" + VALUE "LegalCopyright", "Copyright © Sleepycat Software Inc. 1997-2002\0" VALUE "OriginalFilename", "libdb.dll\0" VALUE "ProductName", "Sleepycat Software libdb\0" VALUE "ProductVersion", "%MAJOR%.%MINOR%.%PATCH%\0" diff --git a/bdb/build_win32/static_dsp.src b/bdb/build_win32/static_dsp.src index 99d00f14291..0c66c851025 100644 --- a/bdb/build_win32/static_dsp.src +++ b/bdb/build_win32/static_dsp.src @@ -1,10 +1,10 @@ # Microsoft Developer Studio Project File - Name="@project_name@" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 -CFG=@project_name@ - Win32 Debug +CFG=@project_name@ - Win32 Debug Static !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE @@ -17,75 +17,33 @@ 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 Release Static" (based on\ - "Win32 (x86) Static Library") -!MESSAGE "@project_name@ - Win32 Debug Static" (based on\ - "Win32 (x86) Static Library") +!MESSAGE "@project_name@ - Win32 Release Static" (based on "Win32 (x86) Static Library") +!MESSAGE "@project_name@ - Win32 Debug Static" (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" +!IF "$(CFG)" == "@project_name@ - Win32 Release Static" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "DB_Stati" -# PROP BASE Intermediate_Dir "DB_Stati" +# PROP BASE Output_Dir "Release_static" +# PROP BASE Intermediate_Dir "Release_static" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release_static" # PROP Intermediate_Dir "Release_static" # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Release_static/libdb@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 "DB_Stat0" -# PROP BASE Intermediate_Dir "DB_Stat0" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_static" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Debug_static/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@sd.lib" - -!ELSEIF "$(CFG)" == "@project_name@ - Win32 Release Static" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "DB_Stati" -# PROP BASE Intermediate_Dir "DB_Stati" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_static" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX"config.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX"config.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I ".." /I "../dbinc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -95,18 +53,20 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "@project_name@ - Win32 Debug Static" -# PROP BASE Use_MFC 0 +# PROP BASE Use_MFC 1 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "DB_Stat0" -# PROP BASE Intermediate_Dir "DB_Stat0" +# PROP BASE Output_Dir "Debug_static" +# PROP BASE Intermediate_Dir "Debug_static" # PROP BASE Target_Dir "" -# PROP Use_MFC 0 +# PROP Use_MFC 1 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug_static" # PROP Intermediate_Dir "Debug_static" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX"config.h" /FD /c -# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX"config.h" /FD /c +# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c +# ADD BASE RSC /l 0xc09 +# ADD RSC /l 0xc09 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -118,8 +78,6 @@ LIB32=link.exe -lib # Begin Target -# Name "@project_name@ - Win32 Release" -# Name "@project_name@ - Win32 Debug" # Name "@project_name@ - Win32 Release Static" # Name "@project_name@ - Win32 Debug Static" @SOURCE_FILES@ diff --git a/bdb/build_win32/tcl_dsp.src b/bdb/build_win32/tcl_dsp.src index 11a36606e37..4de41e6934e 100644 --- a/bdb/build_win32/tcl_dsp.src +++ b/bdb/build_win32/tcl_dsp.src @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="@project_name@" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 @@ -22,6 +22,7 @@ CFG=@project_name@ - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -42,9 +43,9 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "DB_TCL_SUPPORT" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I ".." /I "../dbinc" /D "DB_TCL_SUPPORT" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /YX /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 @@ -52,7 +53,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 Release/libdb32.lib tcl83.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb_tcl@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" +# ADD LINK32 Release/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.lib tcl83.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb_tcl@DB_VERSION_MAJOR@@DB_VERSION_MINOR@.dll" !ELSEIF "$(CFG)" == "@project_name@ - Win32 Debug" @@ -68,10 +69,10 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "DB_TCL_SUPPORT" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /D "_WINDLL" /D "_AFXDLL" /YX"config.h" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I ".." /I "../dbinc" /D "DB_TCL_SUPPORT" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /D "_WINDLL" /D "_AFXDLL" /YX"config.h" /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 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" /d "_AFXDLL" BSC32=bscmake.exe @@ -79,7 +80,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Debug/libdb32d.lib tcl83d.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb_tcl@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no +# ADD LINK32 Debug/libdb@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.lib tcl83d.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb_tcl@DB_VERSION_MAJOR@@DB_VERSION_MINOR@d.dll" /fixed:no !ENDIF diff --git a/bdb/clib/getcwd.c b/bdb/clib/getcwd.c index 630facb4fdb..bae50dfe90c 100644 --- a/bdb/clib/getcwd.c +++ b/bdb/clib/getcwd.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -36,7 +36,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: getcwd.c,v 11.7 2000/11/30 00:58:30 ubell Exp $"; +static const char revid[] = "$Id: getcwd.c,v 11.13 2002/02/28 21:27:18 ubell Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -120,7 +120,7 @@ getcwd(pt, size) ept = pt + size; } else { if ((ret = - __os_malloc(NULL, ptsize = 1024 - 4, NULL, &pt)) != 0) { + __os_malloc(NULL, ptsize = 1024 - 4, &pt)) != 0) { __os_set_errno(ret); return (NULL); } @@ -134,7 +134,7 @@ getcwd(pt, size) * Should always be enough (it's 340 levels). If it's not, allocate * as necessary. Special case the first stat, it's ".", not "..". */ - if ((ret = __os_malloc(NULL, upsize = 1024 - 4, NULL, &up)) != 0) + if ((ret = __os_malloc(NULL, upsize = 1024 - 4, &up)) != 0) goto err; eup = up + 1024; bup = up; @@ -167,7 +167,7 @@ getcwd(pt, size) * been that way and stuff would probably break. */ bcopy(bpt, pt, ept - bpt); - __os_free(up, upsize); + __os_free(NULL, up); return (pt); } @@ -177,7 +177,7 @@ getcwd(pt, size) * possible component name, plus a trailing NULL. */ if (bup + 3 + MAXNAMLEN + 1 >= eup) { - if (__os_realloc(NULL, upsize *= 2, NULL, &up) != 0) + if (__os_realloc(NULL, upsize *= 2, &up) != 0) goto err; bup = up; eup = up + upsize; @@ -238,7 +238,7 @@ getcwd(pt, size) } off = bpt - pt; len = ept - bpt; - if (__os_realloc(NULL, ptsize *= 2, NULL, &pt) != 0) + if (__os_realloc(NULL, ptsize *= 2, &pt) != 0) goto err; bpt = pt + off; ept = pt + ptsize; @@ -261,12 +261,12 @@ notfound: * didn't find the current directory in its parent directory, set * errno to ENOENT. */ - if (__os_get_errno() == 0) + if (__os_get_errno_ret_zero() == 0) __os_set_errno(save_errno == 0 ? ENOENT : save_errno); /* FALLTHROUGH */ err: if (ptsize) - __os_free(pt, ptsize); - __os_free(up, upsize); + __os_free(NULL, pt); + __os_free(NULL, up); return (NULL); } diff --git a/bdb/clib/getopt.c b/bdb/clib/getopt.c index 667fca1d78c..3f6659ea6e6 100644 --- a/bdb/clib/getopt.c +++ b/bdb/clib/getopt.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -36,7 +36,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: getopt.c,v 11.4 2000/02/14 02:59:40 bostic Exp $"; +static const char revid[] = "$Id: getopt.c,v 11.7 2002/01/11 15:51:28 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -47,6 +47,8 @@ static const char revid[] = "$Id: getopt.c,v 11.4 2000/02/14 02:59:40 bostic Exp #include "db_int.h" +int __db_getopt_reset; /* global reset for VxWorks. */ + int opterr = 1, /* if error message should be printed */ optind = 1, /* index into parent argv vector */ optopt, /* character checked for validity */ @@ -78,6 +80,19 @@ getopt(nargc, nargv, ostr) static char *place = EMSG; /* option letter processing */ char *oli; /* option letter list index */ + /* + * VxWorks needs to be able to repeatedly call getopt from multiple + * programs within its global name space. + */ + if (__db_getopt_reset) { + __db_getopt_reset = 0; + + opterr = optind = 1; + optopt = optreset = 0; + optarg = NULL; + progname = NULL; + place = EMSG; + } if (!progname) { if ((progname = __db_rpath(*nargv)) == NULL) progname = *nargv; diff --git a/bdb/clib/memcmp.c b/bdb/clib/memcmp.c index 2aedc3fa6b8..979badaef30 100644 --- a/bdb/clib/memcmp.c +++ b/bdb/clib/memcmp.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -36,7 +36,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: memcmp.c,v 11.5 2000/02/24 21:58:12 bostic Exp $"; +static const char revid[] = "$Id: memcmp.c,v 11.7 2002/01/11 15:51:28 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES diff --git a/bdb/clib/memmove.c b/bdb/clib/memmove.c index da6bcfe8b13..632d50788da 100644 --- a/bdb/clib/memmove.c +++ b/bdb/clib/memmove.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -36,7 +36,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: memmove.c,v 11.4 2000/02/14 02:59:40 bostic Exp $"; +static const char revid[] = "$Id: memmove.c,v 11.6 2002/01/11 15:51:28 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES diff --git a/bdb/clib/raise.c b/bdb/clib/raise.c index acec86cd63a..fcf3bbcbd7f 100644 --- a/bdb/clib/raise.c +++ b/bdb/clib/raise.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: raise.c,v 11.3 2000/02/14 02:59:41 bostic Exp $"; +static const char revid[] = "$Id: raise.c,v 11.6 2002/01/11 15:51:28 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -28,5 +28,9 @@ 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/bdb/clib/snprintf.c b/bdb/clib/snprintf.c index 6aa9e3ae66c..fa1a63425e8 100644 --- a/bdb/clib/snprintf.c +++ b/bdb/clib/snprintf.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: snprintf.c,v 11.5 2000/12/22 19:38:37 bostic Exp $"; +static const char revid[] = "$Id: snprintf.c,v 11.10 2002/01/11 15:51:28 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -39,23 +39,36 @@ snprintf(str, n, fmt, va_alist) va_dcl #endif { + static int ret_charpnt = -1; va_list ap; - int rval; + int len; COMPQUIET(n, 0); + + /* + * Some old versions of sprintf return a pointer to the first argument + * instead of a character count. Assume the return value of snprintf, + * vsprintf, etc. will be the same as sprintf, and check the easy one. + * + * We do this test at run-time because it's not a test we can do in a + * cross-compilation environment. + */ + if (ret_charpnt == -1) { + char buf[10]; + + ret_charpnt = + sprintf(buf, "123") != 3 || + sprintf(buf, "123456789") != 9 || + sprintf(buf, "1234") != 4; + } + #ifdef __STDC__ va_start(ap, fmt); #else va_start(ap); #endif -#ifdef SPRINTF_RET_CHARPNT - (void)vsprintf(str, fmt, ap); + len = vsprintf(str, fmt, ap); va_end(ap); - return (strlen(str)); -#else - rval = vsprintf(str, fmt, ap); - va_end(ap); - return (rval); -#endif + return (ret_charpnt ? (int)strlen(str) : len); } #endif diff --git a/bdb/clib/strcasecmp.c b/bdb/clib/strcasecmp.c index 6633197bc8c..d5ce6d76d5f 100644 --- a/bdb/clib/strcasecmp.c +++ b/bdb/clib/strcasecmp.c @@ -34,7 +34,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: strcasecmp.c,v 1.4 2000/03/24 22:31:31 bostic Exp $"; +static const char revid[] = "$Id: strcasecmp.c,v 1.7 2001/11/15 17:51:38 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -78,14 +78,16 @@ static const unsigned char charmap[] = { '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' }; /* * strcasecmp -- * Do strcmp(3) in a case-insensitive manner. * + * PUBLIC: #ifndef HAVE_STRCASECMP * PUBLIC: int strcasecmp __P((const char *, const char *)); + * PUBLIC: #endif */ int strcasecmp(s1, s2) @@ -100,3 +102,31 @@ strcasecmp(s1, s2) return (0); return (cm[*us1] - cm[*--us2]); } + +/* + * strncasecmp -- + * Do strncmp(3) in a case-insensitive manner. + * + * PUBLIC: #ifndef HAVE_STRCASECMP + * PUBLIC: int strncasecmp __P((const char *, const char *, size_t)); + * PUBLIC: #endif + */ +int +strncasecmp(s1, s2, n) + const char *s1, *s2; + register size_t n; +{ + if (n != 0) { + register const unsigned char *cm = charmap, + *us1 = (const unsigned char *)s1, + *us2 = (const unsigned char *)s2; + + do { + if (cm[*us1] != cm[*us2++]) + return (cm[*us1] - cm[*--us2]); + if (*us1++ == '\0') + break; + } while (--n != 0); + } + return (0); +} diff --git a/bdb/clib/strdup.c b/bdb/clib/strdup.c new file mode 100644 index 00000000000..e68623f1407 --- /dev/null +++ b/bdb/clib/strdup.c @@ -0,0 +1,67 @@ +/* + * 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" + +#ifndef lint +static const char revid[] = "$Id: strdup.c,v 1.5 2002/05/01 18:40:05 bostic Exp $"; +#endif /* not lint */ + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include +#include +#include +#endif + +/* + * strdup -- + * + * PUBLIC: #ifndef HAVE_STRDUP + * PUBLIC: char *strdup __P((const char *)); + * PUBLIC: #endif + */ +char * +strdup(str) + const char *str; +{ + size_t len; + char *copy; + + len = strlen(str) + 1; + if (!(copy = malloc((u_int)len))) + return (NULL); + memcpy(copy, str, len); + return (copy); +} diff --git a/bdb/clib/strerror.c b/bdb/clib/strerror.c index 0f7447b0419..06c28946b88 100644 --- a/bdb/clib/strerror.c +++ b/bdb/clib/strerror.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. */ /* @@ -36,7 +36,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: strerror.c,v 11.4 2000/02/14 02:59:41 bostic Exp $"; +static const char revid[] = "$Id: strerror.c,v 11.6 2002/01/11 15:51:29 bostic Exp $"; #endif /* not lint */ /* diff --git a/bdb/clib/vsnprintf.c b/bdb/clib/vsnprintf.c index 3d27bc0d2f8..4ffea8cb0ad 100644 --- a/bdb/clib/vsnprintf.c +++ b/bdb/clib/vsnprintf.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: vsnprintf.c,v 11.4 2000/05/18 19:24:59 bostic Exp $"; +static const char revid[] = "$Id: vsnprintf.c,v 11.7 2002/01/11 15:51:29 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -24,7 +24,7 @@ static const char revid[] = "$Id: vsnprintf.c,v 11.4 2000/05/18 19:24:59 bostic * Bounded version of vsprintf. * * PUBLIC: #ifndef HAVE_VSNPRINTF - * PUBLIC: int vsnprintf(); + * PUBLIC: int vsnprintf __P((char *, size_t, const char *, va_list)); * PUBLIC: #endif */ #ifndef HAVE_VSNPRINTF diff --git a/bdb/common/db_byteorder.c b/bdb/common/db_byteorder.c index d089cfe4c99..d42d8e6a958 100644 --- a/bdb/common/db_byteorder.c +++ b/bdb/common/db_byteorder.c @@ -1,30 +1,42 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_byteorder.c,v 11.4 2000/11/30 00:58:31 ubell Exp $"; +static const char revid[] = "$Id: db_byteorder.c,v 11.8 2002/02/01 18:15:29 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include - -#ifdef HAVE_ENDIAN_H -#include -#if BYTE_ORDER == BIG_ENDIAN -#define WORDS_BIGENDIAN 1 -#endif -#endif - #endif #include "db_int.h" -#include "common_ext.h" + +/* + * __db_isbigendian -- + * Return 1 if big-endian (Motorola and Sparc), not little-endian + * (Intel and Vax). We do this work at run-time, rather than at + * configuration time so cross-compilation and general embedded + * system support is simpler. + * + * PUBLIC: int __db_isbigendian __P((void)); + */ +int +__db_isbigendian() +{ + union { /* From Harbison & Steele. */ + long l; + char c[sizeof(long)]; + } u; + + u.l = 1; + return (u.c[sizeof(long) - 1] == 1); +} /* * __db_byteorder -- @@ -38,21 +50,21 @@ __db_byteorder(dbenv, lorder) DB_ENV *dbenv; int lorder; { + int is_bigendian; + + is_bigendian = __db_isbigendian(); + switch (lorder) { case 0: break; case 1234: -#if defined(WORDS_BIGENDIAN) - return (DB_SWAPBYTES); -#else + if (is_bigendian) + return (DB_SWAPBYTES); break; -#endif case 4321: -#if defined(WORDS_BIGENDIAN) + if (!is_bigendian) + return (DB_SWAPBYTES); break; -#else - return (DB_SWAPBYTES); -#endif default: __db_err(dbenv, "unsupported byte order, only big and little-endian supported"); diff --git a/bdb/common/db_err.c b/bdb/common/db_err.c index d69bd023dfd..7c9ee3c4fde 100644 --- a/bdb/common/db_err.c +++ b/bdb/common/db_err.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_err.c,v 11.38 2001/01/22 21:50:25 sue Exp $"; +static const char revid[] = "$Id: db_err.c,v 11.80 2002/07/30 01:21:53 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -20,21 +20,12 @@ static const char revid[] = "$Id: db_err.c,v 11.38 2001/01/22 21:50:25 sue Exp $ #endif #include "db_int.h" -#include "db_shash.h" -#include "lock.h" -#include "lock_ext.h" -#include "log.h" -#include "log_ext.h" -#include "mp.h" -#include "mp_ext.h" -#include "txn.h" -#include "txn_ext.h" -#include "clib_ext.h" -#include "common_ext.h" -#include "db_auto.h" - -static void __db_errcall __P((const DB_ENV *, int, int, const char *, va_list)); -static void __db_errfile __P((const DB_ENV *, int, int, const char *, va_list)); +#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/txn.h" /* * __db_fchk -- @@ -89,12 +80,13 @@ __db_ferr(dbenv, name, iscombo) * __db_pgerr -- * Error when unable to retrieve a specified page. * - * PUBLIC: int __db_pgerr __P((DB *, db_pgno_t)); + * PUBLIC: void __db_pgerr __P((DB *, db_pgno_t, int)); */ -int -__db_pgerr(dbp, pgno) +void +__db_pgerr(dbp, pgno, errval) DB *dbp; db_pgno_t pgno; + int errval; { /* * Three things are certain: @@ -103,23 +95,22 @@ __db_pgerr(dbp, pgno) */ __db_err(dbp->dbenv, "unable to create/retrieve page %lu", (u_long)pgno); - return (__db_panic(dbp->dbenv, EIO)); + (void)__db_panic(dbp->dbenv, errval); } /* * __db_pgfmt -- * Error when a page has the wrong format. * - * PUBLIC: int __db_pgfmt __P((DB *, db_pgno_t)); + * PUBLIC: int __db_pgfmt __P((DB_ENV *, db_pgno_t)); */ int -__db_pgfmt(dbp, pgno) - DB *dbp; +__db_pgfmt(dbenv, pgno) + DB_ENV *dbenv; db_pgno_t pgno; { - __db_err(dbp->dbenv, - "page %lu: illegal page type or format", (u_long)pgno); - return (__db_panic(dbp->dbenv, EINVAL)); + __db_err(dbenv, "page %lu: illegal page type or format", (u_long)pgno); + return (__db_panic(dbenv, EINVAL)); } /* @@ -157,7 +148,7 @@ __db_assert(failedexpr, file, line) (void)fprintf(stderr, "__db_assert: \"%s\" failed: file \"%s\", line %d\n", failedexpr, file, line); - fflush(stderr); + (void)fflush(stderr); /* We want a stack trace of how this could possibly happen. */ abort(); @@ -176,7 +167,7 @@ int __db_panic_msg(dbenv) DB_ENV *dbenv; { - __db_err(dbenv, "region error detected; run recovery."); + __db_err(dbenv, "fatal region error detected; run recovery"); return (DB_RUNRECOVERY); } @@ -191,11 +182,10 @@ __db_panic(dbenv, errval) DB_ENV *dbenv; int errval; { - if (dbenv != NULL) { - ((REGENV *)((REGINFO *)dbenv->reginfo)->primary)->panic = 1; + PANIC_SET(dbenv, 1); - dbenv->db_panic = errval; + dbenv->panic_errval = errval; __db_err(dbenv, "PANIC: %s", db_strerror(errval)); @@ -203,6 +193,17 @@ __db_panic(dbenv, errval) dbenv->db_paniccall(dbenv, errval); } +#if defined(DIAGNOSTIC) && !defined(CONFIG_TEST) + /* + * We want a stack trace of how this could possibly happen. + * + * Don't drop core if it's the test suite -- it's reasonable for the + * test suite to check to make sure that DB_RUNRECOVERY is returned + * under certain conditions. + */ + abort(); +#endif + /* * Chaos reigns within. * Reflect, repent, and reboot. @@ -214,6 +215,8 @@ __db_panic(dbenv, errval) /* * db_strerror -- * ANSI C strerror(3) for DB. + * + * EXTERN: char *db_strerror __P((int)); */ char * db_strerror(error) @@ -232,8 +235,8 @@ db_strerror(error) * altered. */ switch (error) { - case DB_INCOMPLETE: - return ("DB_INCOMPLETE: Cache flush was unable to complete"); + case DB_DONOTINDEX: + return ("DB_DONOTINDEX: Secondary index callback returns null"); case DB_KEYEMPTY: return ("DB_KEYEMPTY: Non-existent key/data pair"); case DB_KEYEXIST: @@ -253,8 +256,26 @@ db_strerror(error) return ("DB_NOTFOUND: No matching key/data pair found"); case DB_OLD_VERSION: return ("DB_OLDVERSION: Database requires a version upgrade"); + case DB_PAGE_NOTFOUND: + return ("DB_PAGE_NOTFOUND: Requested page not found"); + case DB_REP_DUPMASTER: + return ("DB_REP_DUPMASTER: A second master site appeared"); + case DB_REP_HOLDELECTION: + return ("DB_REP_HOLDELECTION: Need to hold an election"); + 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_OUTDATED: + return + ("DB_REP_OUTDATED: Insufficient logs on master to recover"); + case DB_REP_UNAVAIL: + return ("DB_REP_UNAVAIL: Unable to elect a master"); case DB_RUNRECOVERY: return ("DB_RUNRECOVERY: Fatal error, run database recovery"); + case DB_SECONDARY_BAD: + return + ("DB_SECONDARY_BAD: Secondary index item missing from primary"); case DB_VERIFY_BAD: return ("DB_VERIFY_BAD: Database verification failed"); default: { @@ -274,8 +295,8 @@ db_strerror(error) /* * __db_err -- - * Standard DB error routine. The same as db_errx, except that we - * don't write to stderr if no output mechanism was specified. + * Standard DB error routine. The same as errx, except we don't write + * to stderr if no output mechanism was specified. * * PUBLIC: void __db_err __P((const DB_ENV *, const char *, ...)); */ @@ -289,81 +310,17 @@ __db_err(dbenv, fmt, va_alist) va_dcl #endif { - va_list ap; - -/* - XXX - Log the message. - - It would be nice to automatically log the error into the log files - if the application is configured for logging. The problem is that - if we currently hold the log region mutex, we will self-deadlock. - Leave all the structure in place, but turned off. I'd like to fix - this in the future by detecting if we have the log region already - locked (e.g., a flag in the environment handle), or perhaps even - have a finer granularity so that the only calls to __db_err we - can't log are those made while we have the current log buffer - locked, or perhaps have a separate buffer into which we log error - messages. - -#ifdef __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - __db_real_log(dbenv, NULL, "db_err", 0, fmt, ap); - - va_end(ap); -#endif -*/ - - /* Tell the application. */ -#ifdef __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - __db_real_err(dbenv, 0, 0, 0, fmt, ap); - - va_end(ap); -} - -/* - * __db_real_err -- - * All the DB error routines end up here. - * - * PUBLIC: void __db_real_err - * PUBLIC: __P((const DB_ENV *, int, int, int, const char *, va_list)); - */ -void -__db_real_err(dbenv, error, error_set, stderr_default, fmt, ap) - const DB_ENV *dbenv; - int error, error_set, stderr_default; - const char *fmt; - va_list ap; -{ - /* Call the user's callback function, if specified. */ - if (dbenv != NULL && dbenv->db_errcall != NULL) - __db_errcall(dbenv, error, error_set, fmt, ap); - - /* Write to the user's file descriptor, if specified. */ - if (dbenv != NULL && dbenv->db_errfile != NULL) - __db_errfile(dbenv, error, error_set, fmt, ap); - - /* - * If we have a default and we didn't do either of the above, write - * to the default. - */ - if (stderr_default && (dbenv == NULL || - (dbenv->db_errcall == NULL && dbenv->db_errfile == NULL))) - __db_errfile(dbenv, error, error_set, fmt, ap); + DB_REAL_ERR(dbenv, 0, 0, 0, fmt); } /* * __db_errcall -- * Do the error message work for callback functions. + * + * PUBLIC: void __db_errcall + * PUBLIC: __P((const DB_ENV *, int, int, const char *, va_list)); */ -static void +void __db_errcall(dbenv, error, error_set, fmt, ap) const DB_ENV *dbenv; int error, error_set; @@ -371,27 +328,44 @@ __db_errcall(dbenv, error, error_set, fmt, ap) va_list ap; { char *p; - char __errbuf[2048]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ + char errbuf[2048]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ - p = __errbuf; - if (fmt != NULL) { - p += vsnprintf(__errbuf, sizeof(__errbuf), fmt, ap); - if (error_set) { - *p++ = ':'; - *p++ = ' '; - } - } + p = errbuf; + if (fmt != NULL) + p += vsnprintf(errbuf, sizeof(errbuf), fmt, ap); if (error_set) - (void)strcpy(p, db_strerror(error)); + p += snprintf(p, + sizeof(errbuf) - (p - errbuf), ": %s", db_strerror(error)); + /* + * !!! + * We're potentially manipulating strings handed us by the application, + * and on systems without a real snprintf() the sprintf() calls could + * have overflowed the buffer. We can't do anything about it now, but + * we don't want to return control to the application, we might have + * overwritten the stack with a Trojan horse. We're not trying to do + * anything recoverable here because systems without snprintf support + * are pretty rare anymore. + */ + if ((size_t)(p - errbuf) > sizeof(errbuf)) { + (void)fprintf(stderr, + "Berkeley DB: error callback interface buffer overflow\n"); + (void)fflush(stderr); - dbenv->db_errcall(dbenv->db_errpfx, __errbuf); + abort(); + /* NOTREACHED */ + } + + dbenv->db_errcall(dbenv->db_errpfx, errbuf); } /* * __db_errfile -- * Do the error message work for FILE *s. + * + * PUBLIC: void __db_errfile + * PUBLIC: __P((const DB_ENV *, int, int, const char *, va_list)); */ -static void +void __db_errfile(dbenv, error, error_set, fmt, ap) const DB_ENV *dbenv; int error, error_set; @@ -436,48 +410,22 @@ __db_logmsg(dbenv, txnid, opname, flags, fmt, va_alist) va_dcl #endif { + 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; #ifdef __STDC__ va_start(ap, fmt); #else va_start(ap); #endif - __db_real_log(dbenv, txnid, opname, flags, fmt, ap); - - va_end(ap); -} - -/* - * __db_real_log -- - * Write information into the DB log. - * - * PUBLIC: void __db_real_log __P((const DB_ENV *, - * PUBLIC: DB_TXN *, const char *, u_int32_t, const char *, va_list ap)); - */ -void -#ifdef __STDC__ -__db_real_log(const DB_ENV *dbenv, DB_TXN *txnid, - const char *opname, u_int32_t flags, const char *fmt, va_list ap) -#else -__db_real_log(dbenv, txnid, opname, flags, fmt, ap) - const DB_ENV *dbenv; - DB_TXN *txnid; - const char *opname, *fmt; - u_int32_t flags; - va_list ap; -#endif -{ - DBT opdbt, msgdbt; - DB_LSN lsn; - char __logbuf[2048]; /* !!!: END OF THE STACK DON'T TRUST SPRINTF. */ - - if (!LOGGING_ON(dbenv)) - return; - memset(&opdbt, 0, sizeof(opdbt)); opdbt.data = (void *)opname; - opdbt.size = strlen(opname) + 1; + opdbt.size = (u_int32_t)(strlen(opname) + 1); memset(&msgdbt, 0, sizeof(msgdbt)); msgdbt.data = __logbuf; @@ -490,6 +438,8 @@ __db_real_log(dbenv, txnid, opname, flags, fmt, ap) */ __db_debug_log( (DB_ENV *)dbenv, txnid, &lsn, flags, &opdbt, -1, &msgdbt, NULL, 0); + + va_end(ap); } /* @@ -511,34 +461,119 @@ __db_unknown_flag(dbenv, routine, flag) /* * __db_unknown_type -- report internal error * - * PUBLIC: int __db_unknown_type __P((DB_ENV *, char *, u_int32_t)); + * PUBLIC: int __db_unknown_type __P((DB_ENV *, char *, DBTYPE)); */ int __db_unknown_type(dbenv, routine, type) DB_ENV *dbenv; char *routine; - u_int32_t type; + DBTYPE type; { __db_err(dbenv, "%s: Unknown db type: 0x%x", routine, type); DB_ASSERT(0); return (EINVAL); } -#ifdef DIAGNOSTIC /* - * __db_missing_txn_err -- - * Cannot combine operations with and without transactions. + * __db_check_txn -- + * Check for common transaction errors. * - * PUBLIC: #ifdef DIAGNOSTIC - * PUBLIC: int __db_missing_txn_err __P((DB_ENV *)); - * PUBLIC: #endif + * PUBLIC: int __db_check_txn __P((DB *, DB_TXN *, u_int32_t, int)); */ int -__db_missing_txn_err(dbenv) - DB_ENV *dbenv; +__db_check_txn(dbp, txn, assoc_lid, read_op) + DB *dbp; + DB_TXN *txn; + u_int32_t assoc_lid; + int read_op; { + DB_ENV *dbenv; + + dbenv = dbp->dbenv; + + /* + * If we are in recovery or aborting a transaction, then we + * don't need to enforce the rules about dbp's not allowing + * transactional operations in non-transactional dbps and + * vica-versa. This happens all the time as the dbp during + * an abort may be transactional, but we undo operations + * outside a transaction since we're aborting. + */ + if (IS_RECOVERING(dbenv) || F_ISSET(dbp, DB_AM_RECOVER)) + return (0); + + /* + * 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. + */ + if (txn == NULL) { + if (!read_op && F_ISSET(dbp, DB_AM_TXN)) { + __db_err(dbenv, + "DB handle previously used in transaction, missing transaction handle"); + return (EINVAL); + } + + if (dbp->cur_lid >= TXN_MINIMUM) + goto open_err; + } else { + if (dbp->cur_lid >= TXN_MINIMUM && dbp->cur_lid != txn->txnid) + 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); + } + } + + /* + * If dbp->associate_lid is not DB_LOCK_INVALIDID, that means we're in + * the middle of a DB->associate with DB_CREATE (i.e., a secondary index + * creation). + * + * In addition to the usual transaction rules, we need to lock out + * non-transactional updates that aren't part of the associate (and + * thus are using some other locker ID). + * + * Transactional updates should simply block; from the time we + * decide to build the secondary until commit, we'll hold a write + * lock on all of its pages, so it should be safe to attempt to update + * the secondary in another transaction (presumably by updating the + * primary). + */ + if (!read_op && dbp->associate_lid != DB_LOCK_INVALIDID && + txn != NULL && dbp->associate_lid != assoc_lid) { + __db_err(dbenv, + "Operation forbidden while secondary index is being created"); + return (EINVAL); + } + + return (0); +open_err: __db_err(dbenv, - "DB handle previously used in transaction, missing transaction handle."); + "Transaction that opened the DB handle is still active"); + return (EINVAL); +} + +/* + * __db_not_txn_env -- + * DB handle must be in an environment that supports transactions. + * + * PUBLIC: int __db_not_txn_env __P((DB_ENV *)); + */ +int +__db_not_txn_env(dbenv) + DB_ENV *dbenv; +{ + __db_err(dbenv, "DB environment not configured for transactions"); return (EINVAL); } -#endif diff --git a/bdb/common/db_getlong.c b/bdb/common/db_getlong.c index bead530cd94..6ba8ebfcdaa 100644 --- a/bdb/common/db_getlong.c +++ b/bdb/common/db_getlong.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_getlong.c,v 11.11 2000/12/22 19:16:04 bostic Exp $"; +static const char revid[] = "$Id: db_getlong.c,v 11.18 2002/03/28 20:13:33 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -20,7 +20,6 @@ static const char revid[] = "$Id: db_getlong.c,v 11.11 2000/12/22 19:16:04 bosti #endif #include "db_int.h" -#include "clib_ext.h" /* * __db_getlong -- @@ -43,42 +42,40 @@ __db_getlong(dbp, progname, p, min, max, storep) val = strtol(p, &end, 10); if ((val == LONG_MIN || val == LONG_MAX) && __os_get_errno() == ERANGE) { - if (dbp == NULL) { + if (dbp == NULL) fprintf(stderr, "%s: %s: %s\n", progname, p, strerror(ERANGE)); - exit(1); - } - dbp->err(dbp, ERANGE, "%s", p); + else + dbp->err(dbp, ERANGE, "%s", p); return (1); } if (p[0] == '\0' || (end[0] != '\0' && end[0] != '\n')) { - if (dbp == NULL) { + if (dbp == NULL) fprintf(stderr, "%s: %s: Invalid numeric argument\n", progname, p); - exit(1); - } - dbp->errx(dbp, "%s: Invalid numeric argument", p); + else + dbp->errx(dbp, "%s: Invalid numeric argument", p); return (1); } if (val < min) { - if (dbp == NULL) { + if (dbp == NULL) fprintf(stderr, "%s: %s: Less than minimum value (%ld)\n", progname, p, min); - exit(1); - } - dbp->errx(dbp, "%s: Less than minimum value (%ld)", p, min); + else + dbp->errx(dbp, + "%s: Less than minimum value (%ld)", p, min); return (1); } if (val > max) { - if (dbp == NULL) { + if (dbp == NULL) fprintf(stderr, "%s: %s: Greater than maximum value (%ld)\n", progname, p, max); - exit(1); - } - dbp->errx(dbp, "%s: Greater than maximum value (%ld)", p, max); - exit(1); + else + dbp->errx(dbp, + "%s: Greater than maximum value (%ld)", p, max); + return (1); } *storep = val; return (0); @@ -109,31 +106,29 @@ __db_getulong(dbp, progname, p, min, max, storep) __os_set_errno(0); val = strtoul(p, &end, 10); if (val == ULONG_MAX && __os_get_errno() == ERANGE) { - if (dbp == NULL) { + if (dbp == NULL) fprintf(stderr, "%s: %s: %s\n", progname, p, strerror(ERANGE)); - exit(1); - } - dbp->err(dbp, ERANGE, "%s", p); + else + dbp->err(dbp, ERANGE, "%s", p); return (1); } if (p[0] == '\0' || (end[0] != '\0' && end[0] != '\n')) { - if (dbp == NULL) { + if (dbp == NULL) fprintf(stderr, "%s: %s: Invalid numeric argument\n", progname, p); - exit(1); - } - dbp->errx(dbp, "%s: Invalid numeric argument", p); + else + dbp->errx(dbp, "%s: Invalid numeric argument", p); return (1); } if (val < min) { - if (dbp == NULL) { + if (dbp == NULL) fprintf(stderr, - "%s: %s: Less than minimum value (%ld)\n", + "%s: %s: Less than minimum value (%lu)\n", progname, p, min); - exit(1); - } - dbp->errx(dbp, "%s: Less than minimum value (%ld)", p, min); + else + dbp->errx(dbp, + "%s: Less than minimum value (%lu)", p, min); return (1); } @@ -144,14 +139,14 @@ __db_getulong(dbp, progname, p, min, max, storep) * may not exist on all platforms. */ if (max != 0 && val > max) { - if (dbp == NULL) { + if (dbp == NULL) fprintf(stderr, - "%s: %s: Greater than maximum value (%ld)\n", + "%s: %s: Greater than maximum value (%lu)\n", progname, p, max); - exit(1); - } - dbp->errx(dbp, "%s: Greater than maximum value (%ld)", p, max); - exit(1); + else + dbp->errx(dbp, + "%s: Greater than maximum value (%lu)", p, max); + return (1); } *storep = val; return (0); diff --git a/bdb/common/db_idspace.c b/bdb/common/db_idspace.c new file mode 100644 index 00000000000..588ffd9fca9 --- /dev/null +++ b/bdb/common/db_idspace.c @@ -0,0 +1,93 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2001-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: db_idspace.c,v 1.5 2002/02/01 18:15:29 bostic Exp $"; +#endif /* not lint */ + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include +#endif + +#include "db_int.h" + +static int __db_idcmp __P((const void *, const void *)); + +static int +__db_idcmp(a, b) + const void *a; + const void *b; +{ + u_int32_t i, j; + + i = *(u_int32_t *)a; + j = *(u_int32_t *)b; + + if (i < j) + return (-1); + else if (i > j) + return (1); + else + return (0); +} + +/* + * __db_idspace -- + * + * On input, minp and maxp contain the minimum and maximum valid values for + * the name space and on return, they contain the minimum and maximum ids + * available (by finding the biggest gap). + * + * PUBLIC: void __db_idspace __P((u_int32_t *, int, u_int32_t *, u_int32_t *)); + */ +void +__db_idspace(inuse, n, minp, maxp) + u_int32_t *inuse; + int n; + u_int32_t *minp, *maxp; +{ + int i, low; + u_int32_t gap, t; + + /* A single locker ID is a special case. */ + if (n == 1) { + /* + * If the single item in use is the last one in the range, + * then we've got to perform wrap which means that we set + * the min to the minimum ID, which is what we came in with, + * so we don't do anything. + */ + if (inuse[0] != *maxp) + *minp = inuse[0]; + *maxp = inuse[0] - 1; + return; + } + + gap = 0; + low = 0; + qsort(inuse, n, sizeof(u_int32_t), __db_idcmp); + for (i = 0; i < n - 1; i++) + if ((t = (inuse[i + 1] - inuse[i])) > gap) { + gap = t; + low = i; + } + + /* Check for largest gap at the end of the space. */ + if ((*maxp - inuse[n - 1]) + (inuse[0] - *minp) > gap) { + /* Do same check as we do in the n == 1 case. */ + if (inuse[n - 1] != *maxp) + *minp = inuse[n - 1]; + *maxp = inuse[0]; + } else { + *minp = inuse[low]; + *maxp = inuse[low + 1]; + } +} diff --git a/bdb/common/db_log2.c b/bdb/common/db_log2.c index 95bc69499c6..cdd87dda11d 100644 --- a/bdb/common/db_log2.c +++ b/bdb/common/db_log2.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -39,7 +39,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_log2.c,v 11.4 2000/02/14 02:59:41 bostic Exp $"; +static const char revid[] = "$Id: db_log2.c,v 11.7 2002/02/01 18:15:30 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -47,7 +47,6 @@ static const char revid[] = "$Id: db_log2.c,v 11.4 2000/02/14 02:59:41 bostic Ex #endif #include "db_int.h" -#include "common_ext.h" /* * PUBLIC: u_int32_t __db_log2 __P((u_int32_t)); diff --git a/bdb/common/util_arg.c b/bdb/common/util_arg.c new file mode 100644 index 00000000000..e034e3bd194 --- /dev/null +++ b/bdb/common/util_arg.c @@ -0,0 +1,126 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2001-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: util_arg.c,v 1.4 2002/02/01 18:15:30 bostic Exp $"; +#endif /* not lint */ + +#ifndef NO_SYSTEM_INCLUDES +#include +#endif + +#include "db_int.h" + +static char *__db_strsep __P((char **, const char *)); + +/* + * __db_util_arg -- + * Convert a string into an argc/argv pair. + * + * PUBLIC: int __db_util_arg __P((char *, char *, int *, char ***)); + */ +int +__db_util_arg(arg0, str, argcp, argvp) + char *arg0, *str, ***argvp; + int *argcp; +{ + int n, ret; + char **ap, **argv; + +#define MAXARGS 25 + if ((ret = + __os_malloc(NULL, (MAXARGS + 1) * sizeof(char **), &argv)) != 0) + return (ret); + + ap = argv; + *ap++ = arg0; + for (n = 1; (*ap = __db_strsep(&str, " \t")) != NULL;) + if (**ap != '\0') { + ++ap; + if (++n == MAXARGS) + break; + } + *ap = NULL; + + *argcp = ap - argv; + *argvp = argv; + + return (0); +} + +/*- + * 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. + */ +/* + * 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. + */ +static char * +__db_strsep(stringp, delim) + char **stringp; + const char *delim; +{ + const char *spanp; + int c, sc; + char *s, *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/bdb/common/util_cache.c b/bdb/common/util_cache.c new file mode 100644 index 00000000000..5ca88665cc7 --- /dev/null +++ b/bdb/common/util_cache.c @@ -0,0 +1,92 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2000-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: util_cache.c,v 1.3 2002/04/04 18:50:10 bostic Exp $"; +#endif /* not lint */ + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include + +#include +#include +#endif + +#include "db_int.h" + +/* + * __db_util_cache -- + * Compute if we have enough cache. + * + * PUBLIC: int __db_util_cache __P((DB_ENV *, DB *, u_int32_t *, int *)); + */ +int +__db_util_cache(dbenv, dbp, cachep, resizep) + DB_ENV *dbenv; + DB *dbp; + u_int32_t *cachep; + int *resizep; +{ + DBTYPE type; + DB_BTREE_STAT *bsp; + DB_HASH_STAT *hsp; + DB_QUEUE_STAT *qsp; + u_int32_t pgsize; + int ret; + void *sp; + + /* + * The current cache size is in cachep. If it's insufficient, set the + * the memory referenced by resizep to 1 and set cachep to the minimum + * size needed. + */ + if ((ret = dbp->get_type(dbp, &type)) != 0) { + dbenv->err(dbenv, ret, "DB->get_type"); + return (ret); + } + + if ((ret = dbp->stat(dbp, &sp, DB_FAST_STAT)) != 0) { + dbenv->err(dbenv, ret, "DB->stat"); + return (ret); + } + + switch (type) { + case DB_QUEUE: + qsp = (DB_QUEUE_STAT *)sp; + pgsize = qsp->qs_pagesize; + break; + case DB_HASH: + hsp = (DB_HASH_STAT *)sp; + pgsize = hsp->hash_pagesize; + break; + case DB_BTREE: + case DB_RECNO: + bsp = (DB_BTREE_STAT *)sp; + pgsize = bsp->bt_pagesize; + break; + default: + dbenv->err(dbenv, ret, "unknown database type: %d", type); + return (EINVAL); + } + free(sp); + + /* + * Make sure our current cache is big enough. We want at least + * DB_MINPAGECACHE pages in the cache. + */ + if ((*cachep / pgsize) < DB_MINPAGECACHE) { + *resizep = 1; + *cachep = pgsize * DB_MINPAGECACHE; + } else + *resizep = 0; + + return (0); +} diff --git a/bdb/common/util_log.c b/bdb/common/util_log.c index a4743cc2cee..ae215fca64a 100644 --- a/bdb/common/util_log.c +++ b/bdb/common/util_log.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2000 + * Copyright (c) 2000-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: util_log.c,v 1.7 2000/11/30 00:58:31 ubell Exp $"; +static const char revid[] = "$Id: util_log.c,v 1.11 2002/02/01 18:15:30 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -31,7 +31,6 @@ static const char revid[] = "$Id: util_log.c,v 1.7 2000/11/30 00:58:31 ubell Exp #endif #include "db_int.h" -#include "common_ext.h" /* * __db_util_logset -- @@ -46,12 +45,14 @@ __db_util_logset(progname, fname) { FILE *fp; time_t now; + u_int32_t id; if ((fp = fopen(fname, "w")) == NULL) goto err; (void)time(&now); - fprintf(fp, "%s: %lu %s", progname, (u_long)getpid(), ctime(&now)); + __os_id(&id); + fprintf(fp, "%s: %lu %s", progname, (u_long)id, ctime(&now)); if (fclose(fp) == EOF) goto err; diff --git a/bdb/common/util_sig.c b/bdb/common/util_sig.c index 6fe0166fe64..9714427ad33 100644 --- a/bdb/common/util_sig.c +++ b/bdb/common/util_sig.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2000 + * Copyright (c) 2000-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: util_sig.c,v 1.3 2000/04/28 19:32:00 bostic Exp $"; +static const char revid[] = "$Id: util_sig.c,v 1.7 2002/02/02 17:04:42 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,7 +18,6 @@ static const char revid[] = "$Id: util_sig.c,v 1.3 2000/04/28 19:32:00 bostic Ex #endif #include "db_int.h" -#include "common_ext.h" static int interrupt; static void onint __P((int)); @@ -79,7 +78,7 @@ void __db_util_sigresend() { /* Resend any caught signal. */ - if (__db_util_interrupted != 0) { + if (interrupt != 0) { (void)signal(interrupt, SIG_DFL); (void)raise(interrupt); /* NOTREACHED */ diff --git a/bdb/cxx/cxx_app.cpp b/bdb/cxx/cxx_app.cpp deleted file mode 100644 index 1fcf04b5c43..00000000000 --- a/bdb/cxx/cxx_app.cpp +++ /dev/null @@ -1,671 +0,0 @@ -/*- - * See the file LICENSE for redistribution information. - * - * Copyright (c) 1997, 1998, 1999, 2000 - * Sleepycat Software. All rights reserved. - */ - -#include "db_config.h" - -#ifndef lint -static const char revid[] = "$Id: cxx_app.cpp,v 11.38 2000/12/21 20:30:18 dda Exp $"; -#endif /* not lint */ - -#include -#include // needed for set_error_stream -#include - -#include "db_cxx.h" -#include "cxx_int.h" - -#include "db_int.h" -#include "common_ext.h" - -// The reason for a static variable is that some structures -// (like Dbts) have no connection to any Db or DbEnv, so when -// errors occur in their methods, we must have some reasonable -// way to determine whether to throw or return errors. -// -// This variable is taken from flags whenever a DbEnv is constructed. -// Normally there is only one DbEnv per program, and even if not, -// there is typically a single policy of throwing or returning. -// -static int last_known_error_policy = ON_ERROR_UNKNOWN; - -//////////////////////////////////////////////////////////////////////// -// // -// DbEnv // -// // -//////////////////////////////////////////////////////////////////////// - -ostream *DbEnv::error_stream_ = 0; - -// _destroy_check is called when there is a user error in a -// destructor, specifically when close has not been called for an -// object (even if it was never opened). If the DbEnv is being -// destroyed we cannot always use DbEnv::error_stream_, so we'll -// use cerr in that case. -// -void DbEnv::_destroy_check(const char *str, int isDbEnv) -{ - ostream *out; - - out = error_stream_; - if (out == NULL || isDbEnv == 1) - out = &cerr; - - (*out) << "DbEnv::_destroy_check: open " << str << " object destroyed\n"; -} - -// 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 -// no operations are permitted on the DbEnv (other than -// destructor). Leaving the DbEnv handle open and not -// doing a close is generally considered an error. -// -// We used to allow DbEnv objects to be closed and reopened. -// This implied always keeping a valid DB_ENV object, and -// coordinating the open objects between Db/DbEnv turned -// out to be overly complicated. Now we do not allow this. - -DbEnv::DbEnv(u_int32_t flags) -: imp_(0) -, construct_error_(0) -, construct_flags_(flags) -, tx_recover_callback_(0) -, paniccall_callback_(0) -{ - int err; - - COMPQUIET(err, 0); - if ((err = initialize(0)) != 0) - DB_ERROR("DbEnv::DbEnv", err, error_policy()); -} - -DbEnv::DbEnv(DB_ENV *env, u_int32_t flags) -: imp_(0) -, construct_error_(0) -, construct_flags_(flags) -, tx_recover_callback_(0) -, paniccall_callback_(0) -{ - int err; - - COMPQUIET(err, 0); - if ((err = initialize(env)) != 0) - DB_ERROR("DbEnv::DbEnv", err, error_policy()); -} - -// Note: if the user has not closed, we call _destroy_check -// to warn against this non-safe programming practice, -// and call close anyway. -// -DbEnv::~DbEnv() -{ - DB_ENV *env = unwrap(this); - - if (env != NULL) { - _destroy_check("DbEnv", 1); - (void)env->close(env, 0); - - // extra safety - cleanup(); - } -} - -// called by Db destructor when the DbEnv is owned by DB. -void DbEnv::cleanup() -{ - DB_ENV *env = unwrap(this); - - if (env != NULL) { - env->cj_internal = 0; - imp_ = 0; - } -} - -int DbEnv::close(u_int32_t flags) -{ - DB_ENV *env = unwrap(this); - int err, init_err; - - COMPQUIET(init_err, 0); - - // after a close (no matter if success or failure), - // the underlying DB_ENV object must not be accessed, - // so we clean up in advance. - // - cleanup(); - - // It's safe to throw an error after the close, - // since our error mechanism does not peer into - // the DB* structures. - // - if ((err = env->close(env, flags)) != 0) { - DB_ERROR("DbEnv::close", err, error_policy()); - } - return (err); -} - -void DbEnv::err(int error, const char *format, ...) -{ - va_list args; - DB_ENV *env = unwrap(this); - - va_start(args, format); - __db_real_err(env, error, 1, 1, format, args); - va_end(args); -} - -void DbEnv::errx(const char *format, ...) -{ - va_list args; - DB_ENV *env = unwrap(this); - - va_start(args, format); - __db_real_err(env, 0, 0, 1, format, args); - va_end(args); -} - -// used internally during constructor -// to associate an existing DB_ENV with this DbEnv, -// or create a new one. If there is an error, -// construct_error_ is set; this is examined during open. -// -int DbEnv::initialize(DB_ENV *env) -{ - int err; - - last_known_error_policy = error_policy(); - - if (env == 0) { - // Create a new DB_ENV environment. - if ((err = ::db_env_create(&env, - construct_flags_ & ~DB_CXX_NO_EXCEPTIONS)) != 0) { - construct_error_ = err; - return (err); - } - } - imp_ = wrap(env); - env->cj_internal = this; // for DB_ENV* to DbEnv* conversion - return (0); -} - -// Return a tristate value corresponding to whether we should -// throw exceptions on errors: -// ON_ERROR_RETURN -// ON_ERROR_THROW -// ON_ERROR_UNKNOWN -// -int DbEnv::error_policy() -{ - if ((construct_flags_ & DB_CXX_NO_EXCEPTIONS) != 0) { - return (ON_ERROR_RETURN); - } - else { - return (ON_ERROR_THROW); - } -} - -// If an error occurred during the constructor, report it now. -// Otherwise, call the underlying DB->open method. -// -int DbEnv::open(const char *db_home, u_int32_t flags, int mode) -{ - DB_ENV *env = unwrap(this); - int err; - - if ((err = construct_error_) != 0) - DB_ERROR("Db::open", err, error_policy()); - else if ((err = env->open(env, db_home, flags, mode)) != 0) - DB_ERROR("DbEnv::open", err, error_policy()); - - return (err); -} - -int DbEnv::remove(const char *db_home, u_int32_t flags) -{ - DB_ENV *env; - int ret; - - env = unwrap(this); - - // 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) - DB_ERROR("DbEnv::remove", ret, error_policy()); - - return (ret); -} - -// Report an error associated with the DbEnv. -// error_policy is one of: -// ON_ERROR_THROW throw an error -// ON_ERROR_RETURN do nothing here, the caller will return an error -// ON_ERROR_UNKNOWN defer the policy to policy saved in DbEnv::DbEnv -// -void DbEnv::runtime_error(const char *caller, int error, int error_policy) -{ - if (error_policy == ON_ERROR_UNKNOWN) - error_policy = last_known_error_policy; - if (error_policy == ON_ERROR_THROW) { - // Creating and throwing the object in two separate - // statements seems to be necessary for HP compilers. - DbException except(caller, error); - throw except; - } -} - -// static method -char *DbEnv::strerror(int error) -{ - return (db_strerror(error)); -} - -// This is a 'glue' function declared as extern "C" so it will -// be compatible with picky compilers that do not allow mixing -// of function pointers to 'C' functions with function pointers -// to C++ functions. -// -extern "C" -void _stream_error_function_c(const char *prefix, char *message) -{ - DbEnv::_stream_error_function(prefix, message); -} - -void DbEnv::_stream_error_function(const char *prefix, char *message) -{ - // HP compilers need the extra casts, we don't know why. - if (error_stream_) { - if (prefix) { - (*error_stream_) << prefix << (const char *)": "; - } - if (message) { - (*error_stream_) << (const char *)message; - } - (*error_stream_) << (const char *)"\n"; - } -} - -// Note: This actually behaves a bit like a static function, -// since DB_ENV.db_errcall has no information about which -// db_env triggered the call. A user that has multiple DB_ENVs -// will simply not be able to have different streams for each one. -// -void DbEnv::set_error_stream(ostream *stream) -{ - DB_ENV *dbenv = unwrap(this); - - error_stream_ = stream; - dbenv->set_errcall(dbenv, (stream == 0) ? 0 : - _stream_error_function_c); -} - -// static method -char *DbEnv::version(int *major, int *minor, int *patch) -{ - return (db_version(major, minor, patch)); -} - -// This is a variant of the DB_WO_ACCESS macro to define a simple set_ -// method calling the underlying C method, but unlike a simple -// set method, it may return an error or raise an exception. -// Note this macro expects that input _argspec is an argument -// list element (e.g. "char *arg") defined in terms of "arg". -// -#define DB_DBENV_ACCESS(_name, _argspec) \ - \ -int DbEnv::set_##_name(_argspec) \ -{ \ - int ret; \ - DB_ENV *dbenv = unwrap(this); \ - \ - if ((ret = (*(dbenv->set_##_name))(dbenv, arg)) != 0) {\ - DB_ERROR("DbEnv::set_" # _name, ret, error_policy()); \ - } \ - return (ret); \ -} - -#define DB_DBENV_ACCESS_NORET(_name, _argspec) \ - \ -void DbEnv::set_##_name(_argspec) \ -{ \ - DB_ENV *dbenv = unwrap(this); \ - \ - (*(dbenv->set_##_name))(dbenv, arg); \ - return; \ -} - -DB_DBENV_ACCESS_NORET(errfile, FILE *arg) -DB_DBENV_ACCESS_NORET(errpfx, const char *arg) - -// We keep these alphabetical by field name, -// for comparison with Java's list. -// -DB_DBENV_ACCESS(data_dir, const char *arg) -DB_DBENV_ACCESS(lg_bsize, u_int32_t arg) -DB_DBENV_ACCESS(lg_dir, const char *arg) -DB_DBENV_ACCESS(lg_max, u_int32_t arg) -DB_DBENV_ACCESS(lk_detect, u_int32_t arg) -DB_DBENV_ACCESS(lk_max, u_int32_t arg) -DB_DBENV_ACCESS(lk_max_lockers, u_int32_t arg) -DB_DBENV_ACCESS(lk_max_locks, u_int32_t arg) -DB_DBENV_ACCESS(lk_max_objects, u_int32_t arg) -DB_DBENV_ACCESS(mp_mmapsize, size_t arg) -DB_DBENV_ACCESS(mutexlocks, int arg) -DB_DBENV_ACCESS(tmp_dir, const char *arg) -DB_DBENV_ACCESS(tx_max, u_int32_t arg) - -// Here are the set methods that don't fit the above mold. -// -extern "C" { - typedef void (*db_errcall_fcn_type) - (const char *, char *); -}; - -void DbEnv::set_errcall(void (*arg)(const char *, char *)) -{ - DB_ENV *dbenv = unwrap(this); - - // XXX - // We are casting from a function ptr declared with C++ - // linkage to one (same arg types) declared with C - // linkage. It's hard to imagine a pair of C/C++ - // compilers from the same vendor for which this - // won't work. Unfortunately, we can't use a - // intercept function like the others since the - // function does not have a (DbEnv*) as one of - // the args. If this causes trouble, we can pull - // the same trick we use in Java, namely stuffing - // a (DbEnv*) pointer into the prefix. We're - // avoiding this for the moment because it obfuscates. - // - (*(dbenv->set_errcall))(dbenv, (db_errcall_fcn_type)arg); -} - -int DbEnv::set_cachesize(u_int32_t gbytes, u_int32_t bytes, int ncache) -{ - int ret; - DB_ENV *dbenv = unwrap(this); - - if ((ret = - (*(dbenv->set_cachesize))(dbenv, gbytes, bytes, ncache)) != 0) - DB_ERROR("DbEnv::set_cachesize", ret, error_policy()); - - return (ret); -} - -int DbEnv::set_flags(u_int32_t flags, int onoff) -{ - int ret; - DB_ENV *dbenv = unwrap(this); - - if ((ret = (dbenv->set_flags)(dbenv, flags, onoff)) != 0) - DB_ERROR("DbEnv::set_flags", ret, error_policy()); - - return (ret); -} - -int DbEnv::set_lk_conflicts(u_int8_t *lk_conflicts, int lk_max) -{ - int ret; - DB_ENV *dbenv = unwrap(this); - - if ((ret = (*(dbenv->set_lk_conflicts)) - (dbenv, lk_conflicts, lk_max)) != 0) - DB_ERROR("DbEnv::set_lk_conflicts", ret, error_policy()); - - return (ret); -} - -// static method -int DbEnv::set_pageyield(int arg) -{ - int ret; - - if ((ret = db_env_set_pageyield(arg)) != 0) - DB_ERROR("DbEnv::set_pageyield", ret, last_known_error_policy); - - return (ret); -} - -// static method -int DbEnv::set_panicstate(int arg) -{ - int ret; - - if ((ret = db_env_set_panicstate(arg)) != 0) - DB_ERROR("DbEnv::set_panicstate", ret, last_known_error_policy); - - return (ret); -} - -// static method -int DbEnv::set_region_init(int arg) -{ - int ret; - - if ((ret = db_env_set_region_init(arg)) != 0) - DB_ERROR("DbEnv::set_region_init", ret, last_known_error_policy); - - return (ret); -} - -int DbEnv::set_server(char *host, long tsec, long ssec, u_int32_t flags) -{ - int ret; - DB_ENV *dbenv = unwrap(this); - - if ((ret = dbenv->set_server(dbenv, host, tsec, ssec, flags)) != 0) - DB_ERROR("DbEnv::set_server", ret, error_policy()); - - return (ret); -} - -int DbEnv::set_shm_key(long shm_key) -{ - int ret; - DB_ENV *dbenv = unwrap(this); - - if ((ret = dbenv->set_shm_key(dbenv, shm_key)) != 0) - DB_ERROR("DbEnv::set_shm_key", ret, error_policy()); - - return (ret); -} - -// static method -int DbEnv::set_tas_spins(u_int32_t arg) -{ - int ret; - - if ((ret = db_env_set_tas_spins(arg)) != 0) - DB_ERROR("DbEnv::set_tas_spins", ret, last_known_error_policy); - - return (ret); -} - -int DbEnv::set_verbose(u_int32_t which, int onoff) -{ - int ret; - DB_ENV *dbenv = unwrap(this); - - if ((ret = (*(dbenv->set_verbose))(dbenv, which, onoff)) != 0) - DB_ERROR("DbEnv::set_verbose", ret, error_policy()); - - return (ret); -} - -// This is a 'glue' function declared as extern "C" so it will -// be compatible with picky compilers that do not allow mixing -// of function pointers to 'C' functions with function pointers -// to C++ functions. -// -extern "C" -int _tx_recover_intercept_c(DB_ENV *env, DBT *dbt, - DB_LSN *lsn, db_recops op) -{ - return (DbEnv::_tx_recover_intercept(env, dbt, lsn, op)); -} - -int DbEnv::_tx_recover_intercept(DB_ENV *env, DBT *dbt, - DB_LSN *lsn, db_recops op) -{ - if (env == 0) { - DB_ERROR("DbEnv::tx_recover_callback", EINVAL, ON_ERROR_UNKNOWN); - return (EINVAL); - } - DbEnv *cxxenv = (DbEnv *)env->cj_internal; - if (cxxenv == 0) { - DB_ERROR("DbEnv::tx_recover_callback", EINVAL, ON_ERROR_UNKNOWN); - return (EINVAL); - } - if (cxxenv->tx_recover_callback_ == 0) { - DB_ERROR("DbEnv::tx_recover_callback", EINVAL, cxxenv->error_policy()); - return (EINVAL); - } - Dbt *cxxdbt = (Dbt *)dbt; - DbLsn *cxxlsn = (DbLsn *)lsn; - return ((*cxxenv->tx_recover_callback_)(cxxenv, cxxdbt, cxxlsn, op)); -} - -int DbEnv::set_tx_recover - (int (*arg)(DbEnv *, Dbt *, DbLsn *, db_recops)) -{ - int ret; - DB_ENV *dbenv = unwrap(this); - - tx_recover_callback_ = arg; - if ((ret = - (*(dbenv->set_tx_recover))(dbenv, _tx_recover_intercept_c)) != 0) - DB_ERROR("DbEnv::set_tx_recover", ret, error_policy()); - - return (ret); -} - -int DbEnv::set_tx_timestamp(time_t *timestamp) -{ - int ret; - DB_ENV *dbenv = unwrap(this); - - if ((ret = dbenv->set_tx_timestamp(dbenv, timestamp)) != 0) - DB_ERROR("DbEnv::set_tx_timestamp", ret, error_policy()); - - return (ret); -} - -// This is a 'glue' function declared as extern "C" so it will -// be compatible with picky compilers that do not allow mixing -// of function pointers to 'C' functions with function pointers -// to C++ functions. -// -extern "C" -void _paniccall_intercept_c(DB_ENV *env, int errval) -{ - DbEnv::_paniccall_intercept(env, errval); -} - -void DbEnv::_paniccall_intercept(DB_ENV *env, int errval) -{ - if (env == 0) { - DB_ERROR("DbEnv::paniccall_callback", EINVAL, ON_ERROR_UNKNOWN); - } - DbEnv *cxxenv = (DbEnv *)env->cj_internal; - if (cxxenv == 0) { - DB_ERROR("DbEnv::paniccall_callback", EINVAL, ON_ERROR_UNKNOWN); - } - if (cxxenv->paniccall_callback_ == 0) { - DB_ERROR("DbEnv::paniccall_callback", EINVAL, cxxenv->error_policy()); - } - (*cxxenv->paniccall_callback_)(cxxenv, errval); -} - -int DbEnv::set_paniccall(void (*arg)(DbEnv *, int)) -{ - DB_ENV *dbenv = unwrap(this); - - paniccall_callback_ = arg; - - return ((*(dbenv->set_paniccall))(dbenv, _paniccall_intercept_c)); -} - -// This is a 'glue' function declared as extern "C" so it will -// be compatible with picky compilers that do not allow mixing -// of function pointers to 'C' functions with function pointers -// to C++ functions. -// -extern "C" -int _recovery_init_intercept_c(DB_ENV *env) -{ - return (DbEnv::_recovery_init_intercept(env)); -} - -int DbEnv::_recovery_init_intercept(DB_ENV *env) -{ - if (env == 0) { - DB_ERROR("DbEnv::recovery_init_callback", EINVAL, - ON_ERROR_UNKNOWN); - } - DbEnv *cxxenv = (DbEnv *)env->cj_internal; - if (cxxenv == 0) { - DB_ERROR("DbEnv::recovery_init_callback", EINVAL, - ON_ERROR_UNKNOWN); - } - if (cxxenv->recovery_init_callback_ == 0) { - DB_ERROR("DbEnv::recovery_init_callback", EINVAL, - cxxenv->error_policy()); - } - return ((*cxxenv->recovery_init_callback_)(cxxenv)); -} - -int DbEnv::set_recovery_init(int (*arg)(DbEnv *)) -{ - DB_ENV *dbenv = unwrap(this); - - recovery_init_callback_ = arg; - - return ((*(dbenv->set_recovery_init))(dbenv, _recovery_init_intercept_c)); -} - -// This is a 'glue' function declared as extern "C" so it will -// be compatible with picky compilers that do not allow mixing -// of function pointers to 'C' functions with function pointers -// to C++ functions. -// -extern "C" -void _feedback_intercept_c(DB_ENV *env, int opcode, int pct) -{ - DbEnv::_feedback_intercept(env, opcode, pct); -} - -void DbEnv::_feedback_intercept(DB_ENV *env, int opcode, int pct) -{ - if (env == 0) { - DB_ERROR("DbEnv::feedback_callback", EINVAL, ON_ERROR_UNKNOWN); - return; - } - DbEnv *cxxenv = (DbEnv *)env->cj_internal; - if (cxxenv == 0) { - DB_ERROR("DbEnv::feedback_callback", EINVAL, ON_ERROR_UNKNOWN); - return; - } - if (cxxenv->feedback_callback_ == 0) { - DB_ERROR("DbEnv::feedback_callback", EINVAL, - cxxenv->error_policy()); - return; - } - (*cxxenv->feedback_callback_)(cxxenv, opcode, pct); -} - -int DbEnv::set_feedback(void (*arg)(DbEnv *, int, int)) -{ - DB_ENV *dbenv = unwrap(this); - - feedback_callback_ = arg; - - return ((*(dbenv->set_feedback))(dbenv, _feedback_intercept_c)); -} diff --git a/bdb/cxx/cxx_db.cpp b/bdb/cxx/cxx_db.cpp new file mode 100644 index 00000000000..7e50a9b3f27 --- /dev/null +++ b/bdb/cxx/cxx_db.cpp @@ -0,0 +1,605 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: cxx_db.cpp,v 11.71 2002/08/26 22:13:36 mjc Exp $"; +#endif /* not lint */ + +#include +#include + +#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" +#include "dbinc/db_dispatch.h" +#include "dbinc_auto/db_ext.h" +#include "dbinc_auto/common_ext.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 +// list element (e.g., "char *arg") and that _arglist is the arguments +// that should be passed through to the C method (e.g., "(db, arg)") +// +#define DB_METHOD(_name, _argspec, _arglist, _retok) \ +int Db::_name _argspec \ +{ \ + int ret; \ + DB *db = unwrap(this); \ + \ + ret = db->_name _arglist; \ + if (!_retok(ret)) \ + DB_ERROR("Db::" # _name, ret, error_policy()); \ + return (ret); \ +} + +#define DB_METHOD_CHECKED(_name, _cleanup, _argspec, _arglist, _retok) \ +int Db::_name _argspec \ +{ \ + int ret; \ + DB *db = unwrap(this); \ + \ + if (!db) { \ + DB_ERROR("Db::" # _name, EINVAL, error_policy()); \ + return (EINVAL); \ + } \ + if (_cleanup) \ + cleanup(); \ + ret = db->_name _arglist; \ + if (!_retok(ret)) \ + DB_ERROR("Db::" # _name, ret, error_policy()); \ + return (ret); \ +} + +#define DB_METHOD_QUIET(_name, _argspec, _arglist) \ +int Db::_name _argspec \ +{ \ + DB *db = unwrap(this); \ + \ + return (db->_name _arglist); \ +} + +#define DB_METHOD_VOID(_name, _argspec, _arglist) \ +void Db::_name _argspec \ +{ \ + DB *db = unwrap(this); \ + \ + db->_name _arglist; \ +} + +// A truism for the Db object is that there is a valid +// DB handle from the constructor until close(). +// After the close, the DB handle is invalid and +// no operations are permitted on the Db (other than +// destructor). Leaving the Db handle open and not +// doing a close is generally considered an error. +// +// We used to allow Db objects to be closed and reopened. +// This implied always keeping a valid DB object, and +// coordinating the open objects between Db/DbEnv turned +// out to be overly complicated. Now we do not allow this. + +Db::Db(DbEnv *env, u_int32_t flags) +: imp_(0) +, env_(env) +, construct_error_(0) +, flags_(0) +, construct_flags_(flags) +, append_recno_callback_(0) +, associate_callback_(0) +, bt_compare_callback_(0) +, bt_prefix_callback_(0) +, dup_compare_callback_(0) +, feedback_callback_(0) +, h_hash_callback_(0) +{ + if (env_ == 0) + flags_ |= DB_CXX_PRIVATE_ENV; + + if ((construct_error_ = initialize()) != 0) + DB_ERROR("Db::Db", construct_error_, error_policy()); +} + +// If the DB handle is still open, we close it. This is to make stack +// allocation of Db objects easier so that they are cleaned up in the error +// path. If the environment was closed prior to this, it may cause a trap, but +// an error message is generated during the environment close. Applications +// should call close explicitly in normal (non-exceptional) cases to check the +// return value. +// +Db::~Db() +{ + DB *db; + + db = unwrap(this); + if (db != NULL) { + cleanup(); + (void)db->close(db, 0); + } +} + +// private method to initialize during constructor. +// initialize must create a backing DB object, +// and if that creates a new DB_ENV, it must be tied to a new DbEnv. +// +int Db::initialize() +{ + DB *db; + DB_ENV *cenv = unwrap(env_); + int ret; + u_int32_t cxx_flags; + + cxx_flags = construct_flags_ & DB_CXX_NO_EXCEPTIONS; + + // Create a new underlying DB object. + // We rely on the fact that if a NULL DB_ENV* is given, + // one is allocated by DB. + // + if ((ret = db_create(&db, cenv, + construct_flags_ & ~cxx_flags)) != 0) + return (ret); + + // Associate the DB with this object + imp_ = wrap(db); + db->api_internal = this; + + // Create a new DbEnv from a DB_ENV* if it was created locally. + // It is deleted in Db::close(). + // + if ((flags_ & DB_CXX_PRIVATE_ENV) != 0) + env_ = new DbEnv(db->dbenv, cxx_flags); + + return (0); +} + +// 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. +// +void Db::cleanup() +{ + DB *db = unwrap(this); + + if (db != NULL) { + // extra safety + db->api_internal = 0; + imp_ = 0; + + // we must dispose of the DbEnv object if + // we created it. This will be the case + // if a NULL DbEnv was passed into the constructor. + // The underlying DB_ENV object will be inaccessible + // after the close, so we must clean it up now. + // + if ((flags_ & DB_CXX_PRIVATE_ENV) != 0) { + env_->cleanup(); + delete env_; + env_ = 0; + } + } +} + +// Return a tristate value corresponding to whether we should +// throw exceptions on errors: +// ON_ERROR_RETURN +// ON_ERROR_THROW +// ON_ERROR_UNKNOWN +// +int Db::error_policy() +{ + if (env_ != NULL) + return (env_->error_policy()); + else { + // If the env_ is null, that means that the user + // did not attach an environment, so the correct error + // policy can be deduced from constructor flags + // for this Db. + // + if ((construct_flags_ & DB_CXX_NO_EXCEPTIONS) != 0) { + return (ON_ERROR_RETURN); + } + else { + return (ON_ERROR_THROW); + } + } +} + +int Db::close(u_int32_t flags) +{ + DB *db = unwrap(this); + int ret; + + // after a DB->close (no matter if success or failure), + // the underlying DB object must not be accessed, + // so we clean up in advance. + // + cleanup(); + + // It's safe to throw an error after the close, + // since our error mechanism does not peer into + // the DB* structures. + // + if ((ret = db->close(db, flags)) != 0) + DB_ERROR("Db::close", ret, error_policy()); + + return (ret); +} + +// The following cast implies that Dbc can be no larger than DBC +DB_METHOD(cursor, (DbTxn *txnid, Dbc **cursorp, u_int32_t flags), + (db, unwrap(txnid), (DBC **)cursorp, flags), + DB_RETOK_STD) + +DB_METHOD(del, (DbTxn *txnid, Dbt *key, u_int32_t flags), + (db, unwrap(txnid), key, flags), + DB_RETOK_DBDEL) + +void Db::err(int error, const char *format, ...) +{ + DB *db = unwrap(this); + + DB_REAL_ERR(db->dbenv, error, 1, 1, format); +} + +void Db::errx(const char *format, ...) +{ + DB *db = unwrap(this); + + DB_REAL_ERR(db->dbenv, 0, 0, 1, format); +} + +DB_METHOD(fd, (int *fdp), + (db, fdp), + DB_RETOK_STD) + +int Db::get(DbTxn *txnid, Dbt *key, Dbt *value, u_int32_t flags) +{ + DB *db = unwrap(this); + int ret; + + ret = db->get(db, unwrap(txnid), key, value, flags); + + if (!DB_RETOK_DBGET(ret)) { + if (ret == ENOMEM && DB_OVERFLOWED_DBT(value)) + DB_ERROR_DBT("Db::get", value, error_policy()); + else + DB_ERROR("Db::get", ret, error_policy()); + } + + return (ret); +} + +int Db::get_byteswapped(int *isswapped) +{ + DB *db = (DB *)unwrapConst(this); + return (db->get_byteswapped(db, isswapped)); +} + +int Db::get_type(DBTYPE *dbtype) +{ + DB *db = (DB *)unwrapConst(this); + return (db->get_type(db, dbtype)); +} + +// Dbc is a "compatible" subclass of DBC - that is, no virtual functions +// or even extra data members, so these casts, although technically +// non-portable, "should" always be okay. +DB_METHOD(join, (Dbc **curslist, Dbc **cursorp, u_int32_t flags), + (db, (DBC **)curslist, (DBC **)cursorp, flags), + DB_RETOK_STD) + +DB_METHOD(key_range, + (DbTxn *txnid, Dbt *key, DB_KEY_RANGE *results, u_int32_t flags), + (db, unwrap(txnid), key, results, flags), + DB_RETOK_STD) + +// If an error occurred during the constructor, report it now. +// Otherwise, call the underlying DB->open method. +// +int Db::open(DbTxn *txnid, const char *file, const char *database, + DBTYPE type, u_int32_t flags, int mode) +{ + int ret; + DB *db = unwrap(this); + + if (construct_error_ != 0) + ret = construct_error_; + else + ret = db->open(db, unwrap(txnid), file, database, type, flags, + mode); + + if (!DB_RETOK_STD(ret)) + DB_ERROR("Db::open", ret, error_policy()); + + return (ret); +} + +int Db::pget(DbTxn *txnid, Dbt *key, Dbt *pkey, Dbt *value, u_int32_t flags) +{ + DB *db = unwrap(this); + int ret; + + ret = db->pget(db, unwrap(txnid), key, pkey, value, flags); + + /* The logic here is identical to Db::get - reuse the macro. */ + if (!DB_RETOK_DBGET(ret)) { + if (ret == ENOMEM && DB_OVERFLOWED_DBT(value)) + DB_ERROR_DBT("Db::pget", value, error_policy()); + else + DB_ERROR("Db::pget", ret, error_policy()); + } + + return (ret); +} + +DB_METHOD(put, + (DbTxn *txnid, Dbt *key, Dbt *value, u_int32_t flags), + (db, unwrap(txnid), key, value, flags), + DB_RETOK_DBPUT) + +DB_METHOD_CHECKED(rename, 1, + (const char *file, const char *database, const char *newname, + u_int32_t flags), + (db, file, database, newname, flags), DB_RETOK_STD) + +DB_METHOD_CHECKED(remove, 1, + (const char *file, const char *database, u_int32_t flags), + (db, file, database, flags), DB_RETOK_STD) + +DB_METHOD_CHECKED(truncate, 0, + (DbTxn *txnid, u_int32_t *countp, u_int32_t flags), + (db, unwrap(txnid), countp, flags), DB_RETOK_STD) + +DB_METHOD_CHECKED(stat, 0, + (void *sp, u_int32_t flags), (db, sp, flags), DB_RETOK_STD) + +DB_METHOD_CHECKED(sync, 0, + (u_int32_t flags), (db, flags), DB_RETOK_STD) + +DB_METHOD_CHECKED(upgrade, 0, + (const char *name, u_int32_t flags), (db, name, flags), DB_RETOK_STD) + +//////////////////////////////////////////////////////////////////////// +// +// callbacks +// +// *_intercept_c are 'glue' functions that must be declared +// as extern "C" so to be typesafe. Using a C++ method, even +// a static class method with 'correct' arguments, will not pass +// the test; some picky compilers do not allow mixing of function +// pointers to 'C' functions with function pointers to C++ functions. +// +// One wart with this scheme is that the *_callback_ method pointer +// must be declared public to be accessible by the C intercept. +// It's possible to accomplish the goal without this, and with +// another public transfer method, but it's just too much overhead. +// These callbacks are supposed to be *fast*. +// +// The DBTs we receive in these callbacks from the C layer may be +// manufactured there, but we want to treat them as a Dbts. +// Technically speaking, these DBTs were not constructed as a Dbts, +// but it should be safe to cast them as such given that Dbt is a +// *very* thin extension of the DBT. That is, Dbt has no additional +// data elements, does not use virtual functions, virtual inheritance, +// multiple inheritance, RTI, or any other language feature that +// causes the structure to grow or be displaced. Although this may +// sound risky, a design goal of C++ is complete structure +// compatibility with C, and has the philosophy 'if you don't use it, +// you shouldn't incur the overhead'. If the C/C++ compilers you're +// using on a given machine do not have matching struct layouts, then +// a lot more things will be broken than just this. +// +// The alternative, creating a Dbt here in the callback, and populating +// it from the DBT, is just too slow and cumbersome to be very useful. + +// These macros avoid a lot of boilerplate code for callbacks + +#define DB_CALLBACK_C_INTERCEPT(_name, _rettype, _cargspec, \ + _return, _cxxargs) \ +extern "C" _rettype _db_##_name##_intercept_c _cargspec \ +{ \ + Db *cxxthis; \ + \ + DB_ASSERT(cthis != NULL); \ + cxxthis = (Db *)cthis->api_internal; \ + DB_ASSERT(cxxthis != NULL); \ + DB_ASSERT(cxxthis->_name##_callback_ != 0); \ + \ + _return (*cxxthis->_name##_callback_) _cxxargs; \ +} + +#define DB_SET_CALLBACK(_cxxname, _name, _cxxargspec, _cb) \ +int Db::_cxxname _cxxargspec \ +{ \ + DB *cthis = unwrap(this); \ + \ + _name##_callback_ = _cb; \ + return ((*(cthis->_cxxname))(cthis, \ + (_cb) ? _db_##_name##_intercept_c : NULL)); \ +} + +/* associate callback - doesn't quite fit the pattern because of the flags */ +DB_CALLBACK_C_INTERCEPT(associate, + int, (DB *cthis, const DBT *key, const DBT *data, DBT *retval), + return, (cxxthis, Dbt::get_const_Dbt(key), Dbt::get_const_Dbt(data), + Dbt::get_Dbt(retval))) + +int Db::associate(DbTxn *txn, Db *secondary, int (*callback)(Db *, const Dbt *, + const Dbt *, Dbt *), u_int32_t flags) +{ + DB *cthis = unwrap(this); + + /* Since the secondary Db is used as the first argument + * to the callback, we store the C++ callback on it + * rather than on 'this'. + */ + secondary->associate_callback_ = callback; + return ((*(cthis->associate))(cthis, unwrap(txn), unwrap(secondary), + (callback) ? _db_associate_intercept_c : NULL, flags)); +} + +DB_CALLBACK_C_INTERCEPT(feedback, + void, (DB *cthis, int opcode, int pct), + /* no return */ (void), (cxxthis, opcode, pct)) + +DB_SET_CALLBACK(set_feedback, feedback, + (void (*arg)(Db *cxxthis, int opcode, int pct)), arg) + +DB_CALLBACK_C_INTERCEPT(append_recno, + int, (DB *cthis, DBT *data, db_recno_t recno), + return, (cxxthis, Dbt::get_Dbt(data), recno)) + +DB_SET_CALLBACK(set_append_recno, append_recno, + (int (*arg)(Db *cxxthis, Dbt *data, db_recno_t recno)), arg) + +DB_CALLBACK_C_INTERCEPT(bt_compare, + int, (DB *cthis, const DBT *data1, const DBT *data2), + return, + (cxxthis, Dbt::get_const_Dbt(data1), Dbt::get_const_Dbt(data2))) + +DB_SET_CALLBACK(set_bt_compare, bt_compare, + (int (*arg)(Db *cxxthis, const Dbt *data1, const Dbt *data2)), arg) + +DB_CALLBACK_C_INTERCEPT(bt_prefix, + size_t, (DB *cthis, const DBT *data1, const DBT *data2), + return, + (cxxthis, Dbt::get_const_Dbt(data1), Dbt::get_const_Dbt(data2))) + +DB_SET_CALLBACK(set_bt_prefix, bt_prefix, + (size_t (*arg)(Db *cxxthis, const Dbt *data1, const Dbt *data2)), arg) + +DB_CALLBACK_C_INTERCEPT(dup_compare, + int, (DB *cthis, const DBT *data1, const DBT *data2), + return, + (cxxthis, Dbt::get_const_Dbt(data1), Dbt::get_const_Dbt(data2))) + +DB_SET_CALLBACK(set_dup_compare, dup_compare, + (int (*arg)(Db *cxxthis, const Dbt *data1, const Dbt *data2)), arg) + +DB_CALLBACK_C_INTERCEPT(h_hash, + u_int32_t, (DB *cthis, const void *data, u_int32_t len), + return, (cxxthis, data, len)) + +DB_SET_CALLBACK(set_h_hash, h_hash, + (u_int32_t (*arg)(Db *cxxthis, const void *data, u_int32_t len)), arg) + +// This is a 'glue' function declared as extern "C" so it will +// be compatible with picky compilers that do not allow mixing +// of function pointers to 'C' functions with function pointers +// to C++ functions. +// +extern "C" +int _verify_callback_c(void *handle, const void *str_arg) +{ + char *str; + __DB_OSTREAMCLASS *out; + + str = (char *)str_arg; + out = (__DB_OSTREAMCLASS *)handle; + + (*out) << str; + if (out->fail()) + return (EIO); + + return (0); +} + +int Db::verify(const char *name, const char *subdb, + __DB_OSTREAMCLASS *ostr, u_int32_t flags) +{ + DB *db = unwrap(this); + int ret; + + if (!db) + ret = EINVAL; + else + ret = __db_verify_internal(db, name, subdb, ostr, + _verify_callback_c, flags); + + if (!DB_RETOK_STD(ret)) + DB_ERROR("Db::verify", ret, error_policy()); + + return (ret); +} + +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(set_bt_minkey, (u_int32_t bt_minkey), + (db, bt_minkey), DB_RETOK_STD) +DB_METHOD(set_bt_prefix, (bt_prefix_fcn_type func), + (db, func), DB_RETOK_STD) +DB_METHOD(set_dup_compare, (dup_compare_fcn_type func), + (db, func), DB_RETOK_STD) +DB_METHOD(set_encrypt, (const char *passwd, int flags), + (db, passwd, flags), DB_RETOK_STD) +DB_METHOD_VOID(set_errfile, (FILE *errfile), (db, errfile)) +DB_METHOD_VOID(set_errpfx, (const char *errpfx), (db, errpfx)) +DB_METHOD(set_flags, (u_int32_t flags), (db, flags), + DB_RETOK_STD) +DB_METHOD(set_h_ffactor, (u_int32_t h_ffactor), + (db, h_ffactor), DB_RETOK_STD) +DB_METHOD(set_h_hash, (h_hash_fcn_type func), + (db, func), DB_RETOK_STD) +DB_METHOD(set_h_nelem, (u_int32_t h_nelem), + (db, h_nelem), DB_RETOK_STD) +DB_METHOD(set_lorder, (int db_lorder), (db, db_lorder), + DB_RETOK_STD) +DB_METHOD(set_pagesize, (u_int32_t db_pagesize), + (db, db_pagesize), DB_RETOK_STD) +DB_METHOD(set_re_delim, (int re_delim), + (db, re_delim), DB_RETOK_STD) +DB_METHOD(set_re_len, (u_int32_t re_len), + (db, re_len), DB_RETOK_STD) +DB_METHOD(set_re_pad, (int re_pad), + (db, re_pad), DB_RETOK_STD) +DB_METHOD(set_re_source, (char *re_source), + (db, re_source), DB_RETOK_STD) +DB_METHOD(set_q_extentsize, (u_int32_t extentsize), + (db, extentsize), DB_RETOK_STD) + +DB_METHOD_QUIET(set_alloc, (db_malloc_fcn_type malloc_fcn, + db_realloc_fcn_type realloc_fcn, db_free_fcn_type free_fcn), + (db, malloc_fcn, realloc_fcn, free_fcn)) + +void Db::set_errcall(void (*arg)(const char *, char *)) +{ + env_->set_errcall(arg); +} + +void *Db::get_app_private() const +{ + return unwrapConst(this)->app_private; +} + +void Db::set_app_private(void *value) +{ + unwrap(this)->app_private = value; +} + +DB_METHOD(set_cachesize, (u_int32_t gbytes, u_int32_t bytes, int ncache), + (db, gbytes, bytes, ncache), DB_RETOK_STD) +DB_METHOD(set_cache_priority, (DB_CACHE_PRIORITY priority), + (db, priority), DB_RETOK_STD) + +int Db::set_paniccall(void (*callback)(DbEnv *, int)) +{ + return (env_->set_paniccall(callback)); +} + +void Db::set_error_stream(__DB_OSTREAMCLASS *error_stream) +{ + env_->set_error_stream(error_stream); +} diff --git a/bdb/cxx/cxx_dbc.cpp b/bdb/cxx/cxx_dbc.cpp new file mode 100644 index 00000000000..4d5844f922f --- /dev/null +++ b/bdb/cxx/cxx_dbc.cpp @@ -0,0 +1,115 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: cxx_dbc.cpp,v 11.55 2002/07/03 21:03:52 bostic Exp $"; +#endif /* not lint */ + +#include +#include + +#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" +#include "dbinc/db_dispatch.h" +#include "dbinc_auto/db_ext.h" +#include "dbinc_auto/common_ext.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 +// list element (e.g., "char *arg") and that _arglist is the arguments +// that should be passed through to the C method (e.g., "(db, arg)") +// +#define DBC_METHOD(_name, _argspec, _arglist, _retok) \ +int Dbc::_name _argspec \ +{ \ + int ret; \ + DBC *dbc = this; \ + \ + ret = dbc->c_##_name _arglist; \ + if (!_retok(ret)) \ + DB_ERROR("Dbc::" # _name, ret, ON_ERROR_UNKNOWN); \ + return (ret); \ +} + +// It's private, and should never be called, but VC4.0 needs it resolved +// +Dbc::~Dbc() +{ +} + +DBC_METHOD(close, (void), (dbc), DB_RETOK_STD) +DBC_METHOD(count, (db_recno_t *countp, u_int32_t _flags), + (dbc, countp, _flags), DB_RETOK_STD) +DBC_METHOD(del, (u_int32_t _flags), + (dbc, _flags), DB_RETOK_DBCDEL) + +int Dbc::dup(Dbc** cursorp, u_int32_t _flags) +{ + int ret; + DBC *dbc = this; + DBC *new_cursor = 0; + + ret = dbc->c_dup(dbc, &new_cursor, _flags); + + if (DB_RETOK_STD(ret)) + // The following cast implies that Dbc can be no larger than DBC + *cursorp = (Dbc*)new_cursor; + else + DB_ERROR("Dbc::dup", ret, ON_ERROR_UNKNOWN); + + return (ret); +} + +int Dbc::get(Dbt* key, Dbt *data, u_int32_t _flags) +{ + int ret; + DBC *dbc = this; + + ret = dbc->c_get(dbc, key, data, _flags); + + if (!DB_RETOK_DBCGET(ret)) { + if (ret == ENOMEM && DB_OVERFLOWED_DBT(key)) + DB_ERROR_DBT("Dbc::get", key, ON_ERROR_UNKNOWN); + else if (ret == ENOMEM && DB_OVERFLOWED_DBT(data)) + DB_ERROR_DBT("Dbc::get", data, ON_ERROR_UNKNOWN); + else + DB_ERROR("Dbc::get", ret, ON_ERROR_UNKNOWN); + } + + return (ret); +} + +int Dbc::pget(Dbt* key, Dbt *pkey, Dbt *data, u_int32_t _flags) +{ + int ret; + DBC *dbc = this; + + ret = dbc->c_pget(dbc, key, pkey, data, _flags); + + /* Logic is the same as for Dbc::get - reusing macro. */ + if (!DB_RETOK_DBCGET(ret)) { + if (ret == ENOMEM && DB_OVERFLOWED_DBT(key)) + DB_ERROR_DBT("Dbc::pget", key, ON_ERROR_UNKNOWN); + else if (ret == ENOMEM && DB_OVERFLOWED_DBT(data)) + DB_ERROR_DBT("Dbc::pget", data, ON_ERROR_UNKNOWN); + else + DB_ERROR("Dbc::pget", ret, ON_ERROR_UNKNOWN); + } + + return (ret); +} + +DBC_METHOD(put, (Dbt* key, Dbt *data, u_int32_t _flags), + (dbc, key, data, _flags), DB_RETOK_DBCPUT) diff --git a/bdb/cxx/cxx_dbt.cpp b/bdb/cxx/cxx_dbt.cpp new file mode 100644 index 00000000000..7a4224503ee --- /dev/null +++ b/bdb/cxx/cxx_dbt.cpp @@ -0,0 +1,61 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: cxx_dbt.cpp,v 11.53 2002/03/27 04:31:14 bostic Exp $"; +#endif /* not lint */ + +#include +#include + +#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" +#include "dbinc/db_dispatch.h" +#include "dbinc_auto/db_ext.h" +#include "dbinc_auto/common_ext.h" + +Dbt::Dbt() +{ + DBT *dbt = this; + memset(dbt, 0, sizeof(DBT)); +} + +Dbt::Dbt(void *data_arg, u_int32_t size_arg) +{ + DBT *dbt = this; + memset(dbt, 0, sizeof(DBT)); + set_data(data_arg); + set_size(size_arg); +} + +Dbt::~Dbt() +{ +} + +Dbt::Dbt(const Dbt &that) +{ + const DBT *from = &that; + DBT *to = this; + memcpy(to, from, sizeof(DBT)); +} + +Dbt &Dbt::operator = (const Dbt &that) +{ + if (this != &that) { + const DBT *from = &that; + DBT *to = this; + memcpy(to, from, sizeof(DBT)); + } + return (*this); +} diff --git a/bdb/cxx/cxx_env.cpp b/bdb/cxx/cxx_env.cpp new file mode 100644 index 00000000000..c78c6e9fa47 --- /dev/null +++ b/bdb/cxx/cxx_env.cpp @@ -0,0 +1,802 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: cxx_env.cpp,v 11.88 2002/08/26 22:13:36 mjc Exp $"; +#endif /* not lint */ + +#include +#include // needed for set_error_stream +#include + +#include "db_cxx.h" +#include "dbinc/cxx_int.h" + +#include "db_int.h" +#include "dbinc_auto/common_ext.h" + +#ifdef HAVE_CXX_STDHEADERS +using std::cerr; +#endif + +// Helper macros for simple methods that pass through to the +// underlying C method. They may return an error or raise an exception. +// These macros expect that input _argspec is an argument +// list element (e.g., "char *arg") and that _arglist is the arguments +// that should be passed through to the C method (e.g., "(dbenv, arg)") +// +#define DBENV_METHOD_ERR(_name, _argspec, _arglist, _on_err) \ +int DbEnv::_name _argspec \ +{ \ + DB_ENV *dbenv = unwrap(this); \ + int ret; \ + \ + if ((ret = dbenv->_name _arglist) != 0) { \ + _on_err; \ + } \ + return (ret); \ +} + +#define DBENV_METHOD(_name, _argspec, _arglist) \ + DBENV_METHOD_ERR(_name, _argspec, _arglist, \ + DB_ERROR("DbEnv::" # _name, ret, error_policy())) + +#define DBENV_METHOD_QUIET(_name, _argspec, _arglist) \ +int DbEnv::_name _argspec \ +{ \ + DB_ENV *dbenv = unwrap(this); \ + \ + return (dbenv->_name _arglist); \ +} + +#define DBENV_METHOD_VOID(_name, _argspec, _arglist) \ +void DbEnv::_name _argspec \ +{ \ + DB_ENV *dbenv = unwrap(this); \ + \ + dbenv->_name _arglist; \ +} + +// This datatype is needed for picky compilers. +// +extern "C" { + typedef void (*db_errcall_fcn_type) + (const char *, char *); +}; + +// The reason for a static variable is that some structures +// (like Dbts) have no connection to any Db or DbEnv, so when +// errors occur in their methods, we must have some reasonable +// way to determine whether to throw or return errors. +// +// This variable is taken from flags whenever a DbEnv is constructed. +// Normally there is only one DbEnv per program, and even if not, +// there is typically a single policy of throwing or returning. +// +static int last_known_error_policy = ON_ERROR_UNKNOWN; + +__DB_OSTREAMCLASS *DbEnv::error_stream_ = 0; + +// These 'glue' function are declared as extern "C" so they will +// be compatible with picky compilers that do not allow mixing +// of function pointers to 'C' functions with function pointers +// to C++ functions. +// +extern "C" +void _feedback_intercept_c(DB_ENV *env, int opcode, int pct) +{ + DbEnv::_feedback_intercept(env, opcode, pct); +} + +extern "C" +void _paniccall_intercept_c(DB_ENV *env, int errval) +{ + DbEnv::_paniccall_intercept(env, errval); +} + +extern "C" +void _stream_error_function_c(const char *prefix, char *message) +{ + DbEnv::_stream_error_function(prefix, message); +} + +extern "C" +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, int id, u_int32_t flags) +{ + return (DbEnv::_rep_send_intercept(env, + cntrl, data, id, flags)); +} + +void DbEnv::_feedback_intercept(DB_ENV *env, int opcode, int pct) +{ + if (env == 0) { + DB_ERROR("DbEnv::feedback_callback", EINVAL, ON_ERROR_UNKNOWN); + return; + } + DbEnv *cxxenv = (DbEnv *)env->api1_internal; + if (cxxenv == 0) { + DB_ERROR("DbEnv::feedback_callback", EINVAL, ON_ERROR_UNKNOWN); + return; + } + if (cxxenv->feedback_callback_ == 0) { + DB_ERROR("DbEnv::feedback_callback", EINVAL, + cxxenv->error_policy()); + return; + } + (*cxxenv->feedback_callback_)(cxxenv, opcode, pct); +} + +void DbEnv::_paniccall_intercept(DB_ENV *env, int errval) +{ + if (env == 0) { + DB_ERROR("DbEnv::paniccall_callback", EINVAL, + ON_ERROR_UNKNOWN); + } + DbEnv *cxxenv = (DbEnv *)env->api1_internal; + if (cxxenv == 0) { + DB_ERROR("DbEnv::paniccall_callback", EINVAL, + ON_ERROR_UNKNOWN); + } + if (cxxenv->paniccall_callback_ == 0) { + DB_ERROR("DbEnv::paniccall_callback", EINVAL, + cxxenv->error_policy()); + } + (*cxxenv->paniccall_callback_)(cxxenv, errval); +} + +int DbEnv::_app_dispatch_intercept(DB_ENV *env, DBT *dbt, + DB_LSN *lsn, db_recops op) +{ + if (env == 0) { + DB_ERROR("DbEnv::app_dispatch_callback", + EINVAL, ON_ERROR_UNKNOWN); + return (EINVAL); + } + DbEnv *cxxenv = (DbEnv *)env->api1_internal; + if (cxxenv == 0) { + DB_ERROR("DbEnv::app_dispatch_callback", + EINVAL, ON_ERROR_UNKNOWN); + return (EINVAL); + } + if (cxxenv->app_dispatch_callback_ == 0) { + DB_ERROR("DbEnv::app_dispatch_callback", + EINVAL, cxxenv->error_policy()); + return (EINVAL); + } + Dbt *cxxdbt = (Dbt *)dbt; + DbLsn *cxxlsn = (DbLsn *)lsn; + return ((*cxxenv->app_dispatch_callback_)(cxxenv, cxxdbt, cxxlsn, op)); +} + +int DbEnv::_rep_send_intercept(DB_ENV *env, const DBT *cntrl, + const DBT *data, int id, u_int32_t flags) +{ + + if (env == 0) { + DB_ERROR("DbEnv::rep_send_callback", EINVAL, ON_ERROR_UNKNOWN); + return (EINVAL); + } + DbEnv *cxxenv = (DbEnv *)env->api1_internal; + if (cxxenv == 0) { + DB_ERROR("DbEnv::rep_send_callback", EINVAL, ON_ERROR_UNKNOWN); + return (EINVAL); + } + const Dbt *cxxcntrl = (const Dbt *)cntrl; + Dbt *cxxdata = (Dbt *)data; + return ((*cxxenv->rep_send_callback_)(cxxenv, + cxxcntrl, cxxdata, id, flags)); +} + +// 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 +// no operations are permitted on the DbEnv (other than +// destructor). Leaving the DbEnv handle open and not +// doing a close is generally considered an error. +// +// We used to allow DbEnv objects to be closed and reopened. +// This implied always keeping a valid DB_ENV object, and +// coordinating the open objects between Db/DbEnv turned +// out to be overly complicated. Now we do not allow this. + +DbEnv::DbEnv(u_int32_t flags) +: imp_(0) +, construct_error_(0) +, construct_flags_(flags) +, app_dispatch_callback_(0) +, feedback_callback_(0) +, paniccall_callback_(0) +, pgin_callback_(0) +, pgout_callback_(0) +, rep_send_callback_(0) +{ + if ((construct_error_ = initialize(0)) != 0) + DB_ERROR("DbEnv::DbEnv", construct_error_, error_policy()); +} + +DbEnv::DbEnv(DB_ENV *env, u_int32_t flags) +: imp_(0) +, construct_error_(0) +, construct_flags_(flags) +, app_dispatch_callback_(0) +, feedback_callback_(0) +, paniccall_callback_(0) +, pgin_callback_(0) +, pgout_callback_(0) +, rep_send_callback_(0) +{ + if ((construct_error_ = initialize(env)) != 0) + DB_ERROR("DbEnv::DbEnv", construct_error_, error_policy()); +} + +// If the DB_ENV handle is still open, we close it. This is to make stack +// allocation of DbEnv objects easier so that they are cleaned up in the error +// path. Note that the C layer catches cases where handles are open in the +// environment at close time and reports an error. Applications should call +// close explicitly in normal (non-exceptional) cases to check the return +// value. +// +DbEnv::~DbEnv() +{ + DB_ENV *env = unwrap(this); + + if (env != NULL) { + cleanup(); + (void)env->close(env, 0); + } +} + +// 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; + } +} + +int DbEnv::close(u_int32_t flags) +{ + int ret; + DB_ENV *env = unwrap(this); + + // after a close (no matter if success or failure), + // the underlying DB_ENV object must not be accessed, + // so we clean up in advance. + // + 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) + DB_ERROR("DbEnv::close", ret, error_policy()); + + return (ret); +} + +DBENV_METHOD(dbremove, + (DbTxn *txn, const char *name, const char *subdb, u_int32_t flags), + (dbenv, unwrap(txn), name, subdb, flags)) +DBENV_METHOD(dbrename, (DbTxn *txn, const char *name, const char *subdb, + const char *newname, u_int32_t flags), + (dbenv, unwrap(txn), name, subdb, newname, flags)) + +void DbEnv::err(int error, const char *format, ...) +{ + DB_ENV *env = unwrap(this); + + DB_REAL_ERR(env, error, 1, 1, format); +} + +// Return a tristate value corresponding to whether we should +// throw exceptions on errors: +// ON_ERROR_RETURN +// ON_ERROR_THROW +// ON_ERROR_UNKNOWN +// +int DbEnv::error_policy() +{ + if ((construct_flags_ & DB_CXX_NO_EXCEPTIONS) != 0) { + return (ON_ERROR_RETURN); + } + else { + return (ON_ERROR_THROW); + } +} + +void DbEnv::errx(const char *format, ...) +{ + DB_ENV *env = unwrap(this); + + DB_REAL_ERR(env, 0, 0, 1, format); +} + +void *DbEnv::get_app_private() const +{ + return unwrapConst(this)->app_private; +} + +// used internally during constructor +// to associate an existing DB_ENV with this DbEnv, +// or create a new one. +// +int DbEnv::initialize(DB_ENV *env) +{ + int ret; + + last_known_error_policy = error_policy(); + + if (env == 0) { + // Create a new DB_ENV environment. + if ((ret = ::db_env_create(&env, + construct_flags_ & ~DB_CXX_NO_EXCEPTIONS)) != 0) + return (ret); + } + imp_ = wrap(env); + env->api1_internal = this; // for DB_ENV* to DbEnv* conversion + return (0); +} + +// lock methods +DBENV_METHOD(lock_detect, (u_int32_t flags, u_int32_t atype, int *aborted), + (dbenv, flags, atype, aborted)) +DBENV_METHOD_ERR(lock_get, + (u_int32_t locker, u_int32_t flags, const Dbt *obj, + db_lockmode_t lock_mode, DbLock *lock), + (dbenv, locker, flags, obj, lock_mode, &lock->lock_), + DbEnv::runtime_error_lock_get("DbEnv::lock_get", ret, + DB_LOCK_GET, lock_mode, obj, *lock, + -1, error_policy())) +DBENV_METHOD(lock_id, (u_int32_t *idp), (dbenv, idp)) +DBENV_METHOD(lock_id_free, (u_int32_t id), (dbenv, id)) +DBENV_METHOD(lock_put, (DbLock *lock), (dbenv, &lock->lock_)) +DBENV_METHOD(lock_stat, (DB_LOCK_STAT **statp, u_int32_t flags), + (dbenv, statp, flags)) +DBENV_METHOD_ERR(lock_vec, + (u_int32_t locker, u_int32_t flags, DB_LOCKREQ list[], + int nlist, DB_LOCKREQ **elist_returned), + (dbenv, locker, flags, list, nlist, elist_returned), + DbEnv::runtime_error_lock_get("DbEnv::lock_vec", ret, + (*elist_returned)->op, (*elist_returned)->mode, + Dbt::get_Dbt((*elist_returned)->obj), DbLock((*elist_returned)->lock), + (*elist_returned) - list, error_policy())) +// log methods +DBENV_METHOD(log_archive, (char **list[], u_int32_t flags), + (dbenv, list, flags)) + +int DbEnv::log_compare(const DbLsn *lsn0, const DbLsn *lsn1) +{ + return (::log_compare(lsn0, lsn1)); +} + +// The following cast implies that DbLogc can be no larger than DB_LOGC +DBENV_METHOD(log_cursor, (DbLogc **cursorp, u_int32_t flags), + (dbenv, (DB_LOGC **)cursorp, flags)) +DBENV_METHOD(log_file, (DbLsn *lsn, char *namep, size_t len), + (dbenv, lsn, namep, 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)) +DBENV_METHOD(log_stat, (DB_LOG_STAT **spp, u_int32_t flags), + (dbenv, spp, flags)) + +int DbEnv::memp_fcreate(DbMpoolFile **dbmfp, u_int32_t flags) +{ + DB_ENV *env = unwrap(this); + int ret; + DB_MPOOLFILE *mpf; + + if (env == NULL) + ret = EINVAL; + else + ret = env->memp_fcreate(env, &mpf, flags); + + if (DB_RETOK_STD(ret)) { + *dbmfp = new DbMpoolFile(); + (*dbmfp)->imp_ = wrap(mpf); + } else + DB_ERROR("DbMpoolFile::f_create", ret, ON_ERROR_UNKNOWN); + + return (ret); +} + +DBENV_METHOD(memp_register, + (int ftype, pgin_fcn_type pgin_fcn, pgout_fcn_type pgout_fcn), + (dbenv, ftype, pgin_fcn, pgout_fcn)) + +// memory pool methods +DBENV_METHOD(memp_stat, + (DB_MPOOL_STAT **gsp, DB_MPOOL_FSTAT ***fsp, u_int32_t flags), + (dbenv, gsp, fsp, flags)) + +DBENV_METHOD(memp_sync, (DbLsn *sn), (dbenv, sn)) + +DBENV_METHOD(memp_trickle, (int pct, int *nwrotep), (dbenv, pct, nwrotep)) + +// If an error occurred during the constructor, report it now. +// Otherwise, call the underlying DB->open method. +// +int DbEnv::open(const char *db_home, u_int32_t flags, int mode) +{ + int ret; + DB_ENV *env = unwrap(this); + + if (construct_error_ != 0) + ret = construct_error_; + else + ret = env->open(env, db_home, flags, mode); + + if (!DB_RETOK_STD(ret)) + DB_ERROR("DbEnv::open", ret, error_policy()); + + return (ret); +} + +int DbEnv::remove(const char *db_home, u_int32_t flags) +{ + int ret; + DB_ENV *env = unwrap(this); + + // 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) + DB_ERROR("DbEnv::remove", ret, error_policy()); + + return (ret); +} + +// Report an error associated with the DbEnv. +// error_policy is one of: +// ON_ERROR_THROW throw an error +// ON_ERROR_RETURN do nothing here, the caller will return an error +// ON_ERROR_UNKNOWN defer the policy to policy saved in DbEnv::DbEnv +// +void DbEnv::runtime_error(const char *caller, int error, int error_policy) +{ + if (error_policy == ON_ERROR_UNKNOWN) + error_policy = last_known_error_policy; + if (error_policy == ON_ERROR_THROW) { + // Creating and throwing the object in two separate + // statements seems to be necessary for HP compilers. + switch (error) { + case DB_LOCK_DEADLOCK: + { + DbDeadlockException dl_except(caller); + throw dl_except; + } + break; + case DB_RUNRECOVERY: + { + DbRunRecoveryException rr_except(caller); + throw rr_except; + } + break; + default: + { + DbException except(caller, error); + throw except; + } + break; + } + } +} + +// Like DbEnv::runtime_error, but issue a DbMemoryException +// based on the fact that this Dbt is not large enough. +void DbEnv::runtime_error_dbt(const char *caller, Dbt *dbt, int error_policy) +{ + if (error_policy == ON_ERROR_UNKNOWN) + error_policy = last_known_error_policy; + if (error_policy == ON_ERROR_THROW) { + // Creating and throwing the object in two separate + // statements seems to be necessary for HP compilers. + DbMemoryException except(caller, dbt); + throw except; + } +} + +// Like DbEnv::runtime_error, but issue a DbLockNotGrantedException, +// or a regular runtime error. +// call regular runtime_error if it +void DbEnv::runtime_error_lock_get(const char *caller, int error, + db_lockop_t op, db_lockmode_t mode, const Dbt *obj, + DbLock lock, int index, int error_policy) +{ + if (error != DB_LOCK_NOTGRANTED) { + runtime_error(caller, error, error_policy); + return; + } + + if (error_policy == ON_ERROR_UNKNOWN) + error_policy = last_known_error_policy; + if (error_policy == ON_ERROR_THROW) { + // Creating and throwing the object in two separate + // statements seems to be necessary for HP compilers. + DbLockNotGrantedException except(caller, op, mode, + obj, lock, index); + throw except; + } +} + +// static method +char *DbEnv::strerror(int error) +{ + return (db_strerror(error)); +} + +void DbEnv::_stream_error_function(const char *prefix, char *message) +{ + // HP compilers need the extra casts, we don't know why. + if (error_stream_) { + if (prefix) { + (*error_stream_) << prefix << (const char *)": "; + } + if (message) { + (*error_stream_) << (const char *)message; + } + (*error_stream_) << (const char *)"\n"; + } +} + +// set methods + +DBENV_METHOD_VOID(set_errfile, (FILE *errfile), (dbenv, errfile)) +DBENV_METHOD_VOID(set_errpfx, (const char *errpfx), (dbenv, errpfx)) + +// We keep these alphabetical by field name, +// for comparison with Java's list. +// +DBENV_METHOD(set_data_dir, (const char *dir), (dbenv, dir)) +DBENV_METHOD(set_encrypt, (const char *passwd, int flags), + (dbenv, passwd, flags)) +DBENV_METHOD(set_lg_bsize, (u_int32_t bsize), (dbenv, bsize)) +DBENV_METHOD(set_lg_dir, (const char *dir), (dbenv, dir)) +DBENV_METHOD(set_lg_max, (u_int32_t max), (dbenv, max)) +DBENV_METHOD(set_lg_regionmax, (u_int32_t regionmax), (dbenv, regionmax)) +DBENV_METHOD(set_lk_detect, (u_int32_t detect), (dbenv, detect)) +DBENV_METHOD(set_lk_max, (u_int32_t max), (dbenv, max)) +DBENV_METHOD(set_lk_max_lockers, (u_int32_t max_lockers), (dbenv, max_lockers)) +DBENV_METHOD(set_lk_max_locks, (u_int32_t max_locks), (dbenv, max_locks)) +DBENV_METHOD(set_lk_max_objects, (u_int32_t max_objects), (dbenv, max_objects)) +DBENV_METHOD(set_mp_mmapsize, (size_t mmapsize), (dbenv, mmapsize)) +DBENV_METHOD(set_tmp_dir, (const char *tmp_dir), (dbenv, tmp_dir)) +DBENV_METHOD(set_tx_max, (u_int32_t tx_max), (dbenv, tx_max)) + +DBENV_METHOD_QUIET(set_alloc, + (db_malloc_fcn_type malloc_fcn, db_realloc_fcn_type realloc_fcn, + db_free_fcn_type free_fcn), + (dbenv, malloc_fcn, realloc_fcn, free_fcn)) + +void DbEnv::set_app_private(void *value) +{ + unwrap(this)->app_private = value; +} + +DBENV_METHOD(set_cachesize, + (u_int32_t gbytes, u_int32_t bytes, int ncache), + (dbenv, gbytes, bytes, ncache)) + +void DbEnv::set_errcall(void (*arg)(const char *, char *)) +{ + DB_ENV *dbenv = unwrap(this); + + // XXX + // We are casting from a function ptr declared with C++ + // linkage to one (same arg types) declared with C + // linkage. It's hard to imagine a pair of C/C++ + // compilers from the same vendor for which this + // won't work. Unfortunately, we can't use a + // intercept function like the others since the + // function does not have a (DbEnv*) as one of + // the args. If this causes trouble, we can pull + // the same trick we use in Java, namely stuffing + // a (DbEnv*) pointer into the prefix. We're + // avoiding this for the moment because it obfuscates. + // + (*(dbenv->set_errcall))(dbenv, (db_errcall_fcn_type)arg); +} + +// Note: This actually behaves a bit like a static function, +// since DB_ENV.db_errcall has no information about which +// db_env triggered the call. A user that has multiple DB_ENVs +// will simply not be able to have different streams for each one. +// +void DbEnv::set_error_stream(__DB_OSTREAMCLASS *stream) +{ + DB_ENV *dbenv = unwrap(this); + + error_stream_ = stream; + dbenv->set_errcall(dbenv, (stream == 0) ? 0 : + _stream_error_function_c); +} + +int DbEnv::set_feedback(void (*arg)(DbEnv *, int, int)) +{ + DB_ENV *dbenv = unwrap(this); + + feedback_callback_ = arg; + + return ((*(dbenv->set_feedback))(dbenv, _feedback_intercept_c)); +} + +DBENV_METHOD(set_flags, (u_int32_t flags, int onoff), (dbenv, flags, onoff)) +DBENV_METHOD(set_lk_conflicts, (u_int8_t *lk_conflicts, int lk_max), + (dbenv, lk_conflicts, lk_max)) + +int DbEnv::set_paniccall(void (*arg)(DbEnv *, int)) +{ + DB_ENV *dbenv = unwrap(this); + + paniccall_callback_ = arg; + + return ((*(dbenv->set_paniccall))(dbenv, _paniccall_intercept_c)); +} + +DBENV_METHOD(set_rpc_server, + (void *cl, char *host, long tsec, long ssec, u_int32_t flags), + (dbenv, cl, host, tsec, ssec, flags)) +DBENV_METHOD(set_shm_key, (long shm_key), (dbenv, shm_key)) +// Note: this changes from last_known_error_policy to error_policy() +DBENV_METHOD(set_tas_spins, (u_int32_t arg), (dbenv, arg)) + +int DbEnv::set_app_dispatch + (int (*arg)(DbEnv *, Dbt *, DbLsn *, db_recops)) +{ + DB_ENV *dbenv = unwrap(this); + int ret; + + app_dispatch_callback_ = arg; + if ((ret = (*(dbenv->set_app_dispatch))(dbenv, + _app_dispatch_intercept_c)) != 0) + DB_ERROR("DbEnv::set_app_dispatch", ret, error_policy()); + + return (ret); +} + +DBENV_METHOD(set_tx_timestamp, (time_t *timestamp), (dbenv, timestamp)) +DBENV_METHOD(set_verbose, (u_int32_t which, int onoff), (dbenv, which, onoff)) + +int DbEnv::txn_begin(DbTxn *pid, DbTxn **tid, u_int32_t flags) +{ + DB_ENV *env = unwrap(this); + DB_TXN *txn; + int ret; + + ret = env->txn_begin(env, unwrap(pid), &txn, flags); + if (DB_RETOK_STD(ret)) + *tid = new DbTxn(txn); + else + DB_ERROR("DbEnv::txn_begin", ret, error_policy()); + + return (ret); +} + +DBENV_METHOD(txn_checkpoint, (u_int32_t kbyte, u_int32_t min, u_int32_t flags), + (dbenv, kbyte, min, flags)) + +int DbEnv::txn_recover(DbPreplist *preplist, long count, + long *retp, u_int32_t flags) +{ + DB_ENV *dbenv = unwrap(this); + DB_PREPLIST *c_preplist; + long i; + int ret; + + /* + * We need to allocate some local storage for the + * returned preplist, and that requires us to do + * our own argument validation. + */ + if (count <= 0) + ret = EINVAL; + else + ret = __os_malloc(dbenv, sizeof(DB_PREPLIST) * count, + &c_preplist); + + if (ret != 0) { + DB_ERROR("DbEnv::txn_recover", ret, error_policy()); + return (ret); + } + + if ((ret = + dbenv->txn_recover(dbenv, c_preplist, count, retp, flags)) != 0) { + __os_free(dbenv, c_preplist); + DB_ERROR("DbEnv::txn_recover", ret, error_policy()); + return (ret); + } + + for (i = 0; i < *retp; i++) { + preplist[i].txn = new DbTxn(); + preplist[i].txn->imp_ = wrap(c_preplist[i].txn); + memcpy(preplist[i].gid, c_preplist[i].gid, + sizeof(preplist[i].gid)); + } + + __os_free(dbenv, c_preplist); + + return (0); +} + +DBENV_METHOD(txn_stat, (DB_TXN_STAT **statp, u_int32_t flags), + (dbenv, statp, flags)) + +int DbEnv::set_rep_transport(u_int32_t myid, + int (*f_send)(DbEnv *, const Dbt *, const Dbt *, 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("DbEnv::set_rep_transport", ret, error_policy()); + + return (ret); +} + +DBENV_METHOD(rep_elect, + (int nsites, int pri, u_int32_t timeout, int *idp), + (dbenv, nsites, pri, timeout, idp)) + +int DbEnv::rep_process_message(Dbt *control, Dbt *rec, int *idp) +{ + DB_ENV *dbenv = unwrap(this); + int ret; + + ret = dbenv->rep_process_message(dbenv, control, rec, idp); + if (!DB_RETOK_REPPMSG(ret)) + DB_ERROR("DbEnv::rep_process_message", ret, error_policy()); + + return (ret); +} + +DBENV_METHOD(rep_start, + (Dbt *cookie, u_int32_t flags), + (dbenv, (DBT *)cookie, flags)) + +DBENV_METHOD(rep_stat, (DB_REP_STAT **statp, u_int32_t flags), + (dbenv, statp, flags)) + +DBENV_METHOD(set_rep_limit, (u_int32_t gbytes, u_int32_t bytes), + (dbenv, gbytes, bytes)) + +DBENV_METHOD(set_timeout, + (db_timeout_t timeout, u_int32_t flags), + (dbenv, timeout, flags)) + +// static method +char *DbEnv::version(int *major, int *minor, int *patch) +{ + return (db_version(major, minor, patch)); +} + +// static method +DbEnv *DbEnv::wrap_DB_ENV(DB_ENV *dbenv) +{ + DbEnv *wrapped_env = get_DbEnv(dbenv); + if (wrapped_env == NULL) + wrapped_env = new DbEnv(dbenv, 0); + return wrapped_env; +} diff --git a/bdb/cxx/cxx_except.cpp b/bdb/cxx/cxx_except.cpp index a62e21a767d..40fdeae69d6 100644 --- a/bdb/cxx/cxx_except.cpp +++ b/bdb/cxx/cxx_except.cpp @@ -1,20 +1,21 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: cxx_except.cpp,v 11.7 2000/09/21 15:05:45 dda Exp $"; +static const char revid[] = "$Id: cxx_except.cpp,v 11.17 2002/08/23 01:07:27 mjc Exp $"; #endif /* not lint */ #include +#include #include "db_cxx.h" -#include "cxx_int.h" +#include "dbinc/cxx_int.h" // tmpString is used to create strings on the stack // @@ -25,30 +26,7 @@ public: const char *str2 = 0, const char *str3 = 0, const char *str4 = 0, - const char *str5 = 0) - { - int len = strlen(str1); - if (str2) - len += strlen(str2); - if (str3) - len += strlen(str3); - if (str4) - len += strlen(str4); - if (str5) - len += strlen(str5); - - s_ = new char[len+1]; - - strcpy(s_, str1); - if (str2) - strcat(s_, str2); - if (str3) - strcat(s_, str3); - if (str4) - strcat(s_, str4); - if (str5) - strcat(s_, str5); - } + const char *str5 = 0); ~tmpString() { delete [] s_; } operator const char *() { return (s_); } @@ -56,6 +34,35 @@ private: char *s_; }; +tmpString::tmpString(const char *str1, + const char *str2, + const char *str3, + const char *str4, + const char *str5) +{ + size_t len = strlen(str1); + if (str2) + len += strlen(str2); + if (str3) + len += strlen(str3); + if (str4) + len += strlen(str4); + if (str5) + len += strlen(str5); + + s_ = new char[len+1]; + + strcpy(s_, str1); + if (str2) + strcat(s_, str2); + if (str3) + strcat(s_, str3); + if (str4) + strcat(s_, str4); + if (str5) + strcat(s_, str5); +} + // 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). @@ -100,7 +107,8 @@ DbException::DbException(const char *prefix, int err) DbException::DbException(const char *prefix1, const char *prefix2, int err) : err_(err) { - what_ = dupString(tmpString(prefix1, ": ", prefix2, ": ", db_strerror(err))); + what_ = dupString(tmpString(prefix1, ": ", prefix2, ": ", + db_strerror(err))); } DbException::DbException(const DbException &that) @@ -130,3 +138,193 @@ const char *DbException::what() const { return (what_); } + +//////////////////////////////////////////////////////////////////////// +// // +// DbMemoryException // +// // +//////////////////////////////////////////////////////////////////////// + +static const char *memory_err_desc = "Dbt not large enough for available data"; +DbMemoryException::~DbMemoryException() +{ +} + +DbMemoryException::DbMemoryException(Dbt *dbt) +: DbException(memory_err_desc, ENOMEM) +, dbt_(dbt) +{ +} + +DbMemoryException::DbMemoryException(const char *description) +: DbException(description, ENOMEM) +, dbt_(0) +{ +} + +DbMemoryException::DbMemoryException(const char *prefix, Dbt *dbt) +: DbException(prefix, memory_err_desc, ENOMEM) +, dbt_(dbt) +{ +} + +DbMemoryException::DbMemoryException(const char *prefix1, const char *prefix2, + Dbt *dbt) +: DbException(prefix1, prefix2, ENOMEM) +, dbt_(dbt) +{ +} + +DbMemoryException::DbMemoryException(const DbMemoryException &that) +: DbException(that) +, dbt_(that.dbt_) +{ +} + +DbMemoryException +&DbMemoryException::operator =(const DbMemoryException &that) +{ + if (this != &that) { + DbException::operator=(that); + dbt_ = that.dbt_; + } + return (*this); +} + +Dbt *DbMemoryException::get_dbt() const +{ + return (dbt_); +} + +//////////////////////////////////////////////////////////////////////// +// // +// DbDeadlockException // +// // +//////////////////////////////////////////////////////////////////////// + +DbDeadlockException::~DbDeadlockException() +{ +} + +DbDeadlockException::DbDeadlockException(const char *description) +: DbException(description, DB_LOCK_DEADLOCK) +{ +} + +DbDeadlockException::DbDeadlockException(const DbDeadlockException &that) +: DbException(that) +{ +} + +DbDeadlockException +&DbDeadlockException::operator =(const DbDeadlockException &that) +{ + if (this != &that) + DbException::operator=(that); + return (*this); +} + +//////////////////////////////////////////////////////////////////////// +// // +// DbLockNotGrantedException // +// // +//////////////////////////////////////////////////////////////////////// + +DbLockNotGrantedException::~DbLockNotGrantedException() +{ + delete lock_; +} + +DbLockNotGrantedException::DbLockNotGrantedException(const char *prefix, + db_lockop_t op, db_lockmode_t mode, const Dbt *obj, const DbLock lock, + int index) +: DbException(prefix, DbEnv::strerror(DB_LOCK_NOTGRANTED), + DB_LOCK_NOTGRANTED) +, op_(op) +, mode_(mode) +, obj_(obj) +, index_(index) +{ + lock_ = new DbLock(lock); +} + +DbLockNotGrantedException::DbLockNotGrantedException + (const DbLockNotGrantedException &that) +: DbException(that) +{ + op_ = that.op_; + mode_ = that.mode_; + obj_ = that.obj_; + lock_ = new DbLock(*that.lock_); + index_ = that.index_; +} + +DbLockNotGrantedException +&DbLockNotGrantedException::operator =(const DbLockNotGrantedException &that) +{ + if (this != &that) { + DbException::operator=(that); + op_ = that.op_; + mode_ = that.mode_; + obj_ = that.obj_; + lock_ = new DbLock(*that.lock_); + index_ = that.index_; + } + return (*this); +} + +db_lockop_t DbLockNotGrantedException::get_op() const +{ + return op_; +} + +db_lockmode_t DbLockNotGrantedException::get_mode() const +{ + return mode_; +} + +const Dbt* DbLockNotGrantedException::get_obj() const +{ + return obj_; +} + +DbLock* DbLockNotGrantedException::get_lock() const +{ + return lock_; +} + +int DbLockNotGrantedException::get_index() const +{ + return index_; +} + + + +//////////////////////////////////////////////////////////////////////// +// // +// DbRunRecoveryException // +// // +//////////////////////////////////////////////////////////////////////// + +DbRunRecoveryException::~DbRunRecoveryException() +{ +} + +DbRunRecoveryException::DbRunRecoveryException(const char *description) +: DbException(description, DB_RUNRECOVERY) +{ +} + +DbRunRecoveryException::DbRunRecoveryException + (const DbRunRecoveryException &that) +: DbException(that) +{ +} + +DbRunRecoveryException +&DbRunRecoveryException::operator =(const DbRunRecoveryException &that) +{ + if (this != &that) + DbException::operator=(that); + return (*this); +} diff --git a/bdb/cxx/cxx_lock.cpp b/bdb/cxx/cxx_lock.cpp index e8ce2aa9d30..446eba49e27 100644 --- a/bdb/cxx/cxx_lock.cpp +++ b/bdb/cxx/cxx_lock.cpp @@ -1,86 +1,21 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: cxx_lock.cpp,v 11.9 2000/09/21 15:05:45 dda Exp $"; +static const char revid[] = "$Id: cxx_lock.cpp,v 11.17 2002/03/27 04:31:16 bostic Exp $"; #endif /* not lint */ #include #include #include "db_cxx.h" -#include "cxx_int.h" - -int DbEnv::lock_detect(u_int32_t flags, u_int32_t atype, int *aborted) -{ - DB_ENV *env = unwrap(this); - int err; - - if ((err = ::lock_detect(env, flags, atype, aborted)) != 0) { - DB_ERROR("DbEnv::lock_detect", err, error_policy()); - return (err); - } - return (err); -} - -int DbEnv::lock_get(u_int32_t locker, u_int32_t flags, const Dbt *obj, - db_lockmode_t lock_mode, DbLock *lock) -{ - DB_ENV *env = unwrap(this); - int err; - - if ((err = ::lock_get(env, locker, flags, obj, - lock_mode, &lock->lock_)) != 0) { - DB_ERROR("DbEnv::lock_get", err, error_policy()); - return (err); - } - return (err); -} - -int DbEnv::lock_id(u_int32_t *idp) -{ - DB_ENV *env = unwrap(this); - int err; - - if ((err = ::lock_id(env, idp)) != 0) { - DB_ERROR("DbEnv::lock_id", err, error_policy()); - } - return (err); -} - -int DbEnv::lock_stat(DB_LOCK_STAT **statp, - db_malloc_fcn_type db_malloc_fcn) -{ - DB_ENV *env = unwrap(this); - int err; - - if ((err = ::lock_stat(env, statp, db_malloc_fcn)) != 0) { - DB_ERROR("DbEnv::lock_stat", err, error_policy()); - return (err); - } - return (0); -} - -int DbEnv::lock_vec(u_int32_t locker, u_int32_t flags, - DB_LOCKREQ list[], - int nlist, DB_LOCKREQ **elist_returned) -{ - DB_ENV *env = unwrap(this); - int err; - - if ((err = ::lock_vec(env, locker, flags, list, - nlist, elist_returned)) != 0) { - DB_ERROR("DbEnv::lock_vec", err, error_policy()); - return (err); - } - return (err); -} +#include "dbinc/cxx_int.h" //////////////////////////////////////////////////////////////////////// // // @@ -108,18 +43,3 @@ DbLock &DbLock::operator = (const DbLock &that) lock_ = that.lock_; return (*this); } - -int DbLock::put(DbEnv *env) -{ - DB_ENV *envp = unwrap(env); - - if (!env) { - return (EINVAL); // handle never assigned - } - - int err; - if ((err = lock_put(envp, &lock_)) != 0) { - DB_ERROR("DbLock::put", err, env->error_policy()); - } - return (err); -} diff --git a/bdb/cxx/cxx_log.cpp b/bdb/cxx/cxx_log.cpp deleted file mode 100644 index 336b9d337f0..00000000000 --- a/bdb/cxx/cxx_log.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/*- - * See the file LICENSE for redistribution information. - * - * Copyright (c) 1997, 1998, 1999, 2000 - * Sleepycat Software. All rights reserved. - */ - -#include "db_config.h" - -#ifndef lint -static const char revid[] = "$Id: cxx_log.cpp,v 11.9 2000/09/21 15:05:45 dda Exp $"; -#endif /* not lint */ - -#include - -#include "db_cxx.h" -#include "cxx_int.h" - -//////////////////////////////////////////////////////////////////////// -// // -// DbLog // -// // -//////////////////////////////////////////////////////////////////////// - -int DbEnv::log_archive(char **list[], u_int32_t flags, - db_malloc_fcn_type db_malloc_fcn) -{ - int err; - DB_ENV *env = unwrap(this); - - if ((err = ::log_archive(env, list, flags, db_malloc_fcn)) != 0) { - DB_ERROR("DbEnv::log_archive", err, error_policy()); - return (err); - } - return (0); -} - -int DbEnv::log_compare(const DbLsn *lsn0, const DbLsn *lsn1) -{ - return (::log_compare(lsn0, lsn1)); -} - -int DbEnv::log_file(DbLsn *lsn, char *namep, size_t len) -{ - int err; - DB_ENV *env = unwrap(this); - - if ((err = ::log_file(env, lsn, namep, len)) != 0) { - DB_ERROR("DbEnv::log_file", err, error_policy()); - return (err); - } - return (0); -} - -int DbEnv::log_flush(const DbLsn *lsn) -{ - int err; - DB_ENV *env = unwrap(this); - - if ((err = ::log_flush(env, lsn)) != 0) { - DB_ERROR("DbEnv::log_flush", err, error_policy()); - return (err); - } - return (0); -} - -int DbEnv::log_get(DbLsn *lsn, Dbt *data, u_int32_t flags) -{ - int err; - DB_ENV *env = unwrap(this); - - if ((err = ::log_get(env, lsn, data, flags)) != 0) { - DB_ERROR("DbEnv::log_get", err, error_policy()); - return (err); - } - return (0); -} - -int DbEnv::log_put(DbLsn *lsn, const Dbt *data, u_int32_t flags) -{ - int err = 0; - DB_ENV *env = unwrap(this); - - if ((err = ::log_put(env, lsn, data, flags)) != 0) { - DB_ERROR("DbEnv::log_put", err, error_policy()); - return (err); - } - return (0); -} - -int DbEnv::log_register(Db *dbp, const char *name) -{ - int err = 0; - DB_ENV *env = unwrap(this); - - if ((err = ::log_register(env, unwrap(dbp), name)) != 0) { - DB_ERROR("DbEnv::log_register", err, error_policy()); - return (err); - } - return (0); -} - -int DbEnv::log_stat(DB_LOG_STAT **spp, db_malloc_fcn_type db_malloc_fcn) -{ - int err = 0; - DB_ENV *env = unwrap(this); - - if ((err = ::log_stat(env, spp, db_malloc_fcn)) != 0) { - DB_ERROR("DbEnv::log_stat", err, error_policy()); - return (err); - } - return (0); -} - -int DbEnv::log_unregister(Db *dbp) -{ - int err; - DB_ENV *env = unwrap(this); - - if ((err = ::log_unregister(env, unwrap(dbp))) != 0) { - DB_ERROR("DbEnv::log_unregister", err, error_policy()); - return (err); - } - return (0); -} diff --git a/bdb/cxx/cxx_logc.cpp b/bdb/cxx/cxx_logc.cpp new file mode 100644 index 00000000000..d1fe83dd58b --- /dev/null +++ b/bdb/cxx/cxx_logc.cpp @@ -0,0 +1,65 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: cxx_logc.cpp,v 11.8 2002/07/03 21:03:53 bostic Exp $"; +#endif /* not lint */ + +#include +#include + +#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" +#include "dbinc/db_dispatch.h" +#include "dbinc_auto/db_ext.h" +#include "dbinc_auto/common_ext.h" + +// It's private, and should never be called, +// but some compilers need it resolved +// +DbLogc::~DbLogc() +{ +} + +// The name _flags prevents a name clash with __db_log_cursor::flags +int DbLogc::close(u_int32_t _flags) +{ + DB_LOGC *logc = this; + int ret; + + ret = logc->close(logc, _flags); + + if (!DB_RETOK_STD(ret)) + DB_ERROR("DbLogc::close", ret, ON_ERROR_UNKNOWN); + + return (ret); +} + +// The name _flags prevents a name clash with __db_log_cursor::flags +int DbLogc::get(DbLsn *lsn, Dbt *data, u_int32_t _flags) +{ + DB_LOGC *logc = this; + int ret; + + ret = logc->get(logc, lsn, data, _flags); + + if (!DB_RETOK_LGGET(ret)) { + if (ret == ENOMEM && DB_OVERFLOWED_DBT(data)) + DB_ERROR_DBT("DbLogc::get", data, ON_ERROR_UNKNOWN); + else + DB_ERROR("DbLogc::get", ret, ON_ERROR_UNKNOWN); + } + + return (ret); +} diff --git a/bdb/cxx/cxx_mpool.cpp b/bdb/cxx/cxx_mpool.cpp index 22f4735e333..3eb78d03ff4 100644 --- a/bdb/cxx/cxx_mpool.cpp +++ b/bdb/cxx/cxx_mpool.cpp @@ -1,20 +1,51 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: cxx_mpool.cpp,v 11.11 2000/09/21 15:05:45 dda Exp $"; +static const char revid[] = "$Id: cxx_mpool.cpp,v 11.20 2002/07/03 21:03:53 bostic Exp $"; #endif /* not lint */ #include #include "db_cxx.h" -#include "cxx_int.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 +// list element (e.g., "char *arg") and that _arglist is the arguments +// that should be passed through to the C method (e.g., "(mpf, arg)") +// +#define DB_MPOOLFILE_METHOD(_name, _argspec, _arglist, _retok) \ +int DbMpoolFile::_name _argspec \ +{ \ + int ret; \ + DB_MPOOLFILE *mpf = unwrap(this); \ + \ + if (mpf == NULL) \ + ret = EINVAL; \ + else \ + ret = mpf->_name _arglist; \ + if (!_retok(ret)) \ + DB_ERROR("DbMpoolFile::"#_name, ret, ON_ERROR_UNKNOWN); \ + return (ret); \ +} + +#define DB_MPOOLFILE_METHOD_VOID(_name, _argspec, _arglist) \ +void DbMpoolFile::_name _argspec \ +{ \ + DB_MPOOLFILE *mpf = unwrap(this); \ + \ + mpf->_name _arglist; \ +} //////////////////////////////////////////////////////////////////////// // // @@ -31,150 +62,49 @@ DbMpoolFile::~DbMpoolFile() { } -int DbMpoolFile::open(DbEnv *envp, const char *file, - u_int32_t flags, int mode, size_t pagesize, - DB_MPOOL_FINFO *finfop, DbMpoolFile **result) -{ - int err; - - DB_MPOOLFILE *mpf; - DB_ENV *env = unwrap(envp); - - if ((err = ::memp_fopen(env, file, flags, mode, pagesize, - finfop, &mpf)) != 0) { - DB_ERROR("DbMpoolFile::open", err, envp->error_policy()); - return (err); - } - *result = new DbMpoolFile(); - (*result)->imp_ = wrap(mpf); - return (0); -} - -int DbMpoolFile::close() +int DbMpoolFile::close(u_int32_t flags) { DB_MPOOLFILE *mpf = unwrap(this); - int err = 0; - if (!mpf) { - err = EINVAL; - } - else if ((err = ::memp_fclose(mpf)) != 0) { - DB_ERROR("DbMpoolFile::close", err, ON_ERROR_UNKNOWN); - return (err); - } + int ret; + + if (mpf == NULL) + ret = EINVAL; + else + ret = mpf->close(mpf, flags); + imp_ = 0; // extra safety // This may seem weird, but is legal as long as we don't access // any data before returning. - // delete this; - return (0); + + if (!DB_RETOK_STD(ret)) + DB_ERROR("DbMpoolFile::close", ret, ON_ERROR_UNKNOWN); + + return (ret); } -int DbMpoolFile::get(db_pgno_t *pgnoaddr, u_int32_t flags, void *pagep) -{ - DB_MPOOLFILE *mpf = unwrap(this); - int err = 0; - if (!mpf) { - err = EINVAL; - } - else if ((err = ::memp_fget(mpf, pgnoaddr, flags, pagep)) != 0) { - DB_ERROR("DbMpoolFile::get", err, ON_ERROR_UNKNOWN); - } - return (err); -} - -int DbMpoolFile::put(void *pgaddr, u_int32_t flags) -{ - DB_MPOOLFILE *mpf = unwrap(this); - int err = 0; - if (!mpf) { - err = EINVAL; - } - else if ((err = ::memp_fput(mpf, pgaddr, flags)) != 0) { - DB_ERROR("DbMpoolFile::put", err, ON_ERROR_UNKNOWN); - } - return (err); -} - -int DbMpoolFile::set(void *pgaddr, u_int32_t flags) -{ - DB_MPOOLFILE *mpf = unwrap(this); - int err = 0; - if (!mpf) { - err = EINVAL; - } - else if ((err = ::memp_fset(mpf, pgaddr, flags)) != 0) { - DB_ERROR("DbMpoolFile::set", err, ON_ERROR_UNKNOWN); - } - return (err); -} - -int DbMpoolFile::sync() -{ - DB_MPOOLFILE *mpf = unwrap(this); - int err = 0; - if (!mpf) { - err = EINVAL; - } - else if ((err = ::memp_fsync(mpf)) != 0 && err != DB_INCOMPLETE) { - DB_ERROR("DbMpoolFile::sync", err, ON_ERROR_UNKNOWN); - } - return (err); -} - -//////////////////////////////////////////////////////////////////////// -// // -// DbMpool // -// // -//////////////////////////////////////////////////////////////////////// - -int DbEnv::memp_register(int ftype, - pgin_fcn_type pgin_fcn, - pgout_fcn_type pgout_fcn) -{ - DB_ENV *env = unwrap(this); - int err = 0; - - if ((err = ::memp_register(env, ftype, pgin_fcn, pgout_fcn)) != 0) { - DB_ERROR("DbEnv::memp_register", err, error_policy()); - return (err); - } - return (err); -} - -int DbEnv::memp_stat(DB_MPOOL_STAT **gsp, DB_MPOOL_FSTAT ***fsp, - db_malloc_fcn_type db_malloc_fcn) -{ - DB_ENV *env = unwrap(this); - int err = 0; - - if ((err = ::memp_stat(env, gsp, fsp, db_malloc_fcn)) != 0) { - DB_ERROR("DbEnv::memp_stat", err, error_policy()); - return (err); - } - return (err); -} - -int DbEnv::memp_sync(DbLsn *sn) -{ - DB_ENV *env = unwrap(this); - int err = 0; - - if ((err = ::memp_sync(env, sn)) != 0 && err != DB_INCOMPLETE) { - DB_ERROR("DbEnv::memp_sync", err, error_policy()); - return (err); - } - return (err); -} - -int DbEnv::memp_trickle(int pct, int *nwrotep) -{ - DB_ENV *env = unwrap(this); - int err = 0; - - if ((err = ::memp_trickle(env, pct, nwrotep)) != 0) { - DB_ERROR("DbEnv::memp_trickle", err, error_policy()); - return (err); - } - return (err); -} +DB_MPOOLFILE_METHOD(get, (db_pgno_t *pgnoaddr, u_int32_t flags, void *pagep), + (mpf, pgnoaddr, flags, pagep), DB_RETOK_MPGET) +DB_MPOOLFILE_METHOD_VOID(last_pgno, (db_pgno_t *pgnoaddr), (mpf, pgnoaddr)) +DB_MPOOLFILE_METHOD(open, + (const char *file, u_int32_t flags, int mode, size_t pagesize), + (mpf, file, flags, mode, pagesize), DB_RETOK_STD) +DB_MPOOLFILE_METHOD(put, (void *pgaddr, u_int32_t flags), + (mpf, pgaddr, flags), DB_RETOK_STD) +DB_MPOOLFILE_METHOD_VOID(refcnt, (db_pgno_t *pgnoaddr), (mpf, pgnoaddr)) +DB_MPOOLFILE_METHOD(set, (void *pgaddr, u_int32_t flags), + (mpf, pgaddr, flags), DB_RETOK_STD) +DB_MPOOLFILE_METHOD(set_clear_len, (u_int32_t len), + (mpf, len), DB_RETOK_STD) +DB_MPOOLFILE_METHOD(set_fileid, (u_int8_t *fileid), + (mpf, fileid), DB_RETOK_STD) +DB_MPOOLFILE_METHOD(set_ftype, (int ftype), + (mpf, ftype), DB_RETOK_STD) +DB_MPOOLFILE_METHOD(set_lsn_offset, (int32_t offset), + (mpf, offset), DB_RETOK_STD) +DB_MPOOLFILE_METHOD(set_pgcookie, (DBT *dbt), + (mpf, dbt), DB_RETOK_STD) +DB_MPOOLFILE_METHOD_VOID(set_unlink, (int ul), (mpf, ul)) +DB_MPOOLFILE_METHOD(sync, (), + (mpf), DB_RETOK_STD) diff --git a/bdb/cxx/cxx_table.cpp b/bdb/cxx/cxx_table.cpp deleted file mode 100644 index b7b335d26e9..00000000000 --- a/bdb/cxx/cxx_table.cpp +++ /dev/null @@ -1,808 +0,0 @@ -/*- - * See the file LICENSE for redistribution information. - * - * Copyright (c) 1997, 1998, 1999, 2000 - * Sleepycat Software. All rights reserved. - */ - -#include "db_config.h" - -#ifndef lint -static const char revid[] = "$Id: cxx_table.cpp,v 11.35 2001/01/11 18:19:49 bostic Exp $"; -#endif /* not lint */ - -#include -#include - -#include "db_cxx.h" -#include "cxx_int.h" - -#include "db_int.h" -#include "db_page.h" -#include "db_ext.h" -#include "common_ext.h" - -//////////////////////////////////////////////////////////////////////// -// // -// Db // -// // -//////////////////////////////////////////////////////////////////////// - -// 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 handle is invalid and -// no operations are permitted on the Db (other than -// destructor). Leaving the Db handle open and not -// doing a close is generally considered an error. -// -// We used to allow Db objects to be closed and reopened. -// This implied always keeping a valid DB object, and -// coordinating the open objects between Db/DbEnv turned -// out to be overly complicated. Now we do not allow this. - -Db::Db(DbEnv *env, u_int32_t flags) -: imp_(0) -, env_(env) -, construct_error_(0) -, flags_(0) -, construct_flags_(flags) -{ - if (env_ == 0) - flags_ |= DB_CXX_PRIVATE_ENV; - initialize(); -} - -// Note: if the user has not closed, we call _destroy_check -// to warn against this non-safe programming practice. -// We can't close, because the environment may already -// be closed/destroyed. -// -Db::~Db() -{ - DB *db; - - db = unwrap(this); - if (db != NULL) { - DbEnv::_destroy_check("Db", 0); - cleanup(); - } -} - -// private method to initialize during constructor. -// initialize must create a backing DB object, -// and if that creates a new DB_ENV, it must be tied to a new DbEnv. -// If there is an error, construct_error_ is set; this is examined -// during open. -// -int Db::initialize() -{ - u_int32_t cxx_flags; - DB *db; - int err; - DB_ENV *cenv = unwrap(env_); - - cxx_flags = construct_flags_ & DB_CXX_NO_EXCEPTIONS; - - // Create a new underlying DB object. - // We rely on the fact that if a NULL DB_ENV* is given, - // one is allocated by DB. - // - if ((err = db_create(&db, cenv, - construct_flags_ & ~cxx_flags)) != 0) { - construct_error_ = err; - return (err); - } - - // Associate the DB with this object - imp_ = wrap(db); - db->cj_internal = this; - - // Create a new DbEnv from a DB_ENV* if it was created locally. - // It is deleted in Db::close(). - // - if ((flags_ & DB_CXX_PRIVATE_ENV) != 0) - env_ = new DbEnv(db->dbenv, cxx_flags); - - return (0); -} - -// 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. -// -void Db::cleanup() -{ - DB *db = unwrap(this); - - if (db != NULL) { - // extra safety - db->cj_internal = 0; - imp_ = 0; - - // we must dispose of the DbEnv object if - // we created it. This will be the case - // if a NULL DbEnv was passed into the constructor. - // The underlying DB_ENV object will be inaccessible - // after the close, so we must clean it up now. - // - if ((flags_ & DB_CXX_PRIVATE_ENV) != 0) { - env_->cleanup(); - delete env_; - env_ = 0; - } - } - construct_error_ = 0; -} - -// Return a tristate value corresponding to whether we should -// throw exceptions on errors: -// ON_ERROR_RETURN -// ON_ERROR_THROW -// ON_ERROR_UNKNOWN -// -int Db::error_policy() -{ - if (env_ != NULL) - return (env_->error_policy()); - else { - // If the env_ is null, that means that the user - // did not attach an environment, so the correct error - // policy can be deduced from constructor flags - // for this Db. - // - if ((construct_flags_ & DB_CXX_NO_EXCEPTIONS) != 0) { - return (ON_ERROR_RETURN); - } - else { - return (ON_ERROR_THROW); - } - } -} - -int Db::close(u_int32_t flags) -{ - DB *db = unwrap(this); - int err; - - // after a DB->close (no matter if success or failure), - // the underlying DB object must not be accessed, - // so we clean up in advance. - // - cleanup(); - - // It's safe to throw an error after the close, - // since our error mechanism does not peer into - // the DB* structures. - // - if ((err = db->close(db, flags)) != 0 && err != DB_INCOMPLETE) - DB_ERROR("Db::close", err, error_policy()); - - return (err); -} - -int Db::cursor(DbTxn *txnid, Dbc **cursorp, u_int32_t flags) -{ - DB *db = unwrap(this); - DBC *dbc = 0; - int err; - - if ((err = db->cursor(db, unwrap(txnid), &dbc, flags)) != 0) { - DB_ERROR("Db::cursor", err, error_policy()); - return (err); - } - - // The following cast implies that Dbc can be no larger than DBC - *cursorp = (Dbc*)dbc; - return (0); -} - -int Db::del(DbTxn *txnid, Dbt *key, u_int32_t flags) -{ - DB *db = unwrap(this); - int err; - - if ((err = db->del(db, unwrap(txnid), key, flags)) != 0) { - // DB_NOTFOUND is a "normal" return, so should not be - // thrown as an error - // - if (err != DB_NOTFOUND) { - DB_ERROR("Db::del", err, error_policy()); - return (err); - } - } - return (err); -} - -void Db::err(int error, const char *format, ...) -{ - va_list args; - DB *db = unwrap(this); - - va_start(args, format); - __db_real_err(db->dbenv, error, 1, 1, format, args); - va_end(args); -} - -void Db::errx(const char *format, ...) -{ - va_list args; - DB *db = unwrap(this); - - va_start(args, format); - __db_real_err(db->dbenv, 0, 0, 1, format, args); - va_end(args); -} - -int Db::fd(int *fdp) -{ - DB *db = unwrap(this); - int err; - - if ((err = db->fd(db, fdp)) != 0) { - DB_ERROR("Db::fd", err, error_policy()); - return (err); - } - return (0); -} - -// This is a 'glue' function declared as extern "C" so it will -// be compatible with picky compilers that do not allow mixing -// of function pointers to 'C' functions with function pointers -// to C++ functions. -// -extern "C" -void _db_feedback_intercept_c(DB *db, int opcode, int pct) -{ - Db::_feedback_intercept(db, opcode, pct); -} - -//static -void Db::_feedback_intercept(DB *db, int opcode, int pct) -{ - if (db == 0) { - DB_ERROR("Db::feedback_callback", EINVAL, ON_ERROR_UNKNOWN); - return; - } - Db *cxxdb = (Db *)db->cj_internal; - if (cxxdb == 0) { - DB_ERROR("Db::feedback_callback", EINVAL, ON_ERROR_UNKNOWN); - return; - } - if (cxxdb->feedback_callback_ == 0) { - DB_ERROR("Db::feedback_callback", EINVAL, cxxdb->error_policy()); - return; - } - (*cxxdb->feedback_callback_)(cxxdb, opcode, pct); -} - -int Db::set_feedback(void (*arg)(Db *, int, int)) -{ - DB *db = unwrap(this); - - feedback_callback_ = arg; - - return ((*(db->set_feedback))(db, _db_feedback_intercept_c)); -} - -// This is a 'glue' function declared as extern "C" so it will -// be compatible with picky compilers that do not allow mixing -// of function pointers to 'C' functions with function pointers -// to C++ functions. -// -extern "C" -int _db_append_recno_intercept_c(DB *db, DBT *data, db_recno_t recno) -{ - return (Db::_append_recno_intercept(db, data, recno)); -} - -//static -int Db::_append_recno_intercept(DB *db, DBT *data, db_recno_t recno) -{ - int err; - - if (db == 0) { - DB_ERROR("Db::append_recno_callback", EINVAL, ON_ERROR_UNKNOWN); - return (EINVAL); - } - Db *cxxdb = (Db *)db->cj_internal; - if (cxxdb == 0) { - DB_ERROR("Db::append_recno_callback", EINVAL, ON_ERROR_UNKNOWN); - return (EINVAL); - } - if (cxxdb->append_recno_callback_ == 0) { - DB_ERROR("Db::append_recno_callback", EINVAL, cxxdb->error_policy()); - return (EINVAL); - } - - // making these copies is slow but portable. - // Another alternative is to cast the DBT* manufactured - // by the C layer to a Dbt*. It 'should be' safe since - // Dbt is a thin shell over DBT, adding no extra data, - // but is nonportable, and could lead to errors if anything - // were added to the Dbt class. - // - Dbt cxxdbt; - memcpy((DBT *)&cxxdbt, data, sizeof(DBT)); - err = (*cxxdb->append_recno_callback_)(cxxdb, &cxxdbt, recno); - memcpy(data, (DBT *)&cxxdbt, sizeof(DBT)); - return (err); -} - -int Db::set_append_recno(int (*arg)(Db *, Dbt *, db_recno_t)) -{ - DB *db = unwrap(this); - - append_recno_callback_ = arg; - - return ((*(db->set_append_recno))(db, _db_append_recno_intercept_c)); -} - -int Db::get(DbTxn *txnid, Dbt *key, Dbt *value, u_int32_t flags) -{ - DB *db = unwrap(this); - int err; - - if ((err = db->get(db, unwrap(txnid), key, value, flags)) != 0) { - // DB_NOTFOUND and DB_KEYEMPTY are "normal" returns, - // so should not be thrown as an error - // - if (err != DB_NOTFOUND && err != DB_KEYEMPTY) { - DB_ERROR("Db::get", err, error_policy()); - return (err); - } - } - return (err); -} - -int Db::get_byteswapped() const -{ - DB *db = (DB *)unwrapConst(this); - return (db->get_byteswapped(db)); -} - -DBTYPE Db::get_type() const -{ - DB *db = (DB *)unwrapConst(this); - return ((DBTYPE)db->get_type(db)); -} - -int Db::join(Dbc **curslist, Dbc **cursorp, u_int32_t flags) -{ - // Dbc is a "compatible" subclass of DBC - - // that is, no virtual functions or even extra data members, - // so this cast, although technically non-portable, - // "should" always be okay. - // - DBC **list = (DBC **)(curslist); - DB *db = unwrap(this); - DBC *dbc = 0; - int err; - - if ((err = db->join(db, list, &dbc, flags)) != 0) { - DB_ERROR("Db::join_cursor", err, error_policy()); - return (err); - } - *cursorp = (Dbc*)dbc; - return (0); -} - -int Db::key_range(DbTxn *txnid, Dbt *key, - DB_KEY_RANGE *results, u_int32_t flags) -{ - DB *db = unwrap(this); - int err; - - if ((err = db->key_range(db, unwrap(txnid), key, - results, flags)) != 0) { - DB_ERROR("Db::key_range", err, error_policy()); - return (err); - } - return (0); -} - -// If an error occurred during the constructor, report it now. -// Otherwise, call the underlying DB->open method. -// -int Db::open(const char *file, const char *database, - DBTYPE type, u_int32_t flags, int mode) -{ - int err; - DB *db = unwrap(this); - - if ((err = construct_error_) != 0) - DB_ERROR("Db::open", construct_error_, error_policy()); - else if ((err = db->open(db, file, database, type, flags, mode)) != 0) - DB_ERROR("Db::open", err, error_policy()); - - return (err); -} - -int Db::put(DbTxn *txnid, Dbt *key, Dbt *value, u_int32_t flags) -{ - int err; - DB *db = unwrap(this); - - if ((err = db->put(db, unwrap(txnid), key, value, flags)) != 0) { - - // DB_KEYEXIST is a "normal" return, so should not be - // thrown as an error - // - if (err != DB_KEYEXIST) { - DB_ERROR("Db::put", err, error_policy()); - return (err); - } - } - return (err); -} - -int Db::rename(const char *file, const char *database, - const char *newname, u_int32_t flags) -{ - int err = 0; - DB *db = unwrap(this); - - if (!db) { - DB_ERROR("Db::rename", EINVAL, error_policy()); - return (EINVAL); - } - - // after a DB->rename (no matter if success or failure), - // the underlying DB object must not be accessed, - // so we clean up in advance. - // - cleanup(); - - if ((err = db->rename(db, file, database, newname, flags)) != 0) { - DB_ERROR("Db::rename", err, error_policy()); - return (err); - } - return (0); -} - -int Db::remove(const char *file, const char *database, u_int32_t flags) -{ - int err = 0; - DB *db = unwrap(this); - - if (!db) { - DB_ERROR("Db::remove", EINVAL, error_policy()); - return (EINVAL); - } - - // after a DB->remove (no matter if success or failure), - // the underlying DB object must not be accessed, - // so we clean up in advance. - // - cleanup(); - - if ((err = db->remove(db, file, database, flags)) != 0) - DB_ERROR("Db::remove", err, error_policy()); - - return (err); -} - -int Db::stat(void *sp, db_malloc_fcn_type db_malloc_fcn, u_int32_t flags) -{ - int err; - DB *db = unwrap(this); - - if (!db) { - DB_ERROR("Db::stat", EINVAL, error_policy()); - return (EINVAL); - } - if ((err = db->stat(db, sp, db_malloc_fcn, flags)) != 0) { - DB_ERROR("Db::stat", err, error_policy()); - return (err); - } - return (0); -} - -int Db::sync(u_int32_t flags) -{ - int err; - DB *db = unwrap(this); - - if (!db) { - DB_ERROR("Db::sync", EINVAL, error_policy()); - return (EINVAL); - } - if ((err = db->sync(db, flags)) != 0 && err != DB_INCOMPLETE) { - DB_ERROR("Db::sync", err, error_policy()); - return (err); - } - return (err); -} - -int Db::upgrade(const char *name, u_int32_t flags) -{ - int err; - DB *db = unwrap(this); - - if (!db) { - DB_ERROR("Db::upgrade", EINVAL, error_policy()); - return (EINVAL); - } - if ((err = db->upgrade(db, name, flags)) != 0) { - DB_ERROR("Db::upgrade", err, error_policy()); - return (err); - } - return (0); -} - -static int _verify_callback_cxx(void *handle, const void *str_arg) -{ - char *str; - ostream *out; - - str = (char *)str_arg; - out = (ostream *)handle; - - (*out) << str; - if (out->fail()) - return (EIO); - - return (0); -} - -// This is a 'glue' function declared as extern "C" so it will -// be compatible with picky compilers that do not allow mixing -// of function pointers to 'C' functions with function pointers -// to C++ functions. -// -extern "C" -int _verify_callback_c(void *handle, const void *str_arg) -{ - return (_verify_callback_cxx(handle, str_arg)); -} - -int Db::verify(const char *name, const char *subdb, - ostream *ostr, u_int32_t flags) -{ - int err; - DB *db = unwrap(this); - - if (!db) { - DB_ERROR("Db::verify", EINVAL, error_policy()); - return (EINVAL); - } - if ((err = __db_verify_internal(db, name, subdb, ostr, - _verify_callback_c, flags)) != 0) { - DB_ERROR("Db::verify", err, error_policy()); - return (err); - } - return (0); -} - -// This is a variant of the DB_WO_ACCESS macro to define a simple set_ -// method calling the underlying C method, but unlike a simple -// set method, it may return an error or raise an exception. -// Note this macro expects that input _argspec is an argument -// list element (e.g. "char *arg") defined in terms of "arg". -// -#define DB_DB_ACCESS(_name, _argspec) \ -\ -int Db::set_##_name(_argspec) \ -{ \ - int ret; \ - DB *db = unwrap(this); \ - \ - if ((ret = (*(db->set_##_name))(db, arg)) != 0) { \ - DB_ERROR("Db::set_" # _name, ret, error_policy()); \ - } \ - return (ret); \ -} - -#define DB_DB_ACCESS_NORET(_name, _argspec) \ - \ -void Db::set_##_name(_argspec) \ -{ \ - DB *db = unwrap(this); \ - \ - (*(db->set_##_name))(db, arg); \ - return; \ -} - -DB_DB_ACCESS(bt_compare, bt_compare_fcn_type arg) -DB_DB_ACCESS(bt_maxkey, u_int32_t arg) -DB_DB_ACCESS(bt_minkey, u_int32_t arg) -DB_DB_ACCESS(bt_prefix, bt_prefix_fcn_type arg) -DB_DB_ACCESS(dup_compare, dup_compare_fcn_type arg) -DB_DB_ACCESS_NORET(errfile, FILE *arg) -DB_DB_ACCESS_NORET(errpfx, const char *arg) -DB_DB_ACCESS(flags, u_int32_t arg) -DB_DB_ACCESS(h_ffactor, u_int32_t arg) -DB_DB_ACCESS(h_hash, h_hash_fcn_type arg) -DB_DB_ACCESS(h_nelem, u_int32_t arg) -DB_DB_ACCESS(lorder, int arg) -DB_DB_ACCESS(malloc, db_malloc_fcn_type arg) -DB_DB_ACCESS(pagesize, u_int32_t arg) -DB_DB_ACCESS(realloc, db_realloc_fcn_type arg) -DB_DB_ACCESS(re_delim, int arg) -DB_DB_ACCESS(re_len, u_int32_t arg) -DB_DB_ACCESS(re_pad, int arg) -DB_DB_ACCESS(re_source, char *arg) -DB_DB_ACCESS(q_extentsize, u_int32_t arg) - -// Here are the set methods that don't fit the above mold. -// - -void Db::set_errcall(void (*arg)(const char *, char *)) -{ - env_->set_errcall(arg); -} - -int Db::set_cachesize(u_int32_t gbytes, u_int32_t bytes, int ncache) -{ - int ret; - DB *db = unwrap(this); - - if ((ret = (*(db->set_cachesize))(db, gbytes, bytes, ncache)) != 0) { - DB_ERROR("Db::set_cachesize", ret, error_policy()); - } - return (ret); -} - -int Db::set_paniccall(void (*callback)(DbEnv *, int)) -{ - return (env_->set_paniccall(callback)); -} - -void Db::set_error_stream(ostream *error_stream) -{ - env_->set_error_stream(error_stream); -} - -//////////////////////////////////////////////////////////////////////// -// // -// Dbc // -// // -//////////////////////////////////////////////////////////////////////// - -// It's private, and should never be called, but VC4.0 needs it resolved -// -Dbc::~Dbc() -{ -} - -int Dbc::close() -{ - DBC *cursor = this; - int err; - - if ((err = cursor->c_close(cursor)) != 0) { - DB_ERROR("Db::close", err, ON_ERROR_UNKNOWN); - return (err); - } - return (0); -} - -int Dbc::count(db_recno_t *countp, u_int32_t flags_arg) -{ - DBC *cursor = this; - int err; - - if ((err = cursor->c_count(cursor, countp, flags_arg)) != 0) { - DB_ERROR("Db::count", err, ON_ERROR_UNKNOWN); - return (err); - } - return (0); -} - -int Dbc::del(u_int32_t flags_arg) -{ - DBC *cursor = this; - int err; - - if ((err = cursor->c_del(cursor, flags_arg)) != 0) { - - // DB_KEYEMPTY is a "normal" return, so should not be - // thrown as an error - // - if (err != DB_KEYEMPTY) { - DB_ERROR("Db::del", err, ON_ERROR_UNKNOWN); - return (err); - } - } - return (err); -} - -int Dbc::dup(Dbc** cursorp, u_int32_t flags_arg) -{ - DBC *cursor = this; - DBC *new_cursor = 0; - int err; - - if ((err = cursor->c_dup(cursor, &new_cursor, flags_arg)) != 0) { - DB_ERROR("Db::dup", err, ON_ERROR_UNKNOWN); - return (err); - } - - // The following cast implies that Dbc can be no larger than DBC - *cursorp = (Dbc*)new_cursor; - return (0); -} - -int Dbc::get(Dbt* key, Dbt *data, u_int32_t flags_arg) -{ - DBC *cursor = this; - int err; - - if ((err = cursor->c_get(cursor, key, data, flags_arg)) != 0) { - - // DB_NOTFOUND and DB_KEYEMPTY are "normal" returns, - // so should not be thrown as an error - // - if (err != DB_NOTFOUND && err != DB_KEYEMPTY) { - DB_ERROR("Db::get", err, ON_ERROR_UNKNOWN); - return (err); - } - } - return (err); -} - -int Dbc::put(Dbt* key, Dbt *data, u_int32_t flags_arg) -{ - DBC *cursor = this; - int err; - - if ((err = cursor->c_put(cursor, key, data, flags_arg)) != 0) { - - // DB_KEYEXIST is a "normal" return, so should not be - // thrown as an error - // - if (err != DB_KEYEXIST) { - DB_ERROR("Db::put", err, ON_ERROR_UNKNOWN); - return (err); - } - } - return (err); -} - -//////////////////////////////////////////////////////////////////////// -// // -// Dbt // -// // -//////////////////////////////////////////////////////////////////////// - -Dbt::Dbt() -{ - DBT *dbt = this; - memset(dbt, 0, sizeof(DBT)); -} - -Dbt::Dbt(void *data_arg, size_t size_arg) -{ - DBT *dbt = this; - memset(dbt, 0, sizeof(DBT)); - set_data(data_arg); - set_size(size_arg); -} - -Dbt::~Dbt() -{ -} - -Dbt::Dbt(const Dbt &that) -{ - const DBT *from = &that; - DBT *to = this; - memcpy(to, from, sizeof(DBT)); -} - -Dbt &Dbt::operator = (const Dbt &that) -{ - if (this != &that) { - const DBT *from = &that; - DBT *to = this; - memcpy(to, from, sizeof(DBT)); - } - return (*this); -} - -DB_RW_ACCESS(Dbt, void *, data, data) -DB_RW_ACCESS(Dbt, u_int32_t, size, size) -DB_RW_ACCESS(Dbt, u_int32_t, ulen, ulen) -DB_RW_ACCESS(Dbt, u_int32_t, dlen, dlen) -DB_RW_ACCESS(Dbt, u_int32_t, doff, doff) -DB_RW_ACCESS(Dbt, u_int32_t, flags, flags) diff --git a/bdb/cxx/cxx_txn.cpp b/bdb/cxx/cxx_txn.cpp index 0abae982644..b04077c0f5b 100644 --- a/bdb/cxx/cxx_txn.cpp +++ b/bdb/cxx/cxx_txn.cpp @@ -1,136 +1,81 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: cxx_txn.cpp,v 11.13 2000/12/21 16:24:33 dda Exp $"; +static const char revid[] = "$Id: cxx_txn.cpp,v 11.27 2002/07/20 13:50:11 dda Exp $"; #endif /* not lint */ #include #include "db_cxx.h" -#include "cxx_int.h" +#include "dbinc/cxx_int.h" -//////////////////////////////////////////////////////////////////////// -// // -// DbTxnMgr // -// // -//////////////////////////////////////////////////////////////////////// +#include "db_int.h" -int DbEnv::txn_begin(DbTxn *pid, DbTxn **tid, u_int32_t flags) -{ - int err; - DB_ENV *env = unwrap(this); - DB_TXN *txn; - - if ((err = ::txn_begin(env, unwrap(pid), &txn, flags)) != 0) { - DB_ERROR("DbEnv::txn_begin", err, error_policy()); - return (err); - } - DbTxn *result = new DbTxn(); - result->imp_ = wrap(txn); - *tid = result; - return (err); +// 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 +// list element (e.g., "char *arg") and that _arglist is the arguments +// that should be passed through to the C method (e.g., "(db, arg)") +// +#define DBTXN_METHOD(_name, _delete, _argspec, _arglist) \ +int DbTxn::_name _argspec \ +{ \ + int ret; \ + DB_TXN *txn = unwrap(this); \ + \ + ret = txn->_name _arglist; \ + /* Weird, but safe if we don't access this again. */ \ + if (_delete) \ + delete this; \ + if (!DB_RETOK_STD(ret)) \ + DB_ERROR("DbTxn::" # _name, ret, ON_ERROR_UNKNOWN); \ + return (ret); \ } -int DbEnv::txn_checkpoint(u_int32_t kbyte, u_int32_t min, u_int32_t flags) -{ - int err; - DB_ENV *env = unwrap(this); - if ((err = ::txn_checkpoint(env, kbyte, min, flags)) != 0 && - err != DB_INCOMPLETE) { - DB_ERROR("DbEnv::txn_checkpoint", err, error_policy()); - return (err); - } - return (err); -} - -int DbEnv::txn_stat(DB_TXN_STAT **statp, db_malloc_fcn_type db_malloc_fcn) -{ - int err; - DB_ENV *env = unwrap(this); - if ((err = ::txn_stat(env, statp, db_malloc_fcn)) != 0) { - DB_ERROR("DbEnv::txn_stat", err, error_policy()); - return (err); - } - return (err); -} - -//////////////////////////////////////////////////////////////////////// -// // -// DbTxn // -// // -//////////////////////////////////////////////////////////////////////// - +// private constructor, never called but needed by some C++ linkers DbTxn::DbTxn() : imp_(0) { } +DbTxn::DbTxn(DB_TXN *txn) +: imp_(wrap(txn)) +{ + txn->api_internal = this; +} + DbTxn::~DbTxn() { } -int DbTxn::abort() -{ - int err; - DB_TXN *txn; - - txn = unwrap(this); - err = txn_abort(txn); - - // It may seem weird to delete this, but is legal as long - // as we don't access any of its data before returning. - // - delete this; - - if (err != 0) - DB_ERROR("DbTxn::abort", err, ON_ERROR_UNKNOWN); - - return (err); -} - -int DbTxn::commit(u_int32_t flags) -{ - int err; - DB_TXN *txn; - - txn = unwrap(this); - err = txn_commit(txn, flags); - - // It may seem weird to delete this, but is legal as long - // as we don't access any of its data before returning. - // - delete this; - - if (err != 0) - DB_ERROR("DbTxn::commit", err, ON_ERROR_UNKNOWN); - - return (err); -} +DBTXN_METHOD(abort, 1, (), (txn)) +DBTXN_METHOD(commit, 1, (u_int32_t flags), (txn, flags)) +DBTXN_METHOD(discard, 1, (u_int32_t flags), (txn, flags)) u_int32_t DbTxn::id() { DB_TXN *txn; txn = unwrap(this); - return (txn_id(txn)); // no error + return (txn->id(txn)); // no error } -int DbTxn::prepare() +DBTXN_METHOD(prepare, 0, (u_int8_t *gid), (txn, gid)) +DBTXN_METHOD(set_timeout, 0, (db_timeout_t timeout, u_int32_t flags), + (txn, timeout, flags)) + +// static method +DbTxn *DbTxn::wrap_DB_TXN(DB_TXN *txn) { - int err; - DB_TXN *txn; - - txn = unwrap(this); - if ((err = txn_prepare(txn)) != 0) { - DB_ERROR("DbTxn::prepare", err, ON_ERROR_UNKNOWN); - return (err); - } - return (0); + DbTxn *wrapped_txn = get_DbTxn(txn); + if (wrapped_txn == NULL) + wrapped_txn = new DbTxn(txn); + return wrapped_txn; } diff --git a/bdb/cxx/namemap.txt b/bdb/cxx/namemap.txt deleted file mode 100644 index 75207718577..00000000000 --- a/bdb/cxx/namemap.txt +++ /dev/null @@ -1,21 +0,0 @@ -$Id: namemap.txt,v 10.4 2000/02/19 20:57:54 bostic Exp $ - -The bulk of DB provides for wrapper classes and appropriately named methods -that call into DB. For the most part, there is a straightforward mapping of -names. For the purposes of referencing documentation, this chart shows the -underlying C structure name for each C++ class. In some cases, using the -given C prefix with a C++ method name gives the underlying C function name. -For example, DbMpoolFile::close() is implemented by memp_fclose(). - -C++ C C prefix - -Db DB -DbEnv DB_ENV -Dbc DBC -DbException none -DbInfo DB_INFO -DbLock DB_LOCK lock_ -DbLsn DB_LSN -DbMpoolFile DB_MPOOL_FILE memp_ -Dbt DBT -DbTxn DB_TXN txn_ diff --git a/bdb/db/Design.fileop b/bdb/db/Design.fileop deleted file mode 100644 index 187f1ffaf22..00000000000 --- a/bdb/db/Design.fileop +++ /dev/null @@ -1,452 +0,0 @@ -# $Id: Design.fileop,v 11.4 2000/02/19 20:57:54 bostic Exp $ - -The design of file operation recovery. - -Keith has asked me to write up notes on our current status of database -create and delete and recovery, why it's so hard, and how we've violated -all the cornerstone assumptions on which our recovery framework is based. - -I am including two documents at the end of this one. The first is the -initial design of the recoverability of file create and delete (there is -no talk of subdatabases there, because we didn't think we'd have to do -anything special there). I will annotate this document on where things -changed. - -The second is the design of recd007 which is supposed to test our ability -to recover these operations regardless of where one crashes. This test -is fundamentally different from our other recovery tests in the following -manner. Normally, the application controls transaction boundaries. -Therefore, we can perform an operation and then decide whether to commit -or abort it. In the normal recovery tests, we force the database into -each of the four possible states from a recovery perspective: - - database is pre-op, undo (do nothing) - database is pre-op, redo - database is post-op, undo - database is post-op, redo (do nothing) - -By copying databases at various points and initiating txn_commit and abort -appropriately, we can make all these things happen. Notice that the one -case we don't handle is where page A is in one state (e.g., pre-op) and -page B is in another state (e.g., post-op). I will argue that these don't -matter because each page is recovered independently. If anyone can poke -holes in this, I'm interested. - -The problem with create/delete recovery testing is that the transaction -is begun and ended all inside the library. Therefore, there is never any -point (outside the library) where we can copy files and or initiate -abort/commit. In order to still put the recovery code through its paces, -Sue designed an infrastructure that lets you tell the library where to -make copies of things and where to suddenly inject errors so that the -transaction gets aborted. This level of detail allows us to push the -create/delete recovery code through just about every recovery path -possible (although I'm sure Mike will tell me I'm wrong when he starts to -run code coverage tools). - -OK, so that's all preamble and a brief discussion of the documents I'm -enclosing. - -Why was this so hard and painful and why is the code so Q@#$!% complicated? -The following is a discussion/explanation, but to the best of my knowledge, -the structure we have in place now works. The key question we need to be -asking is, "Does this need to have to be so complex or should we redesign -portions to simplify it?" At this point, there is no obvious way to simplify -it in my book, but I may be having difficulty seeing this because my mind is -too polluted at this point. - -Our overall strategy for recovery is that we do write-ahead logging, -that is we log an operation and make sure it is on disk before any -data corresponding to the data that log record describes is on disk. -Typically we use log sequence numbers (LSNs) to mark the data so that -during recovery, we can look at the data and determine if it is in a -state before a particular log record or after a particular log record. - -In the good old days, opens were not transaction protected, so we could -do regular old opens during recovery and if the file existed, we opened -it and if it didn't (or appeared corrupt), we didn't and treated it like -a missing file. As will be discussed below in detail, our states are much -more complicated and recovery can't make such simplistic assumptions. - -Also, since we are now dealing with file system operations, we have less -control about when they actually happen and what the state of the system -can be. That is, we have to write create log records synchronously, because -the create/open system call may force a newly created (0-length) file to -disk. This file has to now be identified as being in the "being-created" -state. - -A. We used to make a number of assumptions during recovery: - -1. We could call db_open at any time and one of three things would happen: - a) the file would be opened cleanly - b) the file would not exist - c) we would encounter an error while opening the file - -Case a posed no difficulty. -In Case b, we simply spit out a warning that a file was missing and then - ignored all subsequent operations to that file. -In Case c, we reported a fatal error. - -2. We can always generate a warning if a file is missing. - -3. We never encounter NULL file names in the log. - -B. We also made some assumptions in the main-line library: - -1. If you try to open a file and it exists but is 0-length, then -someone else is trying to open it. - -2. You can write pages anywhere in a file and any non-existent pages -are 0-filled. [This breaks on Windows.] - -3. If you have proper permissions then you can always evict pages from -the buffer pool. - -4. During open, we can close the master database handle as soon as -we're done with it since all the rest of the activity will take place -on the subdatabase handle. - -In our brave new world, most of these assumptions are no longer valid. -Let's address them one at a time. - -A.1 We could call db_open at any time and one of three things would happen: - a) the file would be opened cleanly - b) the file would not exist - c) we would encounter an error while opening the file -There are now additional states. Since we are trying to make file -operations recoverable, you can now die in the middle of such an -operation and we have to be able to pick up the pieces. What this -now means is that: - - * a 0-length file can be an indication of a create in-progress - * you can have a meta-data page but no root page (of a btree) - * if a file doesn't exist, it could mean that it was just about - to be created and needs to be rolled forward. - * if you encounter an error in a file (e.g., the meta-data page - is all 0's) you could still be in mid-open. - -I have now made this all work, but it required significant changes to the -db_open code and error handling and this is the sort of change that makes -everyone nervous. - -A.2. We can always generate a warning if a file is missing. - -Now that we have a delete file method in the API, we need to make sure -that we do not generate warning messages for files that don't exist if -we see that they were explicitly deleted. - -This means that we need to save state during recovery, determine which -files were missing and were not being recreated and were not deleted and -only complain about those. - -A.3. We never encounter NULL file names in the log. - -Now that we allow tranaction protection on memory-resident files, we write -log messages for files with NULL file names. This means that our assumption -of always being able to call "db_open" on any log_register OPEN message found -in the log is no longer valid. - -B.1. If you try to open a file and it exists but is 0-length, then -someone else is trying to open it. - -As discussed for A.1, this is no longer true. It may be instead that you -are in the process of recovering a create. - -B.2. You can write pages anywhere in a file and any non-existent pages -are 0-filled. - -It turns out that this is not true on Windows. This means that places -we do group allocation (hash) must explicitly allocate each page, because -we can't count on recognizing the uninitialized pages later. - -B.3. If you have proper permissions then you can always evict pages from -the buffer pool. - -In the brave new world though, files can be deleted and they may -have pages in the mpool. If you later try to evict these, you -discover that the file doesn't exist. We'd get here when we had -to dirty pages during a remove operation. - -B.4. You can close files any time you want. - -However, if the file takes part in the open/remove transaction, -then we had better not close it until after the transaction -commits/aborts, because we need to be able to get our hands on the -dbp and the open happened in a different transaction. - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Design for recovering file create and delete in the presence of subdatabases. - -Assumptions: - Remove the O_TRUNCATE flag. - Single-thread all open/create/delete operations. - (Well, almost all; we'll optimize opens without DB_CREATE set.) - The reasoning for this is that with two simultaneous - open/creaters, during recovery, we cannot identify which - transaction successfully created files and therefore cannot - recovery correctly. - File system creates/deletes are synchronous - Once the file is open, subdatabase creates look like regular - get/put operations and a metadata page creation. - -There are 4 cases to deal with: - 1. Open/create file - 2. Open/create subdatabase - 3. Delete - 4. Recovery records - - __db_fileopen_recover - __db_metapage_recover - __db_delete_recover - existing c_put and c_get routines for subdatabase creation - - Note that the open/create of the file and the open/create of the - subdatabase need to be in the same transaction. - -1. Open/create (full file and subdb version) - -If create - LOCK_FILEOP - txn_begin - log create message (open message below) - do file system open/create - if we did not create - abort transaction (before going to open_only) - if (!subdb) - set dbp->open_txn = NULL - else - txn_begin a new transaction for the subdb open - - construct meta-data page - log meta-data page (see metapage) - write the meta-data page - * It may be the case that btrees need to log both meta-data pages - and root pages. If that is the case, I believe that we can use - this same record and recovery routines for both - - txn_commit - UNLOCK_FILEOP - -2. Delete - LOCK_FILEOP - txn_begin - log delete message (delete message below) - mv file __db.file.lsn - txn_commit - unlink __db.file.lsn - UNLOCK_FILEOP - -3. Recovery Routines - -__db_fileopen_recover - if (argp->name.size == 0 - done; - - if (redo) /* Commit */ - __os_open(argp->name, DB_OSO_CREATE, argp->mode, &fh) - __os_closehandle(fh) - if (undo) /* Abort */ - if (argp->name exists) - unlink(argp->name); - -__db_metapage_recover - if (redo) - __os_open(argp->name, 0, 0, &fh) - __os_lseek(meta data page) - __os_write(meta data page) - __os_closehandle(fh); - if (undo) - done = 0; - if (argp->name exists) - if (length of argp->name != 0) - __os_open(argp->name, 0, 0, &fh) - __os_lseek(meta data page) - __os_read(meta data page) - if (read succeeds && page lsn != current_lsn) - done = 1 - __os_closehandle(fh); - if (!done) - unlink(argp->name) - -__db_delete_recover - if (redo) - Check if the backup file still exists and if so, delete it. - - if (undo) - if (__db_appname(__db.file.lsn exists)) - mv __db_appname(__db.file.lsn) __db_appname(file) - -__db_metasub_recover - /* This is like a normal recovery routine */ - Get the metadata page - if (cmp_n && redo) - copy the log page onto the page - update the lsn - make sure page gets put dirty - else if (cmp_p && undo) - update the lsn to the lsn in the log record - make sure page gets put dirty - - if the page was modified, put it back dirty - -In db.src - -# name: filename (before call to __db_appname) -# mode: file system mode -BEGIN open -DBT name DBT s -ARG mode u_int32_t o -END - -# opcode: indicate if it is a create/delete and if it is a subdatabase -# pgsize: page size on which we're going to write the meta-data page -# pgno: page number on which to write this meta-data page -# page: the actual meta-data page -# lsn: LSN of the meta-data page -- 0 for new databases, may be non-0 -# for subdatabases. - -BEGIN metapage -ARG opcode u_int32_t x -DBT name DBT s -ARG pgno db_pgno_t d -DBT page DBT s -POINTER lsn DB_LSN * lu -END - -# We do not need a subdatabase name here because removing a subdatabase -# name is simply a regular bt_delete operation from the master database. -# It will get logged normally. -# name: filename -BEGIN delete -DBT name DBT s -END - -# We also need to reclaim pages, but we can use the existing -# bt_pg_alloc routines. - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Testing recoverability of create/delete. - -These tests are unlike other tests in that they are going to -require hooks in the library. The reason is that the create -and delete calls are internally wrapped in a transaction, so -that if the call returns, the transaction has already either -commited or aborted. Using only that interface limits what -kind of testing we can do. To match our other recovery testing -efforts, we need to add hooks to trigger aborts at particular -times in the create/delete path. - -The general recovery testing strategy is that we wish to -execute every path through every recovery routine. That -means that we try to: - catch each operation in its pre-operation state - call the recovery function with redo - call the recovery function with undo - catch each operation in its post-operation state - call the recovery function with redo - call the recovery function with undo - -In addition, there are a few critical points in the create and -delete path that we want to make sure we capture. - -1. Test Structure - -The test structure should be similar to the existing recovery -tests. We will want to have a structure in place where we -can execute different commands: - create a file/database - create a file that will contain subdatabases. - create a subdatabase - remove a subdatabase (that contains valid data) - remove a subdatabase (that does not contain any data) - remove a file that used to contain subdatabases - remove a file that contains a database - -The tricky part is capturing the state of the world at the -various points in the create/delete process. - -The critical points in the create process are: - - 1. After we've logged the create, but before we've done anything. - in db/db.c - after the open_retry - after the __crdel_fileopen_log call (and before we've - called __os_open). - - 2. Immediately after the __os_open - - 3. Immediately after each __db_log_page call - in bt_open.c - log meta-data page - log root page - in hash.c - log meta-data page - - 4. With respect to the log records above, shortly after each - log write is an memp_fput. We need to do a sync after - each memp_fput and trigger a point after that sync. - -The critical points in the remove process are: - - 1. Right after the crdel_delete_log in db/db.c - - 2. Right after the __os_rename call (below the crdel_delete_log) - - 3. After the __db_remove_callback call. - -I believe that there are the places where we'll need some sort of hook. - -2. Adding hooks to the library. - -The hooks need two components. One component is to capture the state of -the database at the hook point and the other is to trigger a txn_abort at -the hook point. The second part is fairly trivial. - -The first part requires more thought. Let me explain what we do in a -"normal" recovery test. In a normal recovery test, we save an intial -copy of the database (this copy is called init). Then we execute one -or more operations. Then, right before the commit/abort, we sync the -file, and save another copy (the afterop copy). Finally, we call txn_commit -or txn_abort, sync the file again, and save the database one last time (the -final copy). - -Then we run recovery. The first time, this should be a no-op, because -we've either committed the transaction and are checking to redo it or -we aborted the transaction, undid it on the abort and are checking to -undo it again. - -We then run recovery again on whatever database will force us through -the path that requires work. In the commit case, this means we start -with the init copy of the database and run recovery. This pushes us -through all the redo paths. In the abort case, we start with the afterop -copy which pushes us through all the undo cases. - -In some sense, we're asking the create/delete test to be more exhaustive -by defining all the trigger points, but I think that's the correct thing -to do, since the create/delete is not initiated by a user transaction. - -So, what do we have to do at the hook points? - 1. sync the file to disk. - 2. save the file itself - 3. save any files named __db_backup_name(name, &backup_name, lsn) - Since we may not know the right lsns, I think we should save - every file of the form __db.name.0xNNNNNNNN.0xNNNNNNNN into - some temporary files from which we can restore it to run - recovery. - -3. Putting it all together - -So, the three pieces are writing the test structure, putting in the hooks -and then writing the recovery portions so that we restore the right thing -that the hooks saved in order to initiate recovery. - -Some of the technical issues that need to be solved are: - How does the hook code become active (i.e., we don't - want it in there normally, but it's got to be - there when you configure for testing)? - How do you (the test) tell the library that you want a - particular hook to abort? - How do you (the test) tell the library that you want the - hook code doing its copies (do we really want - *every* test doing these copies during testing? - Maybe it's not a big deal, but maybe it is; we - should at least think about it). diff --git a/bdb/db/crdel.src b/bdb/db/crdel.src index 17c061d6887..d89fa7a0382 100644 --- a/bdb/db/crdel.src +++ b/bdb/db/crdel.src @@ -1,13 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: crdel.src,v 11.12 2000/12/12 17:41:48 bostic Exp $ + * $Id: crdel.src,v 11.24 2002/04/17 19:02:57 krinsky Exp $ */ -PREFIX crdel +PREFIX __crdel +DBPRIVATE INCLUDE #include "db_config.h" INCLUDE @@ -15,29 +16,19 @@ INCLUDE #ifndef NO_SYSTEM_INCLUDES INCLUDE #include INCLUDE INCLUDE #include -INCLUDE #include INCLUDE #include INCLUDE #endif INCLUDE INCLUDE #include "db_int.h" -INCLUDE #include "db_page.h" -INCLUDE #include "db_dispatch.h" -INCLUDE #include "db_am.h" -INCLUDE #include "txn.h" +INCLUDE #include "dbinc/crypto.h" +INCLUDE #include "dbinc/db_page.h" +INCLUDE #include "dbinc/db_dispatch.h" +INCLUDE #include "dbinc/db_am.h" +INCLUDE #include "dbinc/log.h" +INCLUDE #include "dbinc/rep.h" +INCLUDE #include "dbinc/txn.h" INCLUDE -/* - * Fileopen -- log a potential file create operation - * - * name: filename - * subname: sub database name - * mode: file system mode - */ -BEGIN fileopen 141 -DBT name DBT s -ARG mode u_int32_t o -END - /* * Metasub: log the creation of a subdatabase meta data page. * @@ -47,57 +38,9 @@ END * lsn: lsn of the page. */ BEGIN metasub 142 -ARG fileid int32_t ld -ARG pgno db_pgno_t d -DBT page DBT s +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu +PGDBT page DBT s POINTER lsn DB_LSN * lu END -/* - * Metapage: log the creation of a meta data page for a new file. - * - * fileid: identifies the file being acted upon. - * name: file containing the page. - * pgno: page number on which to write this meta-data page - * page: the actual meta-data page - */ -BEGIN metapage 143 -ARG fileid int32_t ld -DBT name DBT s -ARG pgno db_pgno_t d -DBT page DBT s -END - -/* - * Delete: remove a file. - * Note that we don't need a special log record for subdatabase - * removes, because we use normal btree operations to remove them. - * - * name: name of the file being removed (relative to DBHOME). - */ -DEPRECATED old_delete 144 -DBT name DBT s -END - -/* - * Rename: rename a file - * We do not need this for subdatabases - * - * name: name of the file being removed (relative to DBHOME). - */ -BEGIN rename 145 -ARG fileid int32_t ld -DBT name DBT s -DBT newname DBT s -END -/* - * Delete: remove a file. - * Note that we don't need a special log record for subdatabase - * removes, because we use normal btree operations to remove them. - * - * name: name of the file being removed (relative to DBHOME). - */ -BEGIN delete 146 -ARG fileid int32_t ld -DBT name DBT s -END diff --git a/bdb/db/crdel_rec.c b/bdb/db/crdel_rec.c index 495b92a0ad7..542a0c358dd 100644 --- a/bdb/db/crdel_rec.c +++ b/bdb/db/crdel_rec.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: crdel_rec.c,v 11.43 2000/12/13 08:06:34 krinsky Exp $"; +static const char revid[] = "$Id: crdel_rec.c,v 11.64 2002/08/14 20:27:34 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,112 +18,9 @@ static const char revid[] = "$Id: crdel_rec.c,v 11.43 2000/12/13 08:06:34 krinsk #endif #include "db_int.h" -#include "db_page.h" -#include "log.h" -#include "hash.h" -#include "mp.h" -#include "db_dispatch.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; - DBMETA ondisk; - DB_FH fh; - size_t nr; - int do_unlink, ret; - u_int32_t b, mb, io; - char *real_name; - - COMPQUIET(info, NULL); - - real_name = NULL; - REC_PRINT(__crdel_fileopen_print); - - if ((ret = __crdel_fileopen_read(dbenv, dbtp->data, &argp)) != 0) - goto out; - /* - * If this is an in-memory database, then the name is going to - * be NULL, which looks like a 0-length name in recovery. - */ - if (argp->name.size == 0) - goto done; - - if ((ret = __db_appname(dbenv, DB_APP_DATA, - NULL, argp->name.data, 0, NULL, &real_name)) != 0) - goto out; - if (DB_REDO(op)) { - /* - * The create commited, so we need to make sure that the file - * exists. A simple open should suffice. - */ - if ((ret = __os_open(dbenv, real_name, - DB_OSO_CREATE, argp->mode, &fh)) != 0) - goto out; - if ((ret = __os_closehandle(&fh)) != 0) - goto out; - } else if (DB_UNDO(op)) { - /* - * If the file is 0-length then it was in the process of being - * created, so we should unlink it. If it is non-0 length, then - * either someone else created it and we need to leave it - * untouched or we were in the process of creating it, allocated - * the first page on a system that requires you to actually - * write pages as you allocate them, but never got any data - * on it. - * If the file doesn't exist, we never got around to creating - * it, so that's fine. - */ - if (__os_exists(real_name, NULL) != 0) - goto done; - - if ((ret = __os_open(dbenv, real_name, 0, 0, &fh)) != 0) - goto out; - if ((ret = __os_ioinfo(dbenv, - real_name, &fh, &mb, &b, &io)) != 0) - goto out; - do_unlink = 0; - if (mb != 0 || b != 0) { - /* - * We need to read the first page - * to see if its got valid data on it. - */ - if ((ret = __os_read(dbenv, &fh, - &ondisk, sizeof(ondisk), &nr)) != 0 || - nr != sizeof(ondisk)) - goto out; - if (ondisk.magic == 0) - do_unlink = 1; - } - if ((ret = __os_closehandle(&fh)) != 0) - goto out; - /* Check for 0-length and if it is, delete it. */ - if (do_unlink || (mb == 0 && b == 0)) - if ((ret = __os_unlink(dbenv, real_name)) != 0) - goto out; - } - -done: *lsnp = argp->prev_lsn; - ret = 0; - -out: if (argp != NULL) - __os_free(argp, 0); - if (real_name != NULL) - __os_freestr(real_name); - return (ret); -} +#include "dbinc/db_page.h" +#include "dbinc/hash.h" +#include "dbinc/log.h" /* * __crdel_metasub_recover -- @@ -145,16 +42,16 @@ __crdel_metasub_recover(dbenv, dbtp, lsnp, op, info) DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; - u_int8_t *file_uid, ptype; - int cmp_p, modified, reopen, ret; + int cmp_p, modified, ret; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__crdel_metasub_print); REC_INTRO(__crdel_metasub_read, 0); - 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 { @@ -165,7 +62,6 @@ __crdel_metasub_recover(dbenv, dbtp, lsnp, op, info) } modified = 0; - reopen = 0; cmp_p = log_compare(&LSN(pagep), &argp->lsn); CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->lsn); @@ -173,14 +69,6 @@ __crdel_metasub_recover(dbenv, dbtp, lsnp, op, info) memcpy(pagep, argp->page.data, argp->page.size); LSN(pagep) = *lsnp; modified = 1; - /* - * If this is a meta-data page, then we must reopen; - * if it was a root page, then we do not. - */ - ptype = ((DBMETA *)argp->page.data)->type; - if (ptype == P_HASHMETA || ptype == P_BTREEMETA || - ptype == P_QAMMETA) - reopen = 1; } else if (DB_UNDO(op)) { /* * We want to undo this page creation. The page creation @@ -196,451 +84,14 @@ __crdel_metasub_recover(dbenv, dbtp, lsnp, op, info) LSN(pagep) = argp->lsn; modified = 1; } - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; - - /* - * If we are redoing a subdatabase create, we must close and reopen the - * file to be sure that we have the proper meta information in the - * in-memory structures - */ - if (reopen) { - /* Close cursor if it's open. */ - if (dbc != NULL) { - dbc->c_close(dbc); - dbc = NULL; - } - - if ((ret = __os_malloc(dbenv, - DB_FILE_ID_LEN, NULL, &file_uid)) != 0) - goto out; - memcpy(file_uid, &file_dbp->fileid[0], DB_FILE_ID_LEN); - ret = __log_reopen_file(dbenv, - NULL, argp->fileid, file_uid, argp->pgno); - (void)__os_free(file_uid, DB_FILE_ID_LEN); - if (ret != 0) - goto out; - } + pagep = NULL; done: *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 *dbp; - DBMETA *meta, ondisk; - DB_FH fh; - size_t nr; - u_int32_t b, io, mb, pagesize; - int is_done, ret; - char *real_name; - - COMPQUIET(info, NULL); - - real_name = NULL; - memset(&fh, 0, sizeof(fh)); - REC_PRINT(__crdel_metapage_print); - - if ((ret = __crdel_metapage_read(dbenv, dbtp->data, &argp)) != 0) - goto out; - - /* - * If this is an in-memory database, then the name is going to - * be NULL, which looks like a 0-length name in recovery. - */ - if (argp->name.size == 0) - goto done; - - meta = (DBMETA *)argp->page.data; - __ua_memcpy(&pagesize, &meta->pagesize, sizeof(pagesize)); - - if ((ret = __db_appname(dbenv, DB_APP_DATA, - NULL, argp->name.data, 0, NULL, &real_name)) != 0) - goto out; - if (DB_REDO(op)) { - if ((ret = __db_fileid_to_db(dbenv, - &dbp, argp->fileid, 0)) != 0) { - if (ret == DB_DELETED) - goto done; - else - goto out; - } - - /* - * We simply read the first page and if the LSN is 0, we - * write the meta-data page. - */ - if ((ret = __os_open(dbenv, real_name, 0, 0, &fh)) != 0) - goto out; - if ((ret = __os_seek(dbenv, &fh, - pagesize, argp->pgno, 0, 0, DB_OS_SEEK_SET)) != 0) - goto out; - /* - * If the read succeeds then the page exists, then we need - * to vrify that the page has actually been written, because - * on some systems (e.g., Windows) we preallocate pages because - * files aren't allowed to have holes in them. If the page - * looks good then we're done. - */ - if ((ret = __os_read(dbenv, &fh, &ondisk, - sizeof(ondisk), &nr)) == 0 && nr == sizeof(ondisk)) { - if (ondisk.magic != 0) - goto done; - if ((ret = __os_seek(dbenv, &fh, - pagesize, argp->pgno, 0, 0, DB_OS_SEEK_SET)) != 0) - goto out; - } - - /* - * Page didn't exist, update the LSN and write a new one. - * (seek pointer shouldn't have moved) - */ - __ua_memcpy(&meta->lsn, lsnp, sizeof(DB_LSN)); - if ((ret = __os_write(dbp->dbenv, &fh, - argp->page.data, argp->page.size, &nr)) != 0) - goto out; - if (nr != (size_t)argp->page.size) { - __db_err(dbenv, "Write failed during recovery"); - ret = EIO; - goto out; - } - - /* - * We must close and reopen the file to be sure - * that we have the proper meta information - * in the in memory structures - */ - - if ((ret = __log_reopen_file(dbenv, - argp->name.data, argp->fileid, - meta->uid, argp->pgno)) != 0) - goto out; - - /* Handle will be closed on exit. */ - } else if (DB_UNDO(op)) { - is_done = 0; - - /* If file does not exist, there is nothing to undo. */ - if (__os_exists(real_name, NULL) != 0) - goto done; - - /* - * Before we can look at anything on disk, we have to check - * if there is a valid dbp for this, and if there is, we'd - * better flush it. - */ - dbp = NULL; - if ((ret = - __db_fileid_to_db(dbenv, &dbp, argp->fileid, 0)) == 0) - (void)dbp->sync(dbp, 0); - - /* - * We need to make sure that we do not remove a file that - * someone else created. If the file is 0-length, then we - * can assume that we created it and remove it. If it is - * not 0-length, then we need to check the LSN and make - * sure that it's the file we created. - */ - if ((ret = __os_open(dbenv, real_name, 0, 0, &fh)) != 0) - goto out; - if ((ret = __os_ioinfo(dbenv, - real_name, &fh, &mb, &b, &io)) != 0) - goto out; - if (mb != 0 || b != 0) { - /* The file has something in it. */ - if ((ret = __os_seek(dbenv, &fh, - pagesize, argp->pgno, 0, 0, DB_OS_SEEK_SET)) != 0) - goto out; - if ((ret = __os_read(dbenv, &fh, - &ondisk, sizeof(ondisk), &nr)) != 0) - goto out; - if (log_compare(&ondisk.lsn, lsnp) != 0) - is_done = 1; - } - - /* - * Must close here, because unlink with the file open fails - * on some systems. - */ - if ((ret = __os_closehandle(&fh)) != 0) - goto out; - - if (!is_done) { - /* - * On some systems, you cannot unlink an open file so - * we close the fd in the dbp here and make sure we - * don't try to close it again. First, check for a - * saved_open_fhp, then close down the mpool. - */ - if (dbp != NULL && dbp->saved_open_fhp != NULL && - F_ISSET(dbp->saved_open_fhp, DB_FH_VALID) && - (ret = __os_closehandle(dbp->saved_open_fhp)) != 0) - goto out; - if (dbp != NULL && dbp->mpf != NULL) { - (void)__memp_fremove(dbp->mpf); - if ((ret = memp_fclose(dbp->mpf)) != 0) - goto out; - F_SET(dbp, DB_AM_DISCARD); - dbp->mpf = NULL; - } - if ((ret = __os_unlink(dbenv, real_name)) != 0) - goto out; - } - } - -done: *lsnp = argp->prev_lsn; - ret = 0; - -out: if (argp != NULL) - __os_free(argp, 0); - if (real_name != NULL) - __os_freestr(real_name); - if (F_ISSET(&fh, DB_FH_VALID)) - (void)__os_closehandle(&fh); - return (ret); -} - -/* - * __crdel_delete_recover -- - * Recovery function for delete. - * - * PUBLIC: int __crdel_delete_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__crdel_delete_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - DB *dbp; - __crdel_delete_args *argp; - int ret; - char *backup, *real_back, *real_name; - - REC_PRINT(__crdel_delete_print); - - backup = real_back = real_name = NULL; - if ((ret = __crdel_delete_read(dbenv, dbtp->data, &argp)) != 0) - goto out; - - if (DB_REDO(op)) { - /* - * On a recovery, as we recreate what was going on, we - * recreate the creation of the file. And so, even though - * it committed, we need to delete it. Try to delete it, - * but it is not an error if that delete fails. - */ - if ((ret = __db_appname(dbenv, DB_APP_DATA, - NULL, argp->name.data, 0, NULL, &real_name)) != 0) - goto out; - if (__os_exists(real_name, NULL) == 0) { - /* - * If a file is deleted and then recreated, it's - * possible for the __os_exists call above to - * return success and for us to get here, but for - * the fileid we're looking for to be marked - * deleted. In that case, we needn't redo the - * unlink even though the file exists, and it's - * not an error. - */ - ret = __db_fileid_to_db(dbenv, &dbp, argp->fileid, 0); - if (ret == 0) { - /* - * On Windows, the underlying file must be - * closed to perform a remove. - */ - (void)__memp_fremove(dbp->mpf); - if ((ret = memp_fclose(dbp->mpf)) != 0) - goto out; - dbp->mpf = NULL; - if ((ret = __os_unlink(dbenv, real_name)) != 0) - goto out; - } else if (ret != DB_DELETED) - goto out; - } - /* - * The transaction committed, so the only thing that might - * be true is that the backup file is still around. Try - * to delete it, but it's not an error if that delete fails. - */ - if ((ret = __db_backup_name(dbenv, argp->name.data, - &backup, lsnp)) != 0) - goto out; - if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, backup, 0, NULL, &real_back)) != 0) - goto out; - if (__os_exists(real_back, NULL) == 0) - if ((ret = __os_unlink(dbenv, real_back)) != 0) - goto out; - if ((ret = __db_txnlist_delete(dbenv, info, - argp->name.data, TXNLIST_INVALID_ID, 1)) != 0) - goto out; - } else if (DB_UNDO(op)) { - /* - * Trying to undo. File may or may not have been deleted. - * Try to move the backup to the original. If the backup - * exists, then this is right. If it doesn't exist, then - * nothing will happen and that's OK. - */ - if ((ret = __db_backup_name(dbenv, argp->name.data, - &backup, lsnp)) != 0) - goto out; - if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, backup, 0, NULL, &real_back)) != 0) - goto out; - if ((ret = __db_appname(dbenv, DB_APP_DATA, - NULL, argp->name.data, 0, NULL, &real_name)) != 0) - goto out; - if (__os_exists(real_back, NULL) == 0) - if ((ret = - __os_rename(dbenv, real_back, real_name)) != 0) - goto out; - } - - *lsnp = argp->prev_lsn; - ret = 0; - -out: if (argp != NULL) - __os_free(argp, 0); - if (backup != NULL) - __os_freestr(backup); - if (real_back != NULL) - __os_freestr(real_back); - if (real_name != NULL) - __os_freestr(real_name); - return (ret); -} -/* - * __crdel_rename_recover -- - * Recovery function for rename. - * - * PUBLIC: int __crdel_rename_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__crdel_rename_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - DB *dbp; - __crdel_rename_args *argp; - char *new_name, *real_name; - int ret, set; - - COMPQUIET(info, NULL); - - REC_PRINT(__crdel_rename_print); - - new_name = real_name = NULL; - - if ((ret = __crdel_rename_read(dbenv, dbtp->data, &argp)) != 0) - goto out; - - if ((ret = __db_fileid_to_db(dbenv, &dbp, argp->fileid, 0)) != 0) - goto out; - if (DB_REDO(op)) { - /* - * We don't use the dbp parameter to __log_filelist_update - * in the rename case, so passing NULL for it is OK. - */ - if ((ret = __log_filelist_update(dbenv, NULL, - argp->fileid, argp->newname.data, &set)) != 0) - goto out; - if (set != 0) { - if ((ret = __db_appname(dbenv, DB_APP_DATA, - NULL, argp->name.data, 0, NULL, &real_name)) != 0) - goto out; - if (__os_exists(real_name, NULL) == 0) { - if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, argp->newname.data, - 0, NULL, &new_name)) != 0) - goto out; - /* - * On Windows, the underlying file - * must be closed to perform a remove. - * The db will be closed by a - * log_register record. Rename - * has exclusive access to the db. - */ - (void)__memp_fremove(dbp->mpf); - if ((ret = memp_fclose(dbp->mpf)) != 0) - goto out; - dbp->mpf = NULL; - if ((ret = __os_rename(dbenv, - real_name, new_name)) != 0) - goto out; - } - } - } else { - /* - * We don't use the dbp parameter to __log_filelist_update - * in the rename case, so passing NULL for it is OK. - */ - if ((ret = __log_filelist_update(dbenv, NULL, - argp->fileid, argp->name.data, &set)) != 0) - goto out; - if (set != 0) { - if ((ret = __db_appname(dbenv, DB_APP_DATA, - NULL, argp->newname.data, 0, NULL, &new_name)) != 0) - goto out; - if (__os_exists(new_name, NULL) == 0) { - if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, argp->name.data, - 0, NULL, &real_name)) != 0) - goto out; - /* - * On Windows, the underlying file - * must be closed to perform a remove. - * The file may have already been closed - * if we are aborting the transaction. - */ - if (dbp->mpf != NULL) { - (void)__memp_fremove(dbp->mpf); - if ((ret = memp_fclose(dbp->mpf)) != 0) - goto out; - dbp->mpf = NULL; - } - if ((ret = __os_rename(dbenv, - new_name, real_name)) != 0) - goto out; - } - } - } - - *lsnp = argp->prev_lsn; - ret = 0; - -out: if (argp != NULL) - __os_free(argp, 0); - - if (new_name != NULL) - __os_free(new_name, 0); - - if (real_name != NULL) - __os_free(real_name, 0); - - return (ret); +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } diff --git a/bdb/db/db.c b/bdb/db/db.c index 6e74b4b21bd..986167d5ade 100644 --- a/bdb/db/db.c +++ b/bdb/db/db.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -40,7 +40,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db.c,v 11.117 2001/01/11 18:19:50 bostic Exp $"; +static const char revid[] = "$Id: db.c,v 11.246 2002/08/20 14:40:00 margo Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -52,352 +52,41 @@ static const char revid[] = "$Id: db.c,v 11.117 2001/01/11 18:19:50 bostic Exp $ #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "db_swap.h" -#include "btree.h" -#include "db_am.h" -#include "hash.h" -#include "lock.h" -#include "log.h" -#include "mp.h" -#include "qam.h" -#include "common_ext.h" +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/db_swap.h" +#include "dbinc/btree.h" +#include "dbinc/hash.h" +#include "dbinc/lock.h" +#include "dbinc/log.h" +#include "dbinc/log.h" +#include "dbinc/mp.h" +#include "dbinc/qam.h" +#include "dbinc/txn.h" -/* Actions that __db_master_update can take. */ -typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action; - -/* Flag values that __db_file_setup can return. */ -#define DB_FILE_SETUP_CREATE 0x01 -#define DB_FILE_SETUP_ZERO 0x02 - -static int __db_file_setup __P((DB *, - const char *, u_int32_t, int, db_pgno_t, int *)); -static int __db_master_update __P((DB *, - const char *, u_int32_t, - db_pgno_t *, mu_action, const char *, u_int32_t)); -static int __db_refresh __P((DB *)); -static int __db_remove_callback __P((DB *, void *)); -static int __db_set_pgsize __P((DB *, DB_FH *, char *)); -static int __db_subdb_remove __P((DB *, const char *, const char *)); -static int __db_subdb_rename __P(( DB *, - const char *, const char *, const char *)); -#if CONFIG_TEST +static int __db_disassociate __P((DB *)); +#if CONFIG_TEST static void __db_makecopy __P((const char *, const char *)); -static int __db_testdocopy __P((DB *, const char *)); -static int __qam_testdocopy __P((DB *, const char *)); +static int __db_testdocopy __P((DB_ENV *, const char *)); +static int __qam_testdocopy __P((DB *, const char *)); #endif /* - * __db_open -- - * Main library interface to the DB access methods. - * - * PUBLIC: int __db_open __P((DB *, - * PUBLIC: const char *, const char *, DBTYPE, u_int32_t, int)); + * DB.C -- + * This file contains the utility functions for the DBP layer. */ -int -__db_open(dbp, name, subdb, type, flags, mode) - DB *dbp; - const char *name, *subdb; - DBTYPE type; - u_int32_t flags; - int mode; -{ - DB_ENV *dbenv; - DB_LOCK open_lock; - DB *mdbp; - db_pgno_t meta_pgno; - u_int32_t ok_flags; - int ret, t_ret; - - dbenv = dbp->dbenv; - mdbp = NULL; - - /* Validate arguments. */ -#define OKFLAGS \ - (DB_CREATE | DB_EXCL | DB_FCNTL_LOCKING | \ - DB_NOMMAP | DB_RDONLY | DB_RDWRMASTER | DB_THREAD | DB_TRUNCATE) - if ((ret = __db_fchk(dbenv, "DB->open", flags, OKFLAGS)) != 0) - return (ret); - if (LF_ISSET(DB_EXCL) && !LF_ISSET(DB_CREATE)) - return (__db_ferr(dbenv, "DB->open", 1)); - if (LF_ISSET(DB_RDONLY) && LF_ISSET(DB_CREATE)) - return (__db_ferr(dbenv, "DB->open", 1)); -#ifdef HAVE_VXWORKS - if (LF_ISSET(DB_TRUNCATE)) { - __db_err(dbenv, "DB_TRUNCATE unsupported in VxWorks"); - return (__db_eopnotsup(dbenv)); - } -#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", - name); - return (EINVAL); - } - ok_flags = 0; - break; - case DB_BTREE: - ok_flags = DB_OK_BTREE; - break; - case DB_HASH: - ok_flags = DB_OK_HASH; - break; - case DB_QUEUE: - ok_flags = DB_OK_QUEUE; - break; - case DB_RECNO: - ok_flags = DB_OK_RECNO; - break; - default: - __db_err(dbenv, "unknown type: %lu", (u_long)type); - return (EINVAL); - } - if (ok_flags) - DB_ILLEGAL_METHOD(dbp, ok_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"); - return (EINVAL); - } - - /* - * Historically, you could pass in an environment that didn't have a - * mpool, and DB would create a private one behind the scenes. This - * no longer works. - */ - if (!F_ISSET(dbenv, DB_ENV_DBLOCAL) && !MPOOL_ON(dbenv)) { - __db_err(dbenv, "environment did not include a memory pool."); - return (EINVAL); - } - - /* - * You can't specify threads during DB->open if subsystems in the - * environment weren't configured with them. - */ - if (LF_ISSET(DB_THREAD) && - !F_ISSET(dbenv, DB_ENV_DBLOCAL | DB_ENV_THREAD)) { - __db_err(dbenv, "environment not created using DB_THREAD"); - return (EINVAL); - } - - /* - * If the environment was configured with threads, the DB handle - * must also be free-threaded, so we force the DB_THREAD flag on. - * (See SR #2033 for why this is a requirement--recovery needs - * to be able to grab a dbp using __db_fileid_to_dbp, and it has - * no way of knowing which dbp goes with which thread, so whichever - * one it finds has to be usable in any of them.) - */ - if (F_ISSET(dbenv, DB_ENV_THREAD)) - LF_SET(DB_THREAD); - - /* DB_TRUNCATE is not transaction recoverable. */ - if (LF_ISSET(DB_TRUNCATE) && TXN_ON(dbenv)) { - __db_err(dbenv, - "DB_TRUNCATE illegal in a transaction protected environment"); - return (EINVAL); - } - - /* Subdatabase checks. */ - if (subdb != NULL) { - /* Subdatabases must be created in named files. */ - if (name == NULL) { - __db_err(dbenv, - "multiple databases cannot be created in temporary files"); - 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); - } - } - - /* Convert any DB->open flags. */ - if (LF_ISSET(DB_RDONLY)) - F_SET(dbp, DB_AM_RDONLY); - - /* Fill in the type. */ - dbp->type = type; - - /* - * If we're potentially creating a database, wrap the open inside of - * a transaction. - */ - if (TXN_ON(dbenv) && LF_ISSET(DB_CREATE)) - if ((ret = __db_metabegin(dbp, &open_lock)) != 0) - return (ret); - - /* - * If we're opening a subdatabase, we have to open (and potentially - * create) the main database, and then get (and potentially store) - * our base page number in that database. Then, we can finally open - * the subdatabase. - */ - if (subdb == NULL) - meta_pgno = PGNO_BASE_MD; - else { - /* - * Open the master database, optionally creating or updating - * it, and retrieve the metadata page number. - */ - if ((ret = - __db_master_open(dbp, name, flags, mode, &mdbp)) != 0) - goto err; - - /* Copy the page size and file id from the master. */ - dbp->pgsize = mdbp->pgsize; - F_SET(dbp, DB_AM_SUBDB); - memcpy(dbp->fileid, mdbp->fileid, DB_FILE_ID_LEN); - - if ((ret = __db_master_update(mdbp, - subdb, type, &meta_pgno, MU_OPEN, NULL, flags)) != 0) - goto err; - - /* - * Clear the exclusive open and truncation flags, they only - * apply to the open of the master database. - */ - LF_CLR(DB_EXCL | DB_TRUNCATE); - } - - ret = __db_dbopen(dbp, name, flags, mode, meta_pgno); - - /* - * You can open the database that describes the subdatabases in the - * rest of the file read-only. The content of each key's data is - * unspecified and applications should never be adding new records - * or updating existing records. However, during recovery, we need - * to open these databases R/W so we can redo/undo changes in them. - * Likewise, we need to open master databases read/write during - * rename and remove so we can be sure they're fully sync'ed, so - * we provide an override flag for the purpose. - */ - if (subdb == NULL && !IS_RECOVERING(dbenv) && !LF_ISSET(DB_RDONLY) && - !LF_ISSET(DB_RDWRMASTER) && F_ISSET(dbp, DB_AM_SUBDB)) { - __db_err(dbenv, - "files containing multiple databases may only be opened read-only"); - ret = EINVAL; - goto err; - } - -err: /* - * End any transaction, committing if we were successful, aborting - * otherwise. - */ - if (TXN_ON(dbenv) && LF_ISSET(DB_CREATE)) - if ((t_ret = __db_metaend(dbp, - &open_lock, ret == 0, NULL, NULL)) != 0 && ret == 0) - ret = t_ret; - - /* If we were successful, don't discard the file on close. */ - if (ret == 0) - F_CLR(dbp, DB_AM_DISCARD); - - /* If we were unsuccessful, destroy the DB handle. */ - if (ret != 0) { - /* In recovery we set log_fileid early. */ - if (IS_RECOVERING(dbenv)) - dbp->log_fileid = DB_LOGFILEID_INVALID; - __db_refresh(dbp); - } - - if (mdbp != NULL) { - /* If we were successful, don't discard the file on close. */ - if (ret == 0) - F_CLR(mdbp, DB_AM_DISCARD); - if ((t_ret = mdbp->close(mdbp, 0)) != 0 && ret == 0) - ret = t_ret; - } - - return (ret); -} - -/* - * __db_dbopen -- - * Open a database. - * PUBLIC: int __db_dbopen __P((DB *, const char *, u_int32_t, int, db_pgno_t)); - */ -int -__db_dbopen(dbp, name, flags, mode, meta_pgno) - DB *dbp; - const char *name; - u_int32_t flags; - int mode; - db_pgno_t meta_pgno; -{ - DB_ENV *dbenv; - int ret, retinfo; - - dbenv = dbp->dbenv; - - /* Set up the underlying file. */ - if ((ret = __db_file_setup(dbp, - name, flags, mode, meta_pgno, &retinfo)) != 0) - return (ret); - - /* - * If we created the file, set the truncate flag for the mpool. This - * isn't for anything we've done, it's protection against stupid user - * tricks: if the user deleted a file behind Berkeley DB's back, we - * may still have pages in the mpool that match the file's "unique" ID. - */ - if (retinfo & DB_FILE_SETUP_CREATE) - flags |= DB_TRUNCATE; - - /* Set up the underlying environment. */ - if ((ret = __db_dbenv_setup(dbp, name, flags)) != 0) - return (ret); - - /* - * Do access method specific initialization. - * - * !!! - * Set the open flag. (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_OPEN_CALLED); - - if (retinfo & DB_FILE_SETUP_ZERO) - return (0); - - switch (dbp->type) { - case DB_BTREE: - ret = __bam_open(dbp, name, meta_pgno, flags); - break; - case DB_HASH: - ret = __ham_open(dbp, name, meta_pgno, flags); - break; - case DB_RECNO: - ret = __ram_open(dbp, name, meta_pgno, flags); - break; - case DB_QUEUE: - ret = __qam_open(dbp, name, meta_pgno, mode, flags); - break; - case DB_UNKNOWN: - return (__db_unknown_type(dbp->dbenv, - "__db_dbopen", dbp->type)); - break; - } - return (ret); -} /* * __db_master_open -- * Open up a handle on a master database. * * PUBLIC: int __db_master_open __P((DB *, - * PUBLIC: const char *, u_int32_t, int, DB **)); + * PUBLIC: DB_TXN *, const char *, u_int32_t, int, DB **)); */ int -__db_master_open(subdbp, name, flags, mode, dbpp) +__db_master_open(subdbp, txn, name, flags, mode, dbpp) DB *subdbp; + DB_TXN *txn; const char *name; u_int32_t flags; int mode; @@ -417,30 +106,62 @@ __db_master_open(subdbp, name, flags, mode, dbpp) * Flag that we're creating a database with subdatabases. */ dbp->type = DB_BTREE; - dbp->open_txn = subdbp->open_txn; dbp->pgsize = subdbp->pgsize; F_SET(dbp, DB_AM_SUBDB); + F_SET(dbp, F_ISSET(subdbp, + DB_AM_RECOVER | DB_AM_SWAP | DB_AM_ENCRYPT | DB_AM_CHKSUM)); - if ((ret = __db_dbopen(dbp, name, flags, mode, PGNO_BASE_MD)) != 0) { - if (!F_ISSET(dbp, DB_AM_DISCARD)) - dbp->close(dbp, 0); - return (ret); + /* + * If there was a subdb specified, then we only want to apply + * DB_EXCL to the subdb, not the actual file. We only got here + * because there was a subdb specified. + */ + LF_CLR(DB_EXCL); + LF_SET(DB_RDWRMASTER); + if ((ret = __db_dbopen(dbp, txn, name, NULL, flags, mode, PGNO_BASE_MD)) + != 0) + 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 + * chksumming 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; } - - *dbpp = dbp; - return (0); +err: + if (ret != 0 && !F_ISSET(dbp, DB_AM_DISCARD)) + __db_close_i(dbp, txn, 0); + else + *dbpp = dbp; + return (ret); } /* * __db_master_update -- - * Add/Remove a subdatabase from a master database. + * Add/Open/Remove a subdatabase from a master database. + * + * PUBLIC: int __db_master_update __P((DB *, DB *, DB_TXN *, const char *, + * PUBLIC: DBTYPE, mu_action, const char *, u_int32_t)); */ -static int -__db_master_update(mdbp, subdb, type, meta_pgnop, action, newname, flags) - DB *mdbp; +int +__db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags) + DB *mdbp, *sdbp; + DB_TXN *txn; const char *subdb; - u_int32_t type; - db_pgno_t *meta_pgnop; /* may be NULL on MU_RENAME */ + DBTYPE type; mu_action action; const char *newname; u_int32_t flags; @@ -456,33 +177,37 @@ __db_master_update(mdbp, subdb, type, meta_pgnop, action, newname, flags) dbc = ndbc = NULL; p = NULL; - /* Might we modify the master database? If so, we'll need to lock. */ - modify = (action != MU_OPEN || LF_ISSET(DB_CREATE)) ? 1 : 0; - 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. */ - if ((ret = mdbp->cursor(mdbp, mdbp->open_txn, &dbc, + if ((ret = mdbp->cursor(mdbp, txn, &dbc, (CDB_LOCKING(dbenv) && modify) ? DB_WRITECURSOR : 0)) != 0) goto err; /* - * Try to point the cursor at the record. + * Point the cursor at the record. * * If we're removing or potentially creating an entry, lock the page * with DB_RMW. * + * We do multiple cursor operations with the cursor in some cases and + * subsequently access the data DBT information. Set DB_DBT_MALLOC so + * we don't risk modification of the data between our uses of it. + * * !!! * We don't include the name's nul termination in the database. */ - key.data = (char *)subdb; - key.size = strlen(subdb); - /* In the rename case, we do multiple cursor ops, so MALLOC is safer. */ + key.data = (void *)subdb; + key.size = (u_int32_t)strlen(subdb); F_SET(&data, DB_DBT_MALLOC); + ret = dbc->c_get(dbc, &key, &data, DB_SET | ((STD_LOCKING(dbc) && modify) ? DB_RMW : 0)); @@ -514,9 +239,10 @@ __db_master_update(mdbp, subdb, type, meta_pgnop, action, newname, flags) * so it hasn't been converted to/from opposite * endian architectures. Do it explicitly, now. */ - memcpy(meta_pgnop, data.data, sizeof(db_pgno_t)); - DB_NTOHL(meta_pgnop); - if ((ret = memp_fget(mdbp->mpf, meta_pgnop, 0, &p)) != 0) + memcpy(&sdbp->meta_pgno, data.data, sizeof(db_pgno_t)); + DB_NTOHL(&sdbp->meta_pgno); + if ((ret = + mdbp->mpf->get(mdbp->mpf, &sdbp->meta_pgno, 0, &p)) != 0) goto err; /* Free and put the page. */ @@ -538,11 +264,11 @@ __db_master_update(mdbp, subdb, type, meta_pgnop, action, newname, flags) * for the existence of newname; it shouldn't appear under * us since we hold the metadata lock. */ - if ((ret = mdbp->cursor(mdbp, mdbp->open_txn, &ndbc, 0)) != 0) + if ((ret = mdbp->cursor(mdbp, txn, &ndbc, 0)) != 0) goto err; DB_ASSERT(newname != NULL); - key.data = (void *) newname; - key.size = strlen(newname); + key.data = (void *)newname; + key.size = (u_int32_t)strlen(newname); /* * We don't actually care what the meta page of the potentially- @@ -583,8 +309,12 @@ __db_master_update(mdbp, subdb, type, meta_pgnop, action, newname, flags) */ switch (ret) { case 0: - memcpy(meta_pgnop, data.data, sizeof(db_pgno_t)); - DB_NTOHL(meta_pgnop); + if (LF_ISSET(DB_CREATE) && LF_ISSET(DB_EXCL)) { + ret = EEXIST; + goto err; + } + memcpy(&sdbp->meta_pgno, data.data, sizeof(db_pgno_t)); + DB_NTOHL(&sdbp->meta_pgno); goto done; case DB_NOTFOUND: if (LF_ISSET(DB_CREATE)) @@ -599,10 +329,22 @@ __db_master_update(mdbp, subdb, type, meta_pgnop, action, newname, flags) goto err; } + /* + * We need to check against the master lorder here because + * we only want to check this if we are creating. In the + * case where we don't create we just want to inherit. + */ + if (F_ISSET(mdbp, DB_AM_SWAP) != F_ISSET(sdbp, DB_AM_SWAP)) { + ret = EINVAL; + __db_err(mdbp->dbenv, + "Different lorder specified on existent file"); + goto err; + } + /* Create a subdatabase. */ if ((ret = __db_new(dbc, type == DB_HASH ? P_HASHMETA : P_BTREEMETA, &p)) != 0) goto err; - *meta_pgnop = PGNO(p); + sdbp->meta_pgno = PGNO(p); /* * XXX @@ -617,6 +359,7 @@ __db_master_update(mdbp, subdb, type, meta_pgnop, action, newname, flags) ndata.size = sizeof(db_pgno_t); if ((ret = dbc->c_put(dbc, &key, &ndata, DB_KEYLAST)) != 0) goto err; + F_SET(sdbp, DB_AM_CREATED); break; } @@ -628,7 +371,7 @@ done: /* if (p != NULL) { if (ret == 0) { if ((t_ret = - memp_fput(mdbp->mpf, p, DB_MPOOL_DIRTY)) != 0) + mdbp->mpf->put(mdbp->mpf, p, DB_MPOOL_DIRTY)) != 0) ret = t_ret; /* * Since we cannot close this file until after @@ -639,12 +382,12 @@ done: /* if ((t_ret = mdbp->sync(mdbp, 0)) != 0 && ret == 0) ret = t_ret; } else - (void)__db_free(dbc, p); + (void)mdbp->mpf->put(mdbp->mpf, p, 0); } /* Discard the cursor(s) and data. */ if (data.data != NULL) - __os_free(data.data, data.size); + __os_ufree(dbenv, data.data); if (dbc != NULL && (t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; if (ndbc != NULL && (t_ret = ndbc->c_close(ndbc)) != 0 && ret == 0) @@ -657,21 +400,25 @@ done: /* * __db_dbenv_setup -- * Set up the underlying environment during a db_open. * - * PUBLIC: int __db_dbenv_setup __P((DB *, const char *, u_int32_t)); + * PUBLIC: int __db_dbenv_setup __P((DB *, + * PUBLIC: DB_TXN *, const char *, u_int32_t, u_int32_t)); */ int -__db_dbenv_setup(dbp, name, flags) +__db_dbenv_setup(dbp, txn, name, id, flags) DB *dbp; + DB_TXN *txn; const char *name; + u_int32_t id; u_int32_t flags; { DB *ldbp; - DB_ENV *dbenv; DBT pgcookie; - DB_MPOOL_FINFO finfo; + DB_ENV *dbenv; + DB_MPOOL *dbmp; + DB_MPOOLFILE *mpf; DB_PGINFO pginfo; - int ret; u_int32_t maxid; + int ftype, ret; dbenv = dbp->dbenv; @@ -690,8 +437,18 @@ __db_dbenv_setup(dbp, name, flags) } /* Register DB's pgin/pgout functions. */ - if ((ret = - memp_register(dbenv, DB_FTYPE_SET, __db_pgin, __db_pgout)) != 0) + if ((ret = dbenv->memp_register( + dbenv, DB_FTYPE_SET, __db_pgin, __db_pgout)) != 0) + return (ret); + + /* Create the DB_MPOOLFILE structure. */ + if ((ret = dbenv->memp_fcreate(dbenv, &dbp->mpf, 0)) != 0) + return (ret); + mpf = dbp->mpf; + + /* Set the database's cache priority if we've been given one. */ + if (dbp->priority != 0 && + (ret = mpf->set_priority(mpf, dbp->priority)) != 0) return (ret); /* @@ -704,22 +461,26 @@ __db_dbenv_setup(dbp, name, flags) * need to page the file in and out. This has to be right -- we can't * mmap files that are being paged in and out. */ - memset(&finfo, 0, sizeof(finfo)); switch (dbp->type) { case DB_BTREE: case DB_RECNO: - finfo.ftype = - F_ISSET(dbp, DB_AM_SWAP) ? DB_FTYPE_SET : DB_FTYPE_NOTSET; - finfo.clear_len = DB_PAGE_DB_LEN; + ftype = F_ISSET(dbp, DB_AM_SWAP | DB_AM_ENCRYPT | DB_AM_CHKSUM) + ? DB_FTYPE_SET : DB_FTYPE_NOTSET; + (void)mpf->set_ftype(mpf, ftype); + (void)mpf->set_clear_len(mpf, (CRYPTO_ON(dbenv) ? + dbp->pgsize : DB_PAGE_DB_LEN)); break; case DB_HASH: - finfo.ftype = DB_FTYPE_SET; - finfo.clear_len = DB_PAGE_DB_LEN; + (void)mpf->set_ftype(mpf, DB_FTYPE_SET); + (void)mpf->set_clear_len(mpf, (CRYPTO_ON(dbenv) ? + dbp->pgsize : DB_PAGE_DB_LEN)); break; case DB_QUEUE: - finfo.ftype = - F_ISSET(dbp, DB_AM_SWAP) ? DB_FTYPE_SET : DB_FTYPE_NOTSET; - finfo.clear_len = DB_PAGE_QUEUE_LEN; + ftype = F_ISSET(dbp, DB_AM_SWAP | DB_AM_ENCRYPT | DB_AM_CHKSUM) + ? DB_FTYPE_SET : DB_FTYPE_NOTSET; + (void)mpf->set_ftype(mpf, ftype); + (void)mpf->set_clear_len(mpf, (CRYPTO_ON(dbenv) ? + dbp->pgsize : DB_PAGE_QUEUE_LEN)); break; case DB_UNKNOWN: /* @@ -735,48 +496,63 @@ __db_dbenv_setup(dbp, name, flags) * to salvage some data even with no metadata page. */ if (F_ISSET(dbp, DB_AM_VERIFYING)) { - finfo.ftype = DB_FTYPE_NOTSET; - finfo.clear_len = DB_PAGE_DB_LEN; + (void)mpf->set_ftype(mpf, DB_FTYPE_NOTSET); + (void)mpf->set_clear_len(mpf, DB_PAGE_DB_LEN); break; } - return (__db_unknown_type(dbp->dbenv, - "__db_dbenv_setup", dbp->type)); + /* FALLTHROUGH */ + default: + return ( + __db_unknown_type(dbenv, "__db_dbenv_setup", dbp->type)); } - finfo.pgcookie = &pgcookie; - finfo.fileid = dbp->fileid; - finfo.lsn_offset = 0; + + (void)mpf->set_fileid(mpf, dbp->fileid); + (void)mpf->set_lsn_offset(mpf, 0); pginfo.db_pagesize = dbp->pgsize; - pginfo.needswap = F_ISSET(dbp, DB_AM_SWAP); + pginfo.flags = + F_ISSET(dbp, (DB_AM_CHKSUM | DB_AM_ENCRYPT | DB_AM_SWAP)); + pginfo.type = dbp->type; pgcookie.data = &pginfo; pgcookie.size = sizeof(DB_PGINFO); + (void)mpf->set_pgcookie(mpf, &pgcookie); - if ((ret = memp_fopen(dbenv, name, - LF_ISSET(DB_RDONLY | DB_NOMMAP | DB_ODDFILESIZE | DB_TRUNCATE), - 0, dbp->pgsize, &finfo, &dbp->mpf)) != 0) + if ((ret = mpf->open(mpf, name, + LF_ISSET(DB_RDONLY | DB_NOMMAP | DB_ODDFILESIZE | DB_TRUNCATE) | + (F_ISSET(dbenv, DB_ENV_DIRECT_DB) ? DB_DIRECT : 0), + 0, dbp->pgsize)) != 0) return (ret); /* - * We may need a per-thread mutex. Allocate it from the environment + * 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)) { - if ((ret = __db_mutex_alloc( - dbenv, dbenv->reginfo, (MUTEX **)&dbp->mutexp)) != 0) + dbmp = dbenv->mp_handle; + if ((ret = __db_mutex_setup(dbenv, dbmp->reginfo, &dbp->mutexp, + MUTEX_ALLOC | MUTEX_THREAD)) != 0) return (ret); - if ((ret = __db_mutex_init( - dbenv, dbp->mutexp, 0, MUTEX_THREAD)) != 0) { - __db_mutex_free(dbenv, dbenv->reginfo, dbp->mutexp); - return (ret); - } } - /* Get a log file id. */ - if (LOGGING_ON(dbenv) && !IS_RECOVERING(dbenv) && + /* + * Set up a bookkeeping entry for this database in the log region, + * if such a region exists. Note that even if we're in recovery + * 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, name, 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. + */ + if (DBENV_LOGGING(dbenv) && !F_ISSET(dbp, DB_AM_RECOVER) && #if !defined(DEBUG_ROP) !F_ISSET(dbp, DB_AM_RDONLY) && #endif - (ret = log_register(dbenv, dbp, name)) != 0) + (ret = __dbreg_new_id(dbp, txn)) != 0) return (ret); /* @@ -821,463 +597,6 @@ __db_dbenv_setup(dbp, name, flags) return (0); } -/* - * __db_file_setup -- - * Setup the file or in-memory data. - * Read the database metadata and resolve it with our arguments. - */ -static int -__db_file_setup(dbp, name, flags, mode, meta_pgno, retflags) - DB *dbp; - const char *name; - u_int32_t flags; - int mode; - db_pgno_t meta_pgno; - int *retflags; -{ - DB *mdb; - DBT namedbt; - DB_ENV *dbenv; - DB_FH *fhp, fh; - DB_LSN lsn; - DB_TXN *txn; - size_t nr; - u_int32_t magic, oflags; - int ret, retry_cnt, t_ret; - char *real_name, mbuf[DBMETASIZE]; - -#define IS_SUBDB_SETUP (meta_pgno != PGNO_BASE_MD) - - dbenv = dbp->dbenv; - dbp->meta_pgno = meta_pgno; - txn = NULL; - *retflags = 0; - - /* - * If we open a file handle and our caller is doing fcntl(2) locking, - * we can't close it because that would discard the caller's lock. - * Save it until we close the DB handle. - */ - if (LF_ISSET(DB_FCNTL_LOCKING)) { - if ((ret = __os_malloc(dbenv, sizeof(*fhp), NULL, &fhp)) != 0) - return (ret); - } else - fhp = &fh; - memset(fhp, 0, sizeof(*fhp)); - - /* - * If the file is in-memory, set up is simple. Otherwise, do the - * hard work of opening and reading the file. - * - * If we have a file name, try and read the first page, figure out - * what type of file it is, and initialize everything we can based - * on that file's meta-data page. - * - * !!! - * There's a reason we don't push this code down into the buffer cache. - * The problem is that there's no information external to the file that - * we can use as a unique ID. UNIX has dev/inode pairs, but they are - * not necessarily unique after reboot, if the file was mounted via NFS. - * Windows has similar problems, as the FAT filesystem doesn't maintain - * dev/inode numbers across reboot. So, we must get something from the - * file we can use to ensure that, even after a reboot, the file we're - * joining in the cache is the right file for us to join. The solution - * we use is to maintain a file ID that's stored in the database, and - * that's why we have to open and read the file before calling into the - * buffer cache. - * - * The secondary reason is that there's additional information that - * we want to have before instantiating a file in the buffer cache: - * the page size, file type (btree/hash), if swapping is required, - * and flags (DB_RDONLY, DB_CREATE, DB_TRUNCATE). We could handle - * needing this information by allowing it to be set for a file in - * the buffer cache even after the file has been opened, and, of - * course, supporting the ability to flush a file from the cache as - * necessary, e.g., if we guessed wrongly about the page size. Given - * that we have to read the file anyway to get the file ID, we might - * as well get the rest, too. - * - * Get the real file name. - */ - if (name == NULL) { - F_SET(dbp, DB_AM_INMEM); - - if (dbp->type == DB_UNKNOWN) { - __db_err(dbenv, - "DBTYPE of unknown without existing file"); - return (EINVAL); - } - real_name = NULL; - - /* Set the page size if we don't have one yet. */ - 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)) != 0) - return (ret); - - return (0); - } - - /* Get the real backing file name. */ - if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, name, 0, NULL, &real_name)) != 0) - return (ret); - - /* - * Open the backing file. We need to make sure that multiple processes - * attempting to create the file at the same time are properly ordered - * so that only one of them creates the "unique" file ID, so we open it - * O_EXCL and O_CREAT so two simultaneous attempts to create the region - * will return failure in one of the attempts. If we're the one that - * fails, simply retry without the O_CREAT flag, which will require the - * meta-data page exist. - */ - - /* Fill in the default file mode. */ - if (mode == 0) - mode = __db_omode("rwrw--"); - - oflags = 0; - if (LF_ISSET(DB_RDONLY)) - oflags |= DB_OSO_RDONLY; - if (LF_ISSET(DB_TRUNCATE)) - oflags |= DB_OSO_TRUNC; - - retry_cnt = 0; -open_retry: - *retflags = 0; - ret = 0; - if (!IS_SUBDB_SETUP && LF_ISSET(DB_CREATE)) { - if (dbp->open_txn != NULL) { - /* - * Start a child transaction to wrap this individual - * create. - */ - if ((ret = - txn_begin(dbenv, dbp->open_txn, &txn, 0)) != 0) - goto err_msg; - - memset(&namedbt, 0, sizeof(namedbt)); - namedbt.data = (char *)name; - namedbt.size = strlen(name) + 1; - if ((ret = __crdel_fileopen_log(dbenv, txn, - &lsn, DB_FLUSH, &namedbt, mode)) != 0) - goto err_msg; - } - DB_TEST_RECOVERY(dbp, DB_TEST_PREOPEN, ret, name); - if ((ret = __os_open(dbenv, real_name, - oflags | DB_OSO_CREATE | DB_OSO_EXCL, mode, fhp)) == 0) { - DB_TEST_RECOVERY(dbp, DB_TEST_POSTOPEN, ret, name); - - /* Commit the file create. */ - if (dbp->open_txn != NULL) { - if ((ret = txn_commit(txn, DB_TXN_SYNC)) != 0) - goto err_msg; - txn = NULL; - } - - /* - * We created the file. This means that if we later - * fail, we need to delete the file and if we're going - * to do that, we need to trash any pages in the - * memory pool. Since we only know here that we - * created the file, we're going to set the flag here - * and clear it later if we commit successfully. - */ - F_SET(dbp, DB_AM_DISCARD); - *retflags |= DB_FILE_SETUP_CREATE; - } else { - /* - * Abort the file create. If the abort fails, report - * the error returned by txn_abort(), rather than the - * open error, for no particular reason. - */ - if (dbp->open_txn != NULL) { - if ((t_ret = txn_abort(txn)) != 0) { - ret = t_ret; - goto err_msg; - } - txn = NULL; - } - - /* - * If we were not doing an exclusive open, try again - * without the create flag. - */ - if (ret == EEXIST && !LF_ISSET(DB_EXCL)) { - LF_CLR(DB_CREATE); - DB_TEST_RECOVERY(dbp, - DB_TEST_POSTOPEN, ret, name); - goto open_retry; - } - } - } else - ret = __os_open(dbenv, real_name, oflags, mode, fhp); - - /* - * Be quiet if we couldn't open the file because it didn't exist - * or we did not have permission, - * the customers don't like those messages appearing in the logs. - * Otherwise, complain loudly. - */ - if (ret != 0) { - if (ret == EACCES || ret == ENOENT) - goto err; - goto err_msg; - } - - /* Set the page size if we don't have one yet. */ - if (dbp->pgsize == 0) { - if (IS_SUBDB_SETUP) { - if ((ret = __db_master_open(dbp, - name, flags, mode, &mdb)) != 0) - goto err; - dbp->pgsize = mdb->pgsize; - (void)mdb->close(mdb, 0); - } else if ((ret = __db_set_pgsize(dbp, fhp, real_name)) != 0) - goto err; - } - - /* - * Seek to the metadata offset; if it's a master database open or a - * database without subdatabases, we're seeking to 0, but that's OK. - */ - if ((ret = __os_seek(dbenv, fhp, - dbp->pgsize, meta_pgno, 0, 0, DB_OS_SEEK_SET)) != 0) - goto err_msg; - - /* - * Read the metadata page. We read DBMETASIZE bytes, which is larger - * than any access method's metadata page and smaller than any disk - * sector. - */ - if ((ret = __os_read(dbenv, fhp, mbuf, sizeof(mbuf), &nr)) != 0) - goto err_msg; - - if (nr == sizeof(mbuf)) { - /* - * Figure out what access method we're dealing with, and then - * call access method specific code to check error conditions - * based on conflicts between the found file and application - * arguments. A found file overrides some user information -- - * 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); - magic = ((DBMETA *)mbuf)->magic; - -swap_retry: switch (magic) { - case DB_BTREEMAGIC: - if ((ret = - __bam_metachk(dbp, name, (BTMETA *)mbuf)) != 0) - goto err; - break; - case DB_HASHMAGIC: - if ((ret = - __ham_metachk(dbp, name, (HMETA *)mbuf)) != 0) - goto err; - break; - case DB_QAMMAGIC: - if ((ret = - __qam_metachk(dbp, name, (QMETA *)mbuf)) != 0) - goto err; - break; - case 0: - /* - * There are two ways we can get a 0 magic number. - * If we're creating a subdatabase, then the magic - * number will be 0. We allocate a page as part of - * finding out what the base page number will be for - * the new subdatabase, but it's not initialized in - * any way. - * - * The second case happens if we are in recovery - * and we are going to recreate a database, it's - * possible that it's page was created (on systems - * where pages must be created explicitly to avoid - * holes in files) but is still 0. - */ - if (IS_SUBDB_SETUP) { /* Case 1 */ - if ((IS_RECOVERING(dbenv) - && F_ISSET((DB_LOG *) - dbenv->lg_handle, DBLOG_FORCE_OPEN)) - || ((DBMETA *)mbuf)->pgno != PGNO_INVALID) - goto empty; - - ret = EINVAL; - goto err; - } - /* Case 2 */ - if (IS_RECOVERING(dbenv)) { - *retflags |= DB_FILE_SETUP_ZERO; - goto empty; - } - goto bad_format; - default: - if (F_ISSET(dbp, DB_AM_SWAP)) - goto bad_format; - - M_32_SWAP(magic); - F_SET(dbp, DB_AM_SWAP); - goto swap_retry; - } - } else { - /* - * Only newly created files are permitted to fail magic - * number tests. - */ - if (nr != 0 || (!IS_RECOVERING(dbenv) && IS_SUBDB_SETUP)) - goto bad_format; - - /* Let the caller know that we had a 0-length file. */ - if (!LF_ISSET(DB_CREATE | DB_TRUNCATE)) - *retflags |= DB_FILE_SETUP_ZERO; - - /* - * The only way we can reach here with the DB_CREATE flag set - * is if we created the file. If that's not the case, then - * either (a) someone else created the file but has not yet - * written out the metadata page, or (b) we truncated the file - * (DB_TRUNCATE) leaving it zero-length. In the case of (a), - * we want to sleep and give the file creator time to write - * the metadata page. In the case of (b), we want to continue. - * - * !!! - * There's a race in the case of two processes opening the file - * with the DB_TRUNCATE flag set at roughly the same time, and - * they could theoretically hurt each other. Sure hope that's - * unlikely. - */ - if (!LF_ISSET(DB_CREATE | DB_TRUNCATE) && - !IS_RECOVERING(dbenv)) { - if (retry_cnt++ < 3) { - __os_sleep(dbenv, 1, 0); - goto open_retry; - } -bad_format: if (!IS_RECOVERING(dbenv)) - __db_err(dbenv, - "%s: unexpected file type or format", name); - ret = EINVAL; - goto err; - } - - DB_ASSERT (dbp->type != DB_UNKNOWN); - -empty: /* - * The file is empty, and that's OK. If it's not a subdatabase, - * though, we do need to generate a unique file ID for it. The - * unique file ID includes a timestamp so that we can't collide - * with any other files, even when the file IDs (dev/inode pair) - * are reused. - */ - if (!IS_SUBDB_SETUP) { - if (*retflags & DB_FILE_SETUP_ZERO) - memset(dbp->fileid, 0, DB_FILE_ID_LEN); - else if ((ret = __os_fileid(dbenv, - real_name, 1, dbp->fileid)) != 0) - goto err_msg; - } - } - - if (0) { -err_msg: __db_err(dbenv, "%s: %s", name, db_strerror(ret)); - } - - /* - * Abort any running transaction -- it can only exist if something - * went wrong. - */ -err: -DB_TEST_RECOVERY_LABEL - - /* - * If we opened a file handle and our caller is doing fcntl(2) locking, - * then we can't close it because that would discard the caller's lock. - * Otherwise, close the handle. - */ - if (F_ISSET(fhp, DB_FH_VALID)) { - if (ret == 0 && LF_ISSET(DB_FCNTL_LOCKING)) - dbp->saved_open_fhp = fhp; - else - if ((t_ret = __os_closehandle(fhp)) != 0 && ret == 0) - ret = t_ret; - } - - /* - * This must be done after the file is closed, since - * txn_abort() may remove the file, and an open file - * cannot be removed on a Windows platforms. - */ - if (txn != NULL) - (void)txn_abort(txn); - - if (real_name != NULL) - __os_freestr(real_name); - - return (ret); -} - -/* - * __db_set_pgsize -- - * Set the page size based on file information. - */ -static int -__db_set_pgsize(dbp, fhp, name) - DB *dbp; - DB_FH *fhp; - char *name; -{ - DB_ENV *dbenv; - u_int32_t iopsize; - int ret; - - dbenv = dbp->dbenv; - - /* - * Use the filesystem's optimum I/O size as the pagesize if a pagesize - * not specified. Some filesystems have 64K as their optimum I/O size, - * but as that results in fairly large default caches, we limit the - * default pagesize to 16K. - */ - if ((ret = __os_ioinfo(dbenv, name, fhp, NULL, NULL, &iopsize)) != 0) { - __db_err(dbenv, "%s: %s", name, db_strerror(ret)); - return (ret); - } - if (iopsize < 512) - iopsize = 512; - if (iopsize > 16 * 1024) - iopsize = 16 * 1024; - - /* - * Sheer paranoia, but we don't want anything that's not a power-of-2 - * (we rely on that for alignment of various types on the pages), and - * we want a multiple of the sector size as well. - */ - OS_ROUNDOFF(iopsize, 512); - - dbp->pgsize = iopsize; - F_SET(dbp, DB_AM_PGDEF); - - return (0); -} - /* * __db_close -- * DB destructor. @@ -1290,73 +609,58 @@ __db_close(dbp, flags) u_int32_t flags; { DB_ENV *dbenv; - DBC *dbc; - int ret, t_ret; - - ret = 0; dbenv = dbp->dbenv; + PANIC_CHECK(dbenv); - /* Validate arguments. */ - if ((ret = __db_closechk(dbp, flags)) != 0) - goto err; + /* Validate arguments, but as a DB handle destructor, we can't fail. */ + if (flags != 0 && flags != DB_NOSYNC) + (void)__db_ferr(dbenv, "DB->close", 0); - /* If never opened, or not currently open, it's easy. */ - if (!F_ISSET(dbp, DB_OPEN_CALLED)) - goto never_opened; + return (__db_close_i(dbp, NULL, flags)); +} - /* Sync the underlying access method. */ - if (!LF_ISSET(DB_NOSYNC) && !F_ISSET(dbp, DB_AM_DISCARD) && - (t_ret = dbp->sync(dbp, 0)) != 0 && ret == 0) - ret = t_ret; +/* + * __db_close_i -- + * Internal DB destructor. + * + * PUBLIC: int __db_close_i __P((DB *, DB_TXN *, u_int32_t)); + */ +int +__db_close_i(dbp, txn, flags) + DB *dbp; + DB_TXN *txn; + u_int32_t flags; +{ + DB_ENV *dbenv; + int ret, t_ret; + + dbenv = dbp->dbenv; + ret = 0; /* - * Go through the active cursors and call the cursor recycle routine, - * which resolves pending operations and moves the cursors onto the - * free list. Then, walk the free list and call the cursor destroy - * routine. + * Validate arguments, but as a DB handle destructor, we can't fail. + * + * Check for consistent transaction usage -- ignore errors. Only + * internal callers specify transactions, so it's a serious problem + * if we get error messages. */ - while ((dbc = TAILQ_FIRST(&dbp->active_queue)) != NULL) - if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) - ret = t_ret; - while ((dbc = TAILQ_FIRST(&dbp->free_queue)) != NULL) - if ((t_ret = __db_c_destroy(dbc)) != 0 && ret == 0) - ret = t_ret; + if (txn != NULL) + (void)__db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0); - /* - * Close any outstanding join cursors. Join cursors destroy - * themselves on close and have no separate destroy routine. - */ - while ((dbc = TAILQ_FIRST(&dbp->join_queue)) != NULL) - if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) - ret = t_ret; - - /* Remove this DB handle from the DB_ENV's dblist. */ - MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); - LIST_REMOVE(dbp, dblistlinks); - MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); - - /* Sync the memory pool. */ - if (!LF_ISSET(DB_NOSYNC) && !F_ISSET(dbp, DB_AM_DISCARD) && - (t_ret = memp_fsync(dbp->mpf)) != 0 && - t_ret != DB_INCOMPLETE && ret == 0) + /* Refresh the structure and close any local environment. */ + if ((t_ret = __db_refresh(dbp, txn, flags)) != 0 && ret == 0) ret = t_ret; - /* Close any handle we've been holding since the open. */ - if (dbp->saved_open_fhp != NULL && - F_ISSET(dbp->saved_open_fhp, DB_FH_VALID) && - (t_ret = __os_closehandle(dbp->saved_open_fhp)) != 0 && ret == 0) - ret = t_ret; - -never_opened: /* * Call the access specific close function. * * !!! - * Because of where the function is called in the close process, - * these routines can't do anything that would dirty pages or - * otherwise affect closing down the database. + * Because of where these functions are called in the DB handle close + * process, these routines can't do anything that would dirty pages or + * otherwise affect closing down the database. Specifically, we can't + * abort and recover any of the information they control. */ if ((t_ret = __ham_db_close(dbp)) != 0 && ret == 0) ret = t_ret; @@ -1365,17 +669,14 @@ never_opened: if ((t_ret = __qam_db_close(dbp)) != 0 && ret == 0) ret = t_ret; -err: - /* Refresh the structure and close any local environment. */ - if ((t_ret = __db_refresh(dbp)) != 0 && ret == 0) - ret = t_ret; - if (F_ISSET(dbenv, DB_ENV_DBLOCAL) && - --dbenv->dblocal_ref == 0 && + --dbenv->db_ref; + if (F_ISSET(dbenv, DB_ENV_DBLOCAL) && dbenv->db_ref == 0 && (t_ret = dbenv->close(dbenv, 0)) != 0 && ret == 0) ret = t_ret; + /* Free the database handle. */ memset(dbp, CLEAR_BYTE, sizeof(*dbp)); - __os_free(dbp, sizeof(*dbp)); + __os_free(dbenv, dbp); return (ret); } @@ -1383,653 +684,257 @@ err: /* * __db_refresh -- * Refresh the DB structure, releasing any allocated resources. + * This does most of the work of closing files now because refresh + * is what is used during abort processing (since we can't destroy + * 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)); */ -static int -__db_refresh(dbp) +int +__db_refresh(dbp, txn, flags) DB *dbp; + DB_TXN *txn; + u_int32_t flags; { - DB_ENV *dbenv; + DB *sdbp; DBC *dbc; + DB_ENV *dbenv; + DB_LOCKREQ lreq; + DB_MPOOL *dbmp; int ret, t_ret; ret = 0; dbenv = dbp->dbenv; + /* If never opened, or not currently open, it's easy. */ + if (!F_ISSET(dbp, DB_AM_OPEN_CALLED)) + goto never_opened; + + /* + * If we have any secondary indices, disassociate them from us. + * We don't bother with the mutex here; it only protects some + * of the ops that will make us core-dump mid-close anyway, and + * if you're trying to do something with a secondary *while* you're + * closing the primary, you deserve what you get. The disassociation + * 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_REMOVE(sdbp, s_links); + if ((t_ret = __db_disassociate(sdbp)) != 0 && ret == 0) + ret = t_ret; + } + + /* + * Sync the underlying access method. Do before closing the cursors + * because DB->sync allocates cursors in order to write Recno backing + * source text files. + */ + if (!LF_ISSET(DB_NOSYNC) && !F_ISSET(dbp, DB_AM_DISCARD) && + (t_ret = dbp->sync(dbp, 0)) != 0 && ret == 0) + ret = t_ret; + /* * Go through the active cursors and call the cursor recycle routine, * which resolves pending operations and moves the cursors onto the * free list. Then, walk the free list and call the cursor destroy - * routine. + * routine. Note that any failure on a close is considered "really + * bad" and we just break out of the loop and force forward. */ while ((dbc = TAILQ_FIRST(&dbp->active_queue)) != NULL) - if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) - ret = t_ret; + if ((t_ret = dbc->c_close(dbc)) != 0) { + if (ret == 0) + ret = t_ret; + break; + } + while ((dbc = TAILQ_FIRST(&dbp->free_queue)) != NULL) - if ((t_ret = __db_c_destroy(dbc)) != 0 && ret == 0) + if ((t_ret = __db_c_destroy(dbc)) != 0) { + if (ret == 0) + ret = t_ret; + break; + } + + /* + * Close any outstanding join cursors. Join cursors destroy + * themselves on close and have no separate destroy routine. + */ + while ((dbc = TAILQ_FIRST(&dbp->join_queue)) != NULL) + if ((t_ret = dbc->c_close(dbc)) != 0) { + if (ret == 0) + ret = t_ret; + break; + } + + /* + * Sync the memory pool, even though we've already called DB->sync, + * because closing cursors can dirty pages by deleting items they + * referenced. + */ + if (!LF_ISSET(DB_NOSYNC) && !F_ISSET(dbp, DB_AM_DISCARD) && + (t_ret = dbp->mpf->sync(dbp->mpf)) != 0 && ret == 0) + ret = t_ret; + + /* Close any handle we've been holding since the open. */ + if (dbp->saved_open_fhp != NULL && + F_ISSET(dbp->saved_open_fhp, DB_FH_VALID) && + (t_ret = __os_closehandle(dbenv, dbp->saved_open_fhp)) != 0 && + ret == 0) + ret = t_ret; + +never_opened: + /* + * We are not releasing the handle lock here because we're about + * to release all locks held by dbp->lid below. There are two + * ways that we can get in here with a handle_lock, but not a + * dbp->lid. The first is when our lid has been hijacked by a + * subdb. The second is when we are a Queue database in the midst + * of a rename. If the queue file hasn't actually been opened, we + * hijack the main dbp's locker id to do the open so we can get the + * extent files. In both cases, we needn't free the handle lock + * because it will be freed when the hijacked locker-id is freed. + */ + DB_ASSERT(!LOCK_ISSET(dbp->handle_lock) || + dbp->lid != DB_LOCK_INVALIDID || + dbp->type == DB_QUEUE || + F_ISSET(dbp, DB_AM_SUBDB)); + + if (dbp->lid != DB_LOCK_INVALIDID) { + /* We may have pending trade operations on this dbp. */ + if (txn != NULL) + __txn_remlock(dbenv, txn, &dbp->handle_lock, dbp->lid); + + /* We may be holding the handle lock; release it. */ + lreq.op = DB_LOCK_PUT_ALL; + if ((t_ret = __lock_vec(dbenv, + dbp->lid, 0, &lreq, 1, NULL)) != 0 && ret == 0) ret = t_ret; - dbp->type = 0; + if ((t_ret = + dbenv->lock_id_free(dbenv, dbp->lid)) != 0 && ret == 0) + ret = t_ret; + dbp->lid = DB_LOCK_INVALIDID; + LOCK_INIT(dbp->handle_lock); + } + + /* Discard the locker ID allocated as the fileid. */ + if (F_ISSET(dbp, DB_AM_INMEM) && + LOCKING_ON(dbenv) && (t_ret = dbenv->lock_id_free( + dbenv, *(u_int32_t *)dbp->fileid)) != 0 && ret == 0) + ret = t_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; + } + + /* Discard any memory used to store returned data. */ + if (dbp->my_rskey.data != NULL) + __os_free(dbp->dbenv, dbp->my_rskey.data); + if (dbp->my_rkey.data != NULL) + __os_free(dbp->dbenv, dbp->my_rkey.data); + if (dbp->my_rdata.data != NULL) + __os_free(dbp->dbenv, dbp->my_rdata.data); + + /* For safety's sake; we may refresh twice. */ + memset(&dbp->my_rskey, 0, sizeof(DBT)); + memset(&dbp->my_rkey, 0, sizeof(DBT)); + memset(&dbp->my_rdata, 0, sizeof(DBT)); + + /* + * Remove this DB handle from the DB_ENV's dblist, if it's been added. + */ + MUTEX_THREAD_LOCK(dbenv, dbenv->dblist_mutexp); + if (dbp->dblistlinks.le_prev != NULL) + LIST_REMOVE(dbp, dblistlinks); + MUTEX_THREAD_UNLOCK(dbenv, dbenv->dblist_mutexp); + dbp->dblistlinks.le_prev = NULL; /* Close the memory pool file handle. */ if (dbp->mpf != NULL) { - if (F_ISSET(dbp, DB_AM_DISCARD)) - (void)__memp_fremove(dbp->mpf); - if ((t_ret = memp_fclose(dbp->mpf)) != 0 && ret == 0) + if ((t_ret = dbp->mpf->close(dbp->mpf, + F_ISSET(dbp, DB_AM_DISCARD) ? DB_MPOOL_DISCARD : 0)) != 0 && + ret == 0) ret = t_ret; dbp->mpf = NULL; } - /* Discard the thread mutex. */ - if (dbp->mutexp != NULL) { - __db_mutex_free(dbenv, dbenv->reginfo, dbp->mutexp); - dbp->mutexp = NULL; + if (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 (F_ISSET(dbp, DB_AM_RECOVER)) + (void)__dbreg_revoke_id(dbp, 0); + else + (void)__dbreg_close_id(dbp, txn); + + /* Discard the log FNAME. */ + (void)__dbreg_teardown(dbp); } - /* Discard the log file id. */ - if (!IS_RECOVERING(dbenv) - && dbp->log_fileid != DB_LOGFILEID_INVALID) - (void)log_unregister(dbenv, dbp); + /* Clear out fields that normally get set during open. */ + memset(dbp->fileid, 0, sizeof(dbp->fileid)); + dbp->adj_fileid = 0; + dbp->meta_pgno = 0; + dbp->cur_lid = DB_LOCK_INVALIDID; + dbp->associate_lid = DB_LOCK_INVALIDID; + dbp->cl_id = 0; + /* + * If we are being refreshed with a txn specified, then we need + * to make sure that we clear out the lock handle field, because + * releasing all the locks for this transaction will release this + * lock and we don't want close to stumble upon this handle and + * try to close it. + */ + if (txn != NULL) + LOCK_INIT(dbp->handle_lock); + + F_CLR(dbp, DB_AM_DBM_ERROR); F_CLR(dbp, DB_AM_DISCARD); F_CLR(dbp, DB_AM_INMEM); + F_CLR(dbp, DB_AM_RECOVER); + F_CLR(dbp, DB_AM_OPEN_CALLED); F_CLR(dbp, DB_AM_RDONLY); F_CLR(dbp, DB_AM_SWAP); - F_CLR(dbp, DB_DBM_ERROR); - F_CLR(dbp, DB_OPEN_CALLED); - - return (ret); -} - -/* - * __db_remove - * Remove method for DB. - * - * PUBLIC: int __db_remove __P((DB *, const char *, const char *, u_int32_t)); - */ -int -__db_remove(dbp, name, subdb, flags) - DB *dbp; - const char *name, *subdb; - u_int32_t flags; -{ - DBT namedbt; - DB_ENV *dbenv; - DB_LOCK remove_lock; - DB_LSN newlsn; - int ret, t_ret, (*callback_func) __P((DB *, void *)); - char *backup, *real_back, *real_name; - void *cookie; - - dbenv = dbp->dbenv; - ret = 0; - backup = real_back = real_name = NULL; - - PANIC_CHECK(dbenv); - /* - * Cannot use DB_ILLEGAL_AFTER_OPEN here because that returns - * and we cannot return, but must deal with the error and destroy - * the handle anyway. - */ - if (F_ISSET(dbp, DB_OPEN_CALLED)) { - ret = __db_mi_open(dbp->dbenv, "remove", 1); - goto err_close; - } - - /* Validate arguments. */ - if ((ret = __db_removechk(dbp, flags)) != 0) - goto err_close; - - /* - * Subdatabases. - */ - if (subdb != NULL) { - /* Subdatabases must be created in named files. */ - if (name == NULL) { - __db_err(dbenv, - "multiple databases cannot be created in temporary files"); - goto err_close; - } - return (__db_subdb_remove(dbp, name, subdb)); - } - - if ((ret = dbp->open(dbp, - name, NULL, DB_UNKNOWN, DB_RDWRMASTER, 0)) != 0) - goto err_close; - - if (LOGGING_ON(dbenv) && (ret = __log_file_lock(dbp)) != 0) - goto err_close; - - if ((ret = dbp->sync(dbp, 0)) != 0) - goto err_close; - - /* Start the transaction and log the delete. */ - if (TXN_ON(dbenv) && (ret = __db_metabegin(dbp, &remove_lock)) != 0) - goto err_close; - - if (LOGGING_ON(dbenv)) { - memset(&namedbt, 0, sizeof(namedbt)); - namedbt.data = (char *)name; - namedbt.size = strlen(name) + 1; - - if ((ret = __crdel_delete_log(dbenv, - dbp->open_txn, &newlsn, DB_FLUSH, - dbp->log_fileid, &namedbt)) != 0) { - __db_err(dbenv, - "%s: %s", name, db_strerror(ret)); - goto err; - } - } - - /* Find the real name of the file. */ - if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, name, 0, NULL, &real_name)) != 0) - goto err; - - /* - * XXX - * We don't bother to open the file and call __memp_fremove on the mpf. - * There is a potential race here. It is at least possible that, if - * the unique filesystem ID (dev/inode pair on UNIX) is reallocated - * within a second (the granularity of the fileID timestamp), a new - * file open will get the same fileID as the file being "removed". - * We may actually want to open the file and call __memp_fremove on - * the mpf to get around this. - */ - - /* Create name for backup file. */ - if (TXN_ON(dbenv)) { - if ((ret = - __db_backup_name(dbenv, name, &backup, &newlsn)) != 0) - goto err; - if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, backup, 0, NULL, &real_back)) != 0) - goto err; - } - - callback_func = __db_remove_callback; - cookie = real_back; - DB_TEST_RECOVERY(dbp, DB_TEST_PRERENAME, ret, name); - if (dbp->db_am_remove != NULL && - (ret = dbp->db_am_remove(dbp, - name, subdb, &newlsn, &callback_func, &cookie)) != 0) - goto err; - /* - * On Windows, the underlying file must be closed to perform a remove. - * Nothing later in __db_remove requires that it be open, and the - * dbp->close closes it anyway, so we just close it early. - */ - (void)__memp_fremove(dbp->mpf); - if ((ret = memp_fclose(dbp->mpf)) != 0) - goto err; - dbp->mpf = NULL; - - if (TXN_ON(dbenv)) - ret = __os_rename(dbenv, real_name, real_back); - else - ret = __os_unlink(dbenv, real_name); - - DB_TEST_RECOVERY(dbp, DB_TEST_POSTRENAME, ret, name); - -err: -DB_TEST_RECOVERY_LABEL - /* - * End the transaction, committing the transaction if we were - * successful, aborting otherwise. - */ - if (dbp->open_txn != NULL && (t_ret = __db_metaend(dbp, &remove_lock, - ret == 0, callback_func, cookie)) != 0 && ret == 0) - ret = t_ret; - - /* FALLTHROUGH */ - -err_close: - if (real_back != NULL) - __os_freestr(real_back); - if (real_name != NULL) - __os_freestr(real_name); - if (backup != NULL) - __os_freestr(backup); - - /* We no longer have an mpool, so syncing would be disastrous. */ - if ((t_ret = dbp->close(dbp, DB_NOSYNC)) != 0 && ret == 0) - ret = t_ret; - - return (ret); -} - -/* - * __db_subdb_remove -- - * Remove a subdatabase. - */ -static int -__db_subdb_remove(dbp, name, subdb) - DB *dbp; - const char *name, *subdb; -{ - DB *mdbp; - DBC *dbc; - DB_ENV *dbenv; - DB_LOCK remove_lock; - db_pgno_t meta_pgno; - int ret, t_ret; - - mdbp = NULL; - dbc = NULL; - dbenv = dbp->dbenv; - - /* Start the transaction. */ - if (TXN_ON(dbenv) && (ret = __db_metabegin(dbp, &remove_lock)) != 0) - goto err_close; - - /* - * Open the subdatabase. We can use the user's DB handle for this - * purpose, I think. - */ - if ((ret = __db_open(dbp, name, subdb, DB_UNKNOWN, 0, 0)) != 0) - goto err; - - /* Free up the pages in the subdatabase. */ - switch (dbp->type) { - case DB_BTREE: - case DB_RECNO: - if ((ret = __bam_reclaim(dbp, dbp->open_txn)) != 0) - goto err; - break; - case DB_HASH: - if ((ret = __ham_reclaim(dbp, dbp->open_txn)) != 0) - goto err; - break; - default: - ret = __db_unknown_type(dbp->dbenv, - "__db_subdb_remove", dbp->type); - goto err; - } - - /* - * Remove the entry from the main database and free the subdatabase - * metadata page. - */ - if ((ret = __db_master_open(dbp, name, 0, 0, &mdbp)) != 0) - goto err; - - if ((ret = __db_master_update(mdbp, - subdb, dbp->type, &meta_pgno, MU_REMOVE, NULL, 0)) != 0) - goto err; - -err: /* - * End the transaction, committing the transaction if we were - * successful, aborting otherwise. - */ - if (dbp->open_txn != NULL && (t_ret = __db_metaend(dbp, - &remove_lock, ret == 0, NULL, NULL)) != 0 && ret == 0) - ret = t_ret; - -err_close: - /* - * Close the user's DB handle -- do this LAST to avoid smashing the - * the transaction information. - */ - if ((t_ret = dbp->close(dbp, 0)) != 0 && ret == 0) - ret = t_ret; - - if (mdbp != NULL && (t_ret = mdbp->close(mdbp, 0)) != 0 && ret == 0) - ret = t_ret; - - return (ret); -} - -/* - * __db_rename - * Rename method for DB. - * - * PUBLIC: int __db_rename __P((DB *, - * PUBLIC: const char *, const char *, const char *, u_int32_t)); - */ -int -__db_rename(dbp, filename, subdb, newname, flags) - DB *dbp; - const char *filename, *subdb, *newname; - u_int32_t flags; -{ - DBT namedbt, newnamedbt; - DB_ENV *dbenv; - DB_LOCK remove_lock; - DB_LSN newlsn; - char *real_name, *real_newname; - int ret, t_ret; - - dbenv = dbp->dbenv; - ret = 0; - real_name = real_newname = NULL; - - PANIC_CHECK(dbenv); - /* - * Cannot use DB_ILLEGAL_AFTER_OPEN here because that returns - * and we cannot return, but must deal with the error and destroy - * the handle anyway. - */ - if (F_ISSET(dbp, DB_OPEN_CALLED)) { - ret = __db_mi_open(dbp->dbenv, "rename", 1); - goto err_close; - } - - /* Validate arguments -- has same rules as remove. */ - if ((ret = __db_removechk(dbp, flags)) != 0) - goto err_close; - - /* - * Subdatabases. - */ - if (subdb != NULL) { - if (filename == NULL) { - __db_err(dbenv, - "multiple databases cannot be created in temporary files"); - goto err_close; - } - return (__db_subdb_rename(dbp, filename, subdb, newname)); - } - - if ((ret = dbp->open(dbp, - filename, NULL, DB_UNKNOWN, DB_RDWRMASTER, 0)) != 0) - goto err_close; - - if (LOGGING_ON(dbenv) && (ret = __log_file_lock(dbp)) != 0) - goto err_close; - - if ((ret = dbp->sync(dbp, 0)) != 0) - goto err_close; - - /* Start the transaction and log the rename. */ - if (TXN_ON(dbenv) && (ret = __db_metabegin(dbp, &remove_lock)) != 0) - goto err_close; - - if (LOGGING_ON(dbenv)) { - memset(&namedbt, 0, sizeof(namedbt)); - namedbt.data = (char *)filename; - namedbt.size = strlen(filename) + 1; - - memset(&newnamedbt, 0, sizeof(namedbt)); - newnamedbt.data = (char *)newname; - newnamedbt.size = strlen(newname) + 1; - - if ((ret = __crdel_rename_log(dbenv, dbp->open_txn, - &newlsn, 0, dbp->log_fileid, &namedbt, &newnamedbt)) != 0) { - __db_err(dbenv, "%s: %s", filename, db_strerror(ret)); - goto err; - } - - if ((ret = __log_filelist_update(dbenv, dbp, - dbp->log_fileid, newname, NULL)) != 0) - goto err; - } - - /* Find the real name of the file. */ - if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, filename, 0, NULL, &real_name)) != 0) - goto err; - - /* Find the real newname of the file. */ - if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, newname, 0, NULL, &real_newname)) != 0) - goto err; - - /* - * It is an error to rename a file over one that already exists, - * as that wouldn't be transaction-safe. - */ - if (__os_exists(real_newname, NULL) == 0) { - ret = EEXIST; - __db_err(dbenv, "rename: file %s exists", real_newname); - goto err; - } - - DB_TEST_RECOVERY(dbp, DB_TEST_PRERENAME, ret, filename); - if (dbp->db_am_rename != NULL && - (ret = dbp->db_am_rename(dbp, filename, subdb, newname)) != 0) - goto err; - /* - * We have to flush the cache for a couple of reasons. First, the - * underlying MPOOLFILE maintains a "name" that unrelated processes - * can use to open the file in order to flush pages, and that name - * is about to be wrong. Second, on Windows the unique file ID is - * generated from the file's name, not other file information as is - * the case on UNIX, and so a subsequent open of the old file name - * could conceivably result in a matching "unique" file ID. - */ - if ((ret = __memp_fremove(dbp->mpf)) != 0) - goto err; - - /* - * On Windows, the underlying file must be closed to perform a rename. - * Nothing later in __db_rename requires that it be open, and the call - * to dbp->close closes it anyway, so we just close it early. - */ - if ((ret = memp_fclose(dbp->mpf)) != 0) - goto err; - dbp->mpf = NULL; - - ret = __os_rename(dbenv, real_name, real_newname); - DB_TEST_RECOVERY(dbp, DB_TEST_POSTRENAME, ret, newname); - -DB_TEST_RECOVERY_LABEL -err: if (dbp->open_txn != NULL && (t_ret = __db_metaend(dbp, - &remove_lock, ret == 0, NULL, NULL)) != 0 && ret == 0) - ret = t_ret; - -err_close: - /* We no longer have an mpool, so syncing would be disastrous. */ - dbp->close(dbp, DB_NOSYNC); - if (real_name != NULL) - __os_freestr(real_name); - if (real_newname != NULL) - __os_freestr(real_newname); - - return (ret); -} - -/* - * __db_subdb_rename -- - * Rename a subdatabase. - */ -static int -__db_subdb_rename(dbp, name, subdb, newname) - DB *dbp; - const char *name, *subdb, *newname; -{ - DB *mdbp; - DBC *dbc; - DB_ENV *dbenv; - DB_LOCK remove_lock; - int ret, t_ret; - - mdbp = NULL; - dbc = NULL; - dbenv = dbp->dbenv; - - /* Start the transaction. */ - if (TXN_ON(dbenv) && (ret = __db_metabegin(dbp, &remove_lock)) != 0) - goto err_close; - - /* - * Open the subdatabase. We can use the user's DB handle for this - * purpose, I think. - */ - if ((ret = __db_open(dbp, name, subdb, DB_UNKNOWN, 0, 0)) != 0) - goto err; - - /* - * Rename the entry in the main database. - */ - if ((ret = __db_master_open(dbp, name, 0, 0, &mdbp)) != 0) - goto err; - - if ((ret = __db_master_update(mdbp, - subdb, dbp->type, NULL, MU_RENAME, newname, 0)) != 0) - goto err; - -err: /* - * End the transaction, committing the transaction if we were - * successful, aborting otherwise. - */ - if (dbp->open_txn != NULL && (t_ret = __db_metaend(dbp, - &remove_lock, ret == 0, NULL, NULL)) != 0 && ret == 0) - ret = t_ret; - -err_close: - /* - * Close the user's DB handle -- do this LAST to avoid smashing the - * the transaction information. - */ - if ((t_ret = dbp->close(dbp, 0)) != 0 && ret == 0) - ret = t_ret; - - if (mdbp != NULL && (t_ret = mdbp->close(mdbp, 0)) != 0 && ret == 0) - ret = t_ret; - - return (ret); -} - -/* - * __db_metabegin -- - * - * Begin a meta-data operation. This involves doing any required locking, - * potentially beginning a transaction and then telling the caller if you - * did or did not begin the transaction. - * - * The writing flag indicates if the caller is actually allowing creates - * or doing deletes (i.e., if the caller is opening and not creating, then - * we don't need to do any of this). - * PUBLIC: int __db_metabegin __P((DB *, DB_LOCK *)); - */ -int -__db_metabegin(dbp, lockp) - DB *dbp; - DB_LOCK *lockp; -{ - DB_ENV *dbenv; - DBT dbplock; - u_int32_t locker, lockval; - int ret; - - dbenv = dbp->dbenv; - - lockp->off = LOCK_INVALID; - - /* - * There is no single place where we can know that we are or are not - * going to be creating any files and/or subdatabases, so we will - * always begin a tranasaction when we start creating one. If we later - * discover that this was unnecessary, we will abort the transaction. - * Recovery is written so that if we log a file create, but then - * discover that we didn't have to do it, we recover correctly. The - * file recovery design document has details. - * - * We need to single thread all create and delete operations, so if we - * are running with locking, we must obtain a lock. We use lock_id to - * generate a unique locker id and use a handcrafted DBT as the object - * on which we are locking. - */ - if (LOCKING_ON(dbenv)) { - if ((ret = lock_id(dbenv, &locker)) != 0) - return (ret); - lockval = 0; - dbplock.data = &lockval; - dbplock.size = sizeof(lockval); - if ((ret = lock_get(dbenv, - locker, 0, &dbplock, DB_LOCK_WRITE, lockp)) != 0) - return (ret); - } - - return (txn_begin(dbenv, NULL, &dbp->open_txn, 0)); -} - -/* - * __db_metaend -- - * End a meta-data operation. - * PUBLIC: int __db_metaend __P((DB *, - * PUBLIC: DB_LOCK *, int, int (*)(DB *, void *), void *)); - */ -int -__db_metaend(dbp, lockp, commit, callback, cookie) - DB *dbp; - DB_LOCK *lockp; - int commit, (*callback) __P((DB *, void *)); - void *cookie; -{ - DB_ENV *dbenv; - int ret, t_ret; - - ret = 0; - dbenv = dbp->dbenv; - - /* End the transaction. */ - if (commit) { - if ((ret = txn_commit(dbp->open_txn, DB_TXN_SYNC)) == 0) { - /* - * Unlink any underlying file, we've committed the - * transaction. - */ - if (callback != NULL) - ret = callback(dbp, cookie); - } - } else if ((t_ret = txn_abort(dbp->open_txn)) && ret == 0) - ret = t_ret; - - /* Release our lock. */ - if (lockp->off != LOCK_INVALID && - (t_ret = lock_put(dbenv, lockp)) != 0 && ret == 0) - ret = t_ret; return (ret); } /* * __db_log_page - * Log a meta-data or root page during a create operation. + * Log a meta-data or root page during a subdatabase create operation. * - * PUBLIC: int __db_log_page __P((DB *, - * PUBLIC: const char *, DB_LSN *, db_pgno_t, PAGE *)); + * PUBLIC: int __db_log_page __P((DB *, DB_TXN *, DB_LSN *, db_pgno_t, PAGE *)); */ int -__db_log_page(dbp, name, lsn, pgno, page) +__db_log_page(dbp, txn, lsn, pgno, page) DB *dbp; - const char *name; + DB_TXN *txn; DB_LSN *lsn; db_pgno_t pgno; PAGE *page; { - DBT name_dbt, page_dbt; + DBT page_dbt; DB_LSN new_lsn; int ret; - if (dbp->open_txn == NULL) + if (!LOGGING_ON(dbp->dbenv) || txn == NULL) return (0); memset(&page_dbt, 0, sizeof(page_dbt)); page_dbt.size = dbp->pgsize; page_dbt.data = page; - if (pgno == PGNO_BASE_MD) { - /* - * !!! - * Make sure that we properly handle a null name. The old - * Tcl sent us pathnames of the form ""; it may be the case - * that the new Tcl doesn't do that, so we can get rid of - * the second check here. - */ - memset(&name_dbt, 0, sizeof(name_dbt)); - name_dbt.data = (char *)name; - if (name == NULL || *name == '\0') - name_dbt.size = 0; - else - name_dbt.size = strlen(name) + 1; - ret = __crdel_metapage_log(dbp->dbenv, - dbp->open_txn, &new_lsn, DB_FLUSH, - dbp->log_fileid, &name_dbt, pgno, &page_dbt); - } else - ret = __crdel_metasub_log(dbp->dbenv, dbp->open_txn, - &new_lsn, 0, dbp->log_fileid, pgno, &page_dbt, lsn); + ret = __crdel_metasub_log(dbp, txn, &new_lsn, 0, pgno, &page_dbt, lsn); if (ret == 0) page->lsn = new_lsn; @@ -2041,69 +946,95 @@ __db_log_page(dbp, name, lsn, pgno, page) * Create the backup file name for a given file. * * PUBLIC: int __db_backup_name __P((DB_ENV *, - * PUBLIC: const char *, char **, DB_LSN *)); + * PUBLIC: const char *, DB_TXN *, char **)); */ #undef BACKUP_PREFIX #define BACKUP_PREFIX "__db." #undef MAX_LSN_TO_TEXT -#define MAX_LSN_TO_TEXT 21 +#define MAX_LSN_TO_TEXT 17 + int -__db_backup_name(dbenv, name, backup, lsn) +__db_backup_name(dbenv, name, txn, backup) DB_ENV *dbenv; const char *name; + DB_TXN *txn; char **backup; - DB_LSN *lsn; { + DB_LSN lsn; size_t len; int plen, ret; char *p, *retp; - len = strlen(name) + strlen(BACKUP_PREFIX) + MAX_LSN_TO_TEXT + 1; + /* + * Create the name. Backup file names are in one of two forms: + * + * In a transactional env: __db.LSN(8).LSN(8) + * and + * in a non-transactional env: __db.FILENAME. + * + * If the transaction doesn't have a current LSN, we write + * a dummy log record to force it, so that we ensure that + * all tmp names are unique. + * + * In addition, the name passed may contain an env-relative path. + * In that case, put the __db. in the right place (in the last + * component of the pathname). + */ + if (txn != NULL) { + if (IS_ZERO_LSN(txn->last_lsn)) { + /* + * Write dummy log record. The two choices for + * dummy log records are __db_noop_log and + * __db_debug_log; unfortunately __db_noop_log requires + * a valid dbp, and we aren't guaranteed to be able + * to pass one in here. + */ + if ((ret = __db_debug_log(dbenv, txn, &lsn, 0, + NULL, 0, NULL, NULL, 0)) != 0) + return (ret); + } else + lsn = txn->last_lsn; + } - if ((ret = __os_malloc(dbenv, len, NULL, &retp)) != 0) + /* + * Part of the name may be a full path, so we need to make sure that + * 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; + + if ((ret = __os_malloc(dbenv, len, &retp)) != 0) return (ret); /* - * Create the name. Backup file names are of the form: - * - * __db.name.0x[lsn-file].0x[lsn-offset] - * - * which guarantees uniqueness. - * - * However, name may contain an env-relative path in it. - * In that case, put the __db. after the last portion of - * the pathname. + * There are four cases here: + * 1. simple path w/out transaction + * 2. simple path + transaction + * 3. multi-component path w/out transaction + * 4. multi-component path + transaction */ - if ((p = __db_rpath(name)) == NULL) - snprintf(retp, len, - "%s%s.0x%x0x%x", BACKUP_PREFIX, name, - lsn->file, lsn->offset); - else { - plen = p - name + 1; + if ((p = __db_rpath(name)) == NULL) { + if (txn == NULL) /* case 1 */ + snprintf(retp, len, "%s%s.", BACKUP_PREFIX, name); + else /* case 2 */ + snprintf(retp, len, + "%s%x.%x", BACKUP_PREFIX, lsn.file, lsn.offset); + } else { + plen = (int)(p - name) + 1; p++; - snprintf(retp, len, - "%.*s%s%s.0x%x0x%x", plen, name, BACKUP_PREFIX, p, - lsn->file, lsn->offset); + if (txn == NULL) /* case 3 */ + snprintf(retp, len, + "%.*s%s%s.", plen, name, BACKUP_PREFIX, p); + else /* case 4 */ + snprintf(retp, len, + "%.*s%x.%x.", plen, name, lsn.file, lsn.offset); } *backup = retp; return (0); } -/* - * __db_remove_callback -- - * Callback function -- on file remove commit, it unlinks the backing - * file. - */ -static int -__db_remove_callback(dbp, cookie) - DB *dbp; - void *cookie; -{ - return (__os_unlink(dbp->dbenv, cookie)); -} - /* * __dblist_get -- * Get the first element of dbenv->dblist with @@ -2126,22 +1057,73 @@ __dblist_get(dbenv, adjid) return (dbp); } -#if CONFIG_TEST +/* + * __db_disassociate -- + * Destroy the association between a given secondary and its primary. + */ +static int +__db_disassociate(sdbp) + DB *sdbp; +{ + DBC *dbc; + int ret, t_ret; + + ret = 0; + + sdbp->s_callback = NULL; + sdbp->s_primary = NULL; + sdbp->get = sdbp->stored_get; + sdbp->close = sdbp->stored_close; + + /* + * Complain, but proceed, if we have any active cursors. (We're in + * the middle of a close, so there's really no turning back.) + */ + if (sdbp->s_refcnt != 1 || + TAILQ_FIRST(&sdbp->active_queue) != NULL || + TAILQ_FIRST(&sdbp->join_queue) != NULL) { + __db_err(sdbp->dbenv, + "Closing a primary DB while a secondary DB has active cursors is unsafe"); + ret = EINVAL; + } + sdbp->s_refcnt = 0; + + while ((dbc = TAILQ_FIRST(&sdbp->free_queue)) != NULL) + if ((t_ret = __db_c_destroy(dbc)) != 0 && ret == 0) + ret = t_ret; + + F_CLR(sdbp, DB_AM_SECONDARY); + return (ret); +} + +#if CONFIG_TEST /* * __db_testcopy * Create a copy of all backup files and our "main" DB. * - * PUBLIC: int __db_testcopy __P((DB *, const char *)); + * PUBLIC: #if CONFIG_TEST + * PUBLIC: int __db_testcopy __P((DB_ENV *, DB *, const char *)); + * PUBLIC: #endif */ int -__db_testcopy(dbp, name) +__db_testcopy(dbenv, dbp, name) + DB_ENV *dbenv; DB *dbp; const char *name; { - if (dbp->type == DB_QUEUE) + DB_MPOOLFILE *mpf; + + DB_ASSERT(dbp != NULL || name != NULL); + + if (name == NULL) { + mpf = dbp->mpf; + name = R_ADDR(mpf->dbmp->reginfo, mpf->mfp->path_off); + } + + if (dbp != NULL && dbp->type == DB_QUEUE) return (__qam_testdocopy(dbp, name)); else - return (__db_testdocopy(dbp, name)); + return (__db_testdocopy(dbenv, name)); } static int @@ -2154,7 +1136,7 @@ __qam_testdocopy(dbp, name) int ret; filelist = NULL; - if ((ret = __db_testdocopy(dbp, name)) != 0) + if ((ret = __db_testdocopy(dbp->dbenv, name)) != 0) return (ret); if (dbp->mpf != NULL && (ret = __qam_gen_filelist(dbp, &filelist)) != 0) @@ -2164,12 +1146,13 @@ __qam_testdocopy(dbp, name) return (0); dir = ((QUEUE *)dbp->q_internal)->dir; for (fp = filelist; fp->mpf != NULL; fp++) { - snprintf(buf, sizeof(buf), QUEUE_EXTENT, dir, name, fp->id); - if ((ret = __db_testdocopy(dbp, buf)) != 0) + snprintf(buf, sizeof(buf), + QUEUE_EXTENT, dir, PATH_SEPARATOR[0], name, fp->id); + if ((ret = __db_testdocopy(dbp->dbenv, buf)) != 0) return (ret); } - __os_free(filelist, 0); + __os_free(dbp->dbenv, filelist); return (0); } @@ -2179,8 +1162,8 @@ __qam_testdocopy(dbp, name) * */ static int -__db_testdocopy(dbp, name) - DB *dbp; +__db_testdocopy(dbenv, name) + DB_ENV *dbenv; const char *name; { size_t len; @@ -2188,8 +1171,8 @@ __db_testdocopy(dbp, name) char **namesp, *backup, *copy, *dir, *p, *real_name; real_name = NULL; /* Get the real backing file name. */ - if ((ret = __db_appname(dbp->dbenv, - DB_APP_DATA, NULL, name, 0, NULL, &real_name)) != 0) + if ((ret = __db_appname(dbenv, + DB_APP_DATA, name, 0, NULL, &real_name)) != 0) return (ret); copy = backup = NULL; @@ -2200,10 +1183,10 @@ __db_testdocopy(dbp, name) */ len = strlen(real_name) + strlen(BACKUP_PREFIX) + MAX_LSN_TO_TEXT + 9; - if ((ret = __os_malloc(dbp->dbenv, len, NULL, ©)) != 0) + if ((ret = __os_malloc(dbenv, len, ©)) != 0) goto out; - if ((ret = __os_malloc(dbp->dbenv, len, NULL, &backup)) != 0) + if ((ret = __os_malloc(dbenv, len, &backup)) != 0) goto out; /* @@ -2212,9 +1195,9 @@ __db_testdocopy(dbp, name) snprintf(copy, len, "%s.afterop", real_name); __db_makecopy(real_name, copy); - if ((ret = __os_strdup(dbp->dbenv, real_name, &dir)) != 0) + if ((ret = __os_strdup(dbenv, real_name, &dir)) != 0) goto out; - __os_freestr(real_name); + __os_free(dbenv, real_name); real_name = NULL; /* * Create the name. Backup file names are of the form: @@ -2234,7 +1217,7 @@ __db_testdocopy(dbp, name) p = __db_rpath(dir); if (p != NULL) *p = '\0'; - ret = __os_dirlist(dbp->dbenv, dir, &namesp, &dircnt); + ret = __os_dirlist(dbenv, dir, &namesp, &dircnt); #if DIAGNOSTIC /* * XXX @@ -2245,7 +1228,7 @@ __db_testdocopy(dbp, name) */ *p = '/'; #endif - __os_freestr(dir); + __os_free(dbenv, dir); if (ret != 0) goto out; for (i = 0; i < dircnt; i++) { @@ -2258,8 +1241,8 @@ __db_testdocopy(dbp, name) * know its LSN's. */ if (strncmp(namesp[i], backup, strlen(backup)) == 0) { - if ((ret = __db_appname(dbp->dbenv, DB_APP_DATA, - NULL, namesp[i], 0, NULL, &real_name)) != 0) + if ((ret = __db_appname(dbenv, DB_APP_DATA, + namesp[i], 0, NULL, &real_name)) != 0) goto out; /* @@ -2268,25 +1251,25 @@ __db_testdocopy(dbp, name) * If so, just move on. */ if (strstr(real_name, ".afterop") != NULL) { - __os_freestr(real_name); + __os_free(dbenv, real_name); real_name = NULL; continue; } snprintf(copy, len, "%s.afterop", real_name); __db_makecopy(real_name, copy); - __os_freestr(real_name); + __os_free(dbenv, real_name); real_name = NULL; } } out: if (backup != NULL) - __os_freestr(backup); + __os_free(dbenv, backup); if (copy != NULL) - __os_freestr(copy); + __os_free(dbenv, copy); if (namesp != NULL) - __os_dirfree(namesp, dircnt); + __os_dirfree(dbenv, namesp, dircnt); if (real_name != NULL) - __os_freestr(real_name); + __os_free(dbenv, real_name); return (ret); } @@ -2301,7 +1284,7 @@ __db_makecopy(src, dest) memset(&rfh, 0, sizeof(rfh)); memset(&wfh, 0, sizeof(wfh)); - if (__os_malloc(NULL, 1024, NULL, &buf) != 0) + if (__os_malloc(NULL, 1024, &buf) != 0) return; if (__os_open(NULL, @@ -2313,13 +1296,13 @@ __db_makecopy(src, dest) for (;;) if (__os_read(NULL, &rfh, buf, 1024, &rcnt) < 0 || rcnt == 0 || - __os_write(NULL, &wfh, buf, rcnt, &wcnt) < 0 || wcnt != rcnt) + __os_write(NULL, &wfh, buf, rcnt, &wcnt) < 0) break; -err: __os_free(buf, 1024); +err: __os_free(NULL, buf); if (F_ISSET(&rfh, DB_FH_VALID)) - __os_closehandle(&rfh); + __os_closehandle(NULL, &rfh); if (F_ISSET(&wfh, DB_FH_VALID)) - __os_closehandle(&wfh); + __os_closehandle(NULL, &wfh); } #endif diff --git a/bdb/db/db.src b/bdb/db/db.src index b695e1360c5..414321fcbbd 100644 --- a/bdb/db/db.src +++ b/bdb/db/db.src @@ -1,13 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: db.src,v 11.8 2000/02/17 20:24:07 bostic Exp $ + * $Id: db.src,v 11.18 2002/04/17 19:02:58 krinsky Exp $ */ -PREFIX db +PREFIX __db +DBPRIVATE INCLUDE #include "db_config.h" INCLUDE @@ -15,15 +16,17 @@ INCLUDE #ifndef NO_SYSTEM_INCLUDES INCLUDE #include INCLUDE INCLUDE #include -INCLUDE #include INCLUDE #include INCLUDE #endif INCLUDE INCLUDE #include "db_int.h" -INCLUDE #include "db_page.h" -INCLUDE #include "db_dispatch.h" -INCLUDE #include "db_am.h" -INCLUDE #include "txn.h" +INCLUDE #include "dbinc/crypto.h" +INCLUDE #include "dbinc/db_page.h" +INCLUDE #include "dbinc/db_dispatch.h" +INCLUDE #include "dbinc/db_am.h" +INCLUDE #include "dbinc/log.h" +INCLUDE #include "dbinc/rep.h" +INCLUDE #include "dbinc/txn.h" INCLUDE /* @@ -44,32 +47,15 @@ INCLUDE */ BEGIN addrem 41 ARG opcode u_int32_t lu -ARG fileid int32_t ld -ARG pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu ARG indx u_int32_t lu -ARG nbytes size_t lu -DBT hdr DBT s +ARG nbytes u_int32_t lu +PGDBT hdr DBT s DBT dbt DBT s POINTER pagelsn DB_LSN * lu END -/* - * split -- Handles the split of a duplicate page. - * - * opcode: defines whether we are splitting from or splitting onto - * fileid: file identifier of the file being modified. - * pgno: page number being split. - * pageimage: entire page contents. - * pagelsn: former lsn of the page. - */ -DEPRECATED split 42 -ARG opcode u_int32_t lu -ARG fileid int32_t ld -ARG pgno db_pgno_t lu -DBT pageimage DBT s -POINTER pagelsn DB_LSN * lu -END - /* * big -- Handles addition and deletion of big key/data items. * @@ -87,10 +73,10 @@ END */ BEGIN big 43 ARG opcode u_int32_t lu -ARG fileid int32_t ld -ARG pgno db_pgno_t lu -ARG prev_pgno db_pgno_t lu -ARG next_pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu +WRLOCKNZ prev_pgno db_pgno_t lu +WRLOCKNZ next_pgno db_pgno_t lu DBT dbt DBT s POINTER pagelsn DB_LSN * lu POINTER prevlsn DB_LSN * lu @@ -106,8 +92,8 @@ END * lsn: the page's original lsn. */ BEGIN ovref 44 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu ARG adjust int32_t ld POINTER lsn DB_LSN * lu END @@ -125,32 +111,15 @@ END */ BEGIN relink 45 ARG opcode u_int32_t lu -ARG fileid int32_t ld -ARG pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu POINTER lsn DB_LSN * lu -ARG prev db_pgno_t lu +WRLOCKNZ prev db_pgno_t lu POINTER lsn_prev DB_LSN * lu -ARG next db_pgno_t lu +WRLOCKNZ next db_pgno_t lu POINTER lsn_next DB_LSN * lu END -/* - * Addpage -- Handles adding a new duplicate page onto the end of - * an existing duplicate page. - * fileid: identifies the file being changed. - * pgno: page number to which a new page is being added. - * lsn: lsn of pgno - * nextpgno: new page number being added. - * nextlsn: lsn of nextpgno; - */ -DEPRECATED addpage 46 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu -POINTER lsn DB_LSN * lu -ARG nextpgno db_pgno_t lu -POINTER nextlsn DB_LSN * lu -END - /* * Debug -- log an operation upon entering an access method. * op: Operation (cursor, c_close, c_get, c_put, c_del, @@ -172,7 +141,55 @@ END * noop -- do nothing, but get an LSN. */ BEGIN noop 48 -ARG fileid int32_t ld -ARG pgno db_pgno_t lu +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu POINTER prevlsn DB_LSN * lu END + +/* + * pg_alloc: used to record allocating a new page. + * + * meta_lsn: the meta-data page's original lsn. + * meta_pgno the meta-data page number. + * page_lsn: the allocated page's original lsn. + * pgno: the page allocated. + * ptype: the type of the page allocated. + * next: the next page on the free list. + */ +BEGIN pg_alloc 49 +DB fileid int32_t ld +POINTER meta_lsn DB_LSN * lu +WRLOCK meta_pgno db_pgno_t lu +POINTER page_lsn DB_LSN * lu +WRLOCK pgno db_pgno_t lu +ARG ptype u_int32_t lu +ARG next db_pgno_t lu +END + +/* + * pg_free: used to record freeing a page. + * + * pgno: the page being freed. + * meta_lsn: the meta-data page's original lsn. + * meta_pgno: the meta-data page number. + * header: the header from the free'd page. + * next: the previous next pointer on the metadata page. + */ +BEGIN pg_free 50 +DB fileid int32_t ld +WRLOCK pgno db_pgno_t lu +POINTER meta_lsn DB_LSN * lu +WRLOCK meta_pgno db_pgno_t lu +PGDBT header DBT s +ARG next db_pgno_t lu +END + +/* + * cksum -- + * This log record is written when we're unable to checksum a page, + * before returning DB_RUNRECOVERY. This log record causes normal + * recovery to itself return DB_RUNRECOVERY, as only catastrophic + * recovery can fix things. + */ +BEGIN cksum 51 +END diff --git a/bdb/db/db_am.c b/bdb/db/db_am.c index 2d224566904..cf6ef18549b 100644 --- a/bdb/db/db_am.c +++ b/bdb/db/db_am.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1998, 1999, 2000 + * Copyright (c) 1998-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_am.c,v 11.42 2001/01/11 18:19:50 bostic Exp $"; +static const char revid[] = "$Id: db_am.c,v 11.96 2002/08/27 15:17:32 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,16 +18,22 @@ static const char revid[] = "$Id: db_am.c,v 11.42 2001/01/11 18:19:50 bostic Exp #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "btree.h" -#include "hash.h" -#include "qam.h" -#include "lock.h" -#include "mp.h" -#include "txn.h" -#include "db_am.h" -#include "db_ext.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/log.h" +#include "dbinc/mp.h" +#include "dbinc/qam.h" + +static int __db_append_primary __P((DBC *, DBT *, DBT *)); +static int __db_secondary_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); +static int __db_secondary_close __P((DB *, u_int32_t)); + +#ifdef DEBUG +static int __db_cprint_item __P((DBC *)); +#endif /* * __db_cursor -- @@ -53,12 +59,22 @@ __db_cursor(dbp, txn, dbcp, flags) PANIC_CHECK(dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->cursor"); - /* Check for invalid flags. */ - if ((ret = __db_cursorchk(dbp, flags, F_ISSET(dbp, DB_AM_RDONLY))) != 0) + /* Validate arguments. */ + if ((ret = __db_cursorchk(dbp, flags)) != 0) return (ret); - if ((ret = - __db_icursor(dbp, txn, dbp->type, PGNO_INVALID, 0, dbcp)) != 0) + /* + * 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.) + */ + if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 1)) != 0) + return (ret); + + if ((ret = __db_icursor(dbp, + txn, dbp->type, PGNO_INVALID, 0, DB_LOCK_INVALIDID, dbcp)) != 0) return (ret); dbc = *dbcp; @@ -70,7 +86,7 @@ __db_cursor(dbp, txn, dbcp, flags) op = LF_ISSET(DB_OPFLAGS_MASK); mode = (op == DB_WRITELOCK) ? DB_LOCK_WRITE : ((op == DB_WRITECURSOR) ? DB_LOCK_IWRITE : DB_LOCK_READ); - if ((ret = lock_get(dbenv, dbc->locker, 0, + if ((ret = dbenv->lock_get(dbenv, dbc->locker, 0, &dbc->lock_dbt, mode, &dbc->mylock)) != 0) { (void)__db_c_close(dbc); return (ret); @@ -81,6 +97,9 @@ __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); return (0); } @@ -91,15 +110,16 @@ __db_cursor(dbp, txn, dbcp, flags) * initialize as a cursor. * * PUBLIC: int __db_icursor - * PUBLIC: __P((DB *, DB_TXN *, DBTYPE, db_pgno_t, int, DBC **)); + * PUBLIC: __P((DB *, DB_TXN *, DBTYPE, db_pgno_t, int, u_int32_t, DBC **)); */ int -__db_icursor(dbp, txn, dbtype, root, is_opd, dbcp) +__db_icursor(dbp, txn, dbtype, root, is_opd, lockerid, dbcp) DB *dbp; DB_TXN *txn; DBTYPE dbtype; db_pgno_t root; int is_opd; + u_int32_t lockerid; DBC **dbcp; { DBC *dbc, *adbc; @@ -120,7 +140,7 @@ __db_icursor(dbp, txn, dbtype, root, is_opd, dbcp) dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) if (dbtype == dbc->dbtype) { TAILQ_REMOVE(&dbp->free_queue, dbc, links); - dbc->flags = 0; + F_CLR(dbc, ~DBC_OWN_LID); break; } MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); @@ -144,11 +164,35 @@ __db_icursor(dbp, txn, dbtype, root, is_opd, dbcp) if (!DB_IS_THREADED(dbp) && (adbc = TAILQ_FIRST(&dbp->active_queue)) != NULL) dbc->lid = adbc->lid; - else - if ((ret = lock_id(dbenv, &dbc->lid)) != 0) + else { + if ((ret = + dbenv->lock_id(dbenv, &dbc->lid)) != 0) goto err; + F_SET(dbc, DBC_OWN_LID); + } + + /* + * In CDB, secondary indices should share a lock file + * ID with the primary; otherwise we're susceptible to + * deadlocks. We also use __db_icursor rather + * than sdbp->cursor to create secondary update + * cursors in c_put and c_del; these won't + * acquire a new lock. + * + * !!! + * Since this is in the one-time cursor allocation + * code, we need to be sure to destroy, not just + * close, all cursors in the secondary when we + * associate. + */ + if (CDB_LOCKING(dbp->dbenv) && + F_ISSET(dbp, DB_AM_SECONDARY)) + memcpy(dbc->lock.fileid, + dbp->s_primary->fileid, DB_FILE_ID_LEN); + else + memcpy(dbc->lock.fileid, + dbp->fileid, DB_FILE_ID_LEN); - memcpy(dbc->lock.fileid, dbp->fileid, DB_FILE_ID_LEN); if (CDB_LOCKING(dbenv)) { if (F_ISSET(dbenv, DB_ENV_CDB_ALLDB)) { /* @@ -198,18 +242,55 @@ __db_icursor(dbp, txn, dbtype, root, is_opd, dbcp) /* Refresh the DBC structure. */ dbc->dbtype = dbtype; + RESET_RET_MEM(dbc); - if ((dbc->txn = txn) == NULL) - dbc->locker = dbc->lid; - else { + if ((dbc->txn = txn) == NULL) { + /* + * There are certain cases in which we want to create a + * new cursor with a particular locker ID that is known + * to be the same as (and thus not conflict with) an + * open cursor. + * + * The most obvious case is cursor duplication; when we + * call DBC->c_dup or __db_c_idup, we want to use the original + * cursor's locker ID. + * + * Another case is when updating secondary indices. Standard + * CDB locking would mean that we might block ourself: we need + * to open an update cursor in the secondary while an update + * cursor in the primary is open, and when the secondary and + * 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. + */ + if (lockerid != DB_LOCK_INVALIDID) + dbc->locker = lockerid; + else + dbc->locker = dbc->lid; + } else { dbc->locker = txn->txnid; txn->cursors++; } + /* + * These fields change when we are used as a secondary index, so + * if the DB is a secondary, make sure they're set properly just + * in case we opened some cursors before we were associated. + * + * __db_c_get is used by all access methods, so this should be safe. + */ + if (F_ISSET(dbp, DB_AM_SECONDARY)) + dbc->c_get = __db_c_secondary_get; + if (is_opd) F_SET(dbc, DBC_OPD); if (F_ISSET(dbp, DB_AM_RECOVER)) F_SET(dbc, DBC_RECOVER); + if (F_ISSET(dbp, DB_AM_COMPENSATE)) + F_SET(dbc, DBC_COMPENSATE); /* Refresh the DBC internal structure. */ cp = dbc->internal; @@ -243,75 +324,91 @@ __db_icursor(dbp, txn, dbtype, root, is_opd, dbcp) return (0); err: if (allocated) - __os_free(dbc, sizeof(*dbc)); + __os_free(dbp->dbenv, dbc); return (ret); } #ifdef DEBUG /* * __db_cprint -- - * Display the current cursor list. + * Display the cursor active and free queues. * * PUBLIC: int __db_cprint __P((DB *)); */ int __db_cprint(dbp) DB *dbp; +{ + DBC *dbc; + int ret, t_ret; + + ret = 0; + MUTEX_THREAD_LOCK(dbp->dbenv, dbp->mutexp); + fprintf(stderr, "Active queue:\n"); + for (dbc = TAILQ_FIRST(&dbp->active_queue); + dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) + if ((t_ret = __db_cprint_item(dbc)) != 0 && ret == 0) + ret = t_ret; + fprintf(stderr, "Free queue:\n"); + for (dbc = TAILQ_FIRST(&dbp->free_queue); + dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) + if ((t_ret = __db_cprint_item(dbc)) != 0 && ret == 0) + ret = t_ret; + MUTEX_THREAD_UNLOCK(dbp->dbenv, dbp->mutexp); + + return (ret); +} + +static +int __db_cprint_item(dbc) + DBC *dbc; { static const FN fn[] = { { DBC_ACTIVE, "active" }, + { DBC_COMPENSATE, "compensate" }, { DBC_OPD, "off-page-dup" }, { DBC_RECOVER, "recover" }, { DBC_RMW, "read-modify-write" }, + { DBC_TRANSIENT, "transient" }, { DBC_WRITECURSOR, "write cursor" }, { DBC_WRITEDUP, "internally dup'ed write cursor" }, { DBC_WRITER, "short-term write cursor" }, { 0, NULL } }; - DBC *dbc; + DB *dbp; DBC_INTERNAL *cp; - char *s; + const char *s; - MUTEX_THREAD_LOCK(dbp->dbenv, dbp->mutexp); - for (dbc = TAILQ_FIRST(&dbp->active_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { - switch (dbc->dbtype) { - case DB_BTREE: - s = "btree"; - break; - case DB_HASH: - s = "hash"; - break; - case DB_RECNO: - s = "recno"; - break; - case DB_QUEUE: - s = "queue"; - break; - default: - DB_ASSERT(0); - return (1); - } - cp = dbc->internal; - fprintf(stderr, "%s/%#0lx: opd: %#0lx\n", - s, P_TO_ULONG(dbc), P_TO_ULONG(cp->opd)); - fprintf(stderr, "\ttxn: %#0lx lid: %lu locker: %lu\n", - P_TO_ULONG(dbc->txn), - (u_long)dbc->lid, (u_long)dbc->locker); - fprintf(stderr, "\troot: %lu page/index: %lu/%lu", - (u_long)cp->root, (u_long)cp->pgno, (u_long)cp->indx); - __db_prflags(dbc->flags, fn, stderr); - fprintf(stderr, "\n"); + dbp = dbc->dbp; + cp = dbc->internal; - if (dbp->type == DB_BTREE) - __bam_cprint(dbc); + s = __db_dbtype_to_string(dbc->dbtype); + if (strcmp(s, "UNKNOWN TYPE") == 0) { + DB_ASSERT(0); + return (1); } - for (dbc = TAILQ_FIRST(&dbp->free_queue); - dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) - fprintf(stderr, "free: %#0lx ", P_TO_ULONG(dbc)); - fprintf(stderr, "\n"); - MUTEX_THREAD_UNLOCK(dbp->dbenv, dbp->mutexp); + fprintf(stderr, "%s/%#0lx: opd: %#0lx\n", + s, P_TO_ULONG(dbc), P_TO_ULONG(cp->opd)); + fprintf(stderr, "\ttxn: %#0lx lid: %lu locker: %lu\n", + P_TO_ULONG(dbc->txn), (u_long)dbc->lid, (u_long)dbc->locker); + + fprintf(stderr, "\troot: %lu page/index: %lu/%lu", + (u_long)cp->root, (u_long)cp->pgno, (u_long)cp->indx); + + __db_prflags(dbc->flags, fn, stderr); + fprintf(stderr, "\n"); + + switch (dbp->type) { + case DB_BTREE: + __bam_cprint(dbc); + break; + case DB_HASH: + __ham_cprint(dbc); + break; + default: + break; + } return (0); } #endif /* DEBUG */ @@ -345,7 +442,7 @@ __db_fd(dbp, fdp) return (0); } else { *fdp = -1; - __db_err(dbp->dbenv, "DB does not have a valid file handle."); + __db_err(dbp->dbenv, "DB does not have a valid file handle"); return (ENOENT); } } @@ -372,8 +469,16 @@ __db_get(dbp, txn, key, data, flags) if ((ret = __db_getchk(dbp, key, data, flags)) != 0) return (ret); + /* Check for consistent transaction usage. */ + if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 1)) != 0) + return (ret); + mode = 0; - if (flags == DB_CONSUME || flags == DB_CONSUME_WAIT) + if (LF_ISSET(DB_DIRTY_READ)) { + mode = DB_DIRTY_READ; + LF_CLR(DB_DIRTY_READ); + } + else if (flags == DB_CONSUME || flags == DB_CONSUME_WAIT) mode = DB_WRITELOCK; if ((ret = dbp->cursor(dbp, txn, &dbc, mode)) != 0) return (ret); @@ -387,11 +492,17 @@ __db_get(dbp, txn, key, data, flags) * going to close it right away. Thus, we can perform the get * without duplicating the cursor, saving some cycles in this * common case. + * + * SET_RET_MEM indicates that if key and/or data have no DBT + * flags set and DB manages the returned-data memory, that memory + * will belong to this handle, not to the underlying cursor. */ F_SET(dbc, DBC_TRANSIENT); + SET_RET_MEM(dbc, dbp); - ret = dbc->c_get(dbc, key, data, - flags == 0 || flags == DB_RMW ? flags | DB_SET : flags); + if (LF_ISSET(~(DB_RMW | DB_MULTIPLE)) == 0) + LF_SET(DB_SET); + ret = dbc->c_get(dbc, key, data, flags); if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0) ret = t_ret; @@ -414,20 +525,39 @@ __db_put(dbp, txn, key, data, flags) { DBC *dbc; DBT tdata; - int ret, t_ret; + DB_ENV *dbenv; + int ret, t_ret, txn_local; - PANIC_CHECK(dbp->dbenv); + dbc = NULL; + dbenv = dbp->dbenv; + txn_local = 0; + + PANIC_CHECK(dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->put"); + /* Validate arguments. */ if ((ret = __db_putchk(dbp, key, data, - flags, F_ISSET(dbp, DB_AM_RDONLY), - F_ISSET(dbp, DB_AM_DUP) || F_ISSET(key, DB_DBT_DUPOK))) != 0) + flags, F_ISSET(dbp, DB_AM_DUP) || F_ISSET(key, DB_DBT_DUPOK))) != 0) return (ret); - DB_CHECK_TXN(dbp, txn); + /* Create local transaction as necessary. */ + if (IS_AUTO_COMMIT(dbenv, txn, flags)) { + if ((ret = __db_txn_auto(dbp, &txn)) != 0) + return (ret); + txn_local = 1; + LF_CLR(DB_AUTO_COMMIT); + } + + /* Check for consistent transaction usage. */ + if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0) + goto err; if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) - return (ret); + goto err; + + DEBUG_LWRITE(dbc, txn, "db_put", key, data, flags); + + SET_RET_MEM(dbc, dbp); /* * See the comment in __db_get(). @@ -441,9 +571,58 @@ __db_put(dbp, txn, key, data, flags) */ F_SET(dbc, DBC_TRANSIENT); - DEBUG_LWRITE(dbc, txn, "__db_put", key, data, flags); + switch (flags) { + case DB_APPEND: + /* + * If there is an append callback, the value stored in + * data->data may be replaced and then freed. To avoid + * passing a freed pointer back to the user, just operate + * on a copy of the data DBT. + */ + tdata = *data; - if (flags == DB_NOOVERWRITE) { + /* + * Append isn't a normal put operation; call the appropriate + * access method's append function. + */ + switch (dbp->type) { + case DB_QUEUE: + if ((ret = __qam_append(dbc, key, &tdata)) != 0) + goto err; + break; + case DB_RECNO: + if ((ret = __ram_append(dbc, key, &tdata)) != 0) + goto err; + break; + default: + /* The interface should prevent this. */ + DB_ASSERT(0); + ret = __db_ferr(dbenv, "__db_put", flags); + goto err; + } + + /* + * 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. + */ + DB_ASSERT(!F_ISSET(dbp, DB_AM_SECONDARY)); + + if (LIST_FIRST(&dbp->s_secondaries) != NULL) + 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); + + /* No need for a cursor put; we're done. */ + goto err; + case DB_NOOVERWRITE: flags = 0; /* * Set DB_DBT_USERMEM, this might be a threaded application and @@ -460,16 +639,161 @@ __db_put(dbp, txn, key, data, flags) if ((ret = dbc->c_get(dbc, key, &tdata, DB_SET | (STD_LOCKING(dbc) ? DB_RMW : 0))) == 0) ret = DB_KEYEXIST; - else if (ret == DB_NOTFOUND) + else if (ret == DB_NOTFOUND || ret == DB_KEYEMPTY) ret = 0; + break; + default: + /* Fall through to normal cursor put. */ + break; } if (ret == 0) ret = dbc->c_put(dbc, - key, data, flags == 0 ? DB_KEYLAST : flags); + key, data, flags == 0 ? DB_KEYLAST : flags); - if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0) +err: /* Close the cursor. */ + if (dbc != NULL && (t_ret = __db_c_close(dbc)) != 0 && ret == 0) ret = t_ret; + /* Commit for DB_AUTO_COMMIT. */ + if (txn_local) { + if (ret == 0) + ret = txn->commit(txn, 0); + else + if ((t_ret = txn->abort(txn)) != 0) + ret = __db_panic(dbenv, t_ret); + } + + return (ret); +} + +/* + * __db_delete -- + * Delete the items referenced by a key. + * + * PUBLIC: int __db_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); + */ +int +__db_delete(dbp, txn, key, flags) + DB *dbp; + DB_TXN *txn; + DBT *key; + u_int32_t flags; +{ + DBC *dbc; + DBT data, lkey; + DB_ENV *dbenv; + u_int32_t f_init, f_next; + int ret, t_ret, txn_local; + + dbc = NULL; + dbenv = dbp->dbenv; + txn_local = 0; + + PANIC_CHECK(dbenv); + DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->del"); + + /* Check for invalid flags. */ + if ((ret = __db_delchk(dbp, key, flags)) != 0) + return (ret); + + /* Create local transaction as necessary. */ + if (IS_AUTO_COMMIT(dbenv, txn, flags)) { + if ((ret = __db_txn_auto(dbp, &txn)) != 0) + return (ret); + txn_local = 1; + LF_CLR(DB_AUTO_COMMIT); + } + + /* Check for consistent transaction usage. */ + if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0) + goto err; + + /* Allocate a cursor. */ + if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) + goto err; + + DEBUG_LWRITE(dbc, txn, "db_delete", key, NULL, 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. + */ + 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); + + /* + * If locking (and we haven't already acquired CDB locks), set the + * read-modify-write flag. + */ + f_init = DB_SET; + f_next = DB_NEXT_DUP; + if (STD_LOCKING(dbc)) { + f_init |= DB_RMW; + f_next |= DB_RMW; + } + + /* Walk through the set of key/data pairs, deleting as we go. */ + if ((ret = dbc->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". + * + * !!! + * 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. + */ + if (dbp->type == DB_HASH) { + if (LIST_FIRST(&dbp->s_secondaries) == NULL && + !F_ISSET(dbp, DB_AM_SECONDARY) && + dbc->internal->opd == NULL) { + ret = __ham_quick_delete(dbc); + goto err; + } + } + + for (;;) { + if ((ret = dbc->c_del(dbc, 0)) != 0) + goto err; + if ((ret = dbc->c_get(dbc, &lkey, &data, f_next)) != 0) { + if (ret == DB_NOTFOUND) { + ret = 0; + break; + } + goto err; + } + } + +err: /* Discard the cursor. */ + if (dbc != NULL && (t_ret = dbc->c_close(dbc)) != 0 && ret == 0) + ret = t_ret; + + /* Commit for DB_AUTO_COMMIT. */ + if (txn_local) { + if (ret == 0) + ret = txn->commit(txn, 0); + else + if ((t_ret = txn->abort(txn)) != 0) + ret = __db_panic(dbenv, t_ret); + } + return (ret); } @@ -505,7 +829,443 @@ __db_sync(dbp, flags) return (0); /* Flush any dirty pages from the cache to the backing file. */ - if ((t_ret = memp_fsync(dbp->mpf)) != 0 && ret == 0) + if ((t_ret = dbp->mpf->sync(dbp->mpf)) != 0 && ret == 0) + ret = t_ret; + return (ret); +} + +/* + * __db_associate -- + * Associate another database as a secondary index to this one. + * + * PUBLIC: int __db_associate __P((DB *, DB_TXN *, DB *, + * PUBLIC: int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t)); + */ +int +__db_associate(dbp, txn, sdbp, callback, flags) + DB *dbp, *sdbp; + DB_TXN *txn; + int (*callback) __P((DB *, const DBT *, const DBT *, DBT *)); + u_int32_t flags; +{ + DB_ENV *dbenv; + DBC *pdbc, *sdbc; + DBT skey, key, data; + int build, ret, t_ret, txn_local; + + dbenv = dbp->dbenv; + + PANIC_CHECK(dbenv); + + txn_local = 0; + pdbc = NULL; + + memset(&key, 0, sizeof(DBT)); + memset(&data, 0, sizeof(DBT)); + memset(&skey, 0, sizeof(DBT)); + + if ((ret = __db_associatechk(dbp, sdbp, callback, flags)) != 0) + return (ret); + + /* + * 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. + */ + if (IS_AUTO_COMMIT(dbenv, txn, flags)) { + if ((ret = __db_txn_auto(dbp, &txn)) != 0) + return (ret); + txn_local = 1; + } else if (txn != NULL && !TXN_ON(dbenv)) + return (__db_not_txn_env(dbenv)); + + /* + * Check that if an open transaction is in progress, we're in it, + * for other common transaction errors, and for concurrent associates. + */ + if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0) + return (ret); + + 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; + + /* + * Secondary cursors may have the primary's lock file ID, so we + * need to make sure that no older cursors are lying around + * when we make the transition. + */ + if (TAILQ_FIRST(&sdbp->active_queue) != NULL || + TAILQ_FIRST(&sdbp->join_queue) != NULL) { + __db_err(dbenv, + "Databases may not become secondary indices while cursors are open"); + ret = EINVAL; + goto err; + } + while ((sdbc = TAILQ_FIRST(&sdbp->free_queue)) != NULL) + if ((ret = __db_c_destroy(sdbc)) != 0) + goto err; + + 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. + */ + build = 0; + if (LF_ISSET(DB_CREATE)) { + if ((ret = sdbp->cursor(sdbp, txn, &sdbc, 0)) != 0) + goto err; + + memset(&key, 0, sizeof(DBT)); + memset(&data, 0, sizeof(DBT)); + + /* + * We don't care about key or data; we're just doing + * an existence check. + */ + F_SET(&key, DB_DBT_PARTIAL | DB_DBT_USERMEM); + F_SET(&data, DB_DBT_PARTIAL | DB_DBT_USERMEM); + if ((ret = sdbc->c_real_get(sdbc, &key, &data, + (STD_LOCKING(sdbc) ? DB_RMW : 0) | + DB_FIRST)) == DB_NOTFOUND) { + build = 1; + ret = 0; + } + + /* + * Secondary cursors have special refcounting close + * methods. Be careful. + */ + if ((t_ret = __db_c_close(sdbc)) != 0) + ret = t_ret; + if (ret != 0) + goto err; + } + + /* + * 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); + + /* See __db_s_next for an explanation of secondary refcounting. */ + DB_ASSERT(sdbp->s_refcnt == 0); + sdbp->s_refcnt = 1; + LIST_INSERT_HEAD(&dbp->s_secondaries, sdbp, s_links); + MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); + + if (build) { + /* + * We loop through the primary, putting each item we + * find into the new secondary. + * + * If we're using CDB, opening these two cursors puts us + * in a bit of a locking tangle: CDB locks are done on the + * primary, so that we stay deadlock-free, but that means + * that updating the secondary while we have a read cursor + * open on the primary will self-block. To get around this, + * we force the primary cursor to use the same locker ID + * as the secondary, so they won't conflict. This should + * be harmless even if we're not using CDB. + */ + if ((ret = sdbp->cursor(sdbp, txn, &sdbc, + CDB_LOCKING(sdbp->dbenv) ? DB_WRITECURSOR : 0)) != 0) + goto err; + if ((ret = __db_icursor(dbp, + txn, dbp->type, PGNO_INVALID, 0, sdbc->locker, &pdbc)) != 0) + goto err; + + /* Lock out other threads, now that we have a locker ID. */ + dbp->associate_lid = sdbc->locker; + + memset(&key, 0, sizeof(DBT)); + memset(&data, 0, sizeof(DBT)); + while ((ret = pdbc->c_get(pdbc, &key, &data, DB_NEXT)) == 0) { + memset(&skey, 0, sizeof(DBT)); + if ((ret = callback(sdbp, &key, &data, &skey)) != 0) { + if (ret == DB_DONOTINDEX) + continue; + else + goto err; + } + if ((ret = sdbc->c_put(sdbc, + &skey, &key, DB_UPDATE_SECONDARY)) != 0) { + FREE_IF_NEEDED(sdbp, &skey); + goto err; + } + + FREE_IF_NEEDED(sdbp, &skey); + } + if (ret == DB_NOTFOUND) + ret = 0; + + if ((ret = sdbc->c_close(sdbc)) != 0) + goto err; + } + +err: if (pdbc != NULL && (t_ret = pdbc->c_close(pdbc)) != 0 && ret == 0) + ret = t_ret; + + dbp->associate_lid = DB_LOCK_INVALIDID; + + if (txn_local) { + if (ret == 0) + ret = txn->commit(txn, 0); + else + if ((t_ret = txn->abort(txn)) != 0) + ret = __db_panic(dbenv, t_ret); + } + + return (ret); +} + +/* + * __db_pget -- + * Return a primary key/data pair given a secondary key. + * + * PUBLIC: int __db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)); + */ +int +__db_pget(dbp, txn, skey, pkey, data, flags) + DB *dbp; + DB_TXN *txn; + DBT *skey, *pkey, *data; + u_int32_t flags; +{ + DBC *dbc; + int ret, t_ret; + + PANIC_CHECK(dbp->dbenv); + DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->pget"); + + if ((ret = __db_pgetchk(dbp, skey, pkey, data, flags)) != 0) + return (ret); + + if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0) + return (ret); + SET_RET_MEM(dbc, dbp); + + /* + * The underlying cursor pget will fill in a default DBT for null + * pkeys, and use the cursor's returned-key memory internally to + * store any intermediate primary keys. However, we've just set + * the returned-key memory to the DB handle's key memory, which + * is unsafe to use if the DB handle is threaded. If the pkey + * argument is NULL, use the DBC-owned returned-key memory + * instead; it'll go away when we close the cursor before we + * return, but in this case that's just fine, as we're not + * returning the primary key. + */ + if (pkey == NULL) + dbc->rkey = &dbc->my_rkey; + + DEBUG_LREAD(dbc, txn, "__db_pget", skey, NULL, flags); + + /* + * The cursor is just a perfectly ordinary secondary database + * cursor. Call its c_pget() method to do the dirty work. + */ + if (flags == 0 || flags == DB_RMW) + flags |= DB_SET; + ret = dbc->c_pget(dbc, skey, pkey, data, flags); + + if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0) + ret = t_ret; + return (ret); +} + +/* + * __db_secondary_get -- + * This wrapper function for DB->pget() is the DB->get() function + * on a database which has been made into a secondary index. + */ +static int +__db_secondary_get(sdbp, txn, skey, data, flags) + DB *sdbp; + DB_TXN *txn; + DBT *skey, *data; + u_int32_t flags; +{ + + DB_ASSERT(F_ISSET(sdbp, DB_AM_SECONDARY)); + return (sdbp->pget(sdbp, txn, skey, NULL, data, flags)); +} + +/* + * __db_secondary_close -- + * Wrapper function for DB->close() which we use on secondaries to + * manage refcounting and make sure we don't close them underneath + * a primary that is updating. + */ +static int +__db_secondary_close(sdbp, flags) + DB *sdbp; + u_int32_t flags; +{ + DB *primary; + int doclose; + + doclose = 0; + primary = sdbp->s_primary; + + MUTEX_THREAD_LOCK(primary->dbenv, primary->mutexp); + /* + * Check the refcount--if it was at 1 when we were called, no + * thread is currently updating this secondary through the primary, + * so it's safe to close it for real. + * + * If it's not safe to do the close now, we do nothing; the + * 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); + 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); + + /* + * sdbp->close is this function; call the real one explicitly if + * need be. + */ + return (doclose ? __db_close(sdbp, flags) : 0); +} + +/* + * __db_append_primary -- + * Perform the secondary index updates necessary to put(DB_APPEND) + * a record to a primary database. + */ +static int +__db_append_primary(dbc, key, data) + DBC *dbc; + DBT *key, *data; +{ + DB *dbp, *sdbp; + DBC *sdbc, *pdbc; + DBT oldpkey, pkey, pdata, skey; + int cmp, ret, t_ret; + + dbp = dbc->dbp; + sdbp = NULL; + ret = 0; + + /* + * Worrying about partial appends seems a little like worrying + * about Linear A character encodings. But we support those + * too if your application understands them. + */ + pdbc = NULL; + if (F_ISSET(data, DB_DBT_PARTIAL) || F_ISSET(key, DB_DBT_PARTIAL)) { + /* + * The dbc we were passed is all set to pass things + * back to the user; we can't safely do a call on it. + * Dup the cursor, grab the real data item (we don't + * care what the key is--we've been passed it directly), + * and use that instead of the data DBT we were passed. + * + * Note that we can get away with this simple get because + * an appended item is by definition new, and the + * correctly-constructed full data item from this partial + * put is on the page waiting for us. + */ + if ((ret = __db_c_idup(dbc, &pdbc, DB_POSITIONI)) != 0) + return (ret); + memset(&pkey, 0, sizeof(DBT)); + memset(&pdata, 0, sizeof(DBT)); + + if ((ret = pdbc->c_get(pdbc, &pkey, &pdata, DB_CURRENT)) != 0) + goto err; + + key = &pkey; + data = &pdata; + } + + /* + * Loop through the secondary indices, putting a new item in + * each that points to the appended item. + * + * This is much like the loop in "step 3" in __db_c_put, so + * I'm not commenting heavily here; it was unclean to excerpt + * 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)) { + memset(&skey, 0, sizeof(DBT)); + if ((ret = sdbp->s_callback(sdbp, key, data, &skey)) != 0) { + if (ret == DB_DONOTINDEX) + continue; + else + goto err; + } + + if ((ret = __db_icursor(sdbp, dbc->txn, sdbp->type, + PGNO_INVALID, 0, dbc->locker, &sdbc)) != 0) { + FREE_IF_NEEDED(sdbp, &skey); + goto err; + } + if (CDB_LOCKING(sdbp->dbenv)) { + DB_ASSERT(sdbc->mylock.off == LOCK_INVALID); + F_SET(sdbc, DBC_WRITER); + } + + /* + * Since we know we have a new primary key, it can't be a + * duplicate duplicate in the secondary. It can be a + * duplicate in a secondary that doesn't support duplicates, + * however, so we need to be careful to avoid an overwrite + * (which would corrupt our index). + */ + if (!F_ISSET(sdbp, DB_AM_DUP)) { + memset(&oldpkey, 0, sizeof(DBT)); + F_SET(&oldpkey, DB_DBT_MALLOC); + ret = sdbc->c_real_get(sdbc, &skey, &oldpkey, + DB_SET | (STD_LOCKING(dbc) ? DB_RMW : 0)); + if (ret == 0) { + cmp = __bam_defcmp(sdbp, &oldpkey, key); + /* + * XXX + * This needs to use the right free function + * as soon as this is possible. + */ + __os_ufree(sdbp->dbenv, + oldpkey.data); + if (cmp != 0) { + __db_err(sdbp->dbenv, "%s%s", + "Append results in a non-unique secondary key in", + " an index not configured to support duplicates"); + ret = EINVAL; + goto err1; + } + } else if (ret != DB_NOTFOUND && ret != DB_KEYEMPTY) + goto err1; + } + + ret = sdbc->c_put(sdbc, &skey, key, DB_UPDATE_SECONDARY); + +err1: FREE_IF_NEEDED(sdbp, &skey); + + if ((t_ret = sdbc->c_close(sdbc)) != 0 && ret == 0) + ret = t_ret; + + if (ret != 0) + goto err; + } + +err: if (pdbc != NULL && (t_ret = pdbc->c_close(pdbc)) != 0 && ret == 0) + ret = t_ret; + if (sdbp != NULL && (t_ret = __db_s_done(sdbp)) != 0 && ret == 0) ret = t_ret; return (ret); } diff --git a/bdb/db/db_cam.c b/bdb/db/db_cam.c index 708d4cbda4d..4de3467d4aa 100644 --- a/bdb/db/db_cam.c +++ b/bdb/db/db_cam.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2000 + * Copyright (c) 2000-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_cam.c,v 11.52 2001/01/18 15:11:16 bostic Exp $"; +static const char revid[] = "$Id: db_cam.c,v 11.114 2002/09/03 15:44:46 krinsky Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,17 +18,18 @@ static const char revid[] = "$Id: db_cam.c,v 11.52 2001/01/18 15:11:16 bostic Ex #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "lock.h" -#include "btree.h" -#include "hash.h" -#include "qam.h" -#include "txn.h" -#include "db_ext.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/log.h" +#include "dbinc/qam.h" +static int __db_buildpartial __P((DB *, DBT *, DBT *, DBT *)); static int __db_c_cleanup __P((DBC *, DBC *, int)); -static int __db_c_idup __P((DBC *, DBC **, u_int32_t)); +static int __db_c_del_secondary __P((DBC *)); +static int __db_c_pget_recno __P((DBC *, DBT *, DBT *, u_int32_t)); static int __db_wrlock_err __P((DB_ENV *)); #define CDB_LOCKING_INIT(dbp, dbc) \ @@ -43,9 +44,9 @@ static int __db_wrlock_err __P((DB_ENV *)); return (__db_wrlock_err(dbp->dbenv)); \ \ if (F_ISSET(dbc, DBC_WRITECURSOR) && \ - (ret = lock_get((dbp)->dbenv, (dbc)->locker, \ - DB_LOCK_UPGRADE, &(dbc)->lock_dbt, DB_LOCK_WRITE, \ - &(dbc)->mylock)) != 0) \ + (ret = (dbp)->dbenv->lock_get((dbp)->dbenv, \ + (dbc)->locker, DB_LOCK_UPGRADE, &(dbc)->lock_dbt, \ + DB_LOCK_WRITE, &(dbc)->mylock)) != 0) \ return (ret); \ } #define CDB_LOCKING_DONE(dbp, dbc) \ @@ -63,9 +64,8 @@ static int __db_wrlock_err __P((DB_ENV *)); F_ISSET((dbc_o), DBC_WRITECURSOR | DBC_WRITEDUP)) { \ memcpy(&(dbc_n)->mylock, &(dbc_o)->mylock, \ sizeof((dbc_o)->mylock)); \ - (dbc_n)->locker = (dbc_o)->locker; \ - /* This lock isn't ours to put--just discard it on close. */ \ - F_SET((dbc_n), DBC_WRITEDUP); \ + /* This lock isn't ours to put--just discard it on close. */ \ + F_SET((dbc_n), DBC_WRITEDUP); \ } /* @@ -81,12 +81,14 @@ __db_c_close(dbc) DB *dbp; DBC *opd; DBC_INTERNAL *cp; + DB_ENV *dbenv; int ret, t_ret; dbp = dbc->dbp; + dbenv = dbp->dbenv; ret = 0; - PANIC_CHECK(dbp->dbenv); + PANIC_CHECK(dbenv); /* * If the cursor is already closed we have a serious problem, and we @@ -95,7 +97,7 @@ __db_c_close(dbc) */ if (!F_ISSET(dbc, DBC_ACTIVE)) { if (dbp != NULL) - __db_err(dbp->dbenv, "Closing closed cursor"); + __db_err(dbenv, "Closing already-closed cursor"); DB_ASSERT(0); return (EINVAL); @@ -113,11 +115,9 @@ __db_c_close(dbc) * !!! * Cursors must be removed from the active queue before calling the * access specific cursor close routine, btree depends on having that - * order of operations. It must also happen before any action that - * can fail and cause __db_c_close to return an error, or else calls - * here from __db_close may loop indefinitely. + * order of operations. */ - MUTEX_THREAD_LOCK(dbp->dbenv, dbp->mutexp); + MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); if (opd != NULL) { F_CLR(opd, DBC_ACTIVE); @@ -126,7 +126,7 @@ __db_c_close(dbc) F_CLR(dbc, DBC_ACTIVE); TAILQ_REMOVE(&dbp->active_queue, dbc, links); - MUTEX_THREAD_UNLOCK(dbp->dbenv, dbp->mutexp); + MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); /* Call the access specific cursor close routine. */ if ((t_ret = @@ -137,17 +137,20 @@ __db_c_close(dbc) * Release the lock after calling the access method specific close * routine, a Btree cursor may have had pending deletes. */ - if (CDB_LOCKING(dbc->dbp->dbenv)) { + if (CDB_LOCKING(dbenv)) { /* * If DBC_WRITEDUP is set, the cursor is an internally * duplicated write cursor and the lock isn't ours to put. + * + * Also, be sure not to free anything if mylock.off is + * INVALID; in some cases, such as idup'ed read cursors + * and secondary update cursors, a cursor in a CDB + * environment may not have a lock at all. */ - if (!F_ISSET(dbc, DBC_WRITEDUP) && - dbc->mylock.off != LOCK_INVALID) { - if ((t_ret = lock_put(dbc->dbp->dbenv, - &dbc->mylock)) != 0 && ret == 0) + if (!F_ISSET(dbc, DBC_WRITEDUP) && LOCK_ISSET(dbc->mylock)) { + if ((t_ret = dbenv->lock_put( + dbenv, &dbc->mylock)) != 0 && ret == 0) ret = t_ret; - dbc->mylock.off = LOCK_INVALID; } /* For safety's sake, since this is going on the free queue. */ @@ -159,7 +162,7 @@ __db_c_close(dbc) dbc->txn->cursors--; /* Move the cursor(s) to the free queue. */ - MUTEX_THREAD_LOCK(dbp->dbenv, dbp->mutexp); + MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); if (opd != NULL) { if (dbc->txn != NULL) dbc->txn->cursors--; @@ -167,7 +170,7 @@ __db_c_close(dbc) opd = NULL; } TAILQ_INSERT_TAIL(&dbp->free_queue, dbc, links); - MUTEX_THREAD_UNLOCK(dbp->dbenv, dbp->mutexp); + MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); return (ret); } @@ -183,27 +186,37 @@ __db_c_destroy(dbc) DBC *dbc; { DB *dbp; - DBC_INTERNAL *cp; - int ret; + DB_ENV *dbenv; + int ret, t_ret; dbp = dbc->dbp; - cp = dbc->internal; + dbenv = dbp->dbenv; /* Remove the cursor from the free queue. */ - MUTEX_THREAD_LOCK(dbp->dbenv, dbp->mutexp); + MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); TAILQ_REMOVE(&dbp->free_queue, dbc, links); - MUTEX_THREAD_UNLOCK(dbp->dbenv, dbp->mutexp); + MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); /* Free up allocated memory. */ - if (dbc->rkey.data != NULL) - __os_free(dbc->rkey.data, dbc->rkey.ulen); - if (dbc->rdata.data != NULL) - __os_free(dbc->rdata.data, dbc->rdata.ulen); + if (dbc->my_rskey.data != NULL) + __os_free(dbenv, dbc->my_rskey.data); + if (dbc->my_rkey.data != NULL) + __os_free(dbenv, dbc->my_rkey.data); + if (dbc->my_rdata.data != NULL) + __os_free(dbenv, dbc->my_rdata.data); /* Call the access specific cursor destroy routine. */ ret = dbc->c_am_destroy == NULL ? 0 : dbc->c_am_destroy(dbc); - __os_free(dbc, sizeof(*dbc)); + /* + * Release the lock id for this cursor. + */ + if (LOCKING_ON(dbenv) && + F_ISSET(dbc, DBC_OWN_LID) && + (t_ret = dbenv->lock_id_free(dbenv, dbc->lid)) != 0 && ret == 0) + ret = t_ret; + + __os_free(dbenv, dbc); return (ret); } @@ -256,7 +269,7 @@ __db_c_count(dbc, recnop, flags) break; default: return (__db_unknown_type(dbp->dbenv, - "__db_c_count", dbp->type)); + "__db_c_count", dbp->type)); } return (0); } @@ -286,17 +299,40 @@ __db_c_del(dbc, flags) dbp = dbc->dbp; PANIC_CHECK(dbp->dbenv); - DB_CHECK_TXN(dbp, dbc->txn); /* Check for invalid flags. */ - if ((ret = __db_cdelchk(dbp, flags, - F_ISSET(dbp, DB_AM_RDONLY), IS_INITIALIZED(dbc))) != 0) + if ((ret = __db_cdelchk(dbp, flags, IS_INITIALIZED(dbc))) != 0) + return (ret); + + /* Check for consistent transaction usage. */ + if ((ret = __db_check_txn(dbp, dbc->txn, dbc->locker, 0)) != 0) return (ret); DEBUG_LWRITE(dbc, dbc->txn, "db_c_del", NULL, NULL, flags); CDB_LOCKING_INIT(dbp, dbc); + /* + * If we're a secondary index, and DB_UPDATE_SECONDARY isn't set + * (which it only is if we're being called from a primary update), + * then we need to call through to the primary and delete the item. + * + * Note that this will delete the current item; we don't need to + * delete it ourselves as well, so we can just goto done. + */ + if (flags != DB_UPDATE_SECONDARY && F_ISSET(dbp, DB_AM_SECONDARY)) { + ret = __db_c_del_secondary(dbc); + goto done; + } + + /* + * If we are a primary and have secondary indices, go through + * and delete any secondary keys that point at the current record. + */ + if (LIST_FIRST(&dbp->s_secondaries) != NULL && + (ret = __db_c_del_primary(dbc)) != 0) + goto done; + /* * Off-page duplicate trees are locked in the primary tree, that is, * we acquire a write lock in the primary tree and no locks in the @@ -310,7 +346,7 @@ __db_c_del(dbc, flags) if ((ret = dbc->c_am_writelock(dbc)) == 0) ret = opd->c_am_del(opd); - CDB_LOCKING_DONE(dbp, dbc); +done: CDB_LOCKING_DONE(dbp, dbc); return (ret); } @@ -362,7 +398,7 @@ __db_c_dup(dbc_orig, dbcp, flags) if (CDB_LOCKING(dbenv) && flags != DB_POSITIONI) { DB_ASSERT(!F_ISSET(dbc_orig, DBC_WRITER | DBC_WRITECURSOR)); - if ((ret = lock_get(dbenv, dbc_n->locker, 0, + if ((ret = dbenv->lock_get(dbenv, dbc_n->locker, 0, &dbc_n->lock_dbt, DB_LOCK_READ, &dbc_n->mylock)) != 0) { (void)__db_c_close(dbc_n); return (ret); @@ -380,6 +416,8 @@ __db_c_dup(dbc_orig, dbcp, flags) dbc_n->internal->opd = dbc_nopd; } + /* Copy the dirty read flag to the new cursor. */ + F_SET(dbc_n, F_ISSET(dbc_orig, DBC_DIRTY_READ)); return (0); err: if (dbc_n != NULL) @@ -393,8 +431,10 @@ err: if (dbc_n != NULL) /* * __db_c_idup -- * Internal version of __db_c_dup. + * + * PUBLIC: int __db_c_idup __P((DBC *, DBC **, u_int32_t)); */ -static int +int __db_c_idup(dbc_orig, dbcp, flags) DBC *dbc_orig, **dbcp; u_int32_t flags; @@ -408,17 +448,16 @@ __db_c_idup(dbc_orig, dbcp, flags) dbc_n = *dbcp; if ((ret = __db_icursor(dbp, dbc_orig->txn, dbc_orig->dbtype, - dbc_orig->internal->root, F_ISSET(dbc_orig, DBC_OPD), &dbc_n)) != 0) + dbc_orig->internal->root, F_ISSET(dbc_orig, DBC_OPD), + dbc_orig->locker, &dbc_n)) != 0) return (ret); - dbc_n->locker = dbc_orig->locker; - /* If the user wants the cursor positioned, do it here. */ if (flags == DB_POSITION || flags == DB_POSITIONI) { int_n = dbc_n->internal; int_orig = dbc_orig->internal; - dbc_n->flags = dbc_orig->flags; + dbc_n->flags |= dbc_orig->flags & ~DBC_OWN_LID; int_n->indx = int_orig->indx; int_n->pgno = int_orig->pgno; @@ -449,6 +488,9 @@ __db_c_idup(dbc_orig, dbcp, flags) /* Now take care of duping the CDB information. */ CDB_LOCKING_COPY(dbp, dbc_orig, dbc_n); + /* Copy the dirty read flag to the new cursor. */ + F_SET(dbc_n, F_ISSET(dbc_orig, DBC_DIRTY_READ)); + *dbcp = dbc_n; return (0); @@ -460,12 +502,13 @@ err: (void)dbc_n->c_close(dbc_n); * __db_c_newopd -- * Create a new off-page duplicate cursor. * - * PUBLIC: int __db_c_newopd __P((DBC *, db_pgno_t, DBC **)); + * PUBLIC: int __db_c_newopd __P((DBC *, db_pgno_t, DBC *, DBC **)); */ int -__db_c_newopd(dbc_parent, root, dbcp) +__db_c_newopd(dbc_parent, root, oldopd, dbcp) DBC *dbc_parent; db_pgno_t root; + DBC *oldopd; DBC **dbcp; { DB *dbp; @@ -476,14 +519,44 @@ __db_c_newopd(dbc_parent, root, dbcp) dbp = dbc_parent->dbp; dbtype = (dbp->dup_compare == NULL) ? DB_RECNO : DB_BTREE; + /* + * On failure, we want to default to returning the old off-page dup + * cursor, if any; our caller can't be left with a dangling pointer + * to a freed cursor. On error the only allowable behavior is to + * close the cursor (and the old OPD cursor it in turn points to), so + * this should be safe. + */ + *dbcp = oldopd; + if ((ret = __db_icursor(dbp, - dbc_parent->txn, dbtype, root, 1, &opd)) != 0) + dbc_parent->txn, dbtype, root, 1, dbc_parent->locker, &opd)) != 0) return (ret); + /* !!! + * If the parent is a DBC_WRITER, this won't copy anything. That's + * not actually a problem--we only need lock information in an + * off-page dup cursor in order to upgrade at cursor close time + * if we've done a delete, but WRITERs don't need to upgrade. + */ CDB_LOCKING_COPY(dbp, dbc_parent, opd); *dbcp = opd; + /* + * Check to see if we already have an off-page dup cursor that we've + * passed in. If we do, close it. It'd be nice to use it again + * if it's a cursor belonging to the right tree, but if we're doing + * a cursor-relative operation this might not be safe, so for now + * we'll take the easy way out and always close and reopen. + * + * Note that under no circumstances do we want to close the old + * cursor without returning a valid new one; we don't want to + * leave the main cursor in our caller with a non-NULL pointer + * to a freed off-page dup cursor. + */ + if (oldopd != NULL && (ret = oldopd->c_close(oldopd)) != 0) + return (ret); + return (0); } @@ -502,8 +575,9 @@ __db_c_get(dbc_arg, key, data, flags) DB *dbp; DBC *dbc, *dbc_n, *opd; DBC_INTERNAL *cp, *cp_n; + DB_MPOOLFILE *mpf; db_pgno_t pgno; - u_int32_t tmp_flags, tmp_rmw; + u_int32_t multi, tmp_dirty, tmp_flags, tmp_rmw; u_int8_t type; int ret, t_ret; @@ -517,6 +591,7 @@ __db_c_get(dbc_arg, key, data, flags) * functions. */ dbp = dbc_arg->dbp; + mpf = dbp->mpf; dbc_n = NULL; opd = NULL; @@ -531,6 +606,12 @@ __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); + + multi = LF_ISSET(DB_MULTIPLE|DB_MULTIPLE_KEY); + LF_CLR(DB_MULTIPLE|DB_MULTIPLE_KEY); + DEBUG_LREAD(dbc_arg, dbc_arg->txn, "db_c_get", flags == DB_SET || flags == DB_SET_RANGE ? key : NULL, NULL, flags); @@ -538,8 +619,18 @@ __db_c_get(dbc_arg, key, data, flags) * Return a cursor's record number. It has nothing to do with the * cursor get code except that it was put into the interface. */ - if (flags == DB_GET_RECNO) - return (__bam_c_rget(dbc_arg, data, flags | tmp_rmw)); + if (flags == DB_GET_RECNO) { + if (tmp_rmw) + F_SET(dbc_arg, DBC_RMW); + if (tmp_dirty) + F_SET(dbc_arg, DBC_DIRTY_READ); + 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); + return (ret); + } if (flags == DB_CONSUME || flags == DB_CONSUME_WAIT) CDB_LOCKING_INIT(dbp, dbc_arg); @@ -564,8 +655,8 @@ __db_c_get(dbc_arg, key, data, flags) if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITIONI)) != 0) return (ret); - 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: @@ -605,21 +696,49 @@ __db_c_get(dbc_arg, key, data, flags) break; } + if (tmp_dirty) + F_SET(dbc_arg, DBC_DIRTY_READ); + /* * If this cursor is going to be closed immediately, we don't * need to take precautions to clean it up on error. */ if (F_ISSET(dbc_arg, DBC_TRANSIENT)) dbc_n = dbc_arg; - else if ((ret = __db_c_idup(dbc_arg, &dbc_n, tmp_flags)) != 0) - goto err; + else { + ret = __db_c_idup(dbc_arg, &dbc_n, tmp_flags); + if (tmp_dirty) + F_CLR(dbc_arg, DBC_DIRTY_READ); + + if (ret != 0) + goto err; + COPY_RET_MEM(dbc_arg, dbc_n); + } if (tmp_rmw) F_SET(dbc_n, DBC_RMW); + + switch (multi) { + case DB_MULTIPLE: + F_SET(dbc_n, DBC_MULTIPLE); + break; + case DB_MULTIPLE_KEY: + F_SET(dbc_n, DBC_MULTIPLE_KEY); + break; + case DB_MULTIPLE | DB_MULTIPLE_KEY: + F_SET(dbc_n, DBC_MULTIPLE|DBC_MULTIPLE_KEY); + break; + case 0: + break; + } + pgno = PGNO_INVALID; 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); + F_CLR(dbc_n, DBC_MULTIPLE|DBC_MULTIPLE_KEY); if (ret != 0) goto err; @@ -630,7 +749,8 @@ __db_c_get(dbc_arg, key, data, flags) * a new cursor and call the underlying function. */ if (pgno != PGNO_INVALID) { - if ((ret = __db_c_newopd(dbc_arg, pgno, &cp_n->opd)) != 0) + if ((ret = __db_c_newopd(dbc_arg, + pgno, cp_n->opd, &cp_n->opd)) != 0) goto err; switch (flags) { @@ -648,10 +768,9 @@ __db_c_get(dbc_arg, key, data, flags) tmp_flags = DB_LAST; break; case DB_GET_BOTH: - tmp_flags = DB_GET_BOTH; - break; case DB_GET_BOTHC: - tmp_flags = DB_GET_BOTHC; + case DB_GET_BOTH_RANGE: + tmp_flags = flags; break; default: ret = @@ -680,19 +799,66 @@ 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(dbp->mpf, &cp_n->pgno, 0, &cp_n->page)) != 0) + mpf->get(mpf, &cp_n->pgno, 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) + key, &dbc_arg->rkey->data, &dbc_arg->rkey->ulen)) != 0) goto err; } - dbc = opd != NULL ? opd : cp_n->opd != NULL ? cp_n->opd : dbc_n; - if (!F_ISSET(data, DB_DBT_ISSET)) { + if (multi != 0) { + /* + * Even if fetching from the OPD cursor we need a duplicate + * primary cursor if we are going after multiple keys. + */ + if (dbc_n == NULL) { + /* + * Non-"_KEY" DB_MULTIPLE doesn't move the main cursor, + * so it's safe to just use dbc_arg, unless dbc_arg + * has an open OPD cursor whose state might need to + * be preserved. + */ + if ((!(multi & DB_MULTIPLE_KEY) && + dbc_arg->internal->opd == NULL) || + F_ISSET(dbc_arg, DBC_TRANSIENT)) + dbc_n = dbc_arg; + else { + if ((ret = __db_c_idup(dbc_arg, + &dbc_n, DB_POSITIONI)) != 0) + goto err; + if ((ret = dbc_n->c_am_get(dbc_n, + key, data, DB_CURRENT, &pgno)) != 0) + goto err; + } + cp_n = dbc_n->internal; + } + + /* + * If opd is set then we dupped the opd that we came in with. + * When we return we may have a new opd if we went to another + * key. + */ + if (opd != NULL) { + DB_ASSERT(cp_n->opd == NULL); + cp_n->opd = opd; + opd = NULL; + } + + /* + * Bulk get doesn't use __db_retcopy, so data.size won't + * get set up unless there is an error. Assume success + * here. This is the only call to c_am_bulk, and it avoids + * setting it exactly the same everywhere. If we have an + * ENOMEM error, it'll get overwritten with the needed value. + */ + data->size = data->ulen; + 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 + (type == P_LBTREE || type == P_HASH ? O_INDX : 0), - data, &dbc_arg->rdata.data, &dbc_arg->rdata.ulen); + data, &dbc_arg->rdata->data, &dbc_arg->rdata->ulen); } err: /* Don't pass DB_DBT_ISSET back to application level, error or no. */ @@ -701,9 +867,8 @@ err: /* Don't pass DB_DBT_ISSET back to application level, error or no. */ /* Cleanup and cursor resolution. */ if (opd != NULL) { - if ((t_ret = - __db_c_cleanup(dbc_arg->internal->opd, - opd, ret)) != 0 && ret == 0) + if ((t_ret = __db_c_cleanup( + dbc_arg->internal->opd, opd, ret)) != 0 && ret == 0) ret = t_ret; } @@ -728,11 +893,12 @@ __db_c_put(dbc_arg, key, data, flags) DBT *key, *data; u_int32_t flags; { - DB *dbp; - DBC *dbc_n, *opd; + DB *dbp, *sdbp; + DBC *dbc_n, *oldopd, *opd, *sdbc, *pdbc; + DBT olddata, oldpkey, oldskey, newdata, pkey, save_skey, skey, temp; db_pgno_t pgno; - u_int32_t tmp_flags; - int ret, t_ret; + int cmp, have_oldrec, ispartial, nodel, re_pad, ret, rmw, t_ret; + u_int32_t re_len, size, tmp_flags; /* * Cursor Cleanup Note: @@ -744,22 +910,469 @@ __db_c_put(dbc_arg, key, data, flags) * functions. */ dbp = dbc_arg->dbp; - dbc_n = NULL; + sdbp = NULL; + pdbc = dbc_n = NULL; + memset(&newdata, 0, sizeof(DBT)); PANIC_CHECK(dbp->dbenv); - DB_CHECK_TXN(dbp, dbc_arg->txn); /* Check for invalid flags. */ - if ((ret = __db_cputchk(dbp, key, data, flags, - F_ISSET(dbp, DB_AM_RDONLY), IS_INITIALIZED(dbc_arg))) != 0) + if ((ret = __db_cputchk(dbp, + key, data, flags, IS_INITIALIZED(dbc_arg))) != 0) return (ret); + /* Check for consistent transaction usage. */ + if ((ret = __db_check_txn(dbp, dbc_arg->txn, dbc_arg->locker, 0)) != 0) + return (ret); + + /* + * Putting to secondary indices is forbidden; when we need + * to internally update one, we'll call this with a private + * synonym for DB_KEYLAST, DB_UPDATE_SECONDARY, which does + * the right thing but won't return an error from cputchk(). + */ + if (flags == DB_UPDATE_SECONDARY) + flags = DB_KEYLAST; + DEBUG_LWRITE(dbc_arg, dbc_arg->txn, "db_c_put", flags == DB_KEYFIRST || flags == DB_KEYLAST || flags == DB_NODUPDATA ? key : NULL, data, flags); CDB_LOCKING_INIT(dbp, dbc_arg); + /* + * Check to see if we are a primary and have secondary indices. + * If we are not, we save ourselves a good bit of trouble and + * just skip to the "normal" put. + */ + if (LIST_FIRST(&dbp->s_secondaries) == NULL) + goto skip_s_update; + + /* + * We have at least one secondary which we may need to update. + * + * There is a rather vile locking issue here. Secondary gets + * will always involve acquiring a read lock in the secondary, + * then acquiring a read lock in the primary. Ideally, we + * would likewise perform puts by updating all the secondaries + * first, then doing the actual put in the primary, to avoid + * deadlock (since having multiple threads doing secondary + * gets and puts simultaneously is probably a common case). + * + * However, if this put is a put-overwrite--and we have no way to + * tell in advance whether it will be--we may need to delete + * an outdated secondary key. In order to find that old + * secondary key, we need to get the record we're overwriting, + * before we overwrite it. + * + * (XXX: It would be nice to avoid this extra get, and have the + * underlying put routines somehow pass us the old record + * since they need to traverse the tree anyway. I'm saving + * this optimization for later, as it's a lot of work, and it + * would be hard to fit into this locking paradigm anyway.) + * + * The simple thing to do would be to go get the old record before + * we do anything else. Unfortunately, though, doing so would + * violate our "secondary, then primary" lock acquisition + * ordering--even in the common case where no old primary record + * exists, we'll still acquire and keep a lock on the page where + * we're about to do the primary insert. + * + * To get around this, we do the following gyrations, which + * hopefully solve this problem in the common case: + * + * 1) If this is a c_put(DB_CURRENT), go ahead and get the + * old record. We already hold the lock on this page in + * the primary, so no harm done, and we'll need the primary + * key (which we weren't passed in this case) to do any + * secondary puts anyway. + * + * 2) If we're doing a partial put, we need to perform the + * get on the primary key right away, since we don't have + * the whole datum that the secondary key is based on. + * We may also need to pad out the record if the primary + * has a fixed record length. + * + * 3) Loop through the secondary indices, putting into each a + * new secondary key that corresponds to the new record. + * + * 4) If we haven't done so in (1) or (2), get the old primary + * key/data pair. If one does not exist--the common case--we're + * done with secondary indices, and can go straight on to the + * primary put. + * + * 5) If we do have an old primary key/data pair, however, we need + * to loop through all the secondaries a second time and delete + * the old secondary in each. + */ + memset(&pkey, 0, sizeof(DBT)); + memset(&olddata, 0, sizeof(DBT)); + have_oldrec = nodel = 0; + + /* + * Primary indices can't have duplicates, so only DB_CURRENT, + * DB_KEYFIRST, and DB_KEYLAST make any sense. Other 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); + + /* + * We'll want to use DB_RMW in a few places, but it's only legal + * when locking is on. + */ + rmw = STD_LOCKING(dbc_arg) ? DB_RMW : 0; + + if (flags == DB_CURRENT) { /* Step 1. */ + /* + * This is safe to do on the cursor we already have; + * error or no, it won't move. + * + * We use DB_RMW for all of these gets because we'll be + * writing soon enough in the "normal" put code. In + * transactional databases we'll hold those write locks + * even if we close the cursor we're reading with. + */ + ret = dbc_arg->c_get(dbc_arg, + &pkey, &olddata, rmw | DB_CURRENT); + if (ret == DB_KEYEMPTY) { + nodel = 1; /* + * We know we don't need a delete + * in the secondary. + */ + have_oldrec = 1; /* We've looked for the old record. */ + } else if (ret != 0) + goto err; + else + have_oldrec = 1; + + } else { + /* So we can just use &pkey everywhere instead of key. */ + pkey.data = key->data; + pkey.size = key->size; + } + + /* + * Check for partial puts (step 2). + */ + if (F_ISSET(data, DB_DBT_PARTIAL)) { + if (!have_oldrec && !nodel) { + /* + * We're going to have to search the tree for the + * specified key. Dup a cursor (so we have the same + * locking info) and do a c_get. + */ + if ((ret = __db_c_idup(dbc_arg, &pdbc, 0)) != 0) + goto err; + + /* We should have gotten DB_CURRENT in step 1. */ + DB_ASSERT(flags != DB_CURRENT); + + ret = pdbc->c_get(pdbc, + &pkey, &olddata, rmw | DB_SET); + if (ret == DB_KEYEMPTY || ret == DB_NOTFOUND) { + nodel = 1; + ret = 0; + } + if ((t_ret = pdbc->c_close(pdbc)) != 0) + ret = t_ret; + if (ret != 0) + goto err; + + have_oldrec = 1; + } + + /* + * Now build the new datum from olddata and the partial + * data we were given. + */ + if ((ret = + __db_buildpartial(dbp, &olddata, data, &newdata)) != 0) + goto err; + ispartial = 1; + } else + ispartial = 0; + + /* + * Handle fixed-length records. If the primary database has + * fixed-length records, we need to pad out the datum before + * we pass it into the callback function; we always index the + * "real" record. + */ + if ((dbp->type == DB_RECNO && F_ISSET(dbp, DB_AM_FIXEDLEN)) || + (dbp->type == DB_QUEUE)) { + if (dbp->type == DB_QUEUE) { + re_len = ((QUEUE *)dbp->q_internal)->re_len; + re_pad = ((QUEUE *)dbp->q_internal)->re_pad; + } else { + re_len = ((BTREE *)dbp->bt_internal)->re_len; + re_pad = ((BTREE *)dbp->bt_internal)->re_pad; + } + + size = ispartial ? newdata.size : data->size; + if (size > re_len) { + __db_err(dbp->dbenv, + "Length improper for fixed length record %lu", + (u_long)size); + ret = EINVAL; + goto err; + } else if (size < re_len) { + /* + * If we're not doing a partial put, copy + * data->data into newdata.data, then pad out + * newdata.data. + * + * If we're doing a partial put, the data + * we want are already in newdata.data; we + * just need to pad. + * + * Either way, realloc is safe. + */ + if ((ret = __os_realloc(dbp->dbenv, re_len, + &newdata.data)) != 0) + goto err; + if (!ispartial) + memcpy(newdata.data, data->data, size); + memset((u_int8_t *)newdata.data + size, re_pad, + re_len - size); + newdata.size = re_len; + ispartial = 1; + } + } + + /* + * Loop through the secondaries. (Step 3.) + * + * 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)) { + /* + * 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) { + if (ret == DB_DONOTINDEX) + /* + * The callback returned a null value--don't + * put this key in the secondary. Just + * move on to the next one--we'll handle + * any necessary deletes in step 5. + */ + continue; + else + goto err; + } + + /* + * Save the DBT we just got back from the callback function + * off; we want to pass its value into c_get functions + * that may stomp on a buffer the callback function + * allocated. + */ + memset(&save_skey, 0, sizeof(DBT)); /* Paranoia. */ + save_skey = skey; + + /* + * Open a cursor in this secondary. + * + * Use the same locker ID as our primary cursor, so that + * we're guaranteed that the locks don't conflict (e.g. in CDB + * or if we're subdatabases that share and want to lock a + * metadata page). + */ + if ((ret = __db_icursor(sdbp, dbc_arg->txn, sdbp->type, + PGNO_INVALID, 0, dbc_arg->locker, &sdbc)) != 0) + goto err; + + /* + * If we're in CDB, updates will fail since the new cursor + * isn't a writer. However, we hold the WRITE lock in the + * primary and will for as long as our new cursor lasts, + * and the primary and secondary share a lock file ID, + * so it's safe to consider this a WRITER. The close + * routine won't try to put anything because we don't + * really have a lock. + */ + if (CDB_LOCKING(sdbp->dbenv)) { + DB_ASSERT(sdbc->mylock.off == LOCK_INVALID); + F_SET(sdbc, DBC_WRITER); + } + + /* + * There are three cases here-- + * 1) The secondary supports sorted duplicates. + * If we attempt to put a secondary/primary pair + * that already exists, that's a duplicate duplicate, + * and c_put will return DB_KEYEXIST (see __db_duperr). + * This will leave us with exactly one copy of the + * secondary/primary pair, and this is just right--we'll + * avoid deleting it later, as the old and new secondaries + * will match (since the old secondary is the dup dup + * that's already there). + * 2) The secondary supports duplicates, but they're not + * sorted. We need to avoid putting a duplicate + * duplicate, because the matching old and new secondaries + * will prevent us from deleting anything and we'll + * wind up with two secondary records that point to the + * same primary key. Do a c_get(DB_GET_BOTH); if + * that returns 0, skip the put. + * 3) The secondary doesn't support duplicates at all. + * In this case, secondary keys must be unique; if + * another primary key already exists for this + * secondary key, we have to either overwrite it or + * not put this one, and in either case we've + * corrupted the secondary index. Do a c_get(DB_SET). + * If the secondary/primary pair already exists, do + * nothing; if the secondary exists with a different + * primary, return an error; and if the secondary + * does not exist, put it. + */ + if (!F_ISSET(sdbp, DB_AM_DUP)) { + /* Case 3. */ + memset(&oldpkey, 0, sizeof(DBT)); + F_SET(&oldpkey, DB_DBT_MALLOC); + ret = sdbc->c_real_get(sdbc, + &skey, &oldpkey, rmw | DB_SET); + if (ret == 0) { + cmp = __bam_defcmp(sdbp, &oldpkey, &pkey); + __os_ufree(sdbp->dbenv, oldpkey.data); + if (cmp != 0) { + __db_err(sdbp->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) + goto skipput; + } else if (!F_ISSET(sdbp, DB_AM_DUPSORT)) + /* Case 2. */ + if ((ret = sdbc->c_real_get(sdbc, + &skey, &pkey, rmw | DB_GET_BOTH)) == 0) + goto skipput; + + ret = sdbc->c_put(sdbc, &skey, &pkey, DB_UPDATE_SECONDARY); + + /* + * We don't know yet whether this was a put-overwrite that + * in fact changed nothing. If it was, we may get DB_KEYEXIST. + * This is not an error. + */ + if (ret == DB_KEYEXIST) + ret = 0; + +skipput: FREE_IF_NEEDED(sdbp, &save_skey) + + if ((t_ret = sdbc->c_close(sdbc)) != 0) + ret = t_ret; + + if (ret != 0) + goto err; + } + if (ret != 0) + goto err; + + /* 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 = pdbc->c_get(pdbc, &pkey, &olddata, rmw | DB_SET); + if (ret == DB_KEYEMPTY || ret == DB_NOTFOUND) { + nodel = 1; + ret = 0; + } + if ((t_ret = pdbc->c_close(pdbc)) != 0) + ret = t_ret; + if (ret != 0) + goto err; + have_oldrec = 1; + } + + /* + * If we don't follow this goto, we do in fact have an old record + * we may need to go 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; + } + if ((ret = sdbp->s_callback(sdbp, + &pkey, ispartial ? &newdata : data, &skey)) != 0 && + ret != DB_DONOTINDEX) + goto err; + + /* + * 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. + */ + sdbc = NULL; + if (ret == DB_DONOTINDEX || + ((BTREE *)sdbp->bt_internal)->bt_compare(sdbp, + &oldskey, &skey) != 0) { + if ((ret = __db_icursor(sdbp, dbc_arg->txn, sdbp->type, + PGNO_INVALID, 0, dbc_arg->locker, &sdbc)) != 0) + goto err; + if (CDB_LOCKING(sdbp->dbenv)) { + DB_ASSERT(sdbc->mylock.off == LOCK_INVALID); + F_SET(sdbc, DBC_WRITER); + } + + /* + * Don't let c_get(DB_GET_BOTH) stomp on + * any secondary key value that the callback + * function may have allocated. Use a temp + * DBT instead. + */ + memset(&temp, 0, sizeof(DBT)); + temp.data = oldskey.data; + temp.size = oldskey.size; + if ((ret = sdbc->c_real_get(sdbc, + &temp, &pkey, rmw | DB_GET_BOTH)) == 0) + ret = sdbc->c_del(sdbc, DB_UPDATE_SECONDARY); + } + + FREE_IF_NEEDED(sdbp, &skey); + FREE_IF_NEEDED(sdbp, &oldskey); + if (sdbc != NULL && (t_ret = sdbc->c_close(sdbc)) != 0) + ret = t_ret; + if (ret != 0) + goto err; + } + + /* Secondary index updates are now done. On to the "real" stuff. */ + +skip_s_update: /* * If we have an off-page duplicates cursor, and the operation applies * to it, perform the operation. Duplicate the cursor and call the @@ -826,8 +1439,12 @@ __db_c_put(dbc_arg, key, data, flags) * a new cursor and call the underlying function. */ if (pgno != PGNO_INVALID) { - if ((ret = __db_c_newopd(dbc_arg, pgno, &opd)) != 0) + oldopd = dbc_n->internal->opd; + if ((ret = __db_c_newopd(dbc_arg, pgno, oldopd, &opd)) != 0) { + dbc_n->internal->opd = opd; goto err; + } + dbc_n->internal->opd = opd; if ((ret = opd->c_am_put( @@ -840,8 +1457,15 @@ err: /* Cleanup and cursor resolution. */ if ((t_ret = __db_c_cleanup(dbc_arg, dbc_n, ret)) != 0 && ret == 0) ret = t_ret; + /* If newdata was used, free its buffer. */ + if (newdata.data != NULL) + __os_free(dbp->dbenv, newdata.data); + CDB_LOCKING_DONE(dbp, dbc_arg); + if (sdbp != NULL && (t_ret = __db_s_done(sdbp)) != 0) + return (t_ret); + return (ret); } @@ -855,7 +1479,20 @@ __db_duperr(dbp, flags) DB *dbp; u_int32_t flags; { - if (flags != DB_NODUPDATA) + + /* + * If we run into this error while updating a secondary index, + * don't yell--there's no clean way to pass DB_NODUPDATA in along + * with DB_UPDATE_SECONDARY, but we may run into this problem + * in a normal, non-error course of events. + * + * !!! + * If and when we ever permit duplicate duplicates in sorted-dup + * databases, we need to either change the secondary index code + * to check for dup dups, or we need to maintain the implicit + * "DB_NODUPDATA" behavior for databases with DB_AM_SECONDARY set. + */ + if (flags != DB_NODUPDATA && !F_ISSET(dbp, DB_AM_SECONDARY)) __db_err(dbp->dbenv, "Duplicate data items are not supported with sorted data"); return (DB_KEYEXIST); @@ -873,60 +1510,55 @@ __db_c_cleanup(dbc, dbc_n, failed) DB *dbp; DBC *opd; DBC_INTERNAL *internal; + DB_MPOOLFILE *mpf; int ret, t_ret; dbp = dbc->dbp; + mpf = dbp->mpf; internal = dbc->internal; ret = 0; /* Discard any pages we're holding. */ if (internal->page != NULL) { - if ((t_ret = - memp_fput(dbp->mpf, internal->page, 0)) != 0 && ret == 0) + if ((t_ret = mpf->put(mpf, internal->page, 0)) != 0 && ret == 0) ret = t_ret; internal->page = NULL; } opd = internal->opd; if (opd != NULL && opd->internal->page != NULL) { - if ((t_ret = memp_fput(dbp->mpf, - opd->internal->page, 0)) != 0 && ret == 0) + if ((t_ret = + mpf->put(mpf, opd->internal->page, 0)) != 0 && ret == 0) ret = t_ret; opd->internal->page = NULL; } /* - * If dbc_n is NULL, there's no internal cursor swapping to be - * done and no dbc_n to close--we probably did the entire - * operation on an offpage duplicate cursor. Just return. - */ - if (dbc_n == NULL) - return (ret); - - /* - * If dbc is marked DBC_TRANSIENT, we're inside a DB->{put/get} + * If dbc_n is NULL, there's no internal cursor swapping to be done + * and no dbc_n to close--we probably did the entire operation on an + * offpage duplicate cursor. Just return. + * + * If dbc and dbc_n are the same, we're either inside a DB->{put/get} * operation, and as an optimization we performed the operation on - * the main cursor rather than on a duplicated one. Assert - * that dbc_n == dbc (i.e., that we really did skip the - * duplication). Then just do nothing--even if there was - * an error, we're about to close the cursor, and the fact that we - * moved it isn't a user-visible violation of our "cursor - * stays put on error" rule. + * the main cursor rather than on a duplicated one, or we're in a + * bulk get that can't have moved the cursor (DB_MULTIPLE with the + * initial c_get operation on an off-page dup cursor). Just + * return--either we know we didn't move the cursor, or we're going + * to close it before we return to application code, so we're sure + * not to visibly violate the "cursor stays put on error" rule. */ - if (F_ISSET(dbc, DBC_TRANSIENT)) { - DB_ASSERT(dbc == dbc_n); + if (dbc_n == NULL || dbc == dbc_n) return (ret); - } if (dbc_n->internal->page != NULL) { - if ((t_ret = memp_fput(dbp->mpf, - dbc_n->internal->page, 0)) != 0 && ret == 0) + if ((t_ret = + mpf->put(mpf, dbc_n->internal->page, 0)) != 0 && ret == 0) ret = t_ret; dbc_n->internal->page = NULL; } opd = dbc_n->internal->opd; if (opd != NULL && opd->internal->page != NULL) { - if ((t_ret = memp_fput(dbp->mpf, - opd->internal->page, 0)) != 0 && ret == 0) + if ((t_ret = + mpf->put(mpf, opd->internal->page, 0)) != 0 && ret == 0) ret = t_ret; opd->internal->page = NULL; } @@ -962,6 +1594,316 @@ __db_c_cleanup(dbc, dbc_n, failed) return (ret); } +/* + * __db_c_secondary_get -- + * This wrapper function for DBC->c_pget() is the DBC->c_get() function + * for a secondary index cursor. + * + * PUBLIC: int __db_c_secondary_get __P((DBC *, DBT *, DBT *, u_int32_t)); + */ +int +__db_c_secondary_get(dbc, skey, data, flags) + DBC *dbc; + DBT *skey, *data; + u_int32_t flags; +{ + + DB_ASSERT(F_ISSET(dbc->dbp, DB_AM_SECONDARY)); + return (dbc->c_pget(dbc, skey, NULL, data, flags)); +} + +/* + * __db_c_pget -- + * Get a primary key/data pair through a secondary index. + * + * PUBLIC: int __db_c_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t)); + */ +int +__db_c_pget(dbc, skey, pkey, data, flags) + DBC *dbc; + DBT *skey, *pkey, *data; + u_int32_t flags; +{ + DB *pdbp, *sdbp; + DBC *pdbc; + DBT *save_rdata, nullpkey; + int pkeymalloc, ret, save_pkey_flags, t_ret; + + sdbp = dbc->dbp; + pdbp = sdbp->s_primary; + pkeymalloc = t_ret = 0; + + PANIC_CHECK(sdbp->dbenv); + if ((ret = __db_cpgetchk(sdbp, + skey, pkey, data, flags, IS_INITIALIZED(dbc))) != 0) + return (ret); + + /* + * The challenging part of this function is getting the behavior + * right for all the various permutations of DBT flags. The + * next several blocks handle the various cases we need to + * deal with specially. + */ + + /* + * We may be called with a NULL pkey argument, if we've been + * wrapped by a 2-DBT get call. If so, we need to use our + * own DBT. + */ + if (pkey == NULL) { + memset(&nullpkey, 0, sizeof(DBT)); + pkey = &nullpkey; + } + + /* + * 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 the DBTs we've been passed don't have any of the + * user-specified memory management flags set, we want to make sure + * we return values using the DBTs dbc->rskey, dbc->rkey, and + * dbc->rdata, respectively. + * + * There are two tricky aspects to this: first, we need to pass + * skey and pkey *in* to the initial c_get on the secondary key, + * since either or both may be looked at by it (depending on the + * get flag). Second, we must not use a normal DB->get call + * on the secondary, even though that's what we want to accomplish, + * because the DB handle may be free-threaded. Instead, + * we open a cursor, then take steps to ensure that we actually use + * 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. + * + * 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. + */ + save_pkey_flags = pkey->flags; + F_CLR(pkey, DB_DBT_PARTIAL); + + /* + * 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 = dbc->c_real_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; + } + + /* 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. + */ + dbc->rskey = dbc->rkey; + dbc->rkey = dbc->rdata; + dbc->rdata = save_rdata; + + /* + * 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. + * + * !!! + * We need to use __db_icursor 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.) + */ + if ((ret = __db_icursor(pdbp, + dbc->txn, pdbp->type, PGNO_INVALID, 0, dbc->locker, &pdbc)) != 0) + goto err; + + /* + * 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. + * + * !!! + * 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; + } + + /* + * 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 = pdbc->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 (ret == DB_NOTFOUND) + ret = __db_secondary_corrupt(pdbp); + + /* Now close the primary cursor. */ + t_ret = pdbc->c_close(pdbc); + +err: 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. + */ + F_CLR(pkey, DB_DBT_REALLOC); + F_SET(pkey, DB_DBT_MALLOC); + } + return (t_ret == 0 ? ret : t_ret); +} + +/* + * __db_c_pget_recno -- + * Perform a DB_GET_RECNO c_pget on a secondary index. Returns + * the secondary's record number in the pkey field and the primary's + * in the data field. + */ +static int +__db_c_pget_recno(sdbc, pkey, data, flags) + DBC *sdbc; + DBT *pkey, *data; + u_int32_t flags; +{ + DB *pdbp, *sdbp; + DB_ENV *dbenv; + DBC *pdbc; + DBT discardme, primary_key; + db_recno_t oob; + u_int32_t rmw; + int ret, t_ret; + + sdbp = sdbc->dbp; + pdbp = sdbp->s_primary; + dbenv = sdbp->dbenv; + pdbc = NULL; + ret = t_ret = 0; + + rmw = LF_ISSET(DB_RMW); + + memset(&discardme, 0, sizeof(DBT)); + F_SET(&discardme, DB_DBT_USERMEM | DB_DBT_PARTIAL); + + oob = RECNO_OOB; + + /* + * If the primary is an rbtree, we want its record number, whether + * or not the secondary is one too. Fetch the recno into "data". + * + * If it's not an rbtree, return RECNO_OOB in "data". + */ + if (F_ISSET(pdbp, DB_AM_RECNUM)) { + /* + * Get the primary key, so we can find the record number + * in the primary. (We're uninterested in the secondary key.) + */ + memset(&primary_key, 0, sizeof(DBT)); + F_SET(&primary_key, DB_DBT_MALLOC); + if ((ret = sdbc->c_real_get(sdbc, + &discardme, &primary_key, rmw | DB_CURRENT)) != 0) + return (ret); + + /* + * Open a cursor on the primary, set it to the right record, + * and fetch its recno into "data". + * + * (See __db_c_pget for a comment on the use of __db_icursor.) + * + * SET_RET_MEM so that the secondary DBC owns any returned-data + * memory. + */ + if ((ret = __db_icursor(pdbp, sdbc->txn, + pdbp->type, PGNO_INVALID, 0, sdbc->locker, &pdbc)) != 0) + goto perr; + SET_RET_MEM(pdbc, sdbc); + if ((ret = pdbc->c_get(pdbc, + &primary_key, &discardme, rmw | DB_SET)) != 0) + goto perr; + + ret = pdbc->c_get(pdbc, &discardme, data, rmw | DB_GET_RECNO); + +perr: __os_ufree(sdbp->dbenv, primary_key.data); + if (pdbc != NULL && + (t_ret = pdbc->c_close(pdbc)) != 0 && ret == 0) + ret = t_ret; + if (ret != 0) + return (ret); + } else if ((ret = __db_retcopy(dbenv, data, &oob, + sizeof(oob), &sdbc->rkey->data, &sdbc->rkey->ulen)) != 0) + return (ret); + + /* + * If the secondary is an rbtree, we want its record number, whether + * or not the primary is one too. Fetch the recno into "pkey". + * + * If it's not an rbtree, return RECNO_OOB in "pkey". + */ + if (F_ISSET(sdbp, DB_AM_RECNUM)) + return (sdbc->c_real_get(sdbc, &discardme, pkey, flags)); + else + return (__db_retcopy(dbenv, pkey, &oob, + sizeof(oob), &sdbc->rdata->data, &sdbc->rdata->ulen)); +} + /* * __db_wrlock_err -- do not have a write lock. */ @@ -972,3 +1914,373 @@ __db_wrlock_err(dbenv) __db_err(dbenv, "Write attempted on read-only cursor"); return (EPERM); } + +/* + * __db_c_del_secondary -- + * Perform a delete operation on a secondary index: call through + * to the primary and delete the primary record that this record + * points to. + * + * Note that deleting the primary record will call c_del on all + * the secondaries, including this one; thus, it is not necessary + * to execute both this function and an actual delete. + * + */ +static int +__db_c_del_secondary(dbc) + DBC *dbc; +{ + DB *pdbp; + DBC *pdbc; + DBT skey, pkey; + int ret, t_ret; + + memset(&skey, 0, sizeof(DBT)); + memset(&pkey, 0, sizeof(DBT)); + + /* + * Get the current item that we're pointing at. + * We don't actually care about the secondary key, just + * the primary. + */ + F_SET(&skey, DB_DBT_PARTIAL | DB_DBT_USERMEM); + if ((ret = dbc->c_real_get(dbc, + &skey, &pkey, DB_CURRENT)) != 0) + return (ret); + + /* + * Create a cursor on the primary with our locker ID, + * so that when it calls back, we don't conflict. + * + * We create a cursor explicitly because there's no + * way to specify the same locker ID if we're using + * locking but not transactions if we use the DB->del + * interface. This shouldn't be any less efficient + * anyway. + */ + pdbp = dbc->dbp->s_primary; + if ((ret = __db_icursor(pdbp, dbc->txn, + pdbp->type, PGNO_INVALID, 0, dbc->locker, &pdbc)) != 0) + return (ret); + + /* + * See comment in __db_c_put--if we're in CDB, + * we already hold the locks we need, and we need to flag + * 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); + F_SET(pdbc, DBC_WRITER); + } + + /* + * Set the new cursor to the correct primary key. Then + * delete it. We don't really care about the datum; + * just reuse our skey DBT. + * + * If the primary get returns DB_NOTFOUND, something is amiss-- + * every record in the secondary should correspond to some record + * in the primary. + */ + if ((ret = pdbc->c_get(pdbc, &pkey, &skey, + (STD_LOCKING(dbc) ? DB_RMW : 0) | DB_SET)) == 0) + ret = pdbc->c_del(pdbc, 0); + else if (ret == DB_NOTFOUND) + ret = __db_secondary_corrupt(pdbp); + + if ((t_ret = pdbc->c_close(pdbc)) != 0 && ret != 0) + ret = t_ret; + + return (ret); +} + +/* + * __db_c_del_primary -- + * Perform a delete operation on a primary index. Loop through + * all the secondary indices which correspond to this primary + * database, and delete any secondary keys that point at the current + * record. + * + * PUBLIC: int __db_c_del_primary __P((DBC *)); + */ +int +__db_c_del_primary(dbc) + DBC *dbc; +{ + DB *dbp, *sdbp; + DBC *sdbc; + DBT data, pkey, skey, temp; + int ret, t_ret; + + dbp = dbc->dbp; + + /* + * If we're called at all, we have at least one secondary. + * (Unfortunately, we can't assert this without grabbing the mutex.) + * Get the current record so that we can construct appropriate + * secondary keys as needed. + */ + memset(&pkey, 0, sizeof(DBT)); + memset(&data, 0, sizeof(DBT)); + if ((ret = dbc->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)) { + /* + * 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 + * have no work to do. Proceed. + */ + if (ret == DB_DONOTINDEX) + continue; + + /* We had a substantive error. Bail. */ + FREE_IF_NEEDED(sdbp, &skey); + goto done; + } + + /* Open a secondary cursor. */ + if ((ret = __db_icursor(sdbp, dbc->txn, sdbp->type, + PGNO_INVALID, 0, dbc->locker, &sdbc)) != 0) + goto done; + /* See comment above and in __db_c_put. */ + if (CDB_LOCKING(sdbp->dbenv)) { + DB_ASSERT(sdbc->mylock.off == LOCK_INVALID); + F_SET(sdbc, DBC_WRITER); + } + + /* + * Set the secondary cursor to the appropriate item. + * Delete it. + * + * We want to use DB_RMW if locking is on; it's only + * legal then, though. + * + * !!! + * Don't stomp on any callback-allocated buffer in skey + * when we do a c_get(DB_GET_BOTH); use a temp DBT instead. + */ + memset(&temp, 0, sizeof(DBT)); + temp.data = skey.data; + temp.size = skey.size; + if ((ret = sdbc->c_real_get(sdbc, &temp, &pkey, + (STD_LOCKING(dbc) ? DB_RMW : 0) | DB_GET_BOTH)) == 0) + ret = sdbc->c_del(sdbc, DB_UPDATE_SECONDARY); + + FREE_IF_NEEDED(sdbp, &skey); + + if ((t_ret = sdbc->c_close(sdbc)) != 0 || ret != 0) { + if (ret == 0) + ret = t_ret; + goto done; + } + } + +done: if (sdbp != NULL && (t_ret = __db_s_done(sdbp)) != 0 && ret == 0) + return (t_ret); + return (ret); +} + +/* + * __db_s_first -- + * Get the first secondary, if any are present, from the primary. + * + * PUBLIC: DB *__db_s_first __P((DB *)); + */ +DB * +__db_s_first(pdbp) + DB *pdbp; +{ + DB *sdbp; + + MUTEX_THREAD_LOCK(pdbp->dbenv, pdbp->mutexp); + sdbp = LIST_FIRST(&pdbp->s_secondaries); + + /* See __db_s_next. */ + if (sdbp != NULL) + sdbp->s_refcnt++; + MUTEX_THREAD_UNLOCK(pdbp->dbenv, pdbp->mutexp); + + return (sdbp); +} + +/* + * __db_s_next -- + * Get the next secondary in the list. + * + * PUBLIC: int __db_s_next __P((DB **)); + */ +int +__db_s_next(sdbpp) + DB **sdbpp; +{ + DB *sdbp, *pdbp, *closeme; + int ret; + + /* + * Secondary indices are kept in a linked list, s_secondaries, + * off each primary DB handle. If a primary is free-threaded, + * this list may only be traversed or modified while the primary's + * thread mutex is held. + * + * The tricky part is that we don't want to hold the thread mutex + * across the full set of secondary puts necessary for each primary + * put, or we'll wind up essentially single-threading all the puts + * to the handle; the secondary puts will each take about as + * long as the primary does, and may require I/O. So we instead + * hold the thread mutex only long enough to follow one link to the + * next secondary, and then we release it before performing the + * actual secondary put. + * + * The only danger here is that we might legitimately close a + * secondary index in one thread while another thread is performing + * a put and trying to update that same secondary index. To + * prevent this from happening, we refcount the secondary handles. + * If close is called on a secondary index handle while we're putting + * to it, it won't really be closed--the refcount will simply drop, + * and we'll be responsible for closing it here. + */ + sdbp = *sdbpp; + pdbp = sdbp->s_primary; + closeme = NULL; + + MUTEX_THREAD_LOCK(pdbp->dbenv, pdbp->mutexp); + DB_ASSERT(sdbp->s_refcnt != 0); + if (--sdbp->s_refcnt == 0) { + LIST_REMOVE(sdbp, s_links); + closeme = sdbp; + } + sdbp = LIST_NEXT(sdbp, s_links); + if (sdbp != NULL) + sdbp->s_refcnt++; + MUTEX_THREAD_UNLOCK(pdbp->dbenv, pdbp->mutexp); + + *sdbpp = sdbp; + + /* + * closeme->close() is a wrapper; call __db_close explicitly. + */ + ret = closeme != NULL ? __db_close(closeme, 0) : 0; + return (ret); +} + +/* + * __db_s_done -- + * Properly decrement the refcount on a secondary database handle we're + * using, without calling __db_s_next. + * + * PUBLIC: int __db_s_done __P((DB *)); + */ +int +__db_s_done(sdbp) + DB *sdbp; +{ + DB *pdbp; + int doclose; + + pdbp = sdbp->s_primary; + doclose = 0; + + MUTEX_THREAD_LOCK(pdbp->dbenv, pdbp->mutexp); + DB_ASSERT(sdbp->s_refcnt != 0); + if (--sdbp->s_refcnt == 0) { + LIST_REMOVE(sdbp, s_links); + doclose = 1; + } + MUTEX_THREAD_UNLOCK(pdbp->dbenv, pdbp->mutexp); + + return (doclose ? __db_close(sdbp, 0) : 0); +} + +/* + * __db_buildpartial -- + * Build the record that will result after a partial put is applied to + * an existing record. + * + * This should probably be merged with __bam_build, but that requires + * a little trickery if we plan to keep the overflow-record optimization + * in that function. + */ +static int +__db_buildpartial(dbp, oldrec, partial, newrec) + DB *dbp; + DBT *oldrec, *partial, *newrec; +{ + int ret; + u_int8_t *buf; + u_int32_t len, nbytes; + + DB_ASSERT(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) + return (ret); + newrec->data = buf; + + /* Nul or pad out the buffer, for any part that isn't specified. */ + memset(buf, + F_ISSET(dbp, DB_AM_FIXEDLEN) ? ((BTREE *)dbp->bt_internal)->re_pad : + 0, nbytes); + + /* Copy in any leading data from the original record. */ + memcpy(buf, oldrec->data, + partial->doff > oldrec->size ? oldrec->size : partial->doff); + + /* Copy the data from partial. */ + memcpy(buf + partial->doff, partial->data, partial->size); + + /* Copy any trailing data from the original record. */ + len = partial->doff + partial->dlen; + if (oldrec->size > len) + memcpy(buf + partial->doff + partial->size, + (u_int8_t *)oldrec->data + len, oldrec->size - len); + + return (0); +} + +/* + * __db_partsize -- + * Given the number of bytes in an existing record and a DBT that + * is about to be partial-put, calculate the size of the record + * after the put. + * + * This code is called from __bam_partsize. + * + * PUBLIC: u_int32_t __db_partsize __P((u_int32_t, DBT *)); + */ +u_int32_t +__db_partsize(nbytes, data) + u_int32_t nbytes; + DBT *data; +{ + + /* + * There are really two cases here: + * + * Case 1: We are replacing some bytes that do not exist (i.e., they + * are past the end of the record). In this case the number of bytes + * we are replacing is irrelevant and all we care about is how many + * bytes we are going to add from offset. So, the new record length + * is going to be the size of the new bytes (size) plus wherever those + * new bytes begin (doff). + * + * Case 2: All the bytes we are replacing exist. Therefore, the new + * size is the oldsize (nbytes) minus the bytes we are replacing (dlen) + * plus the bytes we are adding (size). + */ + if (nbytes < data->doff + data->dlen) /* Case 1 */ + return (data->doff + data->size); + + return (nbytes + data->size - data->dlen); /* Case 2 */ +} diff --git a/bdb/db/db_conv.c b/bdb/db/db_conv.c index df60be06790..f731c82d85e 100644 --- a/bdb/db/db_conv.c +++ b/bdb/db/db_conv.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -40,7 +40,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_conv.c,v 11.11 2000/11/30 00:58:31 ubell Exp $"; +static const char revid[] = "$Id: db_conv.c,v 11.38 2002/08/15 03:00:13 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -50,12 +50,14 @@ static const char revid[] = "$Id: db_conv.c,v 11.11 2000/11/30 00:58:31 ubell Ex #endif #include "db_int.h" -#include "db_page.h" -#include "db_swap.h" -#include "db_am.h" -#include "btree.h" -#include "hash.h" -#include "qam.h" +#include "dbinc/crypto.h" +#include "dbinc/hmac.h" +#include "dbinc/db_page.h" +#include "dbinc/db_swap.h" +#include "dbinc/btree.h" +#include "dbinc/hash.h" +#include "dbinc/log.h" +#include "dbinc/qam.h" /* * __db_pgin -- @@ -70,15 +72,135 @@ __db_pgin(dbenv, pg, pp, cookie) void *pp; DBT *cookie; { + DB dummydb, *dbp; DB_PGINFO *pginfo; + DB_CIPHER *db_cipher; + DB_LSN not_used; + PAGE *pagep; + size_t pg_off, pg_len, sum_len; + int is_hmac, ret; + u_int8_t *chksum, *iv; pginfo = (DB_PGINFO *)cookie->data; + pagep = (PAGE *)pp; - switch (((PAGE *)pp)->type) { + ret = is_hmac = 0; + chksum = iv = NULL; + memset(&dummydb, 0, sizeof(DB)); + dbp = &dummydb; + dummydb.flags = pginfo->flags; + db_cipher = (DB_CIPHER *)dbenv->crypto_handle; + switch (pagep->type) { + case P_HASHMETA: + case P_BTREEMETA: + case P_QAMMETA: + /* + * If checksumming is set on the meta-page, we must set + * it in the dbp. + */ + if (FLD_ISSET(((DBMETA *)pp)->metaflags, DBMETA_CHKSUM)) + F_SET(dbp, DB_AM_CHKSUM); + if (((DBMETA *)pp)->encrypt_alg != 0 || + F_ISSET(dbp, DB_AM_ENCRYPT)) + is_hmac = 1; + /* + * !!! + * For all meta pages it is required that the chksum + * be at the same location. Use BTMETA to get to it + * for any meta type. + */ + chksum = ((BTMETA *)pp)->chksum; + sum_len = DBMETASIZE; + break; + case P_INVALID: + /* + * We assume that we've read a file hole if we have + * a zero LSN, zero page number and P_INVALID. Otherwise + * we have an invalid page that might contain real data. + */ + if (IS_ZERO_LSN(LSN(pagep)) && pagep->pgno == PGNO_INVALID) { + sum_len = 0; + break; + } + /* FALLTHROUGH */ + default: + chksum = P_CHKSUM(dbp, pagep); + sum_len = pginfo->db_pagesize; + /* + * If we are reading in a non-meta page, then if we have + * a db_cipher then we are using hmac. + */ + is_hmac = CRYPTO_ON(dbenv) ? 1 : 0; + break; + } + + /* + * We expect a checksum error if there was a configuration problem. + * If there is no configuration problem and we don't get a match, + * it's fatal: panic the system. + */ + if (F_ISSET(dbp, DB_AM_CHKSUM) && sum_len != 0) + switch (ret = __db_check_chksum( + dbenv, db_cipher, chksum, pp, sum_len, is_hmac)) { + case 0: + break; + case -1: + if (DBENV_LOGGING(dbenv)) + __db_cksum_log( + dbenv, NULL, ¬_used, DB_FLUSH); + __db_err(dbenv, + "checksum error: catastrophic recovery required"); + return (__db_panic(dbenv, DB_RUNRECOVERY)); + default: + return (ret); + } + + if (F_ISSET(dbp, DB_AM_ENCRYPT)) { + DB_ASSERT(db_cipher != NULL); + DB_ASSERT(F_ISSET(dbp, DB_AM_CHKSUM)); + + pg_off = P_OVERHEAD(dbp); + DB_ASSERT(db_cipher->adj_size(pg_off) == 0); + + switch (pagep->type) { + case P_HASHMETA: + case P_BTREEMETA: + case P_QAMMETA: + /* + * !!! + * For all meta pages it is required that the iv + * be at the same location. Use BTMETA to get to it + * for any meta type. + */ + iv = ((BTMETA *)pp)->iv; + pg_len = DBMETASIZE; + break; + case P_INVALID: + if (IS_ZERO_LSN(LSN(pagep)) && + pagep->pgno == PGNO_INVALID) { + pg_len = 0; + break; + } + /* FALLTHROUGH */ + default: + iv = P_IV(dbp, pagep); + pg_len = pginfo->db_pagesize; + break; + } + if (pg_len != 0 && (ret = db_cipher->decrypt(dbenv, + db_cipher->data, iv, ((u_int8_t *)pagep) + pg_off, + pg_len - pg_off)) != 0) + return (ret); + } + switch (pagep->type) { + case P_INVALID: + if (pginfo->type == DB_QUEUE) + return (__qam_pgin_out(dbenv, pg, pp, cookie)); + else + return (__ham_pgin(dbenv, dbp, pg, pp, cookie)); case P_HASH: case P_HASHMETA: - case P_INVALID: - return (__ham_pgin(dbenv, pg, pp, cookie)); + return (__ham_pgin(dbenv, dbp, pg, pp, cookie)); case P_BTREEMETA: case P_IBTREE: case P_IRECNO: @@ -86,14 +208,14 @@ __db_pgin(dbenv, pg, pp, cookie) case P_LDUP: case P_LRECNO: case P_OVERFLOW: - return (__bam_pgin(dbenv, pg, pp, cookie)); + return (__bam_pgin(dbenv, dbp, pg, pp, cookie)); case P_QAMMETA: case P_QAMDATA: return (__qam_pgin_out(dbenv, pg, pp, cookie)); default: break; } - return (__db_unknown_type(dbenv, "__db_pgin", ((PAGE *)pp)->type)); + return (__db_pgfmt(dbenv, pg)); } /* @@ -109,15 +231,33 @@ __db_pgout(dbenv, pg, pp, cookie) void *pp; DBT *cookie; { + DB dummydb, *dbp; + DB_CIPHER *db_cipher; DB_PGINFO *pginfo; + PAGE *pagep; + size_t pg_off, pg_len, sum_len; + int ret; + u_int8_t *chksum, *iv, *key; pginfo = (DB_PGINFO *)cookie->data; + pagep = (PAGE *)pp; - switch (((PAGE *)pp)->type) { + chksum = iv = key = NULL; + memset(&dummydb, 0, sizeof(DB)); + dbp = &dummydb; + dummydb.flags = pginfo->flags; + ret = 0; + switch (pagep->type) { + case P_INVALID: + if (pginfo->type == DB_QUEUE) + ret = __qam_pgin_out(dbenv, pg, pp, cookie); + else + ret = __ham_pgout(dbenv, dbp, pg, pp, cookie); + break; case P_HASH: case P_HASHMETA: - case P_INVALID: - return (__ham_pgout(dbenv, pg, pp, cookie)); + ret = __ham_pgout(dbenv, dbp, pg, pp, cookie); + break; case P_BTREEMETA: case P_IBTREE: case P_IRECNO: @@ -125,14 +265,73 @@ __db_pgout(dbenv, pg, pp, cookie) case P_LDUP: case P_LRECNO: case P_OVERFLOW: - return (__bam_pgout(dbenv, pg, pp, cookie)); + ret = __bam_pgout(dbenv, dbp, pg, pp, cookie); + break; case P_QAMMETA: case P_QAMDATA: - return (__qam_pgin_out(dbenv, pg, pp, cookie)); - default: + ret = __qam_pgin_out(dbenv, pg, pp, cookie); break; + default: + return (__db_pgfmt(dbenv, pg)); } - return (__db_unknown_type(dbenv, "__db_pgout", ((PAGE *)pp)->type)); + if (ret) + return (ret); + + 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)); + + pg_off = P_OVERHEAD(dbp); + DB_ASSERT(db_cipher->adj_size(pg_off) == 0); + + key = db_cipher->mac_key; + + switch (pagep->type) { + case P_HASHMETA: + case P_BTREEMETA: + case P_QAMMETA: + /* + * !!! + * For all meta pages it is required that the iv + * be at the same location. Use BTMETA to get to it + * for any meta type. + */ + iv = ((BTMETA *)pp)->iv; + pg_len = DBMETASIZE; + break; + default: + iv = P_IV(dbp, pagep); + pg_len = pginfo->db_pagesize; + break; + } + if ((ret = db_cipher->encrypt(dbenv, db_cipher->data, + iv, ((u_int8_t *)pagep) + pg_off, pg_len - pg_off)) != 0) + return (ret); + } + if (F_ISSET(dbp, DB_AM_CHKSUM)) { + switch (pagep->type) { + case P_HASHMETA: + case P_BTREEMETA: + case P_QAMMETA: + /* + * !!! + * For all meta pages it is required that the chksum + * be at the same location. Use BTMETA to get to it + * for any meta type. + */ + chksum = ((BTMETA *)pp)->chksum; + sum_len = DBMETASIZE; + break; + default: + chksum = P_CHKSUM(dbp, pagep); + sum_len = pginfo->db_pagesize; + break; + } + __db_chksum(pp, sum_len, key, chksum); + } + return (0); } /* @@ -169,11 +368,13 @@ __db_metaswap(pg) * __db_byteswap -- * Byteswap a page. * - * PUBLIC: int __db_byteswap __P((DB_ENV *, db_pgno_t, PAGE *, size_t, int)); + * PUBLIC: int __db_byteswap + * PUBLIC: __P((DB_ENV *, DB *, db_pgno_t, PAGE *, size_t, int)); */ int -__db_byteswap(dbenv, pg, h, pagesize, pgin) +__db_byteswap(dbenv, dbp, pg, h, pagesize, pgin) DB_ENV *dbenv; + DB *dbp; db_pgno_t pg; PAGE *h; size_t pagesize; @@ -183,11 +384,12 @@ __db_byteswap(dbenv, pg, h, pagesize, pgin) BKEYDATA *bk; BOVERFLOW *bo; RINTERNAL *ri; - db_indx_t i, len, tmp; + db_indx_t i, *inp, len, tmp; u_int8_t *p, *end; COMPQUIET(pg, 0); + inp = P_INP(dbp, h); if (pgin) { M_32_SWAP(h->lsn.file); M_32_SWAP(h->lsn.offset); @@ -202,14 +404,14 @@ __db_byteswap(dbenv, pg, h, pagesize, pgin) case P_HASH: for (i = 0; i < NUM_ENT(h); i++) { if (pgin) - M_16_SWAP(h->inp[i]); + M_16_SWAP(inp[i]); - switch (HPAGE_TYPE(h, i)) { + switch (HPAGE_TYPE(dbp, h, i)) { case H_KEYDATA: break; case H_DUPLICATE: - len = LEN_HKEYDATA(h, pagesize, i); - p = HKEYDATA_DATA(P_ENTRY(h, i)); + len = LEN_HKEYDATA(dbp, h, pagesize, i); + p = HKEYDATA_DATA(P_ENTRY(dbp, h, i)); for (end = p + len; p < end;) { if (pgin) { P_16_SWAP(p); @@ -226,11 +428,11 @@ __db_byteswap(dbenv, pg, h, pagesize, pgin) } break; case H_OFFDUP: - p = HOFFPAGE_PGNO(P_ENTRY(h, i)); + p = HOFFPAGE_PGNO(P_ENTRY(dbp, h, i)); SWAP32(p); /* pgno */ break; case H_OFFPAGE: - p = HOFFPAGE_PGNO(P_ENTRY(h, i)); + p = HOFFPAGE_PGNO(P_ENTRY(dbp, h, i)); SWAP32(p); /* pgno */ SWAP32(p); /* tlen */ break; @@ -246,14 +448,14 @@ __db_byteswap(dbenv, pg, h, pagesize, pgin) */ if (!pgin) for (i = 0; i < NUM_ENT(h); i++) - M_16_SWAP(h->inp[i]); + M_16_SWAP(inp[i]); break; case P_LBTREE: case P_LDUP: case P_LRECNO: for (i = 0; i < NUM_ENT(h); i++) { if (pgin) - M_16_SWAP(h->inp[i]); + M_16_SWAP(inp[i]); /* * In the case of on-page duplicates, key information @@ -261,17 +463,17 @@ __db_byteswap(dbenv, pg, h, pagesize, pgin) */ if (h->type == P_LBTREE && i > 1) { if (pgin) { - if (h->inp[i] == h->inp[i - 2]) + if (inp[i] == inp[i - 2]) continue; } else { - M_16_SWAP(h->inp[i]); - if (h->inp[i] == h->inp[i - 2]) + M_16_SWAP(inp[i]); + if (inp[i] == inp[i - 2]) continue; - M_16_SWAP(h->inp[i]); + M_16_SWAP(inp[i]); } } - bk = GET_BKEYDATA(h, i); + bk = GET_BKEYDATA(dbp, h, i); switch (B_TYPE(bk->type)) { case B_KEYDATA: M_16_SWAP(bk->len); @@ -285,15 +487,15 @@ __db_byteswap(dbenv, pg, h, pagesize, pgin) } if (!pgin) - M_16_SWAP(h->inp[i]); + M_16_SWAP(inp[i]); } break; case P_IBTREE: for (i = 0; i < NUM_ENT(h); i++) { if (pgin) - M_16_SWAP(h->inp[i]); + M_16_SWAP(inp[i]); - bi = GET_BINTERNAL(h, i); + bi = GET_BINTERNAL(dbp, h, i); M_16_SWAP(bi->len); M_32_SWAP(bi->pgno); M_32_SWAP(bi->nrecs); @@ -310,20 +512,20 @@ __db_byteswap(dbenv, pg, h, pagesize, pgin) } if (!pgin) - M_16_SWAP(h->inp[i]); + M_16_SWAP(inp[i]); } break; case P_IRECNO: for (i = 0; i < NUM_ENT(h); i++) { if (pgin) - M_16_SWAP(h->inp[i]); + M_16_SWAP(inp[i]); - ri = GET_RINTERNAL(h, i); + ri = GET_RINTERNAL(dbp, h, i); M_32_SWAP(ri->pgno); M_32_SWAP(ri->nrecs); if (!pgin) - M_16_SWAP(h->inp[i]); + M_16_SWAP(inp[i]); } break; case P_OVERFLOW: @@ -331,7 +533,7 @@ __db_byteswap(dbenv, pg, h, pagesize, pgin) /* Nothing to do. */ break; default: - return (__db_unknown_type(dbenv, "__db_byteswap", h->type)); + return (__db_pgfmt(dbenv, pg)); } if (!pgin) { diff --git a/bdb/db/db_dispatch.c b/bdb/db/db_dispatch.c index c9beac401a7..2cf29ec2f33 100644 --- a/bdb/db/db_dispatch.c +++ b/bdb/db/db_dispatch.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -39,7 +39,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_dispatch.c,v 11.41 2001/01/11 18:19:50 bostic Exp $"; +static const char revid[] = "$Id: db_dispatch.c,v 11.121 2002/09/07 17:36:31 ubell Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -51,16 +51,24 @@ static const char revid[] = "$Id: db_dispatch.c,v 11.41 2001/01/11 18:19:50 bost #endif #include "db_int.h" -#include "db_page.h" -#include "db_dispatch.h" -#include "db_am.h" -#include "log_auto.h" -#include "txn.h" -#include "txn_auto.h" -#include "log.h" +#include "dbinc/db_page.h" +#include "dbinc/hash.h" +#include "dbinc/log.h" +#include "dbinc/fop.h" +#include "dbinc/rep.h" +#include "dbinc/txn.h" -static int __db_txnlist_find_internal __P((void *, db_txnlist_type, - u_int32_t, u_int8_t [DB_FILE_ID_LEN], DB_TXNLIST **, int)); +static int __db_limbo_fix __P((DB *, + DB_TXN *, DB_TXNLIST *, db_pgno_t *, DBMETA *)); +static int __db_limbo_bucket __P((DB_ENV *, DB_TXN *, DB_TXNLIST *)); +static int __db_limbo_move __P((DB_ENV *, DB_TXN *, 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_default_getpgnos __P((DB_ENV *, DB_LSN *lsnp, void *)); +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)); +static int __db_txnlist_pgnoadd __P((DB_ENV *, DB_TXNHEAD *, + int32_t, u_int8_t [DB_FILE_ID_LEN], char *, db_pgno_t)); /* * __db_dispatch -- @@ -71,16 +79,21 @@ static int __db_txnlist_find_internal __P((void *, db_txnlist_type, * scripts in the tools directory). An application using a different * recovery paradigm will supply a different dispatch function to txn_open. * - * PUBLIC: int __db_dispatch __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + * 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 *)); */ int -__db_dispatch(dbenv, db, lsnp, redo, info) +__db_dispatch(dbenv, dtab, dtabsize, db, lsnp, redo, info) DB_ENV *dbenv; /* The environment. */ + int (**dtab)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t dtabsize; /* Size of the dtab. */ 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_LSN prev_lsn; u_int32_t rectype, txnid; int make_call, ret; @@ -88,6 +101,9 @@ __db_dispatch(dbenv, db, lsnp, redo, info) memcpy(&txnid, (u_int8_t *)db->data + sizeof(rectype), sizeof(txnid)); make_call = ret = 0; + /* If we don't have a dispatch table, it's hard to dispatch. */ + DB_ASSERT(dtab != NULL); + /* * If we find a record that is in the user's number space and they * have specified a recovery routine, let them handle it. If they @@ -96,17 +112,29 @@ __db_dispatch(dbenv, db, lsnp, redo, info) */ switch (redo) { case DB_TXN_ABORT: - /* - * XXX - * db_printlog depends on DB_TXN_ABORT not examining the TXN - * list. If that ever changes, fix db_printlog too. - */ + case DB_TXN_APPLY: + case DB_TXN_PRINT: make_call = 1; break; case DB_TXN_OPENFILES: - if (rectype == DB_log_register) - return (dbenv->dtab[rectype](dbenv, - db, lsnp, redo, info)); + /* + * We collect all the transactions that have + * "begin" records, those with no previous LSN, + * so that we do not abort partial transactions. + * These are known to be undone, otherwise the + * log would not have been freeable. + */ + memcpy(&prev_lsn, (u_int8_t *)db->data + + sizeof(rectype) + sizeof(txnid), sizeof(prev_lsn)); + if (txnid != 0 && prev_lsn.file == 0 && (ret = + __db_txnlist_add(dbenv, info, txnid, TXN_OK, NULL)) != 0) + return (ret); + + /* FALLTHROUGH */ + case DB_TXN_POPENFILES: + if (rectype == DB___dbreg_register || + rectype == DB___txn_ckp || rectype == DB___txn_recycle) + return (dtab[rectype](dbenv, db, lsnp, redo, info)); break; case DB_TXN_BACKWARD_ROLL: /* @@ -117,43 +145,146 @@ __db_dispatch(dbenv, db, lsnp, redo, info) * we've never seen it, then we call the appropriate recovery * routine. * - * We need to always undo DB_db_noop records, so that we + * We need to always undo DB___db_noop records, so that we * properly handle any aborts before the file was closed. */ - if (rectype == DB_log_register || - rectype == DB_txn_ckp || rectype == DB_db_noop - || rectype == DB_txn_child || (txnid != 0 && - (ret = __db_txnlist_find(info, txnid)) != 0)) { + switch(rectype) { + case DB___txn_regop: + case DB___txn_recycle: + case DB___txn_ckp: + case DB___db_noop: + case DB___fop_file_remove: + case DB___txn_child: make_call = 1; - if (ret == DB_NOTFOUND && rectype != DB_txn_regop && - rectype != DB_txn_xa_regop && (ret = - __db_txnlist_add(dbenv, info, txnid, 1)) != 0) - return (ret); + break; + + case DB___dbreg_register: + if (txnid == 0) { + make_call = 1; + break; + } + /* FALLTHROUGH */ + default: + if (txnid != 0 && (ret = + __db_txnlist_find(dbenv, + info, txnid)) != TXN_COMMIT && ret != TXN_IGNORE) { + /* + * If not found then, this is an incomplete + * abort. + */ + if (ret == TXN_NOTFOUND) + return (__db_txnlist_add(dbenv, + info, txnid, TXN_IGNORE, lsnp)); + make_call = 1; + if (ret == TXN_OK && + (ret = __db_txnlist_update(dbenv, + info, txnid, + rectype == DB___txn_xa_regop ? + TXN_PREPARE : TXN_ABORT, NULL)) != 0) + return (ret); + } } break; case DB_TXN_FORWARD_ROLL: /* * In the forward pass, if we haven't seen the transaction, - * do nothing, else recovery it. + * do nothing, else recover it. * - * We need to always redo DB_db_noop records, so that we + * We need to always redo DB___db_noop records, so that we * properly handle any commits after the file was closed. */ - if (rectype == DB_log_register || - rectype == DB_txn_ckp || - rectype == DB_db_noop || - __db_txnlist_find(info, txnid) == 0) + switch(rectype) { + case DB___txn_recycle: + case DB___txn_ckp: + case DB___db_noop: make_call = 1; + break; + + default: + if (txnid != 0 && (ret = __db_txnlist_find(dbenv, + info, txnid)) == TXN_COMMIT) + make_call = 1; + else if (ret != TXN_IGNORE && + (rectype == DB___ham_metagroup || + rectype == DB___ham_groupalloc || + rectype == DB___db_pg_alloc)) { + /* + * Because we cannot undo file extensions + * all allocation records must be reprocessed + * during rollforward in case the file was + * just created. It may not have been + * present during the backward pass. + */ + make_call = 1; + redo = DB_TXN_BACKWARD_ALLOC; + } else if (rectype == DB___dbreg_register) { + /* + * This may be a transaction dbreg_register. + * If it is, we only make the call on a COMMIT, + * which we checked above. If it's not, then we + * should always make the call, because we need + * the file open information. + */ + if (txnid == 0) + make_call = 1; + } + } break; + case DB_TXN_GETPGNOS: + /* + * If this is one of DB's own log records, we simply + * dispatch. + */ + if (rectype < DB_user_BEGIN) { + make_call = 1; + break; + } + + /* + * If we're still here, this is a custom record in an + * application that's doing app-specific logging. Such a + * record doesn't have a getpgno function for the user + * dispatch function to call--the getpgnos functions return + * which pages replication needs to lock using the TXN_RECS + * structure, which is private and not something we want to + * document. + * + * Thus, we leave any necessary locking for the app's + * recovery function to do during the upcoming + * DB_TXN_APPLY. Fill in default getpgnos info (we need + * a stub entry for every log record that will get + * DB_TXN_APPLY'd) and return success. + */ + return (__db_default_getpgnos(dbenv, lsnp, info)); default: return (__db_unknown_flag(dbenv, "__db_dispatch", redo)); } + /* + * The switch statement uses ret to receive the return value of + * __db_txnlist_find, which returns a large number of different + * statuses, none of which we will be returning. For safety, + * let's reset this here in case we ever do a "return(ret)" + * below in the future. + */ + ret = 0; if (make_call) { - if (rectype >= DB_user_BEGIN && dbenv->tx_recover != NULL) - return (dbenv->tx_recover(dbenv, db, lsnp, redo)); - else - return (dbenv->dtab[rectype](dbenv, db, lsnp, redo, info)); + if (rectype >= DB_user_BEGIN && dbenv->app_dispatch != NULL) + return (dbenv->app_dispatch(dbenv, db, lsnp, redo)); + else { + /* + * The size of the dtab table argument is the same as + * the standard table, use the standard table's size + * as our sanity check. + */ + if (rectype > dtabsize || dtab[rectype] == NULL) { + __db_err(dbenv, + "Illegal record type %lu in log", + (u_long)rectype); + return (EINVAL); + } + return (dtab[rectype](dbenv, db, lsnp, redo, info)); + } } return (0); @@ -163,75 +294,100 @@ __db_dispatch(dbenv, db, lsnp, redo, info) * __db_add_recovery -- * * PUBLIC: int __db_add_recovery __P((DB_ENV *, - * PUBLIC: int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), u_int32_t)); + * PUBLIC: int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *, + * PUBLIC: int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), u_int32_t)); */ int -__db_add_recovery(dbenv, func, ndx) +__db_add_recovery(dbenv, dtab, dtabsize, func, ndx) DB_ENV *dbenv; + int (***dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t *dtabsize; int (*func) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); u_int32_t ndx; { - u_int32_t i, nsize; + size_t i, nsize; int ret; /* Check if we have to grow the table. */ - if (ndx >= dbenv->dtab_size) { + if (ndx >= *dtabsize) { nsize = ndx + 40; - if ((ret = __os_realloc(dbenv, - nsize * sizeof(dbenv->dtab[0]), NULL, &dbenv->dtab)) != 0) + if ((ret = + __os_realloc(dbenv, nsize * sizeof((*dtab)[0]), dtab)) != 0) return (ret); - for (i = dbenv->dtab_size; i < nsize; ++i) - dbenv->dtab[i] = NULL; - dbenv->dtab_size = nsize; + for (i = *dtabsize; i < nsize; ++i) + (*dtab)[i] = NULL; + *dtabsize = nsize; } - dbenv->dtab[ndx] = func; + (*dtab)[ndx] = func; return (0); } -/* - * __deprecated_recover -- - * Stub routine for deprecated recovery functions. - * - * PUBLIC: int __deprecated_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__deprecated_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - COMPQUIET(dbenv, NULL); - COMPQUIET(dbtp, NULL); - COMPQUIET(lsnp, NULL); - COMPQUIET(op, 0); - COMPQUIET(info, NULL); - return (EINVAL); -} - /* * __db_txnlist_init -- * Initialize transaction linked list. * - * PUBLIC: int __db_txnlist_init __P((DB_ENV *, void *)); + * PUBLIC: int __db_txnlist_init __P((DB_ENV *, + * PUBLIC: u_int32_t, u_int32_t, DB_LSN *, void *)); */ int -__db_txnlist_init(dbenv, retp) +__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 *headp; - int ret; + u_int32_t tmp; + int ret, size; - if ((ret = __os_malloc(dbenv, sizeof(DB_TXNHEAD), NULL, &headp)) != 0) + /* + * Size a hash table. + * If low is zero then we are being called during rollback + * and we need only one slot. + * Hi maybe lower than low if we have recycled txnid's. + * The numbers here are guesses about txn density, we can afford + * to look at a few entries in each slot. + */ + if (low_txn == 0) + size = 1; + else { + if (hi_txn < low_txn) { + tmp = hi_txn; + hi_txn = low_txn; + low_txn = tmp; + } + tmp = hi_txn - low_txn; + /* See if we wrapped around. */ + if (tmp > (TXN_MAXIMUM - TXN_MINIMUM) / 2) + tmp = (low_txn - TXN_MINIMUM) + (TXN_MAXIMUM - hi_txn); + size = tmp / 5; + if (size < 100) + size = 100; + } + if ((ret = __os_malloc(dbenv, + sizeof(DB_TXNHEAD) + size * sizeof(headp->head), &headp)) != 0) return (ret); - LIST_INIT(&headp->head); - headp->maxid = 0; - headp->generation = 1; + memset(headp, 0, sizeof(DB_TXNHEAD) + size * sizeof(headp->head)); + headp->maxid = hi_txn; + headp->generation = 0; + headp->nslots = size; + headp->gen_alloc = 8; + if ((ret = __os_malloc(dbenv, headp->gen_alloc * + sizeof(headp->gen_array[0]), &headp->gen_array)) != 0) { + __os_free(dbenv, headp); + return (ret); + } + headp->gen_array[0].generation = 0; + headp->gen_array[0].txn_min = TXN_MINIMUM; + headp->gen_array[0].txn_max = TXN_MAXIMUM; + if (trunc_lsn != NULL) + headp->trunc_lsn = *trunc_lsn; + else + ZERO_LSN(headp->trunc_lsn); + ZERO_LSN(headp->maxlsn); + ZERO_LSN(headp->ckplsn); *(void **)retp = headp; return (0); @@ -241,132 +397,86 @@ __db_txnlist_init(dbenv, retp) * __db_txnlist_add -- * Add an element to our transaction linked list. * - * PUBLIC: int __db_txnlist_add __P((DB_ENV *, void *, u_int32_t, int32_t)); + * PUBLIC: int __db_txnlist_add __P((DB_ENV *, + * PUBLIC: void *, u_int32_t, int32_t, DB_LSN *)); */ int -__db_txnlist_add(dbenv, listp, txnid, aborted) +__db_txnlist_add(dbenv, listp, txnid, status, lsn) DB_ENV *dbenv; void *listp; u_int32_t txnid; - int32_t aborted; + int32_t status; + DB_LSN *lsn; { DB_TXNHEAD *hp; DB_TXNLIST *elp; int ret; - if ((ret = __os_malloc(dbenv, sizeof(DB_TXNLIST), NULL, &elp)) != 0) + if ((ret = __os_malloc(dbenv, sizeof(DB_TXNLIST), &elp)) != 0) return (ret); hp = (DB_TXNHEAD *)listp; - LIST_INSERT_HEAD(&hp->head, elp, links); + LIST_INSERT_HEAD(&hp->head[DB_TXNLIST_MASK(hp, txnid)], elp, links); elp->type = TXNLIST_TXNID; elp->u.t.txnid = txnid; - elp->u.t.aborted = aborted; + elp->u.t.status = status; + elp->u.t.generation = hp->generation; if (txnid > hp->maxid) hp->maxid = txnid; - elp->u.t.generation = hp->generation; + 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); return (0); } + /* * __db_txnlist_remove -- * Remove an element from our transaction linked list. * - * PUBLIC: int __db_txnlist_remove __P((void *, u_int32_t)); + * PUBLIC: int __db_txnlist_remove __P((DB_ENV *, void *, u_int32_t)); */ int -__db_txnlist_remove(listp, txnid) +__db_txnlist_remove(dbenv, listp, txnid) + DB_ENV *dbenv; void *listp; u_int32_t txnid; { DB_TXNLIST *entry; - return (__db_txnlist_find_internal(listp, - TXNLIST_TXNID, txnid, NULL, &entry, 1)); -} - -/* __db_txnlist_close -- - * - * Call this when we close a file. It allows us to reconcile whether - * we have done any operations on this file with whether the file appears - * to have been deleted. If you never do any operations on a file, then - * we assume it's OK to appear deleted. - * - * PUBLIC: int __db_txnlist_close __P((void *, int32_t, u_int32_t)); - */ - -int -__db_txnlist_close(listp, lid, count) - void *listp; - int32_t lid; - u_int32_t count; -{ - DB_TXNHEAD *hp; - DB_TXNLIST *p; - - hp = (DB_TXNHEAD *)listp; - for (p = LIST_FIRST(&hp->head); p != NULL; p = LIST_NEXT(p, links)) { - if (p->type == TXNLIST_DELETE) - if (lid == p->u.d.fileid && - !F_ISSET(&p->u.d, TXNLIST_FLAG_CLOSED)) { - p->u.d.count += count; - return (0); - } - } - - return (0); + return (__db_txnlist_find_internal(dbenv, + listp, TXNLIST_TXNID, txnid, + NULL, &entry, 1) == TXN_NOTFOUND ? TXN_NOTFOUND : TXN_OK); } /* - * __db_txnlist_delete -- + * __db_txnlist_ckp -- + * Used to record the maximum checkpoint that will be retained + * after recovery. Typically this is simply the max checkpoint, but + * if we are doing client replication recovery or timestamp-based + * recovery, we are going to virtually truncate the log and we need + * to retain the last checkpoint before the truncation point. * - * Record that a file was missing or deleted. If the deleted - * flag is set, then we've encountered a delete of a file, else we've - * just encountered a file that is missing. The lid is the log fileid - * and is only meaningful if deleted is not equal to 0. - * - * PUBLIC: int __db_txnlist_delete __P((DB_ENV *, - * PUBLIC: void *, char *, u_int32_t, int)); + * PUBLIC: void __db_txnlist_ckp __P((DB_ENV *, void *, DB_LSN *)); */ -int -__db_txnlist_delete(dbenv, listp, name, lid, deleted) +void +__db_txnlist_ckp(dbenv, listp, ckp_lsn) DB_ENV *dbenv; void *listp; - char *name; - u_int32_t lid; - int deleted; + DB_LSN *ckp_lsn; { DB_TXNHEAD *hp; - DB_TXNLIST *p; - int ret; + + COMPQUIET(dbenv, NULL); hp = (DB_TXNHEAD *)listp; - for (p = LIST_FIRST(&hp->head); p != NULL; p = LIST_NEXT(p, links)) { - if (p->type == TXNLIST_DELETE) - if (strcmp(name, p->u.d.fname) == 0) { - if (deleted) - F_SET(&p->u.d, TXNLIST_FLAG_DELETED); - else - F_CLR(&p->u.d, TXNLIST_FLAG_CLOSED); - return (0); - } - } - /* Need to add it. */ - if ((ret = __os_malloc(dbenv, sizeof(DB_TXNLIST), NULL, &p)) != 0) - return (ret); - LIST_INSERT_HEAD(&hp->head, p, links); - - p->type = TXNLIST_DELETE; - p->u.d.flags = 0; - if (deleted) - F_SET(&p->u.d, TXNLIST_FLAG_DELETED); - p->u.d.fileid = lid; - p->u.d.count = 0; - ret = __os_strdup(dbenv, name, &p->u.d.fname); - - return (ret); + if (IS_ZERO_LSN(hp->ckplsn) && !IS_ZERO_LSN(hp->maxlsn) && + log_compare(&hp->maxlsn, ckp_lsn) >= 0) + hp->ckplsn = *ckp_lsn; } /* @@ -383,99 +493,156 @@ __db_txnlist_end(dbenv, listp) { DB_TXNHEAD *hp; DB_TXNLIST *p; - DB_LOG *lp; + int i; - hp = (DB_TXNHEAD *)listp; - lp = (DB_LOG *)dbenv->lg_handle; - while (hp != NULL && (p = LIST_FIRST(&hp->head)) != NULL) { - LIST_REMOVE(p, links); - switch (p->type) { - case TXNLIST_DELETE: - /* - * If we have a file that is not deleted and has - * some operations, we flag the warning. Since - * the file could still be open, we need to check - * the actual log table as well. - */ - if ((!F_ISSET(&p->u.d, TXNLIST_FLAG_DELETED) && - p->u.d.count != 0) || - (!F_ISSET(&p->u.d, TXNLIST_FLAG_CLOSED) && - p->u.d.fileid != (int32_t) TXNLIST_INVALID_ID && - p->u.d.fileid < lp->dbentry_cnt && - lp->dbentry[p->u.d.fileid].count != 0)) - __db_err(dbenv, "warning: %s: %s", - p->u.d.fname, db_strerror(ENOENT)); - __os_freestr(p->u.d.fname); - break; - case TXNLIST_LSN: - __os_free(p->u.l.lsn_array, - p->u.l.maxn * sizeof(DB_LSN)); - break; - default: - /* Possibly an incomplete DB_TXNLIST; just free it. */ - break; + if ((hp = (DB_TXNHEAD *)listp) == 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); + break; + default: + /* + * Possibly an incomplete DB_TXNLIST; just + * free it. + */ + break; + } + __os_free(dbenv, p); } - __os_free(p, sizeof(DB_TXNLIST)); - } - __os_free(listp, sizeof(DB_TXNHEAD)); + + if (hp->gen_array != NULL) + __os_free(dbenv, hp->gen_array); + __os_free(dbenv, listp); } /* * __db_txnlist_find -- * Checks to see if a txnid with the current generation is in the - * txnid list. This returns DB_NOTFOUND if the item isn't in the - * list otherwise it returns (like __db_txnlist_find_internal) a - * 1 or 0 indicating if the transaction is aborted or not. A txnid - * of 0 means the record was generated while not in a transaction. + * txnid list. This returns TXN_NOTFOUND if the item isn't in the + * list otherwise it returns (like __db_txnlist_find_internal) + * the status of the transaction. A txnid of 0 means the record + * was generated while not in a transaction. * - * PUBLIC: int __db_txnlist_find __P((void *, u_int32_t)); + * PUBLIC: int __db_txnlist_find __P((DB_ENV *, void *, u_int32_t)); */ int -__db_txnlist_find(listp, txnid) +__db_txnlist_find(dbenv, listp, txnid) + DB_ENV *dbenv; void *listp; u_int32_t txnid; { DB_TXNLIST *entry; if (txnid == 0) - return (DB_NOTFOUND); - return (__db_txnlist_find_internal(listp, - TXNLIST_TXNID, txnid, NULL, &entry, 0)); + return (TXN_NOTFOUND); + return (__db_txnlist_find_internal(dbenv, listp, + TXNLIST_TXNID, txnid, NULL, &entry, 0)); +} + +/* + * __db_txnlist_update -- + * Change the status of an existing transaction entry. + * Returns TXN_NOTFOUND if no such entry exists. + * + * PUBLIC: int __db_txnlist_update __P((DB_ENV *, + * PUBLIC: void *, u_int32_t, u_int32_t, DB_LSN *)); + */ +int +__db_txnlist_update(dbenv, listp, txnid, status, lsn) + DB_ENV *dbenv; + void *listp; + u_int32_t txnid; + u_int32_t status; + DB_LSN *lsn; +{ + DB_TXNHEAD *hp; + DB_TXNLIST *elp; + int ret; + + if (txnid == 0) + return (TXN_NOTFOUND); + hp = (DB_TXNHEAD *)listp; + ret = __db_txnlist_find_internal(dbenv, + listp, TXNLIST_TXNID, txnid, NULL, &elp, 0); + + if (ret == TXN_NOTFOUND) + return (ret); + elp->u.t.status = status; + + if (lsn != NULL && IS_ZERO_LSN(hp->maxlsn) && status == TXN_COMMIT) + hp->maxlsn = *lsn; + + return (ret); } /* * __db_txnlist_find_internal -- - * Find an entry on the transaction list. - * If the entry is not there or the list pointeris not initialized - * we return DB_NOTFOUND. If the item is found, we return the aborted - * status (1 for aborted, 0 for not aborted). Currently we always call - * this with an initialized list pointer but checking for NULL keeps it general. + * Find an entry on the transaction list. If the entry is not there or + * the list pointer is not initialized we return TXN_NOTFOUND. If the + * item is found, we return the status. Currently we always call this + * with an initialized list pointer but checking for NULL keeps it general. */ static int -__db_txnlist_find_internal(listp, type, txnid, uid, txnlistp, delete) +__db_txnlist_find_internal(dbenv, listp, type, txnid, uid, txnlistp, delete) + DB_ENV *dbenv; void *listp; db_txnlist_type type; - u_int32_t txnid; + u_int32_t txnid; u_int8_t uid[DB_FILE_ID_LEN]; DB_TXNLIST **txnlistp; int delete; { DB_TXNHEAD *hp; DB_TXNLIST *p; - int ret; + int32_t generation; + u_int32_t hash; + struct __db_headlink *head; + int i, ret; if ((hp = (DB_TXNHEAD *)listp) == NULL) - return (DB_NOTFOUND); + return (TXN_NOTFOUND); - for (p = LIST_FIRST(&hp->head); p != NULL; p = LIST_NEXT(p, links)) { + switch (type) { + case TXNLIST_TXNID: + hash = txnid; + /* Find the most recent generation containing this ID */ + for (i = 0; i <= hp->generation; i++) + /* The range may wrap around the end. */ + if (hp->gen_array[i].txn_min < + hp->gen_array[i].txn_max ? + (txnid >= hp->gen_array[i].txn_min && + txnid <= hp->gen_array[i].txn_max) : + (txnid >= hp->gen_array[i].txn_min || + txnid <= hp->gen_array[i].txn_max)) + break; + DB_ASSERT(i <= hp->generation); + generation = hp->gen_array[i].generation; + break; + case TXNLIST_PGNO: + memcpy(&hash, uid, sizeof(hash)); + generation = 0; + break; + default: + DB_ASSERT(0); + return (EINVAL); + } + + head = &hp->head[DB_TXNLIST_MASK(hp, hash)]; + + for (p = LIST_FIRST(head); p != NULL; p = LIST_NEXT(p, links)) { if (p->type != type) continue; switch (type) { case TXNLIST_TXNID: if (p->u.t.txnid != txnid || - hp->generation != p->u.t.generation) + generation != p->u.t.generation) continue; - ret = p->u.t.aborted; + ret = p->u.t.status; break; case TXNLIST_PGNO: @@ -490,42 +657,67 @@ __db_txnlist_find_internal(listp, type, txnid, uid, txnlistp, delete) } if (delete == 1) { LIST_REMOVE(p, links); - __os_free(p, sizeof(DB_TXNLIST)); - } else if (p != LIST_FIRST(&hp->head)) { + __os_free(dbenv, p); + } else if (p != LIST_FIRST(head)) { /* Move it to head of list. */ LIST_REMOVE(p, links); - LIST_INSERT_HEAD(&hp->head, p, links); + LIST_INSERT_HEAD(head, p, links); } *txnlistp = p; return (ret); } - return (DB_NOTFOUND); + return (TXN_NOTFOUND); } /* * __db_txnlist_gen -- * Change the current generation number. * - * PUBLIC: void __db_txnlist_gen __P((void *, int)); + * PUBLIC: int __db_txnlist_gen __P((DB_ENV *, + * PUBLIC: void *, int, u_int32_t, u_int32_t)); */ -void -__db_txnlist_gen(listp, incr) +int +__db_txnlist_gen(dbenv, listp, incr, min, max) + DB_ENV *dbenv; void *listp; int incr; + u_int32_t min, max; { DB_TXNHEAD *hp; + int ret; /* - * During recovery generation numbers keep track of how many "restart" - * checkpoints we've seen. Restart checkpoints occur whenever we take - * a checkpoint and there are no outstanding transactions. When that - * happens, we can reset transaction IDs back to 1. It always happens - * at recovery and it prevents us from exhausting the transaction IDs - * name space. + * During recovery generation numbers keep track of "restart" + * checkpoints and recycle records. Restart checkpoints occur + * whenever we take a checkpoint and there are no outstanding + * transactions. When that happens, we can reset transaction IDs + * back to TXNID_MINIMUM. Currently we only do the reset + * at then end of recovery. Recycle records occrur when txnids + * are exhausted during runtime. A free range of ids is identified + * and logged. This code maintains a stack of ranges. A txnid + * is given the generation number of the first range it falls into + * in the stack. */ hp = (DB_TXNHEAD *)listp; hp->generation += incr; + if (incr < 0) + memmove(hp->gen_array, &hp->gen_array[1], + (hp->generation + 1) * sizeof(hp->gen_array[0])); + else { + if (hp->generation >= hp->gen_alloc) { + hp->gen_alloc *= 2; + if ((ret = __os_realloc(dbenv, hp->gen_alloc * + sizeof(hp->gen_array[0]), &hp->gen_array)) != 0) + return (ret); + } + memmove(&hp->gen_array[1], &hp->gen_array[0], + hp->generation * sizeof(hp->gen_array[0])); + hp->gen_array[0].generation = hp->generation; + hp->gen_array[0].txn_min = min; + hp->gen_array[0].txn_max = max; + } + return (0); } #define TXN_BUBBLE(AP, MAX) { \ @@ -542,10 +734,10 @@ __db_txnlist_gen(listp, incr) /* * __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. + * 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. * * PUBLIC: int __db_txnlist_lsnadd __P((DB_ENV *, void *, DB_LSN *, u_int32_t)); */ @@ -562,19 +754,19 @@ __db_txnlist_lsnadd(dbenv, listp, lsnp, flags) hp = (DB_TXNHEAD *)listp; - for (elp = LIST_FIRST(&hp->head); + for (elp = LIST_FIRST(&hp->head[0]); elp != NULL; elp = LIST_NEXT(elp, links)) if (elp->type == TXNLIST_LSN) break; if (elp == NULL) - return (EINVAL); + 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), - NULL, &elp->u.l.lsn_array)) != 0) + &elp->u.l.lsn_array)) != 0) return (ret); elp->u.l.maxn *= 2; } @@ -584,9 +776,9 @@ __db_txnlist_lsnadd(dbenv, listp, lsnp, flags) elp->u.l.lsn_array[0] = *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. + * 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); @@ -596,35 +788,6 @@ __db_txnlist_lsnadd(dbenv, listp, lsnp, flags) return (0); } -/* - * __db_txnlist_lsnhead -- - * Return a pointer to the beginning of the lsn_array. - * - * PUBLIC: int __db_txnlist_lsnhead __P((void *, DB_LSN **)); - */ -int -__db_txnlist_lsnhead(listp, lsnpp) - void *listp; - DB_LSN **lsnpp; -{ - DB_TXNHEAD *hp; - DB_TXNLIST *elp; - - hp = (DB_TXNHEAD *)listp; - - for (elp = LIST_FIRST(&hp->head); - elp != NULL; elp = LIST_NEXT(elp, links)) - if (elp->type == TXNLIST_LSN) - break; - - if (elp == NULL) - return (EINVAL); - - *lsnpp = &elp->u.l.lsn_array[0]; - - return (0); -} - /* * __db_txnlist_lsninit -- * Initialize a transaction list with an lsn array entry. @@ -642,12 +805,12 @@ __db_txnlist_lsninit(dbenv, hp, lsnp) elp = NULL; - if ((ret = __os_malloc(dbenv, sizeof(DB_TXNLIST), NULL, &elp)) != 0) + if ((ret = __os_malloc(dbenv, sizeof(DB_TXNLIST), &elp)) != 0) goto err; - LIST_INSERT_HEAD(&hp->head, elp, links); + LIST_INSERT_HEAD(&hp->head[0], elp, links); if ((ret = __os_malloc(dbenv, - 12 * sizeof(DB_LSN), NULL, &elp->u.l.lsn_array)) != 0) + 12 * sizeof(DB_LSN), &elp->u.l.lsn_array)) != 0) goto err; elp->type = TXNLIST_LSN; elp->u.l.maxn = 12; @@ -662,8 +825,7 @@ err: __db_txnlist_end(dbenv, hp); /* * __db_add_limbo -- add pages to the limbo list. - * Get the file information and call pgnoadd - * for each page. + * Get the file information and call pgnoadd for each page. * * PUBLIC: int __db_add_limbo __P((DB_ENV *, * PUBLIC: void *, int32_t, db_pgno_t, int32_t)); @@ -681,7 +843,7 @@ __db_add_limbo(dbenv, info, fileid, pgno, count) int ret; dblp = dbenv->lg_handle; - if ((ret = __log_lid_to_fname(dblp, fileid, &fnp)) != 0) + if ((ret = __dbreg_id_to_fname(dblp, fileid, 0, &fnp)) != 0) return (ret); do { @@ -698,201 +860,429 @@ __db_add_limbo(dbenv, info, fileid, pgno, count) /* * __db_do_the_limbo -- move pages from limbo to free. * - * If we are in recovery we add things to the free list without - * logging becasue we want to incrementaly apply logs that - * may be generated on another copy of this environment. - * Otherwise we just call __db_free to put the pages on - * the free list and log the activity. + * Limbo processing is what ensures that we correctly handle and + * recover from page allocations. During recovery, for each database, + * we process each in-question allocation, link them into the free list + * and then write out the new meta-data page that contains the pointer + * to the new beginning of the free list. On an abort, we use our + * standard __db_free mechanism in a compensating transaction which logs + * the specific modifications to the free list. * - * PUBLIC: int __db_do_the_limbo __P((DB_ENV *, DB_TXNHEAD *)); + * If we run out of log space during an abort, then we can't write the + * compensating transaction, so we abandon the idea of a compenating + * transaction, and go back to processing how we do during recovery. + * The reason that this is not the norm is that it's expensive: it requires + * that we flush any database with an in-question allocation. Thus if + * a compensating transaction fails, we never try to restart it. + * + * Since files may be open and closed within transactions (in particular, + * the master database for subdatabases), we must be prepared to open + * files during this process. If there is a compensating transaction, we + * can open the files in that transaction. If this was an abort and there + * is no compensating transaction, then we've got to perform these opens + * in the context of the aborting transaction so that we do not deadlock. + * During recovery, there's no locking, so this isn't an issue. + * + * What you want to keep in mind when reading this is that there are two + * algorithms going on here: ctxn == NULL, then we're either in recovery + * or our compensating transaction has failed and we're doing the + * "create list and write meta-data page" algorithm. Otherwise, we're in + * an abort and doing the "use compensating transaction" algorithm. + * + * PUBLIC: int __db_do_the_limbo __P((DB_ENV *, + * PUBLIC: DB_TXN *, DB_TXN *, DB_TXNHEAD *)); */ int -__db_do_the_limbo(dbenv, hp) +__db_do_the_limbo(dbenv, ptxn, txn, hp) DB_ENV *dbenv; + DB_TXN *ptxn, *txn; DB_TXNHEAD *hp; { - DB *dbp; - DBC *dbc; - DBMETA *meta; + DB_TXNLIST *elp; + int h, ret; + + ret = 0; + /* + * The slots correspond to hash buckets. We've hashed the + * fileids into hash buckets and need to pick up all affected + * files. (There will only be a single slot for an abort.) + */ + for (h = 0; h < hp->nslots; h++) { + if ((elp = LIST_FIRST(&hp->head[h])) == NULL) + continue; + if (ptxn != NULL) { + if ((ret = + __db_limbo_move(dbenv, ptxn, txn, elp)) != 0) + goto err; + } else if ((ret = __db_limbo_bucket(dbenv, txn, elp)) != 0) + goto err; + } + +err: if (ret != 0) { + __db_err(dbenv, "Fatal error in abort of an allocation"); + ret = __db_panic(dbenv, ret); + } + + return (ret); +} + +/* Limbo support routines. */ + +/* + * __db_lock_move -- + * Move a lock from child to parent. + */ +static int +__db_lock_move(dbenv, fileid, pgno, mode, ptxn, txn) + DB_ENV *dbenv; + u_int8_t *fileid; + db_pgno_t pgno; + db_lockmode_t mode; + DB_TXN *ptxn, *txn; +{ + DBT lock_dbt; + DB_LOCK lock; + DB_LOCK_ILOCK lock_obj; + DB_LOCKREQ req; + int ret; + + lock_obj.pgno = pgno; + memcpy(lock_obj.fileid, fileid, DB_FILE_ID_LEN); + lock_obj.type = DB_PAGE_LOCK; + + memset(&lock_dbt, 0, sizeof(lock_dbt)); + lock_dbt.data = &lock_obj; + lock_dbt.size = sizeof(lock_obj); + + if ((ret = dbenv->lock_get(dbenv, + txn->txnid, 0, &lock_dbt, mode, &lock)) == 0) { + memset(&req, 0, sizeof(req)); + req.lock = lock; + req.op = DB_LOCK_TRADE; + + ret = dbenv->lock_vec(dbenv, ptxn->txnid, 0, &req, 1, NULL); + } + return (ret); +} + +/* + * __db_limbo_move + * Move just the metapage lock to the parent. + */ +static int +__db_limbo_move(dbenv, ptxn, txn, elp) + DB_ENV *dbenv; + DB_TXN *ptxn, *txn; + DB_TXNLIST *elp; +{ + int ret; + + for (; elp != NULL; elp = LIST_NEXT(elp, links)) { + if (elp->type != TXNLIST_PGNO || elp->u.p.locked == 1) + continue; + if ((ret = __db_lock_move(dbenv, elp->u.p.uid, + PGNO_BASE_MD, DB_LOCK_WRITE, ptxn, txn)) != 0) + return (ret); + elp->u.p.locked = 1; + } + + return (0); +} +/* + * __db_limbo_bucket + * Perform limbo processing for a single hash bucket in the txnlist. + * txn is the transaction aborting in the case of an abort and ctxn is the + * compensating transaction. + */ + +#define T_RESTORED(txn) ((txn) != NULL && F_ISSET(txn, TXN_RESTORED)) +static int +__db_limbo_bucket(dbenv, txn, elp) + DB_ENV *dbenv; DB_TXN *txn; DB_TXNLIST *elp; - PAGE *pagep; +{ + DB *dbp; + DB_MPOOLFILE *mpf; + DBMETA *meta; + DB_TXN *ctxn, *t; db_pgno_t last_pgno, pgno; - int i, in_recover, put_page, ret, t_ret; + int dbp_created, in_retry, ret, t_ret; - dbp = NULL; - dbc = NULL; - txn = NULL; + ctxn = NULL; + in_retry = 0; + meta = NULL; + mpf = NULL; ret = 0; - - /* Are we in recovery? */ - in_recover = F_ISSET((DB_LOG *)dbenv->lg_handle, DBLOG_RECOVER); - - for (elp = LIST_FIRST(&hp->head); - elp != NULL; elp = LIST_NEXT(elp, links)) { + for (; elp != NULL; elp = LIST_NEXT(elp, links)) { if (elp->type != TXNLIST_PGNO) continue; +retry: dbp_created = 0; - if (in_recover) { + /* + * Pick the transaction in which to potentially + * log compensations. + */ + if (!in_retry && !IS_RECOVERING(dbenv) && !T_RESTORED(txn) + && (ret = __txn_compensate_begin(dbenv, &ctxn)) != 0) + return (ret); + + /* + * Either use the compensating transaction or + * the one passed in, which will be null if recovering. + */ + t = ctxn == NULL ? txn : ctxn; + + /* First try to get a dbp by fileid. */ + ret = __dbreg_id_to_db(dbenv, t, &dbp, elp->u.p.fileid, 0); + + /* + * File is being destroyed. No need to worry about + * dealing with recovery of allocations. + */ + if (ret == DB_DELETED || + (ret == 0 && F_ISSET(dbp, DB_AM_DISCARD))) + goto next; + + if (ret != 0) { if ((ret = db_create(&dbp, dbenv, 0)) != 0) goto err; /* - * It is ok if the file is nolonger there. + * This tells the system not to lock, which is always + * OK, whether this is an abort or recovery. */ + F_SET(dbp, DB_AM_COMPENSATE); + dbp_created = 1; + + /* It is ok if the file is nolonger there. */ dbp->type = DB_UNKNOWN; - ret = __db_dbopen(dbp, - elp->u.p.fname, 0, __db_omode("rw----"), 0); - } else { - /* - * If we are in transaction undo, then we know - * the fileid is still correct. - */ - if ((ret = - __db_fileid_to_db(dbenv, &dbp, - elp->u.p.fileid, 0)) != 0 && ret != DB_DELETED) - goto err; - /* File is being destroyed. */ - if (F_ISSET(dbp, DB_AM_DISCARD)) - ret = DB_DELETED; + ret = __db_dbopen(dbp, t, elp->u.p.fname, NULL, + DB_ODDFILESIZE, __db_omode("rw----"), PGNO_BASE_MD); + if (ret == ENOENT) + goto next; } + /* * Verify that we are opening the same file that we were * referring to when we wrote this log record. */ - if (ret == 0 && - memcmp(elp->u.p.uid, dbp->fileid, DB_FILE_ID_LEN) == 0) { - last_pgno = PGNO_INVALID; - if (in_recover) { - pgno = PGNO_BASE_MD; - if ((ret = memp_fget(dbp->mpf, - &pgno, 0, (PAGE **)&meta)) != 0) - goto err; - last_pgno = meta->free; - /* - * Check to see if the head of the free - * list is any of the pages we are about - * to link in. We could have crashed - * after linking them in and before writing - * a checkpoint. - * It may not be the last one since - * any page may get reallocated before here. - */ - if (last_pgno != PGNO_INVALID) - for (i = 0; i < elp->u.p.nentries; i++) - if (last_pgno - == elp->u.p.pgno_array[i]) - goto done_it; - } + if (memcmp(elp->u.p.uid, dbp->fileid, DB_FILE_ID_LEN) != 0) + goto next; - for (i = 0; i < elp->u.p.nentries; i++) { - pgno = elp->u.p.pgno_array[i]; - if ((ret = memp_fget(dbp->mpf, - &pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto err; + mpf = dbp->mpf; + last_pgno = PGNO_INVALID; - put_page = 1; - if (IS_ZERO_LSN(LSN(pagep))) { - P_INIT(pagep, dbp->pgsize, - pgno, PGNO_INVALID, - last_pgno, 0, P_INVALID); - - if (in_recover) { - LSN(pagep) = LSN(meta); - last_pgno = pgno; - } else { - /* - * Starting the transaction - * is postponed until we know - * we have something to do. - */ - if (txn == NULL && - (ret = txn_begin(dbenv, - NULL, &txn, 0)) != 0) - goto err; - - if (dbc == NULL && - (ret = dbp->cursor(dbp, - txn, &dbc, 0)) != 0) - goto err; - /* Turn off locking. */ - F_SET(dbc, DBC_COMPENSATE); - - /* __db_free puts the page. */ - if ((ret = - __db_free(dbc, pagep)) != 0) - goto err; - put_page = 0; - } - } - - if (put_page == 1 && - (ret = memp_fput(dbp->mpf, - pagep, DB_MPOOL_DIRTY)) != 0) - goto err; - } - if (in_recover) { - if (last_pgno == meta->free) { -done_it: - if ((ret = - memp_fput(dbp->mpf, meta, 0)) != 0) - goto err; - } else { - /* - * Flush the new free list then - * update the metapage. This is - * unlogged so we cannot have the - * metapage pointing at pages that - * are not on disk. - */ - dbp->sync(dbp, 0); - meta->free = last_pgno; - if ((ret = memp_fput(dbp->mpf, - meta, DB_MPOOL_DIRTY)) != 0) - goto err; - } - } - if (dbc != NULL && (ret = dbc->c_close(dbc)) != 0) + if (ctxn == NULL) { + pgno = PGNO_BASE_MD; + if ((ret = + mpf->get(mpf, &pgno, 0, (PAGE **)&meta)) != 0) goto err; - dbc = NULL; + last_pgno = meta->free; } - if (in_recover && (t_ret = dbp->close(dbp, 0)) != 0 && ret == 0) + + ret = __db_limbo_fix(dbp, ctxn, elp, &last_pgno, meta); + /* + * If we were doing compensating transactions, then we are + * going to hope this error was due to running out of space. + * We'll change modes (into the sync the file mode) and keep + * trying. If we weren't doing compensating transactions, + * then this is a real error and we're sunk. + */ + if (ret != 0) { + if (ret == DB_RUNRECOVERY || ctxn == NULL) + goto err; + in_retry = 1; + goto retry; + } + + if (ctxn != NULL) { + ret = ctxn->commit(ctxn, DB_TXN_NOSYNC); + ctxn = NULL; + if (ret != 0) + goto retry; + goto next; + } + + /* + * This is where we handle the case where we're explicitly + * putting together a free list. We need to decide whether + * we have to write the meta-data page, and if we do, then + * we need to sync it as well. + */ + if (last_pgno == meta->free) { + /* No change to page; just put the page back. */ + if ((ret = mpf->put(mpf, meta, 0)) != 0) + goto err; + meta = NULL; + } else { + /* + * These changes are unlogged so we cannot have the + * metapage pointing at pages that are not on disk. + * Therefore, we flush the new free list, then update + * the metapage. We have to put the meta-data page + * 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"); + if ((ret = mpf->put(mpf, meta, 0)) != 0) + goto err; + meta = NULL; + dbp->sync(dbp, 0); + pgno = PGNO_BASE_MD; + if ((ret = + mpf->get(mpf, &pgno, 0, (PAGE **)&meta)) != 0) + goto err; + meta->free = last_pgno; + if ((ret = mpf->put(mpf, meta, DB_MPOOL_DIRTY)) != 0) + goto err; + meta = NULL; + } + +next: + /* + * If we get here, either we have processed the list + * or the db file has been deleted or could no be opened. + */ + if (ctxn != NULL && + (t_ret = ctxn->abort(ctxn)) != 0 && ret == 0) + ret = t_ret; + + if (dbp_created && + (t_ret = __db_close_i(dbp, txn, 0)) != 0 && ret == 0) ret = t_ret; dbp = NULL; - __os_free(elp->u.p.fname, 0); - __os_free(elp->u.p.pgno_array, 0); + __os_free(dbenv, elp->u.p.fname); + __os_free(dbenv, elp->u.p.pgno_array); if (ret == ENOENT) ret = 0; else if (ret != 0) goto err; } - if (txn != NULL) { - ret = txn_commit(txn, 0); - txn = NULL; - } -err: - if (dbc != NULL) - (void)dbc->c_close(dbc); - if (in_recover && dbp != NULL) - (void)dbp->close(dbp, 0); - if (txn != NULL) - (void)txn_abort(txn); +err: if (meta != NULL) + (void)mpf->put(mpf, meta, 0); return (ret); - } -#define DB_TXNLIST_MAX_PGNO 8 /* A nice even number. */ +/* + * __db_limbo_fix -- + * Process a single limbo entry which describes all the page allocations + * for a single file. + */ +static int +__db_limbo_fix(dbp, ctxn, elp, lastp, meta) + DB *dbp; + DB_TXN *ctxn; + DB_TXNLIST *elp; + db_pgno_t *lastp; + DBMETA *meta; +{ + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *freep, *pagep; + db_pgno_t next, pgno; + int i, put_page, ret, t_ret; + + /* + * Loop through the entries for this txnlist element and + * either link them into the free list or write a compensating + * record for each. + */ + put_page = 0; + ret = 0; + mpf = dbp->mpf; + dbc = NULL; + + for (i = 0; i < elp->u.p.nentries; i++) { + pgno = elp->u.p.pgno_array[i]; + + if ((ret = mpf->get(mpf, &pgno, DB_MPOOL_CREATE, &pagep)) != 0) + goto err; + put_page = 1; + + if (IS_ZERO_LSN(LSN(pagep))) { + if (ctxn == NULL) { + /* + * If this is a fatal recovery which + * spans a previous crash this page may + * be on the free list already. + */ + for (next = *lastp; next != 0; ) { + if (next == pgno) + break; + if ((ret = mpf->get(mpf, + &next, 0, &freep)) != 0) + goto err; + next = NEXT_PGNO(freep); + if ((ret = + mpf->put(mpf, freep, 0)) != 0) + goto err; + } + + if (next != pgno) { + P_INIT(pagep, dbp->pgsize, pgno, + PGNO_INVALID, *lastp, 0, P_INVALID); + LSN(pagep) = LSN(meta); + *lastp = pgno; + } + } else { + P_INIT(pagep, dbp->pgsize, pgno, + PGNO_INVALID, *lastp, 0, P_INVALID); + if (dbc == NULL && (ret = + dbp->cursor(dbp, ctxn, &dbc, 0)) != 0) + goto err; + /* + * If the dbp is compensating (because we + * opened it), the dbc will automatically be + * marked compensating, but in case we didn't + * do the open, we have to mark it explicitly. + */ + F_SET(dbc, DBC_COMPENSATE); + ret = __db_free(dbc, pagep); + put_page = 0; + /* + * On any error, we hope that the error was + * caused due to running out of space, and we + * switch modes, doing the processing where we + * sync out files instead of doing compensating + * transactions. If this was a real error and + * not out of space, we assume that some other + * call will fail real soon. + */ + if (ret != 0) { + /* Assume that this is out of space. */ + (void)dbc->c_close(dbc); + dbc = NULL; + goto err; + } + } + } + + if (put_page == 1) { + ret = mpf->put(mpf, pagep, DB_MPOOL_DIRTY); + put_page = 0; + } + if (ret != 0) + goto err; + } + +err: if (put_page && + (t_ret = mpf->put(mpf, pagep, DB_MPOOL_DIRTY)) != 0 && ret == 0) + ret = t_ret; + if (dbc != NULL && (t_ret = dbc->c_close(dbc)) != 0 && ret == 0) + ret = t_ret; + return (ret); +} + +#define DB_TXNLIST_MAX_PGNO 8 /* A nice even number. */ /* * __db_txnlist_pgnoadd -- - * Find the txnlist entry for a file and add this pgno, - * or add the list entry for the file and then add the pgno. - * - * PUBLIC: int __db_txnlist_pgnoadd __P((DB_ENV *, DB_TXNHEAD *, - * PUBLIC: int32_t, u_int8_t [DB_FILE_ID_LEN], char *, db_pgno_t)); + * Find the txnlist entry for a file and add this pgno, or add the list + * entry for the file and then add the pgno. */ -int +static int __db_txnlist_pgnoadd(dbenv, hp, fileid, uid, fname, pgno) DB_ENV *dbenv; DB_TXNHEAD *hp; @@ -902,34 +1292,39 @@ __db_txnlist_pgnoadd(dbenv, hp, fileid, uid, fname, pgno) db_pgno_t pgno; { DB_TXNLIST *elp; + u_int32_t hash; int len, ret; elp = NULL; - if (__db_txnlist_find_internal(hp, TXNLIST_PGNO, 0, uid, &elp, 0) != 0) { + if (__db_txnlist_find_internal(dbenv, hp, + TXNLIST_PGNO, 0, uid, &elp, 0) != 0) { if ((ret = - __os_malloc(dbenv, sizeof(DB_TXNLIST), NULL, &elp)) != 0) + __os_malloc(dbenv, sizeof(DB_TXNLIST), &elp)) != 0) goto err; - LIST_INSERT_HEAD(&hp->head, elp, links); + memcpy(&hash, uid, sizeof(hash)); + LIST_INSERT_HEAD( + &hp->head[DB_TXNLIST_MASK(hp, hash)], elp, links); elp->u.p.fileid = fileid; memcpy(elp->u.p.uid, uid, DB_FILE_ID_LEN); - len = strlen(fname) + 1; - if ((ret = __os_malloc(dbenv, len, NULL, &elp->u.p.fname)) != 0) + len = (int)strlen(fname) + 1; + if ((ret = __os_malloc(dbenv, len, &elp->u.p.fname)) != 0) goto err; memcpy(elp->u.p.fname, fname, len); elp->u.p.maxentry = 0; + elp->u.p.locked = 0; elp->type = TXNLIST_PGNO; if ((ret = __os_malloc(dbenv, - 8 * sizeof(db_pgno_t), NULL, &elp->u.p.pgno_array)) != 0) + 8 * sizeof(db_pgno_t), &elp->u.p.pgno_array)) != 0) goto err; elp->u.p.maxentry = DB_TXNLIST_MAX_PGNO; elp->u.p.nentries = 0; } else if (elp->u.p.nentries == elp->u.p.maxentry) { elp->u.p.maxentry <<= 1; if ((ret = __os_realloc(dbenv, elp->u.p.maxentry * - sizeof(db_pgno_t), NULL, &elp->u.p.pgno_array)) != 0) + sizeof(db_pgno_t), &elp->u.p.pgno_array)) != 0) goto err; } @@ -941,6 +1336,36 @@ err: __db_txnlist_end(dbenv, hp); return (ret); } +/* + * __db_default_getpgnos -- + * Fill in default getpgnos information for an application-specific + * log record. + */ +static int +__db_default_getpgnos(dbenv, lsnp, summary) + DB_ENV *dbenv; + DB_LSN *lsnp; + void *summary; +{ + TXN_RECS *t; + int ret; + + t = (TXN_RECS *)summary; + + if ((ret = __rep_check_alloc(dbenv, t, 1)) != 0) + return (ret); + + t->array[t->npages].flags = LSN_PAGE_NOLOCK; + t->array[t->npages].lsn = *lsnp; + t->array[t->npages].fid = DB_LOGFILEID_INVALID; + memset(&t->array[t->npages].pgdesc, 0, + sizeof(t->array[t->npages].pgdesc)); + + t->npages++; + + return (0); +} + #ifdef DEBUG /* * __db_txnlist_print -- @@ -954,25 +1379,21 @@ __db_txnlist_print(listp) { DB_TXNHEAD *hp; DB_TXNLIST *p; + int i; + char *stats[] = { "ok", "commit", "prepare", "abort", "notfound", + "ignore", "expected", "unexpected" }; hp = (DB_TXNHEAD *)listp; printf("Maxid: %lu Generation: %lu\n", (u_long)hp->maxid, (u_long)hp->generation); - for (p = LIST_FIRST(&hp->head); p != NULL; p = LIST_NEXT(p, links)) { + for (i = 0; i < hp->nslots; i++) + for (p = LIST_FIRST(&hp->head[i]); p != NULL; p = LIST_NEXT(p, links)) { switch (p->type) { case TXNLIST_TXNID: - printf("TXNID: %lu(%lu)\n", - (u_long)p->u.t.txnid, (u_long)p->u.t.generation); - break; - case TXNLIST_DELETE: - printf("FILE: %s id=%d ops=%d %s %s\n", - p->u.d.fname, p->u.d.fileid, p->u.d.count, - F_ISSET(&p->u.d, TXNLIST_FLAG_DELETED) ? - "(deleted)" : "(missing)", - F_ISSET(&p->u.d, TXNLIST_FLAG_CLOSED) ? - "(closed)" : "(open)"); - + printf("TXNID: %lx(%lu): %s\n", + (u_long)p->u.t.txnid, (u_long)p->u.t.generation, + stats[p->u.t.status]); break; default: printf("Unrecognized type: %d\n", p->type); diff --git a/bdb/db/db_dup.c b/bdb/db/db_dup.c index 6d8b2df9518..2d33d79153f 100644 --- a/bdb/db/db_dup.c +++ b/bdb/db/db_dup.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_dup.c,v 11.18 2000/11/30 00:58:32 ubell Exp $"; +static const char revid[] = "$Id: db_dup.c,v 11.32 2002/08/08 03:57:47 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,12 +18,10 @@ static const char revid[] = "$Id: db_dup.c,v 11.18 2000/11/30 00:58:32 ubell Exp #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "btree.h" -#include "hash.h" -#include "lock.h" -#include "db_am.h" +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/lock.h" +#include "dbinc/db_am.h" /* * __db_ditem -- @@ -39,19 +37,20 @@ __db_ditem(dbc, pagep, indx, nbytes) { DB *dbp; DBT ldbt; - db_indx_t cnt, offset; + db_indx_t cnt, *inp, offset; int ret; u_int8_t *from; dbp = dbc->dbp; - if (DB_LOGGING(dbc)) { - ldbt.data = P_ENTRY(pagep, indx); + if (DBC_LOGGING(dbc)) { + ldbt.data = P_ENTRY(dbp, pagep, indx); ldbt.size = nbytes; - if ((ret = __db_addrem_log(dbp->dbenv, dbc->txn, - &LSN(pagep), 0, DB_REM_DUP, dbp->log_fileid, PGNO(pagep), + if ((ret = __db_addrem_log(dbp, dbc->txn, + &LSN(pagep), 0, DB_REM_DUP, PGNO(pagep), (u_int32_t)indx, nbytes, &ldbt, NULL, &LSN(pagep))) != 0) return (ret); - } + } else + LSN_NOT_LOGGED(LSN(pagep)); /* * If there's only a single item on the page, we don't have to @@ -63,24 +62,26 @@ __db_ditem(dbc, pagep, indx, nbytes) return (0); } + inp = P_INP(dbp, pagep); /* * Pack the remaining key/data items at the end of the page. Use * memmove(3), the regions may overlap. */ from = (u_int8_t *)pagep + HOFFSET(pagep); - memmove(from + nbytes, from, pagep->inp[indx] - HOFFSET(pagep)); + DB_ASSERT((int)inp[indx] - HOFFSET(pagep) >= 0); + memmove(from + nbytes, from, inp[indx] - HOFFSET(pagep)); HOFFSET(pagep) += nbytes; /* Adjust the indices' offsets. */ - offset = pagep->inp[indx]; + offset = inp[indx]; for (cnt = 0; cnt < NUM_ENT(pagep); ++cnt) - if (pagep->inp[cnt] < offset) - pagep->inp[cnt] += nbytes; + if (inp[cnt] < offset) + inp[cnt] += nbytes; /* Shift the indices down. */ --NUM_ENT(pagep); if (indx != NUM_ENT(pagep)) - memmove(&pagep->inp[indx], &pagep->inp[indx + 1], + memmove(&inp[indx], &inp[indx + 1], sizeof(db_indx_t) * (NUM_ENT(pagep) - indx)); return (0); @@ -104,11 +105,13 @@ __db_pitem(dbc, pagep, indx, nbytes, hdr, data) DB *dbp; BKEYDATA bk; DBT thdr; + db_indx_t *inp; int ret; u_int8_t *p; - if (nbytes > P_FREESPACE(pagep)) { - DB_ASSERT(nbytes <= P_FREESPACE(pagep)); + dbp = dbc->dbp; + if (nbytes > P_FREESPACE(dbp, pagep)) { + DB_ASSERT(nbytes <= P_FREESPACE(dbp, pagep)); return (EINVAL); } /* @@ -128,12 +131,13 @@ __db_pitem(dbc, pagep, indx, nbytes, hdr, data) * the passed in header sizes must be adjusted for the structure's * placeholder for the trailing variable-length data field. */ - dbp = dbc->dbp; - if (DB_LOGGING(dbc)) - if ((ret = __db_addrem_log(dbp->dbenv, dbc->txn, - &LSN(pagep), 0, DB_ADD_DUP, dbp->log_fileid, PGNO(pagep), + if (DBC_LOGGING(dbc)) { + if ((ret = __db_addrem_log(dbp, dbc->txn, + &LSN(pagep), 0, DB_ADD_DUP, PGNO(pagep), (u_int32_t)indx, nbytes, hdr, data, &LSN(pagep))) != 0) return (ret); + } else + LSN_NOT_LOGGED(LSN(pagep)); if (hdr == NULL) { B_TSET(bk.type, B_KEYDATA, 0); @@ -143,16 +147,17 @@ __db_pitem(dbc, pagep, indx, nbytes, hdr, data) thdr.size = SSZA(BKEYDATA, data); hdr = &thdr; } + inp = P_INP(dbp, pagep); /* Adjust the index table, then put the item on the page. */ if (indx != NUM_ENT(pagep)) - memmove(&pagep->inp[indx + 1], &pagep->inp[indx], + memmove(&inp[indx + 1], &inp[indx], sizeof(db_indx_t) * (NUM_ENT(pagep) - indx)); HOFFSET(pagep) -= nbytes; - pagep->inp[indx] = HOFFSET(pagep); + inp[indx] = HOFFSET(pagep); ++NUM_ENT(pagep); - p = P_ENTRY(pagep, indx); + p = P_ENTRY(dbp, pagep, indx); memcpy(p, hdr->data, hdr->size); if (data != NULL) memcpy(p + hdr->size, data->data, data->size); @@ -177,13 +182,16 @@ __db_relink(dbc, add_rem, pagep, new_next, needlock) PAGE *np, *pp; DB_LOCK npl, ppl; DB_LSN *nlsnp, *plsnp, ret_lsn; + DB_MPOOLFILE *mpf; int ret; - ret = 0; - np = pp = NULL; - npl.off = ppl.off = LOCK_INVALID; - nlsnp = plsnp = NULL; dbp = dbc->dbp; + np = pp = NULL; + LOCK_INIT(npl); + LOCK_INIT(ppl); + nlsnp = plsnp = NULL; + mpf = dbp->mpf; + ret = 0; /* * Retrieve and lock the one/two pages. For a remove, we may need @@ -194,9 +202,8 @@ __db_relink(dbc, add_rem, pagep, new_next, needlock) if (needlock && (ret = __db_lget(dbc, 0, pagep->next_pgno, DB_LOCK_WRITE, 0, &npl)) != 0) goto err; - if ((ret = memp_fget(dbp->mpf, - &pagep->next_pgno, 0, &np)) != 0) { - (void)__db_pgerr(dbp, pagep->next_pgno); + if ((ret = mpf->get(mpf, &pagep->next_pgno, 0, &np)) != 0) { + __db_pgerr(dbp, pagep->next_pgno, ret); goto err; } nlsnp = &np->lsn; @@ -205,28 +212,27 @@ __db_relink(dbc, add_rem, pagep, new_next, needlock) if (needlock && (ret = __db_lget(dbc, 0, pagep->prev_pgno, DB_LOCK_WRITE, 0, &ppl)) != 0) goto err; - if ((ret = memp_fget(dbp->mpf, - &pagep->prev_pgno, 0, &pp)) != 0) { - (void)__db_pgerr(dbp, pagep->next_pgno); + if ((ret = mpf->get(mpf, &pagep->prev_pgno, 0, &pp)) != 0) { + __db_pgerr(dbp, pagep->next_pgno, ret); goto err; } plsnp = &pp->lsn; } /* Log the change. */ - if (DB_LOGGING(dbc)) { - if ((ret = __db_relink_log(dbp->dbenv, dbc->txn, - &ret_lsn, 0, add_rem, dbp->log_fileid, - pagep->pgno, &pagep->lsn, - pagep->prev_pgno, plsnp, pagep->next_pgno, nlsnp)) != 0) + if (DBC_LOGGING(dbc)) { + if ((ret = __db_relink_log(dbp, dbc->txn, &ret_lsn, 0, add_rem, + pagep->pgno, &pagep->lsn, pagep->prev_pgno, plsnp, + pagep->next_pgno, nlsnp)) != 0) goto err; - if (np != NULL) - np->lsn = ret_lsn; - if (pp != NULL) - pp->lsn = ret_lsn; - if (add_rem == DB_REM_PAGE) - pagep->lsn = ret_lsn; - } + } else + LSN_NOT_LOGGED(ret_lsn); + if (np != NULL) + np->lsn = ret_lsn; + if (pp != NULL) + pp->lsn = ret_lsn; + if (add_rem == DB_REM_PAGE) + pagep->lsn = ret_lsn; /* * Modify and release the two pages. @@ -242,10 +248,10 @@ __db_relink(dbc, add_rem, pagep, new_next, needlock) else np->prev_pgno = pagep->prev_pgno; if (new_next == NULL) - ret = memp_fput(dbp->mpf, np, DB_MPOOL_DIRTY); + ret = mpf->put(mpf, np, DB_MPOOL_DIRTY); else { *new_next = np; - ret = memp_fset(dbp->mpf, np, DB_MPOOL_DIRTY); + ret = mpf->set(mpf, np, DB_MPOOL_DIRTY); } if (ret != 0) goto err; @@ -256,7 +262,7 @@ __db_relink(dbc, add_rem, pagep, new_next, needlock) if (pp != NULL) { pp->next_pgno = pagep->next_pgno; - if ((ret = memp_fput(dbp->mpf, pp, DB_MPOOL_DIRTY)) != 0) + if ((ret = mpf->put(mpf, pp, DB_MPOOL_DIRTY)) != 0) goto err; if (needlock) (void)__TLPUT(dbc, ppl); @@ -264,12 +270,12 @@ __db_relink(dbc, add_rem, pagep, new_next, needlock) return (0); err: if (np != NULL) - (void)memp_fput(dbp->mpf, np, 0); - if (needlock && npl.off != LOCK_INVALID) + (void)mpf->put(mpf, np, 0); + if (needlock) (void)__TLPUT(dbc, npl); if (pp != NULL) - (void)memp_fput(dbp->mpf, pp, 0); - if (needlock && ppl.off != LOCK_INVALID) + (void)mpf->put(mpf, pp, 0); + if (needlock) (void)__TLPUT(dbc, ppl); return (ret); } diff --git a/bdb/db/db_iface.c b/bdb/db/db_iface.c index 3548a2527bb..b518c3b14b2 100644 --- a/bdb/db/db_iface.c +++ b/bdb/db/db_iface.c @@ -1,55 +1,69 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_iface.c,v 11.34 2001/01/11 18:19:51 bostic Exp $"; +static const char revid[] = "$Id: db_iface.c,v 11.77 2002/08/08 03:57:47 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include - -#include #endif #include "db_int.h" -#include "db_page.h" -#include "db_am.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/db_am.h" static int __db_curinval __P((const DB_ENV *)); +static int __db_fnl __P((const DB_ENV *, const char *)); 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) || \ + (F_ISSET((dbp)->dbenv, DB_ENV_REP_CLIENT) && \ + !F_ISSET((dbp), DB_AM_CL_WRITER))) + /* * __db_cursorchk -- * Common cursor argument checking routine. * - * PUBLIC: int __db_cursorchk __P((const DB *, u_int32_t, int)); + * PUBLIC: int __db_cursorchk __P((const DB *, u_int32_t)); */ int -__db_cursorchk(dbp, flags, isrdonly) +__db_cursorchk(dbp, flags) const DB *dbp; u_int32_t flags; - int isrdonly; { + /* DB_DIRTY_READ is the only valid bit-flag and requires locking. */ + if (LF_ISSET(DB_DIRTY_READ)) { + if (!LOCKING_ON(dbp->dbenv)) + return (__db_fnl(dbp->dbenv, "DB->cursor")); + LF_CLR(DB_DIRTY_READ); + } + /* Check for invalid function flags. */ switch (flags) { case 0: break; case DB_WRITECURSOR: - if (isrdonly) + if (IS_READONLY(dbp)) return (__db_rdonly(dbp->dbenv, "DB->cursor")); if (!CDB_LOCKING(dbp->dbenv)) return (__db_ferr(dbp->dbenv, "DB->cursor", 0)); break; case DB_WRITELOCK: - if (isrdonly) + if (IS_READONLY(dbp)) return (__db_rdonly(dbp->dbenv, "DB->cursor")); break; default: @@ -90,22 +104,25 @@ __db_ccountchk(dbp, flags, isvalid) * __db_cdelchk -- * Common cursor delete argument checking routine. * - * PUBLIC: int __db_cdelchk __P((const DB *, u_int32_t, int, int)); + * PUBLIC: int __db_cdelchk __P((const DB *, u_int32_t, int)); */ int -__db_cdelchk(dbp, flags, isrdonly, isvalid) +__db_cdelchk(dbp, flags, isvalid) const DB *dbp; u_int32_t flags; - int isrdonly, isvalid; + int isvalid; { /* Check for changes to a read-only tree. */ - if (isrdonly) + if (IS_READONLY(dbp)) return (__db_rdonly(dbp->dbenv, "c_del")); /* Check for invalid function flags. */ switch (flags) { case 0: break; + case DB_UPDATE_SECONDARY: + DB_ASSERT(F_ISSET(dbp, DB_AM_SECONDARY)); + break; default: return (__db_ferr(dbp->dbenv, "DBcursor->c_del", 0)); } @@ -130,7 +147,7 @@ __db_cgetchk(dbp, key, data, flags, isvalid) u_int32_t flags; int isvalid; { - int ret; + int dirty, multi, ret; /* * Check for read-modify-write validity. DB_RMW doesn't make sense @@ -140,44 +157,68 @@ __db_cgetchk(dbp, key, data, flags, isvalid) * If this changes, confirm that DB does not itself set the DB_RMW * flag in a path where CDB may have been configured. */ - if (LF_ISSET(DB_RMW)) { - if (!LOCKING_ON(dbp->dbenv)) { - __db_err(dbp->dbenv, - "the DB_RMW flag requires locking"); - return (EINVAL); - } - LF_CLR(DB_RMW); + dirty = 0; + if (LF_ISSET(DB_DIRTY_READ | DB_RMW)) { + if (!LOCKING_ON(dbp->dbenv)) + return (__db_fnl(dbp->dbenv, "DBcursor->c_get")); + if (LF_ISSET(DB_DIRTY_READ)) + dirty = 1; + LF_CLR(DB_DIRTY_READ | DB_RMW); + } + + multi = 0; + if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) { + multi = 1; + if (LF_ISSET(DB_MULTIPLE) && LF_ISSET(DB_MULTIPLE_KEY)) + goto multi_err; + LF_CLR(DB_MULTIPLE | DB_MULTIPLE_KEY); } /* Check for invalid function flags. */ switch (flags) { case DB_CONSUME: case DB_CONSUME_WAIT: + if (dirty) { + __db_err(dbp->dbenv, + "DB_DIRTY_READ is not supported with DB_CONSUME or DB_CONSUME_WAIT"); + return (EINVAL); + } if (dbp->type != DB_QUEUE) goto err; break; case DB_CURRENT: case DB_FIRST: case DB_GET_BOTH: - case DB_LAST: + case DB_GET_BOTH_RANGE: case DB_NEXT: case DB_NEXT_DUP: case DB_NEXT_NODUP: - case DB_PREV: - case DB_PREV_NODUP: case DB_SET: case DB_SET_RANGE: break; + case DB_LAST: + case DB_PREV: + case DB_PREV_NODUP: + if (multi) +multi_err: return (__db_ferr(dbp->dbenv, "DBcursor->c_get", 1)); + break; case DB_GET_BOTHC: if (dbp->type == DB_QUEUE) goto err; break; case DB_GET_RECNO: - if (!F_ISSET(dbp, DB_BT_RECNUM)) + /* + * The one situation in which this might be legal with a + * non-RECNUM dbp is if dbp is a secondary and its primary is + * DB_AM_RECNUM. + */ + if (!F_ISSET(dbp, DB_AM_RECNUM) && + (!F_ISSET(dbp, DB_AM_SECONDARY) || + !F_ISSET(dbp->s_primary, DB_AM_RECNUM))) goto err; break; case DB_SET_RECNO: - if (!F_ISSET(dbp, DB_BT_RECNUM)) + if (!F_ISSET(dbp, DB_AM_RECNUM)) goto err; break; default: @@ -190,11 +231,24 @@ err: return (__db_ferr(dbp->dbenv, "DBcursor->c_get", 0)); if ((ret = __dbt_ferr(dbp, "data", data, 0)) != 0) return (ret); + if (multi && !F_ISSET(data, DB_DBT_USERMEM)) { + __db_err(dbp->dbenv, + "DB_MULTIPLE(_KEY) requires that DB_DBT_USERMEM be set"); + return (EINVAL); + } + if (multi && + (F_ISSET(key, DB_DBT_PARTIAL) || F_ISSET(data, DB_DBT_PARTIAL))) { + __db_err(dbp->dbenv, + "DB_DBT_PARTIAL forbidden with DB_MULTIPLE(_KEY)"); + return (EINVAL); + } + /* - * The cursor must be initialized for DB_CURRENT or DB_NEXT_DUP, - * return EINVAL for an invalid cursor, otherwise 0. + * The cursor must be initialized for DB_CURRENT, DB_GET_RECNO and + * DB_NEXT_DUP. Return EINVAL for an invalid cursor, otherwise 0. */ - if (isvalid || (flags != DB_CURRENT && flags != DB_NEXT_DUP)) + if (isvalid || (flags != DB_CURRENT && + flags != DB_GET_RECNO && flags != DB_NEXT_DUP)) return (0); return (__db_curinval(dbp->dbenv)); @@ -205,24 +259,35 @@ err: return (__db_ferr(dbp->dbenv, "DBcursor->c_get", 0)); * Common cursor put argument checking routine. * * PUBLIC: int __db_cputchk __P((const DB *, - * PUBLIC: const DBT *, DBT *, u_int32_t, int, int)); + * PUBLIC: const DBT *, DBT *, u_int32_t, int)); */ int -__db_cputchk(dbp, key, data, flags, isrdonly, isvalid) +__db_cputchk(dbp, key, data, flags, isvalid) const DB *dbp; const DBT *key; DBT *data; u_int32_t flags; - int isrdonly, isvalid; + int isvalid; { int key_flags, ret; key_flags = 0; /* Check for changes to a read-only tree. */ - if (isrdonly) + if (IS_READONLY(dbp)) return (__db_rdonly(dbp->dbenv, "c_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(dbp->dbenv, + "DBcursor->c_put forbidden on secondary indices"); + return (EINVAL); + } + } + /* Check for invalid function flags. */ switch (flags) { case DB_AFTER: @@ -238,7 +303,7 @@ __db_cputchk(dbp, key, data, flags, isrdonly, isvalid) case DB_QUEUE: /* Not permitted. */ goto err; case DB_RECNO: /* Only with mutable record numbers. */ - if (!F_ISSET(dbp, DB_RE_RENUMBER)) + if (!F_ISSET(dbp, DB_AM_RENUMBER)) goto err; key_flags = 1; break; @@ -259,8 +324,6 @@ __db_cputchk(dbp, key, data, flags, isrdonly, isvalid) /* FALLTHROUGH */ case DB_KEYFIRST: case DB_KEYLAST: - if (dbp->type == DB_QUEUE || dbp->type == DB_RECNO) - goto err; key_flags = 1; break; default: @@ -285,48 +348,153 @@ err: return (__db_ferr(dbp->dbenv, "DBcursor->c_put", 0)); } /* - * __db_closechk -- - * DB->close flag check. + * __db_pgetchk -- + * DB->pget flag check. * - * PUBLIC: int __db_closechk __P((const DB *, u_int32_t)); + * PUBLIC: int __db_pgetchk __P((const DB *, const DBT *, DBT *, DBT *, + * PUBLIC: u_int32_t)); */ int -__db_closechk(dbp, flags) +__db_pgetchk(dbp, skey, pkey, data, flags) const DB *dbp; + const DBT *skey; + DBT *pkey, *data; u_int32_t flags; { - /* Check for invalid function flags. */ - switch (flags) { - case 0: - case DB_NOSYNC: - break; - default: - return (__db_ferr(dbp->dbenv, "DB->close", 0)); + int ret; + u_int32_t save_flags; + + save_flags = flags; + + if (!F_ISSET(dbp, DB_AM_SECONDARY)) { + __db_err(dbp->dbenv, + "DB->pget may only be used on secondary indices"); + return (EINVAL); } - return (0); + if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) { + __db_err(dbp->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); + switch (flags) { + case DB_CONSUME: + case DB_CONSUME_WAIT: + return (__db_ferr(dbp->dbenv, "DB->pget", 0)); + default: + /* __db_getchk will catch the rest. */ + break; + } + + /* + * We allow the pkey field to be NULL, so that we can make the + * two-DBT get calls into wrappers for the three-DBT ones. + */ + if (pkey != NULL && + (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(dbp->dbenv, + "DB_GET_BOTH on a secondary index requires a primary key"); + return (EINVAL); + } + + return (__db_getchk(dbp, skey, data, save_flags)); +} + +/* + * __db_cpgetchk -- + * Secondary-index cursor get argument checking routine. + * + * PUBLIC: int __db_cpgetchk __P((const DB *, + * PUBLIC: DBT *, DBT *, DBT *, u_int32_t, int)); + */ +int +__db_cpgetchk(dbp, skey, pkey, data, flags, isvalid) + const DB *dbp; + DBT *skey, *pkey, *data; + u_int32_t flags; + int isvalid; +{ + int ret; + u_int32_t save_flags; + + save_flags = flags; + + if (!F_ISSET(dbp, DB_AM_SECONDARY)) { + __db_err(dbp->dbenv, + "DBcursor->c_pget may only be used on secondary indices"); + return (EINVAL); + } + + if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) { + __db_err(dbp->dbenv, + "DB_MULTIPLE and DB_MULTIPLE_KEY may not be used on secondary indices"); + return (EINVAL); + } + + LF_CLR(DB_RMW); + switch (flags) { + case DB_CONSUME: + case DB_CONSUME_WAIT: + /* DB_CONSUME makes no sense on a secondary index. */ + return (__db_ferr(dbp->dbenv, "DBcursor->c_pget", 0)); + case DB_GET_BOTH: + /* DB_GET_BOTH is "get both the primary and the secondary". */ + if (pkey == NULL) { + __db_err(dbp->dbenv, + "DB_GET_BOTH requires both a secondary and a primary key"); + return (EINVAL); + } + break; + default: + /* __db_cgetchk will catch the rest. */ + break; + } + + /* + * We allow the pkey field to be NULL, so that we can make the + * two-DBT get calls into wrappers for the three-DBT ones. + */ + if (pkey != NULL && + (ret = __dbt_ferr(dbp, "primary key", pkey, 0)) != 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(dbp->dbenv, + "DB_GET_BOTH on a secondary index requires a primary key"); + return (EINVAL); + } + + return (__db_cgetchk(dbp, skey, data, save_flags, isvalid)); } /* * __db_delchk -- * Common delete argument checking routine. * - * PUBLIC: int __db_delchk __P((const DB *, DBT *, u_int32_t, int)); + * PUBLIC: int __db_delchk __P((const DB *, DBT *, u_int32_t)); */ int -__db_delchk(dbp, key, flags, isrdonly) +__db_delchk(dbp, key, flags) const DB *dbp; DBT *key; u_int32_t flags; - int isrdonly; { COMPQUIET(key, NULL); /* Check for changes to a read-only tree. */ - if (isrdonly) + if (IS_READONLY(dbp)) return (__db_rdonly(dbp->dbenv, "delete")); /* Check for invalid function flags. */ + LF_CLR(DB_AUTO_COMMIT); switch (flags) { case 0: break; @@ -350,7 +518,7 @@ __db_getchk(dbp, key, data, flags) DBT *data; u_int32_t flags; { - int ret; + int dirty, multi, ret; /* * Check for read-modify-write validity. DB_RMW doesn't make sense @@ -360,13 +528,21 @@ __db_getchk(dbp, key, data, flags) * If this changes, confirm that DB does not itself set the DB_RMW * flag in a path where CDB may have been configured. */ - if (LF_ISSET(DB_RMW)) { - if (!LOCKING_ON(dbp->dbenv)) { - __db_err(dbp->dbenv, - "the DB_RMW flag requires locking"); - return (EINVAL); - } - LF_CLR(DB_RMW); + dirty = 0; + if (LF_ISSET(DB_DIRTY_READ | DB_RMW)) { + if (!LOCKING_ON(dbp->dbenv)) + return (__db_fnl(dbp->dbenv, "DB->get")); + if (LF_ISSET(DB_DIRTY_READ)) + dirty = 1; + LF_CLR(DB_DIRTY_READ | DB_RMW); + } + + multi = 0; + if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) { + if (LF_ISSET(DB_MULTIPLE_KEY)) + goto multi_err; + multi = LF_ISSET(DB_MULTIPLE) ? 1 : 0; + LF_CLR(DB_MULTIPLE); } /* Check for invalid function flags. */ @@ -375,24 +551,48 @@ __db_getchk(dbp, key, data, flags) case DB_GET_BOTH: break; case DB_SET_RECNO: - if (!F_ISSET(dbp, DB_BT_RECNUM)) + if (!F_ISSET(dbp, DB_AM_RECNUM)) goto err; break; case DB_CONSUME: case DB_CONSUME_WAIT: + if (dirty) { + __db_err(dbp->dbenv, + "DB_DIRTY_READ is not supported with DB_CONSUME or DB_CONSUME_WAIT"); + return (EINVAL); + } + if (multi) +multi_err: return (__db_ferr(dbp->dbenv, "DB->get", 1)); if (dbp->type == DB_QUEUE) break; - /* Fall through */ + /* FALLTHROUGH */ default: err: return (__db_ferr(dbp->dbenv, "DB->get", 0)); } - /* Check for invalid key/data flags. */ + /* + * Check for invalid key/data flags. + * + * XXX: Dave Krinsky + * Remember to modify this when we fix the flag-returning problem. + */ if ((ret = __dbt_ferr(dbp, "key", key, flags == DB_SET_RECNO)) != 0) return (ret); if ((ret = __dbt_ferr(dbp, "data", data, 1)) != 0) return (ret); + if (multi && !F_ISSET(data, DB_DBT_USERMEM)) { + __db_err(dbp->dbenv, + "DB_MULTIPLE requires that DB_DBT_USERMEM be set"); + return (EINVAL); + } + if (multi && + (F_ISSET(key, DB_DBT_PARTIAL) || F_ISSET(data, DB_DBT_PARTIAL))) { + __db_err(dbp->dbenv, + "DB_DBT_PARTIAL forbidden with DB_MULTIPLE(_KEY)"); + return (EINVAL); + } + return (0); } @@ -449,13 +649,11 @@ __db_joingetchk(dbp, key, flags) u_int32_t flags; { - if (LF_ISSET(DB_RMW)) { - if (!LOCKING_ON(dbp->dbenv)) { - __db_err(dbp->dbenv, - "the DB_RMW flag requires locking"); - return (EINVAL); - } - LF_CLR(DB_RMW); + if (LF_ISSET(DB_DIRTY_READ | DB_RMW)) { + if (!LOCKING_ON(dbp->dbenv)) + return (__db_fnl(dbp->dbenv, "DBcursor->c_get")); + + LF_CLR(DB_DIRTY_READ | DB_RMW); } switch (flags) { @@ -491,23 +689,32 @@ __db_joingetchk(dbp, key, flags) * Common put argument checking routine. * * PUBLIC: int __db_putchk - * PUBLIC: __P((const DB *, DBT *, const DBT *, u_int32_t, int, int)); + * PUBLIC: __P((const DB *, DBT *, const DBT *, u_int32_t, int)); */ int -__db_putchk(dbp, key, data, flags, isrdonly, isdup) +__db_putchk(dbp, key, data, flags, isdup) const DB *dbp; DBT *key; const DBT *data; u_int32_t flags; - int isrdonly, isdup; + int isdup; { - int ret; + int ret, returnkey; + + returnkey = 0; /* Check for changes to a read-only tree. */ - if (isrdonly) + if (IS_READONLY(dbp)) return (__db_rdonly(dbp->dbenv, "put")); + /* Check for puts on a secondary. */ + if (F_ISSET(dbp, DB_AM_SECONDARY)) { + __db_err(dbp->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: @@ -515,6 +722,7 @@ __db_putchk(dbp, key, data, flags, isrdonly, isdup) case DB_APPEND: if (dbp->type != DB_RECNO && dbp->type != DB_QUEUE) goto err; + returnkey = 1; break; case DB_NODUPDATA: if (F_ISSET(dbp, DB_AM_DUPSORT)) @@ -525,7 +733,7 @@ err: return (__db_ferr(dbp->dbenv, "DB->put", 0)); } /* Check for invalid key/data flags. */ - if ((ret = __dbt_ferr(dbp, "key", key, 0)) != 0) + if ((ret = __dbt_ferr(dbp, "key", key, returnkey)) != 0) return (ret); if ((ret = __dbt_ferr(dbp, "data", data, 0)) != 0) return (ret); @@ -540,28 +748,6 @@ err: return (__db_ferr(dbp->dbenv, "DB->put", 0)); return (0); } -/* - * __db_removechk -- - * DB->remove flag check. - * - * PUBLIC: int __db_removechk __P((const DB *, u_int32_t)); - */ -int -__db_removechk(dbp, flags) - const DB *dbp; - u_int32_t flags; -{ - /* Check for invalid function flags. */ - switch (flags) { - case 0: - break; - default: - return (__db_ferr(dbp->dbenv, "DB->remove", 0)); - } - - return (0); -} - /* * __db_statchk -- * Common stat argument checking routine. @@ -576,12 +762,13 @@ __db_statchk(dbp, flags) /* Check for invalid function flags. */ switch (flags) { case 0: - case DB_CACHED_COUNTS: + case DB_FAST_STAT: + case DB_CACHED_COUNTS: /* Deprecated and undocumented. */ break; - case DB_RECORDCOUNT: + case DB_RECORDCOUNT: /* Deprecated and undocumented. */ if (dbp->type == DB_RECNO) break; - if (dbp->type == DB_BTREE && F_ISSET(dbp, DB_BT_RECNUM)) + if (dbp->type == DB_BTREE && F_ISSET(dbp, DB_AM_RECNUM)) break; goto err; default: @@ -636,9 +823,9 @@ __dbt_ferr(dbp, name, dbt, check_thread) * database and then specify that same DBT as a key to a primary * database, without having to clear flags. */ - if ((ret = __db_fchk(dbenv, name, dbt->flags, - DB_DBT_MALLOC | DB_DBT_DUPOK | - DB_DBT_REALLOC | DB_DBT_USERMEM | DB_DBT_PARTIAL)) != 0) + 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) return (ret); switch (F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM)) { case 0: @@ -673,6 +860,20 @@ __db_rdonly(dbenv, name) return (EACCES); } +/* + * __db_fnl -- + * Common flag-needs-locking message. + */ +static int +__db_fnl(dbenv, name) + const DB_ENV *dbenv; + const char *name; +{ + __db_err(dbenv, + "%s: the DB_DIRTY_READ and DB_RMW flags require locking", name); + return (EINVAL); +} + /* * __db_curinval * Report that a cursor is in an invalid state. @@ -685,3 +886,98 @@ __db_curinval(dbenv) "Cursor position must be set before performing this operation"); return (EINVAL); } + +/* + * __db_secondary_corrupt -- + * Report that a secondary index appears corrupt, as it has a record + * that does not correspond to a record in the primary. + * + * PUBLIC: int __db_secondary_corrupt __P((DB *)); + */ +int +__db_secondary_corrupt(dbp) + DB *dbp; +{ + + __db_err(dbp->dbenv, + "Secondary index corrupt: item in secondary not found in primary"); + return (DB_SECONDARY_BAD); +} + +/* + * __db_associatechk -- + * Argument checking routine for DB->associate(). + * + * PUBLIC: int __db_associatechk __P((DB *, DB *, + * PUBLIC: int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t)); + */ +int +__db_associatechk(dbp, sdbp, callback, flags) + DB *dbp, *sdbp; + int (*callback) __P((DB *, const DBT *, const DBT *, DBT *)); + u_int32_t flags; +{ + DB_ENV *dbenv; + + dbenv = dbp->dbenv; + + if (F_ISSET(sdbp, DB_AM_SECONDARY)) { + __db_err(dbenv, + "Secondary index handles may not be re-associated"); + return (EINVAL); + } + if (F_ISSET(dbp, DB_AM_SECONDARY)) { + __db_err(dbenv, + "Secondary indices may not be used as primary databases"); + return (EINVAL); + } + if (F_ISSET(dbp, DB_AM_DUP)) { + __db_err(dbenv, + "Primary databases may not be configured with duplicates"); + return (EINVAL); + } + if (F_ISSET(dbp, DB_AM_RENUMBER)) { + __db_err(dbenv, + "Renumbering recno databases may not be used as primary databases"); + return (EINVAL); + } + if (callback == NULL && + (!F_ISSET(dbp, DB_AM_RDONLY) || !F_ISSET(sdbp, DB_AM_RDONLY))) { + __db_err(dbenv, + "Callback function may be NULL only when database handles are read-only"); + return (EINVAL); + } + + return (__db_fchk(dbenv, + "DB->associate", flags, DB_CREATE | DB_AUTO_COMMIT)); +} + +/* + * __db_txn_auto -- + * Handle DB_AUTO_COMMIT initialization. + * + * PUBLIC: int __db_txn_auto __P((DB *, DB_TXN **)); + */ +int +__db_txn_auto(dbp, txnidp) + DB *dbp; + DB_TXN **txnidp; +{ + DB_ENV *dbenv; + + dbenv = dbp->dbenv; + + if (*txnidp != NULL) { + __db_err(dbenv, + "DB_AUTO_COMMIT may not be specified along with a transaction handle"); + return (EINVAL); + } + + if (!TXN_ON(dbenv)) { + __db_err(dbenv, + "DB_AUTO_COMMIT may not be specified in non-transactional environment"); + return (EINVAL); + } + + return (dbenv->txn_begin(dbenv, NULL, txnidp, 0)); +} diff --git a/bdb/db/db_join.c b/bdb/db/db_join.c index 881dedde0fc..6281b1a8383 100644 --- a/bdb/db/db_join.c +++ b/bdb/db/db_join.c @@ -1,14 +1,14 @@ -/*- +/* * See the file LICENSE for redistribution information. * - * Copyright (c) 1998, 1999, 2000 + * Copyright (c) 1998-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_join.c,v 11.31 2000/12/20 22:41:54 krinsky Exp $"; +static const char revid[] = "$Id: db_join.c,v 11.55 2002/08/08 03:57:47 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -19,16 +19,17 @@ static const char revid[] = "$Id: db_join.c,v 11.31 2000/12/20 22:41:54 krinsky #endif #include "db_int.h" -#include "db_page.h" -#include "db_join.h" -#include "db_am.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/db_join.h" +#include "dbinc/btree.h" static int __db_join_close __P((DBC *)); static int __db_join_cmp __P((const void *, const void *)); static int __db_join_del __P((DBC *, u_int32_t)); static int __db_join_get __P((DBC *, DBT *, DBT *, u_int32_t)); -static int __db_join_getnext __P((DBC *, DBT *, DBT *, u_int32_t)); +static int __db_join_getnext __P((DBC *, DBT *, DBT *, u_int32_t, u_int32_t)); +static int __db_join_primget __P((DB *, + DB_TXN *, u_int32_t, DBT *, DBT *, u_int32_t)); static int __db_join_put __P((DBC *, DBT *, DBT *, u_int32_t)); /* @@ -84,7 +85,8 @@ __db_join(primary, curslist, dbcp, flags) DBC *dbc; JOIN_CURSOR *jc; int ret; - u_int32_t i, ncurs, nslots; + u_int32_t i; + size_t ncurs, nslots; COMPQUIET(nslots, 0); @@ -104,11 +106,13 @@ __db_join(primary, curslist, dbcp, flags) 1, sizeof(JOIN_CURSOR), &jc)) != 0) goto err; - if ((ret = __os_malloc(dbenv, 256, NULL, &jc->j_key.data)) != 0) + if ((ret = __os_malloc(dbenv, 256, &jc->j_key.data)) != 0) goto err; jc->j_key.ulen = 256; F_SET(&jc->j_key, DB_DBT_USERMEM); + F_SET(&jc->j_rdata, DB_DBT_REALLOC); + for (jc->j_curslist = curslist; *jc->j_curslist != NULL; jc->j_curslist++) ; @@ -184,7 +188,7 @@ __db_join(primary, curslist, dbcp, flags) jc->j_fdupcurs[i] = NULL; jc->j_exhausted[i] = 0; } - jc->j_ncurs = ncurs; + jc->j_ncurs = (u_int32_t)ncurs; /* * If DB_JOIN_NOSORT is not set, optimize secondary cursors by @@ -226,20 +230,20 @@ __db_join(primary, curslist, dbcp, flags) err: if (jc != NULL) { if (jc->j_curslist != NULL) - __os_free(jc->j_curslist, nslots * sizeof(DBC *)); + __os_free(dbenv, jc->j_curslist); if (jc->j_workcurs != NULL) { if (jc->j_workcurs[0] != NULL) - __os_free(jc->j_workcurs[0], sizeof(DBC)); - __os_free(jc->j_workcurs, nslots * sizeof(DBC *)); + __os_free(dbenv, jc->j_workcurs[0]); + __os_free(dbenv, jc->j_workcurs); } if (jc->j_fdupcurs != NULL) - __os_free(jc->j_fdupcurs, nslots * sizeof(DBC *)); + __os_free(dbenv, jc->j_fdupcurs); if (jc->j_exhausted != NULL) - __os_free(jc->j_exhausted, nslots * sizeof(u_int8_t)); - __os_free(jc, sizeof(JOIN_CURSOR)); + __os_free(dbenv, jc->j_exhausted); + __os_free(dbenv, jc); } if (dbc != NULL) - __os_free(dbc, sizeof(DBC)); + __os_free(dbenv, dbc); return (ret); } @@ -279,8 +283,8 @@ __db_join_get(dbc, key_arg, data_arg, flags) DB *dbp; DBC *cp; JOIN_CURSOR *jc; - int ret; - u_int32_t i, j, operation; + int db_manage_data, ret; + u_int32_t i, j, operation, opmods; dbp = dbc->dbp; jc = (JOIN_CURSOR *)dbc->internal; @@ -289,6 +293,12 @@ __db_join_get(dbc, key_arg, data_arg, flags) operation = LF_ISSET(DB_OPFLAGS_MASK); + /* !!! + * If the set of flags here changes, check that __db_join_primget + * is updated to handle them properly. + */ + opmods = LF_ISSET(DB_RMW | DB_DIRTY_READ); + if ((ret = __db_joingetchk(dbp, key_arg, flags)) != 0) return (ret); @@ -319,13 +329,14 @@ __db_join_get(dbc, key_arg, data_arg, flags) goto samekey; F_CLR(jc, JOIN_RETRY); -retry: ret = jc->j_workcurs[0]->c_get(jc->j_workcurs[0], - &jc->j_key, key_n, jc->j_exhausted[0] ? DB_NEXT_DUP : DB_CURRENT); +retry: ret = jc->j_workcurs[0]->c_real_get(jc->j_workcurs[0], + &jc->j_key, key_n, + opmods | (jc->j_exhausted[0] ? DB_NEXT_DUP : DB_CURRENT)); if (ret == ENOMEM) { jc->j_key.ulen <<= 1; if ((ret = __os_realloc(dbp->dbenv, - jc->j_key.ulen, NULL, &jc->j_key.data)) != 0) + jc->j_key.ulen, &jc->j_key.data)) != 0) goto mem_err; goto retry; } @@ -379,7 +390,7 @@ retry: ret = jc->j_workcurs[0]->c_get(jc->j_workcurs[0], retry2: cp = jc->j_workcurs[i]; if ((ret = __db_join_getnext(cp, &jc->j_key, key_n, - jc->j_exhausted[i])) == DB_NOTFOUND) { + jc->j_exhausted[i], opmods)) == DB_NOTFOUND) { /* * jc->j_workcurs[i] has no more of the datum we're * interested in. Go back one cursor and get @@ -475,7 +486,7 @@ retry2: cp = jc->j_workcurs[i]; if (ret == ENOMEM) { jc->j_key.ulen <<= 1; if ((ret = __os_realloc(dbp->dbenv, jc->j_key.ulen, - NULL, &jc->j_key.data)) != 0) { + &jc->j_key.data)) != 0) { mem_err: __db_err(dbp->dbenv, "Allocation failed for join key, len = %lu", (u_long)jc->j_key.ulen); @@ -523,8 +534,8 @@ samekey: /* * Get the key we tried and failed to return last time; * it should be the current datum of all the secondary cursors. */ - if ((ret = jc->j_workcurs[0]->c_get(jc->j_workcurs[0], - &jc->j_key, key_n, DB_CURRENT)) != 0) + if ((ret = jc->j_workcurs[0]->c_real_get(jc->j_workcurs[0], + &jc->j_key, key_n, DB_CURRENT | opmods)) != 0) return (ret); F_CLR(jc, JOIN_RETRY); } @@ -532,36 +543,28 @@ samekey: /* /* * ret == 0; we have a key to return. * - * If DB_DBT_USERMEM or DB_DBT_MALLOC is set, we need to - * copy it back into the dbt we were given for the key; - * call __db_retcopy. - * - * Otherwise, assert that we do not in fact need to copy anything - * and simply proceed. + * If DB_DBT_USERMEM or DB_DBT_MALLOC is set, we need to copy the key + * 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. */ - if (F_ISSET(key_arg, DB_DBT_USERMEM) || - F_ISSET(key_arg, DB_DBT_MALLOC)) { + DB_ASSERT(F_ISSET( + key_arg, DB_DBT_USERMEM | DB_DBT_MALLOC) || key_n == key_arg); + + if (F_ISSET(key_arg, DB_DBT_USERMEM | DB_DBT_MALLOC) && + (ret = __db_retcopy(dbp->dbenv, + key_arg, key_n->data, key_n->size, NULL, NULL)) != 0) { /* - * We need to copy the key back into our original - * datum. Do so. + * The retcopy failed, most commonly because we have a user + * buffer for the key which is too small. Set things up to + * retry next time, and return. */ - if ((ret = __db_retcopy(dbp, - key_arg, key_n->data, key_n->size, NULL, NULL)) != 0) { - /* - * The retcopy failed, most commonly because we - * have a user buffer for the key which is too small. - * Set things up to retry next time, and return. - */ - F_SET(jc, JOIN_RETRY); - return (ret); - } - } else - DB_ASSERT(key_n == key_arg); + F_SET(jc, JOIN_RETRY); + return (ret); + } /* - * If DB_JOIN_ITEM is - * set, we return it; otherwise we do the lookup in the - * primary and then return. + * 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. @@ -569,14 +572,45 @@ samekey: /* if (operation == DB_JOIN_ITEM) return (0); - if ((ret = jc->j_primary->get(jc->j_primary, - jc->j_curslist[0]->txn, key_arg, data_arg, 0)) != 0) - /* - * The get on the primary failed, most commonly because we're - * using a user buffer that's not big enough. Flag our - * failure so we can return the same key next time. - */ - F_SET(jc, JOIN_RETRY); + /* + * If data_arg->flags == 0--that is, if DB is managing the + * data DBT's memory--it's not safe to just pass the DBT + * through to the primary get call, since we don't want that + * memory to belong to the primary DB handle (and if the primary + * is free-threaded, it can't anyway). + * + * 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)) + 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, + db_manage_data ? &jc->j_rdata : data_arg, opmods)) != 0) { + if (ret == DB_NOTFOUND) + /* + * If ret == DB_NOTFOUND, the primary and secondary + * are out of sync; every item in each secondary + * should correspond to something in the primary, + * or we shouldn't have done the join this way. + * Wail. + */ + ret = __db_secondary_corrupt(jc->j_primary); + else + /* + * The get on the primary failed for some other + * reason, most commonly because we're using a user + * buffer that's not big enough. Flag our failure + * so we can return the same key next time. + */ + F_SET(jc, JOIN_RETRY); + } + if (db_manage_data && ret == 0) { + data_arg->data = jc->j_rdata.data; + data_arg->size = jc->j_rdata.size; + } return (ret); } @@ -586,12 +620,14 @@ __db_join_close(dbc) DBC *dbc; { DB *dbp; + DB_ENV *dbenv; JOIN_CURSOR *jc; int ret, t_ret; u_int32_t i; jc = (JOIN_CURSOR *)dbc->internal; dbp = dbc->dbp; + dbenv = dbp->dbenv; ret = t_ret = 0; /* @@ -599,11 +635,11 @@ __db_join_close(dbc) * must happen before any action that can fail and return, or else * __db_close may loop indefinitely. */ - MUTEX_THREAD_LOCK(dbp->dbenv, dbp->mutexp); + MUTEX_THREAD_LOCK(dbenv, dbp->mutexp); TAILQ_REMOVE(&dbp->join_queue, dbc, links); - MUTEX_THREAD_UNLOCK(dbp->dbenv, dbp->mutexp); + MUTEX_THREAD_UNLOCK(dbenv, dbp->mutexp); - PANIC_CHECK(dbc->dbp->dbenv); + PANIC_CHECK(dbenv); /* * Close any open scratch cursors. In each case, there may @@ -625,13 +661,15 @@ __db_join_close(dbc) ret = t_ret; } - __os_free(jc->j_exhausted, 0); - __os_free(jc->j_curslist, 0); - __os_free(jc->j_workcurs, 0); - __os_free(jc->j_fdupcurs, 0); - __os_free(jc->j_key.data, jc->j_key.ulen); - __os_free(jc, sizeof(JOIN_CURSOR)); - __os_free(dbc, sizeof(DBC)); + __os_free(dbenv, jc->j_exhausted); + __os_free(dbenv, jc->j_curslist); + __os_free(dbenv, jc->j_workcurs); + __os_free(dbenv, jc->j_fdupcurs); + __os_free(dbenv, jc->j_key.data); + if (jc->j_rdata.data != NULL) + __os_ufree(dbenv, jc->j_rdata.data); + __os_free(dbenv, jc); + __os_free(dbenv, dbc); return (ret); } @@ -652,10 +690,10 @@ __db_join_close(dbc) * If no matching datum exists, returns DB_NOTFOUND, else 0. */ static int -__db_join_getnext(dbc, key, data, exhausted) +__db_join_getnext(dbc, key, data, exhausted, opmods) DBC *dbc; DBT *key, *data; - u_int32_t exhausted; + u_int32_t exhausted, opmods; { int ret, cmp; DB *dbp; @@ -667,10 +705,14 @@ __db_join_getnext(dbc, key, data, exhausted) switch (exhausted) { case 0: + /* + * We don't want to step on data->data; use a new + * DBT and malloc so we don't step on dbc's rdata memory. + */ memset(&ldata, 0, sizeof(DBT)); - /* We don't want to step on data->data; malloc. */ F_SET(&ldata, DB_DBT_MALLOC); - if ((ret = dbc->c_get(dbc, key, &ldata, DB_CURRENT)) != 0) + if ((ret = dbc->c_real_get(dbc, + key, &ldata, opmods | DB_CURRENT)) != 0) break; cmp = func(dbp, data, &ldata); if (cmp == 0) { @@ -679,10 +721,10 @@ __db_join_getnext(dbc, key, data, exhausted) * it into data, then free the buffer we malloc'ed * above. */ - if ((ret = __db_retcopy(dbp, data, ldata.data, + if ((ret = __db_retcopy(dbp->dbenv, data, ldata.data, ldata.size, &data->data, &data->size)) != 0) return (ret); - __os_free(ldata.data, 0); + __os_ufree(dbp->dbenv, ldata.data); return (0); } @@ -691,10 +733,10 @@ __db_join_getnext(dbc, key, data, exhausted) * dups. We just forget about ldata and free * its buffer--data contains the value we're searching for. */ - __os_free(ldata.data, 0); + __os_ufree(dbp->dbenv, ldata.data); /* FALLTHROUGH */ case 1: - ret = dbc->c_get(dbc, key, data, DB_GET_BOTHC); + ret = dbc->c_real_get(dbc, key, data, opmods | DB_GET_BOTHC); break; default: ret = EINVAL; @@ -708,7 +750,6 @@ __db_join_getnext(dbc, key, data, exhausted) * __db_join_cmp -- * Comparison function for sorting DBCs in cardinality order. */ - static int __db_join_cmp(a, b) const void *a, *b; @@ -728,3 +769,54 @@ __db_join_cmp(a, b) return (counta - countb); } + +/* + * __db_join_primget -- + * Perform a DB->get in the primary, being careful not to use a new + * locker ID if we're doing CDB locking. + */ +static int +__db_join_primget(dbp, txn, lockerid, key, data, flags) + DB *dbp; + DB_TXN *txn; + u_int32_t lockerid; + DBT *key, *data; + u_int32_t flags; +{ + DBC *dbc; + int dirty, ret, rmw, t_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. + */ + rmw = LF_ISSET(DB_RMW); + dirty = LF_ISSET(DB_DIRTY_READ); + LF_CLR(DB_RMW | DB_DIRTY_READ); + DB_ASSERT(flags == 0); + + if ((ret = __db_icursor(dbp, + txn, dbp->type, PGNO_INVALID, 0, lockerid, &dbc)) != 0) + return (ret); + + if (dirty || + (txn != NULL && F_ISSET(txn, TXN_DIRTY_READ))) + F_SET(dbc, DBC_DIRTY_READ); + F_SET(dbc, DBC_TRANSIENT); + + /* + * This shouldn't be necessary, thanks to the fact that join cursors + * swap in their own DB_DBT_REALLOC'ed buffers, but just for form's + * sake, we mirror what __db_get does. + */ + SET_RET_MEM(dbc, dbp); + + ret = dbc->c_get(dbc, key, data, DB_SET | rmw); + + if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0) + ret = t_ret; + + return (ret); +} diff --git a/bdb/db/db_meta.c b/bdb/db/db_meta.c index 5b57c369454..015ef5c8fc7 100644 --- a/bdb/db/db_meta.c +++ b/bdb/db/db_meta.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -43,7 +43,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_meta.c,v 11.26 2001/01/16 21:57:19 ubell Exp $"; +static const char revid[] = "$Id: db_meta.c,v 11.61 2002/08/08 03:57:48 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -53,12 +53,37 @@ static const char revid[] = "$Id: db_meta.c,v 11.26 2001/01/16 21:57:19 ubell Ex #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "lock.h" -#include "txn.h" -#include "db_am.h" -#include "btree.h" +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/lock.h" +#include "dbinc/db_am.h" + +static void __db_init_meta __P((void *, u_int32_t, db_pgno_t, u_int32_t)); + +/* + * __db_init_meta -- + * Helper function for __db_new that initializes the important fields in + * a meta-data page (used instead of P_INIT). We need to make sure that we + * retain the page number and LSN of the existing page. + */ +static void +__db_init_meta(p, pgsize, pgno, pgtype) + void *p; + u_int32_t pgsize; + db_pgno_t pgno; + u_int32_t pgtype; +{ + DB_LSN save_lsn; + DBMETA *meta; + + meta = (DBMETA *)p; + save_lsn = meta->lsn; + memset(meta, 0, sizeof(DBMETA)); + meta->lsn = save_lsn; + meta->pagesize = pgsize; + meta->pgno = pgno; + meta->type = (u_int8_t)pgtype; +} /* * __db_new -- @@ -75,60 +100,110 @@ __db_new(dbc, type, pagepp) DBMETA *meta; DB *dbp; DB_LOCK metalock; + DB_LSN lsn; + DB_MPOOLFILE *mpf; PAGE *h; - db_pgno_t pgno; - int ret; + db_pgno_t pgno, newnext; + int meta_flags, extend, ret; - dbp = dbc->dbp; meta = NULL; + meta_flags = 0; + dbp = dbc->dbp; + mpf = dbp->mpf; h = NULL; + newnext = PGNO_INVALID; pgno = PGNO_BASE_MD; if ((ret = __db_lget(dbc, LCK_ALWAYS, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) goto err; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, (PAGE **)&meta)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, (PAGE **)&meta)) != 0) goto err; - if (meta->free == PGNO_INVALID) { - if ((ret = memp_fget(dbp->mpf, &pgno, DB_MPOOL_NEW, &h)) != 0) + pgno = meta->last_pgno + 1; + ZERO_LSN(lsn); + extend = 1; + } else { + pgno = meta->free; + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) + goto err; + + /* + * We want to take the first page off the free list and + * then set meta->free to the that page's next_pgno, but + * we need to log the change first. + */ + newnext = h->next_pgno; + lsn = h->lsn; + extend = 0; + } + + /* + * Log the allocation before fetching the new page. If we + * don't have room in the log then we don't want to tell + * mpool to extend the file. + */ + if (DBC_LOGGING(dbc)) { + if ((ret = __db_pg_alloc_log(dbp, dbc->txn, &LSN(meta), 0, + &LSN(meta), PGNO_BASE_MD, &lsn, pgno, + (u_int32_t)type, newnext)) != 0) + goto err; + } else + LSN_NOT_LOGGED(LSN(meta)); + + meta_flags = DB_MPOOL_DIRTY; + meta->free = newnext; + + if (extend == 1) { + meta->last_pgno++; + if ((ret = mpf->get(mpf, &pgno, DB_MPOOL_NEW, &h)) != 0) goto err; ZERO_LSN(h->lsn); h->pgno = pgno; - } else { - pgno = meta->free; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) - goto err; - meta->free = h->next_pgno; - (void)memp_fset(dbp->mpf, (PAGE *)meta, DB_MPOOL_DIRTY); + DB_ASSERT(pgno == meta->last_pgno); } + LSN(h) = LSN(meta); DB_ASSERT(TYPE(h) == P_INVALID); if (TYPE(h) != P_INVALID) return (__db_panic(dbp->dbenv, EINVAL)); - /* Log the change. */ - if (DB_LOGGING(dbc)) { - if ((ret = __db_pg_alloc_log(dbp->dbenv, - dbc->txn, &LSN(meta), 0, dbp->log_fileid, - &LSN(meta), &h->lsn, h->pgno, - (u_int32_t)type, meta->free)) != 0) - goto err; - LSN(h) = LSN(meta); - } - - (void)memp_fput(dbp->mpf, (PAGE *)meta, DB_MPOOL_DIRTY); + (void)mpf->put(mpf, (PAGE *)meta, DB_MPOOL_DIRTY); (void)__TLPUT(dbc, metalock); - P_INIT(h, dbp->pgsize, h->pgno, PGNO_INVALID, PGNO_INVALID, 0, type); + switch (type) { + case P_BTREEMETA: + case P_HASHMETA: + case P_QAMMETA: + __db_init_meta(h, dbp->pgsize, h->pgno, type); + break; + default: + P_INIT(h, dbp->pgsize, + h->pgno, PGNO_INVALID, PGNO_INVALID, 0, type); + break; + } + + /* + * 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. + */ + if (F_ISSET(dbc->dbp, DB_AM_DIRTY) && 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(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); if (meta != NULL) - (void)memp_fput(dbp->mpf, meta, 0); + (void)mpf->put(mpf, meta, meta_flags); (void)__TLPUT(dbc, metalock); return (ret); } @@ -148,11 +223,13 @@ __db_free(dbc, h) DB *dbp; DBT ldbt; DB_LOCK metalock; + DB_MPOOLFILE *mpf; db_pgno_t pgno; u_int32_t dirty_flag; int ret, t_ret; dbp = dbc->dbp; + mpf = dbp->mpf; /* * Retrieve the metadata page and insert the page at the head of @@ -163,43 +240,44 @@ __db_free(dbc, h) dirty_flag = 0; pgno = PGNO_BASE_MD; if ((ret = __db_lget(dbc, - LCK_ALWAYS, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) + LCK_ALWAYS, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) goto err; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, (PAGE **)&meta)) != 0) { + if ((ret = mpf->get(mpf, &pgno, 0, (PAGE **)&meta)) != 0) { (void)__TLPUT(dbc, metalock); goto err; } DB_ASSERT(h->pgno != meta->free); /* Log the change. */ - if (DB_LOGGING(dbc)) { + if (DBC_LOGGING(dbc)) { memset(&ldbt, 0, sizeof(ldbt)); ldbt.data = h; - ldbt.size = P_OVERHEAD; - if ((ret = __db_pg_free_log(dbp->dbenv, - dbc->txn, &LSN(meta), 0, dbp->log_fileid, h->pgno, - &LSN(meta), &ldbt, meta->free)) != 0) { - (void)memp_fput(dbp->mpf, (PAGE *)meta, 0); + ldbt.size = P_OVERHEAD(dbp); + if ((ret = __db_pg_free_log(dbp, + dbc->txn, &LSN(meta), 0, h->pgno, + &LSN(meta), PGNO_BASE_MD, &ldbt, meta->free)) != 0) { + (void)mpf->put(mpf, (PAGE *)meta, 0); (void)__TLPUT(dbc, metalock); - return (ret); + goto err; } - LSN(h) = LSN(meta); - } + } else + LSN_NOT_LOGGED(LSN(meta)); + LSN(h) = LSN(meta); P_INIT(h, dbp->pgsize, h->pgno, PGNO_INVALID, meta->free, 0, P_INVALID); meta->free = h->pgno; /* Discard the metadata page. */ - if ((t_ret = memp_fput(dbp->mpf, - (PAGE *)meta, DB_MPOOL_DIRTY)) != 0 && ret == 0) + if ((t_ret = + mpf->put(mpf, (PAGE *)meta, DB_MPOOL_DIRTY)) != 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 ((t_ret = memp_fput(dbp->mpf, h, dirty_flag)) != 0 && ret == 0) +err: if ((t_ret = mpf->put(mpf, h, dirty_flag)) != 0 && ret == 0) ret = t_ret; /* @@ -227,44 +305,63 @@ __db_lprint(dbc) if (LOCKING_ON(dbp->dbenv)) { req.op = DB_LOCK_DUMP; - lock_vec(dbp->dbenv, dbc->locker, 0, &req, 1, NULL); + dbp->dbenv->lock_vec(dbp->dbenv, dbc->locker, 0, &req, 1, NULL); } return (0); } #endif +/* + * Implement the rules for transactional locking. We can release the previous + * lock if we are not in a transaction or COUPLE_ALWAYS is specifed (used in + * record locking). If we are doing dirty reads then we can release read locks + * and down grade write locks. + */ +#define DB_PUT_ACTION(dbc, action, lockp) \ + (((action == LCK_COUPLE || action == LCK_COUPLE_ALWAYS) && \ + LOCK_ISSET(*lockp)) ? \ + (dbc->txn == NULL || action == LCK_COUPLE_ALWAYS || \ + (F_ISSET(dbc, DBC_DIRTY_READ) && \ + (lockp)->mode == DB_LOCK_DIRTY)) ? LCK_COUPLE : \ + (F_ISSET((dbc)->dbp, DB_AM_DIRTY) && \ + (lockp)->mode == DB_LOCK_WRITE) ? LCK_DOWNGRADE : 0 : 0) + /* * __db_lget -- * The standard lock get call. * * PUBLIC: int __db_lget __P((DBC *, - * PUBLIC: int, db_pgno_t, db_lockmode_t, int, DB_LOCK *)); + * PUBLIC: int, db_pgno_t, db_lockmode_t, u_int32_t, DB_LOCK *)); */ int -__db_lget(dbc, flags, pgno, mode, lkflags, lockp) +__db_lget(dbc, action, pgno, mode, lkflags, lockp) DBC *dbc; - int flags, lkflags; + int action; db_pgno_t pgno; db_lockmode_t mode; + u_int32_t lkflags; DB_LOCK *lockp; { DB *dbp; DB_ENV *dbenv; DB_LOCKREQ couple[2], *reqp; - int ret; + DB_TXN *txn; + int has_timeout, ret; dbp = dbc->dbp; dbenv = dbp->dbenv; + txn = dbc->txn; /* * 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) - || (!LF_ISSET(LCK_ROLLBACK) && F_ISSET(dbc, DBC_RECOVER)) - || (!LF_ISSET(LCK_ALWAYS) && F_ISSET(dbc, DBC_OPD))) { - lockp->off = LOCK_INVALID; + if (CDB_LOCKING(dbenv) || + !LOCKING_ON(dbenv) || F_ISSET(dbc, DBC_COMPENSATE) || + (F_ISSET(dbc, DBC_RECOVER) && + (action != LCK_ROLLBACK || F_ISSET(dbenv, DB_ENV_REP_CLIENT))) || + (action != LCK_ALWAYS && F_ISSET(dbc, DBC_OPD))) { + LOCK_INIT(*lockp); return (0); } @@ -282,27 +379,73 @@ __db_lget(dbc, flags, pgno, mode, lkflags, lockp) if (DB_NONBLOCK(dbc)) lkflags |= DB_LOCK_NOWAIT; - /* - * If the object not currently locked, acquire the lock and return, - * otherwise, lock couple. - */ - if (LF_ISSET(LCK_COUPLE)) { - couple[0].op = DB_LOCK_GET; + if (F_ISSET(dbc, DBC_DIRTY_READ) && mode == DB_LOCK_READ) + mode = DB_LOCK_DIRTY; + + has_timeout = txn != NULL && F_ISSET(txn, TXN_LOCKTIMEOUT); + + switch (DB_PUT_ACTION(dbc, action, lockp)) { + case LCK_COUPLE: +lck_couple: couple[0].op = has_timeout? DB_LOCK_GET_TIMEOUT : DB_LOCK_GET; couple[0].obj = &dbc->lock_dbt; couple[0].mode = mode; - couple[1].op = DB_LOCK_PUT; - couple[1].lock = *lockp; + if (action == LCK_COUPLE_ALWAYS) + action = LCK_COUPLE; + UMRW_SET(couple[0].timeout); + if (has_timeout) + couple[0].timeout = txn->lock_timeout; + if (action == LCK_COUPLE) { + couple[1].op = DB_LOCK_PUT; + couple[1].lock = *lockp; + } - ret = lock_vec(dbenv, - dbc->locker, lkflags, couple, 2, &reqp); + ret = dbenv->lock_vec(dbenv, dbc->locker, + lkflags, couple, action == LCK_COUPLE ? 2 : 1, &reqp); if (ret == 0 || reqp == &couple[1]) *lockp = couple[0].lock; - } else { - ret = lock_get(dbenv, + break; + case LCK_DOWNGRADE: + if ((ret = dbenv->lock_downgrade( + dbenv, lockp, DB_LOCK_WWRITE, 0)) != 0) + return (ret); + /* FALL THROUGH */ + default: + if (has_timeout) + goto lck_couple; + ret = dbenv->lock_get(dbenv, dbc->locker, lkflags, &dbc->lock_dbt, mode, lockp); - - if (ret != 0) - lockp->off = LOCK_INVALID; + break; + } + + return (ret); +} + +/* + * __db_lput -- + * The standard lock put call. + * + * PUBLIC: int __db_lput __P((DBC *, DB_LOCK *)); + */ +int +__db_lput(dbc, lockp) + DBC *dbc; + DB_LOCK *lockp; +{ + DB_ENV *dbenv; + int ret; + + dbenv = dbc->dbp->dbenv; + + switch (DB_PUT_ACTION(dbc, LCK_COUPLE, lockp)) { + case LCK_COUPLE: + ret = dbenv->lock_put(dbenv, lockp); + break; + case LCK_DOWNGRADE: + ret = __lock_downgrade(dbenv, lockp, DB_LOCK_WWRITE, 0); + break; + default: + ret = 0; + break; } return (ret); diff --git a/bdb/db/db_method.c b/bdb/db/db_method.c index 01568a6e144..14712180df0 100644 --- a/bdb/db/db_method.c +++ b/bdb/db/db_method.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1999, 2000 + * Copyright (c) 1999-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_method.c,v 11.36 2000/12/21 09:17:04 krinsky Exp $"; +static const char revid[] = "$Id: db_method.c,v 11.78 2002/07/02 19:26:55 sue Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -21,50 +21,56 @@ static const char revid[] = "$Id: db_method.c,v 11.36 2000/12/21 09:17:04 krinsk #include #endif -#ifdef HAVE_RPC -#include "db_server.h" -#endif - #include "db_int.h" -#include "db_page.h" -#include "db_am.h" -#include "btree.h" -#include "hash.h" -#include "qam.h" -#include "xa.h" -#include "xa_ext.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/qam.h" +#include "dbinc/xa.h" +#include "dbinc_auto/xa_ext.h" +#include "dbinc/db_shash.h" +#include "dbinc/lock.h" #ifdef HAVE_RPC -#include "gen_client_ext.h" -#include "rpc_client_ext.h" +#include "dbinc_auto/db_server.h" +#include "dbinc_auto/rpc_client_ext.h" #endif -static int __db_get_byteswapped __P((DB *)); -static DBTYPE - __db_get_type __P((DB *)); +static int __db_get_byteswapped __P((DB *, int *)); +static int __db_get_type __P((DB *, DBTYPE *dbtype)); static int __db_init __P((DB *, u_int32_t)); static int __db_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, 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))); static int __db_set_cachesize __P((DB *, u_int32_t, u_int32_t, int)); +static int __db_set_cache_priority __P((DB *, DB_CACHE_PRIORITY)); static int __db_set_dup_compare __P((DB *, int (*)(DB *, const DBT *, const DBT *))); -static void __db_set_errcall __P((DB *, void (*)(const char *, char *))); -static void __db_set_errfile __P((DB *, FILE *)); +static int __db_set_encrypt __P((DB *, const char *, u_int32_t)); static int __db_set_feedback __P((DB *, void (*)(DB *, int, int))); static int __db_set_flags __P((DB *, u_int32_t)); -static int __db_set_lorder __P((DB *, int)); -static int __db_set_malloc __P((DB *, void *(*)(size_t))); static int __db_set_pagesize __P((DB *, u_int32_t)); -static int __db_set_realloc __P((DB *, void *(*)(void *, size_t))); -static void __db_set_errpfx __P((DB *, const char *)); static int __db_set_paniccall __P((DB *, void (*)(DB_ENV *, int))); +static void __db_set_errcall __P((DB *, void (*)(const char *, char *))); +static void __db_set_errfile __P((DB *, FILE *)); +static void __db_set_errpfx __P((DB *, const char *)); +static int __db_stat_fail __P((DB *, void *, u_int32_t)); 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. + * + * EXTERN: int db_create __P((DB **, DB_ENV *, u_int32_t)); */ int db_create(dbpp, dbenv, flags) @@ -102,27 +108,25 @@ db_create(dbpp, dbenv, flags) if ((ret = __os_calloc(dbenv, 1, sizeof(*dbp), &dbp)) != 0) return (ret); #ifdef HAVE_RPC - if (dbenv != NULL && dbenv->cl_handle != NULL) + if (dbenv != NULL && RPC_ON(dbenv)) ret = __dbcl_init(dbp, dbenv, flags); else #endif ret = __db_init(dbp, flags); if (ret != 0) { - __os_free(dbp, sizeof(*dbp)); + __os_free(dbenv, dbp); return (ret); } /* If we don't have an environment yet, allocate a local one. */ if (dbenv == NULL) { if ((ret = db_env_create(&dbenv, 0)) != 0) { - __os_free(dbp, sizeof(*dbp)); + __os_free(dbenv, dbp); return (ret); } - dbenv->dblocal_ref = 0; F_SET(dbenv, DB_ENV_DBLOCAL); } - if (F_ISSET(dbenv, DB_ENV_DBLOCAL)) - ++dbenv->dblocal_ref; + ++dbenv->db_ref; dbp->dbenv = dbenv; @@ -141,18 +145,21 @@ __db_init(dbp, flags) { int ret; - dbp->log_fileid = DB_LOGFILEID_INVALID; + dbp->lid = DB_LOCK_INVALIDID; + LOCK_INIT(dbp->handle_lock); TAILQ_INIT(&dbp->free_queue); TAILQ_INIT(&dbp->active_queue); TAILQ_INIT(&dbp->join_queue); + LIST_INIT(&dbp->s_secondaries); FLD_SET(dbp->am_ok, DB_OK_BTREE | DB_OK_HASH | DB_OK_QUEUE | DB_OK_RECNO); + dbp->associate = __db_associate; dbp->close = __db_close; dbp->cursor = __db_cursor; - dbp->del = NULL; /* !!! Must be set by access method. */ + dbp->del = __db_delete; dbp->err = __dbh_err; dbp->errx = __dbh_errx; dbp->fd = __db_fd; @@ -162,26 +169,30 @@ __db_init(dbp, flags) dbp->join = __db_join; dbp->key_range = __db_key_range; dbp->open = __db_open; + dbp->pget = __db_pget; dbp->put = __db_put; dbp->remove = __db_remove; dbp->rename = __db_rename; + dbp->truncate = __db_truncate; + dbp->set_alloc = __db_set_alloc; dbp->set_append_recno = __db_set_append_recno; dbp->set_cachesize = __db_set_cachesize; + dbp->set_cache_priority = __db_set_cache_priority; dbp->set_dup_compare = __db_set_dup_compare; + dbp->set_encrypt = __db_set_encrypt; dbp->set_errcall = __db_set_errcall; dbp->set_errfile = __db_set_errfile; dbp->set_errpfx = __db_set_errpfx; dbp->set_feedback = __db_set_feedback; dbp->set_flags = __db_set_flags; dbp->set_lorder = __db_set_lorder; - dbp->set_malloc = __db_set_malloc; dbp->set_pagesize = __db_set_pagesize; dbp->set_paniccall = __db_set_paniccall; - dbp->set_realloc = __db_set_realloc; - dbp->stat = NULL; /* !!! Must be set by access method. */ + dbp->stat = __db_stat_fail; dbp->sync = __db_sync; dbp->upgrade = __db_upgrade; dbp->verify = __db_verify; + /* Access method specific. */ if ((ret = __bam_db_create(dbp)) != 0) return (ret); @@ -244,16 +255,7 @@ __dbh_err(dbp, error, fmt, va_alist) va_dcl #endif { - va_list ap; - -#ifdef __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - __db_real_err(dbp->dbenv, error, 1, 1, fmt, ap); - - va_end(ap); + DB_REAL_ERR(dbp->dbenv, error, 1, 1, fmt); } /* @@ -270,16 +272,7 @@ __dbh_errx(dbp, fmt, va_alist) va_dcl #endif { - va_list ap; - -#ifdef __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - __db_real_err(dbp->dbenv, 0, 0, 1, fmt, ap); - - va_end(ap); + DB_REAL_ERR(dbp->dbenv, 0, 0, 1, fmt); } /* @@ -287,25 +280,29 @@ __dbh_errx(dbp, fmt, va_alist) * Return if database requires byte swapping. */ static int -__db_get_byteswapped(dbp) +__db_get_byteswapped(dbp, isswapped) DB *dbp; + int *isswapped; { DB_ILLEGAL_BEFORE_OPEN(dbp, "get_byteswapped"); - return (F_ISSET(dbp, DB_AM_SWAP) ? 1 : 0); + *isswapped = F_ISSET(dbp, DB_AM_SWAP) ? 1 : 0; + return (0); } /* * __db_get_type -- * Return type of underlying database. */ -static DBTYPE -__db_get_type(dbp) +static int +__db_get_type(dbp, dbtype) DB *dbp; + DBTYPE *dbtype; { DB_ILLEGAL_BEFORE_OPEN(dbp, "get_type"); - return (dbp->type); + *dbtype = dbp->type; + return (0); } /* @@ -365,6 +362,26 @@ __db_set_cachesize(dbp, cache_gbytes, cache_bytes, ncache) dbp->dbenv, cache_gbytes, cache_bytes, ncache)); } +/* + * __db_set_cache_priority -- + * Set cache priority for pages from this file. + */ +static int +__db_set_cache_priority(dbp, priority) + DB *dbp; + DB_CACHE_PRIORITY priority; +{ + /* + * If an underlying DB_MPOOLFILE exists, call it. Otherwise, save + * the information away until DB->open is called. + */ + if (dbp->mpf == NULL) { + dbp->priority = priority; + return (0); + } + return (dbp->mpf->set_priority(dbp->mpf, priority)); +} + /* * __db_set_dup_compare -- * Set duplicate comparison routine. @@ -374,14 +391,50 @@ __db_set_dup_compare(dbp, func) DB *dbp; int (*func) __P((DB *, const DBT *, const DBT *)); { + int ret; + DB_ILLEGAL_AFTER_OPEN(dbp, "dup_compare"); DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE | DB_OK_HASH); + if ((ret = dbp->set_flags(dbp, DB_DUPSORT)) != 0) + return (ret); + dbp->dup_compare = func; return (0); } +/* + * __db_set_encrypt -- + * Set database passwd. + */ +static int +__db_set_encrypt(dbp, passwd, flags) + DB *dbp; + const char *passwd; + u_int32_t flags; +{ + DB_CIPHER *db_cipher; + int ret; + + DB_ILLEGAL_IN_ENV(dbp, "set_encrypt"); + DB_ILLEGAL_AFTER_OPEN(dbp, "set_encrypt"); + + if ((ret = dbp->dbenv->set_encrypt(dbp->dbenv, passwd, flags)) != 0) + return (ret); + + /* + * In a real env, this gets initialized with the region. In a local + * env, we must do it here. + */ + db_cipher = (DB_CIPHER *)dbp->dbenv->crypto_handle; + if (!F_ISSET(db_cipher, CIPHER_ANY) && + (ret = db_cipher->init(dbp->dbenv, db_cipher)) != 0) + return (ret); + + return (dbp->set_flags(dbp, DB_ENCRYPT)); +} + static void __db_set_errcall(dbp, errcall) DB *dbp; @@ -430,6 +483,21 @@ __db_set_flags(dbp, flags) * * The queue access method takes no flags. */ + if (LF_ISSET(DB_ENCRYPT)) { + if (!CRYPTO_ON(dbp->dbenv)) { + __db_err(dbp->dbenv, + "Database environment not configured for encryption"); + return (EINVAL); + } + F_SET(dbp, DB_AM_ENCRYPT); + F_SET(dbp, DB_AM_CHKSUM); + LF_CLR(DB_ENCRYPT); + } + if (LF_ISSET(DB_CHKSUM_SHA1)) { + F_SET(dbp, DB_AM_CHKSUM); + LF_CLR(DB_CHKSUM_SHA1); + } + if ((ret = __bam_set_flags(dbp, &flags)) != 0) return (ret); if ((ret = __ram_set_flags(dbp, &flags)) != 0) @@ -438,7 +506,13 @@ __db_set_flags(dbp, flags) return (flags == 0 ? 0 : __db_ferr(dbp->dbenv, "DB->set_flags", 0)); } -static int +/* + * __db_set_lorder -- + * Set whether lorder is swapped or not. + * + * PUBLIC: int __db_set_lorder __P((DB *, int)); + */ +int __db_set_lorder(dbp, db_lorder) DB *dbp; int db_lorder; @@ -463,14 +537,17 @@ __db_set_lorder(dbp, db_lorder) } static int -__db_set_malloc(dbp, func) +__db_set_alloc(dbp, mal_func, real_func, free_func) DB *dbp; - void *(*func) __P((size_t)); + void *(*mal_func) __P((size_t)); + void *(*real_func) __P((void *, size_t)); + void (*free_func) __P((void *)); { - DB_ILLEGAL_AFTER_OPEN(dbp, "set_malloc"); + DB_ILLEGAL_IN_ENV(dbp, "set_alloc"); + DB_ILLEGAL_AFTER_OPEN(dbp, "set_alloc"); - dbp->db_malloc = func; - return (0); + return (dbp->dbenv->set_alloc(dbp->dbenv, + mal_func, real_func, free_func)); } static int @@ -495,7 +572,7 @@ __db_set_pagesize(dbp, db_pagesize) * We don't want anything that's not a power-of-2, as we rely on that * for alignment of various types on the pages. */ - if ((u_int32_t)1 << __db_log2(db_pagesize) != db_pagesize) { + if (!POWER_OF_TWO(db_pagesize)) { __db_err(dbp->dbenv, "page sizes must be a power-of-2"); return (EINVAL); } @@ -510,17 +587,6 @@ __db_set_pagesize(dbp, db_pagesize) return (0); } -static int -__db_set_realloc(dbp, func) - DB *dbp; - void *(*func) __P((void *, size_t)); -{ - DB_ILLEGAL_AFTER_OPEN(dbp, "set_realloc"); - - dbp->db_realloc = func; - return (0); -} - static int __db_set_paniccall(dbp, paniccall) DB *dbp; @@ -529,26 +595,37 @@ __db_set_paniccall(dbp, paniccall) return (dbp->dbenv->set_paniccall(dbp->dbenv, paniccall)); } +static int +__db_stat_fail(dbp, sp, flags) + DB *dbp; + void *sp; + u_int32_t flags; +{ + COMPQUIET(sp, NULL); + COMPQUIET(flags, 0); + + /* + * DB->stat isn't initialized until the actual DB->open call, + * but we don't want to core dump. + */ + PANIC_CHECK(dbp->dbenv); + DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->stat"); + + /* NOTREACHED */ + return (EINVAL); +} + #ifdef HAVE_RPC /* * __dbcl_init -- * Initialize a DB structure on the server. - * - * PUBLIC: #ifdef HAVE_RPC - * PUBLIC: int __dbcl_init __P((DB *, DB_ENV *, u_int32_t)); - * PUBLIC: #endif */ -int +static int __dbcl_init(dbp, dbenv, flags) DB *dbp; DB_ENV *dbenv; u_int32_t flags; { - CLIENT *cl; - __db_create_reply *replyp; - __db_create_msg req; - int ret; - TAILQ_INIT(&dbp->free_queue); TAILQ_INIT(&dbp->active_queue); /* !!! @@ -556,6 +633,7 @@ __dbcl_init(dbp, dbenv, flags) * 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; @@ -563,31 +641,34 @@ __dbcl_init(dbp, dbenv, flags) dbp->errx = __dbh_errx; dbp->fd = __dbcl_db_fd; dbp->get = __dbcl_db_get; - dbp->get_byteswapped = __dbcl_db_swapped; + dbp->get_byteswapped = __db_get_byteswapped; dbp->get_type = __db_get_type; dbp->join = __dbcl_db_join; dbp->key_range = __dbcl_db_key_range; - dbp->open = __dbcl_db_open; + 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->set_cachesize = __dbcl_db_cachesize; - dbp->set_dup_compare = NULL; + dbp->set_cache_priority = __dbcl_db_cache_priority; + dbp->set_dup_compare = __dbcl_db_dup_compare; + dbp->set_encrypt = __dbcl_db_encrypt; dbp->set_errcall = __db_set_errcall; dbp->set_errfile = __db_set_errfile; dbp->set_errpfx = __db_set_errpfx; dbp->set_feedback = __dbcl_db_feedback; dbp->set_flags = __dbcl_db_flags; dbp->set_lorder = __dbcl_db_lorder; - dbp->set_malloc = __dbcl_db_malloc; dbp->set_pagesize = __dbcl_db_pagesize; dbp->set_paniccall = __dbcl_db_panic; - dbp->set_q_extentsize = __dbcl_db_extentsize; - dbp->set_realloc = __dbcl_db_realloc; 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. @@ -599,31 +680,12 @@ __dbcl_init(dbp, dbenv, flags) dbp->set_h_ffactor = __dbcl_db_h_ffactor; dbp->set_h_hash = __dbcl_db_h_hash; dbp->set_h_nelem = __dbcl_db_h_nelem; + dbp->set_q_extentsize = __dbcl_db_extentsize; dbp->set_re_delim = __dbcl_db_re_delim; dbp->set_re_len = __dbcl_db_re_len; dbp->set_re_pad = __dbcl_db_re_pad; dbp->set_re_source = __dbcl_db_re_source; -/* - dbp->set_q_extentsize = __dbcl_db_q_extentsize; -*/ - cl = (CLIENT *)dbenv->cl_handle; - req.flags = flags; - req.envpcl_id = dbenv->cl_id; - - /* - * CALL THE SERVER - */ - replyp = __db_db_create_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - return (DB_NOSERVER); - } - - if ((ret = replyp->status) != 0) - return (ret); - - dbp->cl_id = replyp->dbpcl_id; - return (0); + return (__dbcl_db_create(dbp, dbenv, flags)); } #endif diff --git a/bdb/db/db_open.c b/bdb/db/db_open.c new file mode 100644 index 00000000000..f6f96cda547 --- /dev/null +++ b/bdb/db/db_open.c @@ -0,0 +1,705 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: db_open.c,v 11.215 2002/08/15 15:27:52 bostic Exp $"; +#endif /* not lint */ + +#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/db_swap.h" +#include "dbinc/btree.h" +#include "dbinc/crypto.h" +#include "dbinc/hmac.h" +#include "dbinc/fop.h" +#include "dbinc/hash.h" +#include "dbinc/lock.h" +#include "dbinc/log.h" +#include "dbinc/qam.h" +#include "dbinc/txn.h" + +static int __db_openchk __P((DB *, + DB_TXN *, const char *, const char *, DBTYPE, u_int32_t)); + +/* + * __db_open -- + * Main library interface to the DB access methods. + * + * PUBLIC: int __db_open __P((DB *, DB_TXN *, + * PUBLIC: const char *, const char *, DBTYPE, u_int32_t, int)); + */ +int +__db_open(dbp, txn, name, subdb, type, flags, mode) + DB *dbp; + DB_TXN *txn; + const char *name, *subdb; + DBTYPE type; + u_int32_t flags; + int mode; +{ + DB_ENV *dbenv; + int remove_master, remove_me, ret, t_ret, txn_local; + + dbenv = dbp->dbenv; + remove_me = remove_master = txn_local = 0; + + PANIC_CHECK(dbenv); + + if ((ret = __db_openchk(dbp, txn, name, subdb, type, flags)) != 0) + return (ret); + + /* + * Create local transaction as necessary, check for consistent + * transaction usage. + */ + if (IS_AUTO_COMMIT(dbenv, txn, flags)) { + if ((ret = __db_txn_auto(dbp, &txn)) != 0) + return (ret); + txn_local = 1; + } else + if (txn != NULL && !TXN_ON(dbenv)) + return (__db_not_txn_env(dbenv)); + + /* + * If the environment was configured with threads, the DB handle + * must also be free-threaded, so we force the DB_THREAD flag on. + * (See SR #2033 for why this is a requirement--recovery needs + * to be able to grab a dbp using __db_fileid_to_dbp, and it has + * no way of knowing which dbp goes with which thread, so whichever + * one it finds has to be usable in any of them.) + */ + if (F_ISSET(dbenv, DB_ENV_THREAD)) + LF_SET(DB_THREAD); + + /* 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); + + /* Fill in the type. */ + dbp->type = type; + + /* + * If we're opening a subdatabase, we have to open (and potentially + * create) the main database, and then get (and potentially store) + * our base page number in that database. Then, we can finally open + * the subdatabase. + */ + if ((ret = __db_dbopen( + dbp, txn, name, subdb, flags, mode, PGNO_BASE_MD)) != 0) + goto err; + + /* + * You can open the database that describes the subdatabases in the + * rest of the file read-only. The content of each key's data is + * unspecified and applications should never be adding new records + * or updating existing records. However, during recovery, we need + * to open these databases R/W so we can redo/undo changes in them. + * Likewise, we need to open master databases read/write during + * rename and remove so we can be sure they're fully sync'ed, so + * we provide an override flag for the purpose. + */ + if (subdb == NULL && !IS_RECOVERING(dbenv) && !LF_ISSET(DB_RDONLY) && + !LF_ISSET(DB_RDWRMASTER) && F_ISSET(dbp, DB_AM_SUBDB)) { + __db_err(dbenv, + "files containing multiple databases may only be opened read-only"); + ret = EINVAL; + goto err; + } + +err: /* If we were successful, don't discard the file on close. */ + if (ret == 0) + /* If we were successful, don't discard the file on close. */ + F_CLR(dbp, DB_AM_DISCARD | DB_AM_CREATED | DB_AM_CREATED_MSTR); + else { + /* + * If we are not transactional, we need to remove the + * databases/subdatabases. If we are transactional, then + * the abort of the child transaction should take care of + * cleaning them up. + */ + remove_me = txn == NULL && F_ISSET(dbp, DB_AM_CREATED); + remove_master = txn == NULL && F_ISSET(dbp, DB_AM_CREATED_MSTR); + + /* + * If we had an error, it may have happened before or after + * we actually logged the open. If it happened before, then + * abort won't know anything about it and won't close or + * refresh the dbp, so we need to do it explicitly. + */ + (void)__db_refresh(dbp, txn, DB_NOSYNC); + } + + /* Remove anyone we created. */ + if (remove_master || (subdb == NULL && remove_me)) + /* Remove file. */ + (void)dbenv->dbremove(dbenv, txn, name, NULL, 0); + else if (remove_me) + /* Remove subdatabase. */ + (void)dbenv->dbremove(dbenv, txn, name, subdb, 0); + + /* Commit for DB_AUTO_COMMIT. */ + if (txn_local) { + if (ret == 0) + ret = txn->commit(txn, 0); + else + if ((t_ret = txn->abort(txn)) != 0) + ret = __db_panic(dbenv, t_ret); + } + + return (ret); +} + +/* + * __db_dbopen -- + * Open a database. This routine gets called in three different ways. + * 1. It can be called to open a file/database. In this case, subdb will + * be NULL and meta_pgno will be PGNO_BASE_MD. + * 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_BAS_MD (also PGNO_INVALID). + * 3. It can be called during recovery to open a subdatabase in which case + * name will be non-NULL, subname mqy be NULL and meta-pgno will be + * a valid pgno (i.e., not PGNO_BASE_MD). + * + * PUBLIC: int __db_dbopen __P((DB *, DB_TXN *, + * PUBLIC: const char *, const char *, u_int32_t, int, db_pgno_t)); + */ +int +__db_dbopen(dbp, txn, name, subdb, flags, mode, meta_pgno) + DB *dbp; + DB_TXN *txn; + const char *name, *subdb; + u_int32_t flags; + int mode; + db_pgno_t meta_pgno; +{ + DB_ENV *dbenv; + int ret; + u_int32_t id; + + dbenv = dbp->dbenv; + id = TXN_INVALID; + if (txn != NULL) + F_SET(dbp, DB_AM_TXN); + + DB_TEST_RECOVERY(dbp, DB_TEST_PREOPEN, ret, name); + /* + * If name 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 (name == NULL) { + F_SET(dbp, DB_AM_INMEM); + + if (dbp->type == DB_UNKNOWN) { + __db_err(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 = dbenv->lock_id(dbenv, + (u_int32_t *)dbp->fileid)) != 0) + return (ret); + } else if (subdb == NULL && meta_pgno == PGNO_BASE_MD) { + /* Open/create the underlying file. Acquire locks. */ + if ((ret = + __fop_file_setup(dbp, txn, name, mode, flags, &id)) != 0) + return (ret); + } else { + if ((ret = __fop_subdb_setup(dbp, + txn, name, subdb, mode, flags)) != 0) + return (ret); + meta_pgno = dbp->meta_pgno; + } + + /* + * If we created the file, set the truncate flag for the mpool. This + * isn't for anything we've done, it's protection against stupid user + * tricks: if the user deleted a file behind Berkeley DB's back, we + * may still have pages in the mpool that match the file's "unique" ID. + * + * Note that if we're opening a subdatabase, we don't want to set + * the TRUNCATE flag even if we just created the file--we already + * opened and updated the master using access method interfaces, + * so we don't want to get rid of any pages that are in the mpool. + * If we created the file when we opened the master, we already hit + * this check in a non-subdb context then. + */ + if (subdb == NULL && F_ISSET(dbp, DB_AM_CREATED)) + LF_SET(DB_TRUNCATE); + + /* Set up the underlying environment. */ + if ((ret = __db_dbenv_setup(dbp, txn, name, 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 (name == NULL && (ret = __db_new_file(dbp, txn, NULL, NULL)) != 0) + return (ret); + + switch (dbp->type) { + case DB_BTREE: + ret = __bam_open(dbp, txn, name, meta_pgno, flags); + break; + case DB_HASH: + ret = __ham_open(dbp, txn, name, meta_pgno, flags); + break; + case DB_RECNO: + ret = __ram_open(dbp, txn, name, meta_pgno, flags); + break; + case DB_QUEUE: + ret = __qam_open(dbp, txn, name, meta_pgno, mode, flags); + break; + case DB_UNKNOWN: + return (__db_unknown_type(dbenv, "__db_dbopen", dbp->type)); + } + if (ret != 0) + goto err; + + DB_TEST_RECOVERY(dbp, DB_TEST_POSTOPEN, ret, name); + + /* + * Unnamed 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) && + name != NULL && LOCK_ISSET(dbp->handle_lock)) { + if (txn != NULL) { + ret = __txn_lockevent(dbenv, + txn, dbp, &dbp->handle_lock, dbp->lid); + } else if (LOCKING_ON(dbenv)) + /* Trade write handle lock for read handle lock. */ + ret = __lock_downgrade(dbenv, + &dbp->handle_lock, DB_LOCK_READ, 0); + } +DB_TEST_RECOVERY_LABEL +err: + return (ret); +} + +/* + * __db_new_file -- + * Create a new database file. + * + * PUBLIC: int __db_new_file __P((DB *, DB_TXN *, DB_FH *, const char *)); + */ +int +__db_new_file(dbp, txn, fhp, name) + DB *dbp; + DB_TXN *txn; + DB_FH *fhp; + const char *name; +{ + int ret; + + switch (dbp->type) { + case DB_BTREE: + case DB_RECNO: + ret = __bam_new_file(dbp, txn, fhp, name); + break; + case DB_HASH: + ret = __ham_new_file(dbp, txn, fhp, name); + break; + case DB_QUEUE: + ret = __qam_new_file(dbp, txn, fhp, name); + break; + default: + __db_err(dbp->dbenv, + "%s: Invalid type %d specified", name, dbp->type); + ret = EINVAL; + break; + } + + DB_TEST_RECOVERY(dbp, DB_TEST_POSTLOGMETA, ret, name); + /* Sync the file in preparation for moving it into place. */ + if (ret == 0 && fhp != NULL) + ret = __os_fsync(dbp->dbenv, fhp); + + DB_TEST_RECOVERY(dbp, DB_TEST_POSTSYNC, ret, name); + +DB_TEST_RECOVERY_LABEL + return (ret); +} + +/* + * __db_init_subdb -- + * Initialize the dbp for a subdb. + * + * PUBLIC: int __db_init_subdb __P((DB *, DB *, const char *, DB_TXN *)); + */ +int +__db_init_subdb(mdbp, dbp, name, txn) + DB *mdbp, *dbp; + const char *name; + DB_TXN *txn; +{ + DBMETA *meta; + DB_MPOOLFILE *mpf; + int ret, t_ret; + + ret = 0; + if (!F_ISSET(dbp, DB_AM_CREATED)) { + /* Subdb exists; read meta-data page and initialize. */ + mpf = mdbp->mpf; + if ((ret = mpf->get(mpf, &dbp->meta_pgno, 0, &meta)) != 0) + goto err; + ret = __db_meta_setup(mdbp->dbenv, dbp, name, meta, 0, 0); + if ((t_ret = mpf->put(mpf, meta, 0)) != 0 && ret == 0) + ret = t_ret; + /* + * If __db_meta_setup found that the meta-page hadn't + * been written out during recovery, we can just return. + */ + if (ret == ENOENT) + ret = 0; + goto err; + } + + /* Handle the create case here. */ + switch (dbp->type) { + case DB_BTREE: + case DB_RECNO: + ret = __bam_new_subdb(mdbp, dbp, txn); + break; + case DB_HASH: + ret = __ham_new_subdb(mdbp, dbp, txn); + break; + case DB_QUEUE: + ret = EINVAL; + break; + default: + __db_err(dbp->dbenv, + "Invalid subdatabase type %d specified", dbp->type); + return (EINVAL); + } + +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. + * + * Return 0 on success, >0 (errno) on error, -1 on checksum mismatch. + * + * PUBLIC: int __db_chk_meta __P((DB_ENV *, DB *, DBMETA *, int)); + */ +int +__db_chk_meta(dbenv, dbp, meta, do_metachk) + DB_ENV *dbenv; + DB *dbp; + DBMETA *meta; + int do_metachk; +{ + int is_hmac, ret; + u_int8_t *chksum; + + ret = 0; + + if (FLD_ISSET(meta->metaflags, DBMETA_CHKSUM)) { + if (dbp != NULL) + F_SET(dbp, DB_AM_CHKSUM); + + is_hmac = meta->encrypt_alg == 0 ? 0 : 1; + chksum = ((BTMETA *)meta)->chksum; + if (do_metachk && ((ret = __db_check_chksum(dbenv, + (DB_CIPHER *)dbenv->crypto_handle, chksum, meta, + DBMETASIZE, is_hmac)) != 0)) + return (ret); + } + +#ifdef HAVE_CRYPTO + ret = __crypto_decrypt_meta(dbenv, dbp, (u_int8_t *)meta, do_metachk); +#endif + return (ret); +} + +/* + * __db_meta_setup -- + * + * Take a buffer containing a meta-data page and figure out if it's + * valid, and if so, initialize the dbp from the meta-data page. + * + * PUBLIC: int __db_meta_setup __P((DB_ENV *, + * PUBLIC: DB *, const char *, DBMETA *, u_int32_t, int)); + */ +int +__db_meta_setup(dbenv, dbp, name, meta, oflags, do_metachk) + DB_ENV *dbenv; + DB *dbp; + const char *name; + DBMETA *meta; + u_int32_t oflags; + int do_metachk; +{ + u_int32_t flags, magic; + int ret; + + ret = 0; + + /* + * Figure out what access method we're dealing with, and then + * call access method specific code to check error conditions + * based on conflicts between the found file and application + * arguments. A found file overrides some user information -- + * 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); + magic = meta->magic; + +swap_retry: + switch (magic) { + case DB_BTREEMAGIC: + case DB_HASHMAGIC: + case DB_QAMMAGIC: + case DB_RENAMEMAGIC: + break; + case 0: + /* + * The only time this should be 0 is if we're in the + * midst of opening a subdb during recovery and that + * subdatabase had its meta-data page allocated, but + * not yet initialized. + */ + if (F_ISSET(dbp, DB_AM_SUBDB) && ((IS_RECOVERING(dbenv) && + F_ISSET((DB_LOG *) dbenv->lg_handle, DBLOG_FORCE_OPEN)) || + meta->pgno != PGNO_INVALID)) + return (ENOENT); + + goto bad_format; + default: + if (F_ISSET(dbp, DB_AM_SWAP)) + goto bad_format; + + M_32_SWAP(magic); + F_SET(dbp, DB_AM_SWAP); + goto swap_retry; + } + + /* + * We can only check the meta page if we are sure we have a meta page. + * If it is random data, then this check can fail. So only now can we + * checksum and decrypt. Don't distinguish between configuration and + * checksum match errors here, because we haven't opened the database + * and even a checksum error isn't a reason to panic the environment. + */ + if ((ret = __db_chk_meta(dbenv, dbp, meta, do_metachk)) != 0) { + if (ret == -1) { + __db_err(dbenv, + "%s: metadata page checksum error", name); + ret = EINVAL; + } + goto bad_format; + } + + switch (magic) { + case DB_BTREEMAGIC: + flags = meta->flags; + if (F_ISSET(dbp, DB_AM_SWAP)) + M_32_SWAP(flags); + if (LF_ISSET(BTM_RECNO)) + dbp->type = DB_RECNO; + else + dbp->type = DB_BTREE; + if ((oflags & DB_TRUNCATE) == 0 && (ret = + __bam_metachk(dbp, name, (BTMETA *)meta)) != 0) + return (ret); + break; + case DB_HASHMAGIC: + dbp->type = DB_HASH; + if ((oflags & DB_TRUNCATE) == 0 && (ret = + __ham_metachk(dbp, name, (HMETA *)meta)) != 0) + return (ret); + break; + case DB_QAMMAGIC: + dbp->type = DB_QUEUE; + if ((oflags & DB_TRUNCATE) == 0 && (ret = + __qam_metachk(dbp, name, (QMETA *)meta)) != 0) + return (ret); + break; + case DB_RENAMEMAGIC: + F_SET(dbp, DB_AM_IN_RENAME); + break; + } + return (0); + +bad_format: + __db_err(dbenv, "%s: unexpected file type or format", name); + return (ret); +} + +/* + * __db_openchk -- + * Interface error checking for open calls. + */ +static int +__db_openchk(dbp, txn, name, subdb, type, flags) + DB *dbp; + DB_TXN *txn; + const char *name, *subdb; + DBTYPE type; + u_int32_t flags; +{ + DB_ENV *dbenv; + int ret; + u_int32_t ok_flags; + + dbenv = dbp->dbenv; + + /* Validate arguments. */ +#define OKFLAGS \ + (DB_AUTO_COMMIT | DB_CREATE | DB_DIRTY_READ | DB_EXCL | \ + DB_FCNTL_LOCKING | DB_NOMMAP | DB_RDONLY | DB_RDWRMASTER | \ + 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)) + return (__db_ferr(dbenv, "DB->open", 1)); + if (LF_ISSET(DB_RDONLY) && LF_ISSET(DB_CREATE)) + return (__db_ferr(dbenv, "DB->open", 1)); + +#ifdef HAVE_VXWORKS + if (LF_ISSET(DB_TRUNCATE)) { + __db_err(dbenv, "DB_TRUNCATE unsupported in VxWorks"); + return (__db_eopnotsup(dbenv)); + } +#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", + name); + return (EINVAL); + } + ok_flags = 0; + break; + case DB_BTREE: + ok_flags = DB_OK_BTREE; + break; + case DB_HASH: + ok_flags = DB_OK_HASH; + break; + case DB_QUEUE: + ok_flags = DB_OK_QUEUE; + break; + case DB_RECNO: + ok_flags = DB_OK_RECNO; + break; + default: + __db_err(dbenv, "unknown type: %lu", (u_long)type); + return (EINVAL); + } + if (ok_flags) + DB_ILLEGAL_METHOD(dbp, ok_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"); + return (EINVAL); + } + + /* + * Historically, you could pass in an environment that didn't have a + * mpool, and DB would create a private one behind the scenes. This + * no longer works. + */ + if (!F_ISSET(dbenv, DB_ENV_DBLOCAL) && !MPOOL_ON(dbenv)) { + __db_err(dbenv, "environment did not include a memory pool"); + return (EINVAL); + } + + /* + * You can't specify threads during DB->open if subsystems in the + * environment weren't configured with them. + */ + if (LF_ISSET(DB_THREAD) && + !F_ISSET(dbenv, DB_ENV_DBLOCAL | DB_ENV_THREAD)) { + __db_err(dbenv, "environment not created using DB_THREAD"); + return (EINVAL); + } + + /* DB_TRUNCATE is not transaction recoverable. */ + if (LF_ISSET(DB_TRUNCATE) && txn != NULL) { + __db_err(dbenv, + "DB_TRUNCATE illegal with transaction specified"); + return (EINVAL); + } + + /* Subdatabase checks. */ + if (subdb != NULL) { + /* Subdatabases must be created in named files. */ + if (name == NULL) { + __db_err(dbenv, + "multiple databases cannot be created in temporary files"); + return (EINVAL); + } + + /* Truncate is a physical file operation */ + if (LF_ISSET(DB_TRUNCATE)) { + __db_err(dbenv, + "DB_TRUNCATE illegal with multiple databases"); + 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); + } + } + + return (0); +} diff --git a/bdb/db/db_overflow.c b/bdb/db/db_overflow.c index 54f0a03aafe..27dcb41a2ff 100644 --- a/bdb/db/db_overflow.c +++ b/bdb/db/db_overflow.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -43,7 +43,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_overflow.c,v 11.21 2000/11/30 00:58:32 ubell Exp $"; +static const char revid[] = "$Id: db_overflow.c,v 11.46 2002/08/08 03:57:48 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -53,9 +53,9 @@ static const char revid[] = "$Id: db_overflow.c,v 11.21 2000/11/30 00:58:32 ubel #endif #include "db_int.h" -#include "db_page.h" -#include "db_am.h" -#include "db_verify.h" +#include "dbinc/db_page.h" +#include "dbinc/db_am.h" +#include "dbinc/db_verify.h" /* * Big key/data code. @@ -83,6 +83,7 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz) u_int32_t *bpsz; { DB_ENV *dbenv; + DB_MPOOLFILE *mpf; PAGE *h; db_indx_t bytes; u_int32_t curoff, needed, start; @@ -90,6 +91,7 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz) int ret; dbenv = dbp->dbenv; + mpf = dbp->mpf; /* * Check if the buffer is big enough; if it is not and we are @@ -99,7 +101,12 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz) */ if (F_ISSET(dbt, DB_DBT_PARTIAL)) { start = dbt->doff; - needed = dbt->dlen; + if (start > tlen) + needed = 0; + else if (dbt->dlen > tlen - start) + needed = tlen - start; + else + needed = dbt->dlen; } else { start = 0; needed = tlen; @@ -112,15 +119,13 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz) return (ENOMEM); } } else if (F_ISSET(dbt, DB_DBT_MALLOC)) { - if ((ret = __os_malloc(dbenv, - needed, dbp->db_malloc, &dbt->data)) != 0) + if ((ret = __os_umalloc(dbenv, needed, &dbt->data)) != 0) return (ret); } else if (F_ISSET(dbt, DB_DBT_REALLOC)) { - if ((ret = __os_realloc(dbenv, - needed, dbp->db_realloc, &dbt->data)) != 0) + if ((ret = __os_urealloc(dbenv, needed, &dbt->data)) != 0) return (ret); } else if (*bpsz == 0 || *bpsz < needed) { - if ((ret = __os_realloc(dbenv, needed, NULL, bpp)) != 0) + if ((ret = __os_realloc(dbenv, needed, bpp)) != 0) return (ret); *bpsz = needed; dbt->data = *bpp; @@ -133,13 +138,12 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz) */ dbt->size = needed; for (curoff = 0, p = dbt->data; pgno != PGNO_INVALID && needed > 0;) { - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) { - (void)__db_pgerr(dbp, pgno); + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) return (ret); - } + /* Check if we need any bytes from this page. */ if (curoff + OV_LEN(h) >= start) { - src = (u_int8_t *)h + P_OVERHEAD; + src = (u_int8_t *)h + P_OVERHEAD(dbp); bytes = OV_LEN(h); if (start > curoff) { src += start - curoff; @@ -153,7 +157,7 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz) } curoff += OV_LEN(h); pgno = h->next_pgno; - memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); } return (0); } @@ -171,13 +175,14 @@ __db_poff(dbc, dbt, pgnop) db_pgno_t *pgnop; { DB *dbp; - PAGE *pagep, *lastp; - DB_LSN new_lsn, null_lsn; DBT tmp_dbt; + DB_LSN new_lsn, null_lsn; + DB_MPOOLFILE *mpf; + PAGE *pagep, *lastp; db_indx_t pagespace; u_int32_t sz; u_int8_t *p; - int ret; + int ret, t_ret; /* * Allocate pages and copy the key/data item into them. Calculate the @@ -185,8 +190,10 @@ __db_poff(dbc, dbt, pgnop) * item. */ dbp = dbc->dbp; - pagespace = P_MAXSPACE(dbp->pgsize); + mpf = dbp->mpf; + pagespace = P_MAXSPACE(dbp, dbp->pgsize); + ret = 0; lastp = NULL; for (p = dbt->data, sz = dbt->size; sz > 0; p += pagespace, sz -= pagespace) { @@ -203,30 +210,36 @@ __db_poff(dbc, dbt, pgnop) * have a partial record. */ if ((ret = __db_new(dbc, P_OVERFLOW, &pagep)) != 0) - return (ret); - if (DB_LOGGING(dbc)) { + break; + if (DBC_LOGGING(dbc)) { tmp_dbt.data = p; tmp_dbt.size = pagespace; ZERO_LSN(null_lsn); - if ((ret = __db_big_log(dbp->dbenv, dbc->txn, - &new_lsn, 0, DB_ADD_BIG, dbp->log_fileid, - PGNO(pagep), lastp ? PGNO(lastp) : PGNO_INVALID, + if ((ret = __db_big_log(dbp, dbc->txn, + &new_lsn, 0, DB_ADD_BIG, PGNO(pagep), + lastp ? PGNO(lastp) : PGNO_INVALID, PGNO_INVALID, &tmp_dbt, &LSN(pagep), lastp == NULL ? &null_lsn : &LSN(lastp), - &null_lsn)) != 0) - return (ret); + &null_lsn)) != 0) { + if (lastp != NULL) + (void)mpf->put(mpf, + lastp, DB_MPOOL_DIRTY); + lastp = pagep; + break; + } + } else + LSN_NOT_LOGGED(new_lsn); - /* Move lsn onto page. */ - if (lastp) - LSN(lastp) = new_lsn; - LSN(pagep) = new_lsn; - } + /* Move LSN onto page. */ + if (lastp != NULL) + 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, p, pagespace); + memcpy((u_int8_t *)pagep + P_OVERHEAD(dbp), p, pagespace); /* * If this is the first entry, update the user's info. @@ -238,12 +251,14 @@ __db_poff(dbc, dbt, pgnop) else { lastp->next_pgno = PGNO(pagep); pagep->prev_pgno = PGNO(lastp); - (void)memp_fput(dbp->mpf, lastp, DB_MPOOL_DIRTY); + (void)mpf->put(mpf, lastp, DB_MPOOL_DIRTY); } lastp = pagep; } - (void)memp_fput(dbp->mpf, lastp, DB_MPOOL_DIRTY); - return (0); + if (lastp != NULL && + (t_ret = mpf->put(mpf, lastp, DB_MPOOL_DIRTY)) != 0 && ret == 0) + ret = t_ret; + return (ret); } /* @@ -259,23 +274,29 @@ __db_ovref(dbc, pgno, adjust) int32_t adjust; { DB *dbp; + DB_MPOOLFILE *mpf; PAGE *h; int ret; dbp = dbc->dbp; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) { - (void)__db_pgerr(dbp, pgno); + mpf = dbp->mpf; + + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) { + __db_pgerr(dbp, pgno, ret); return (ret); } - if (DB_LOGGING(dbc)) - if ((ret = __db_ovref_log(dbp->dbenv, dbc->txn, - &LSN(h), 0, dbp->log_fileid, h->pgno, adjust, - &LSN(h))) != 0) + if (DBC_LOGGING(dbc)) { + if ((ret = __db_ovref_log(dbp, + dbc->txn, &LSN(h), 0, h->pgno, adjust, &LSN(h))) != 0) { + (void)mpf->put(mpf, h, 0); return (ret); + } + } else + LSN_NOT_LOGGED(LSN(h)); OV_REF(h) += adjust; - (void)memp_fput(dbp->mpf, h, DB_MPOOL_DIRTY); + (void)mpf->put(mpf, h, DB_MPOOL_DIRTY); return (0); } @@ -293,13 +314,16 @@ __db_doff(dbc, pgno) DB *dbp; PAGE *pagep; DB_LSN null_lsn; + DB_MPOOLFILE *mpf; DBT tmp_dbt; int ret; dbp = dbc->dbp; + mpf = dbp->mpf; + do { - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &pagep)) != 0) { - (void)__db_pgerr(dbp, pgno); + if ((ret = mpf->get(mpf, &pgno, 0, &pagep)) != 0) { + __db_pgerr(dbp, pgno, ret); return (ret); } @@ -309,20 +333,24 @@ __db_doff(dbc, pgno) * decrement the reference count and return. */ if (OV_REF(pagep) > 1) { - (void)memp_fput(dbp->mpf, pagep, 0); + (void)mpf->put(mpf, pagep, 0); return (__db_ovref(dbc, pgno, -1)); } - if (DB_LOGGING(dbc)) { - tmp_dbt.data = (u_int8_t *)pagep + P_OVERHEAD; + if (DBC_LOGGING(dbc)) { + tmp_dbt.data = (u_int8_t *)pagep + P_OVERHEAD(dbp); tmp_dbt.size = OV_LEN(pagep); ZERO_LSN(null_lsn); - if ((ret = __db_big_log(dbp->dbenv, dbc->txn, - &LSN(pagep), 0, DB_REM_BIG, dbp->log_fileid, - PGNO(pagep), PREV_PGNO(pagep), NEXT_PGNO(pagep), - &tmp_dbt, &LSN(pagep), &null_lsn, &null_lsn)) != 0) + if ((ret = __db_big_log(dbp, dbc->txn, + &LSN(pagep), 0, DB_REM_BIG, + PGNO(pagep), PREV_PGNO(pagep), + NEXT_PGNO(pagep), &tmp_dbt, + &LSN(pagep), &null_lsn, &null_lsn)) != 0) { + (void)mpf->put(mpf, pagep, 0); return (ret); - } + } + } else + LSN_NOT_LOGGED(LSN(pagep)); pgno = pagep->next_pgno; if ((ret = __db_free(dbc, pagep)) != 0) return (ret); @@ -352,13 +380,16 @@ __db_moff(dbp, dbt, pgno, tlen, cmpfunc, cmpp) u_int32_t tlen; int (*cmpfunc) __P((DB *, const DBT *, const DBT *)), *cmpp; { - PAGE *pagep; DBT local_dbt; + DB_MPOOLFILE *mpf; + PAGE *pagep; void *buf; u_int32_t bufsize, cmp_bytes, key_left; u_int8_t *p1, *p2; int ret; + mpf = dbp->mpf; + /* * If there is a user-specified comparison function, build a * contiguous copy of the key, and call it. @@ -373,27 +404,27 @@ __db_moff(dbp, dbt, pgno, tlen, cmpfunc, cmpp) return (ret); /* Pass the key as the first argument */ *cmpp = cmpfunc(dbp, dbt, &local_dbt); - __os_free(buf, bufsize); + __os_free(dbp->dbenv, buf); return (0); } /* 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(dbp->mpf, &pgno, 0, &pagep)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &pagep)) != 0) return (ret); cmp_bytes = OV_LEN(pagep) < key_left ? OV_LEN(pagep) : key_left; tlen -= cmp_bytes; key_left -= cmp_bytes; - for (p2 = - (u_int8_t *)pagep + P_OVERHEAD; cmp_bytes-- > 0; ++p1, ++p2) + for (p2 = (u_int8_t *)pagep + P_OVERHEAD(dbp); + cmp_bytes-- > 0; ++p1, ++p2) if (*p1 != *p2) { *cmpp = (long)*p1 - (long)*p2; break; } pgno = NEXT_PGNO(pagep); - if ((ret = memp_fput(dbp->mpf, pagep, 0)) != 0) + if ((ret = mpf->put(mpf, pagep, 0)) != 0) return (ret); if (*cmpp != 0) return (0); @@ -440,7 +471,7 @@ __db_vrfy_overflow(dbp, vdp, h, pgno, flags) pip->refcount = OV_REF(h); if (pip->refcount < 1) { EPRINT((dbp->dbenv, - "Overflow page %lu has zero reference count", + "Page %lu: overflow page has zero reference count", (u_long)pgno)); isbad = 1; } @@ -448,7 +479,7 @@ __db_vrfy_overflow(dbp, vdp, h, pgno, flags) /* Just store for now. */ pip->olen = HOFFSET(h); -err: if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0) +err: if ((t_ret = __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } @@ -495,7 +526,7 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags) if (pip->type != P_OVERFLOW) { EPRINT((dbp->dbenv, - "Overflow page %lu of invalid type", + "Page %lu: overflow page of invalid type %lu", (u_long)pgno, (u_long)pip->type)); ret = DB_VERIFY_BAD; goto err; /* Unsafe to continue. */ @@ -504,7 +535,8 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags) prev = pip->prev_pgno; if (prev != PGNO_INVALID) { EPRINT((dbp->dbenv, - "First overflow page %lu has a prev_pgno", (u_long)pgno)); + "Page %lu: first page in overflow chain has a prev_pgno %lu", + (u_long)pgno, (u_long)prev)); isbad = 1; } @@ -543,7 +575,7 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags) */ if ((u_int32_t)p > refcount) { EPRINT((dbp->dbenv, - "Page %lu encountered twice in overflow traversal", + "Page %lu: encountered twice in overflow traversal", (u_long)pgno)); ret = DB_VERIFY_BAD; goto err; @@ -571,19 +603,20 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags) if (!IS_VALID_PGNO(next)) { DB_ASSERT(0); EPRINT((dbp->dbenv, - "Overflow page %lu has bad next_pgno", - (u_long)pgno)); + "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(vdp, pip)) != 0 || + if ((ret = __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 || (ret = __db_vrfy_getpageinfo(vdp, next, &pip)) != 0) return (ret); if (pip->prev_pgno != pgno) { EPRINT((dbp->dbenv, - "Overflow page %lu has bogus prev_pgno value", - (u_long)next)); + "Page %lu: bad prev_pgno %lu on overflow page (should be %lu)", + (u_long)next, (u_long)pip->prev_pgno, + (u_long)pgno)); isbad = 1; /* * It's safe to continue because we have separate @@ -597,10 +630,11 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags) if (tlen > 0) { isbad = 1; EPRINT((dbp->dbenv, - "Overflow item incomplete on page %lu", (u_long)pgno)); + "Page %lu: overflow item incomplete", (u_long)pgno)); } -err: if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) +err: if ((t_ret = + __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } @@ -622,13 +656,15 @@ __db_safe_goff(dbp, vdp, pgno, dbt, buf, flags) void **buf; u_int32_t flags; { + DB_MPOOLFILE *mpf; PAGE *h; - int ret, err_ret; + int ret, t_ret; u_int32_t bytesgot, bytes; u_int8_t *src, *dest; - ret = DB_VERIFY_BAD; - err_ret = 0; + mpf = dbp->mpf; + h = NULL; + ret = t_ret = 0; bytesgot = bytes = 0; while ((pgno != PGNO_INVALID) && (IS_VALID_PGNO(pgno))) { @@ -639,7 +675,7 @@ __db_safe_goff(dbp, vdp, pgno, dbt, buf, flags) if ((ret = __db_salvage_markdone(vdp, pgno)) != 0) break; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) break; /* @@ -651,14 +687,14 @@ __db_safe_goff(dbp, vdp, pgno, dbt, buf, flags) break; } - src = (u_int8_t *)h + P_OVERHEAD; + src = (u_int8_t *)h + P_OVERHEAD(dbp); bytes = OV_LEN(h); - if (bytes + P_OVERHEAD > dbp->pgsize) - bytes = dbp->pgsize - P_OVERHEAD; + if (bytes + P_OVERHEAD(dbp) > dbp->pgsize) + bytes = dbp->pgsize - P_OVERHEAD(dbp); if ((ret = __os_realloc(dbp->dbenv, - bytesgot + bytes, 0, buf)) != 0) + bytesgot + bytes, buf)) != 0) break; dest = (u_int8_t *)*buf + bytesgot; @@ -667,15 +703,24 @@ __db_safe_goff(dbp, vdp, pgno, dbt, buf, flags) memcpy(dest, src, bytes); pgno = NEXT_PGNO(h); - /* Not much we can do here--we don't want to quit. */ - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) - err_ret = ret; + + if ((ret = mpf->put(mpf, h, 0)) != 0) + break; + h = NULL; } - if (ret == 0) { + /* + * If we're being aggressive, salvage a partial datum if there + * was an error somewhere along the way. + */ + if (ret == 0 || LF_ISSET(DB_AGGRESSIVE)) { dbt->size = bytesgot; dbt->data = *buf; } - return ((err_ret != 0 && ret == 0) ? err_ret : ret); + /* If we broke out on error, don't leave pages pinned. */ + if (h != NULL && (t_ret = mpf->put(mpf, h, 0)) != 0 && ret == 0) + ret = t_ret; + + return (ret); } diff --git a/bdb/db/db_pr.c b/bdb/db/db_pr.c index cb977cadfda..235e7187f7c 100644 --- a/bdb/db/db_pr.c +++ b/bdb/db/db_pr.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_pr.c,v 11.46 2001/01/22 17:25:06 krinsky Exp $"; +static const char revid[] = "$Id: db_pr.c,v 11.84 2002/09/10 02:45:20 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -21,33 +21,23 @@ static const char revid[] = "$Id: db_pr.c,v 11.46 2001/01/22 17:25:06 krinsky Ex #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" -#include "hash.h" -#include "qam.h" -#include "db_am.h" -#include "db_verify.h" +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/btree.h" +#include "dbinc/hash.h" +#include "dbinc/mp.h" +#include "dbinc/qam.h" +#include "dbinc/db_verify.h" static int __db_bmeta __P((DB *, FILE *, BTMETA *, u_int32_t)); static int __db_hmeta __P((DB *, FILE *, HMETA *, u_int32_t)); static void __db_meta __P((DB *, DBMETA *, FILE *, FN const *, u_int32_t)); -static const char *__db_dbtype_to_string __P((DB *)); -static void __db_prdb __P((DB *, FILE *, u_int32_t)); -static FILE *__db_prinit __P((FILE *)); -static void __db_proff __P((void *)); -static int __db_prtree __P((DB *, u_int32_t)); -static void __db_psize __P((DB *)); +static const char *__db_pagetype_to_string __P((u_int32_t)); +static void __db_prdb __P((DB *, FILE *)); +static void __db_proff __P((void *, FILE *)); +static int __db_prtree __P((DB *, FILE *, u_int32_t)); static int __db_qmeta __P((DB *, FILE *, QMETA *, u_int32_t)); -/* - * 64K is the maximum page size, so by default we check for offsets larger - * than that, and, where possible, we refine the test. - */ -#define PSIZE_BOUNDARY (64 * 1024 + 1) -static size_t set_psize = PSIZE_BOUNDARY; - -static FILE *set_fp; /* Output file descriptor. */ - /* * __db_loadme -- * A nice place to put a breakpoint. @@ -57,7 +47,9 @@ static FILE *set_fp; /* Output file descriptor. */ void __db_loadme() { - getpid(); + u_int32_t id; + + __os_id(&id); } /* @@ -71,21 +63,9 @@ __db_dump(dbp, op, name) DB *dbp; char *op, *name; { - FILE *fp, *save_fp; + FILE *fp; u_int32_t flags; - - COMPQUIET(save_fp, NULL); - - if (set_psize == PSIZE_BOUNDARY) - __db_psize(dbp); - - if (name != NULL) { - if ((fp = fopen(name, "w")) == NULL) - return (__os_get_errno()); - save_fp = set_fp; - set_fp = fp; - } else - fp = __db_prinit(NULL); + int ret; for (flags = 0; *op != '\0'; ++op) switch (*op) { @@ -101,19 +81,74 @@ __db_dump(dbp, op, name) return (EINVAL); } - __db_prdb(dbp, fp, flags); + if (name == NULL) + fp = stdout; + else { + if ((fp = fopen(name, "w")) == NULL) + return (__os_get_errno()); + } + + __db_prdb(dbp, fp); fprintf(fp, "%s\n", DB_LINE); - (void)__db_prtree(dbp, flags); + ret = __db_prtree(dbp, fp, flags); fflush(fp); - - if (name != NULL) { + if (name != NULL) fclose(fp); - set_fp = save_fp; - } - return (0); + + return (ret); +} + +/* + * __db_inmemdbflags -- + * Call a callback for printing or other handling of strings associated + * with whatever in-memory DB structure flags are set. + * + * PUBLIC: void __db_inmemdbflags __P((u_int32_t, void *, + * PUBLIC: void (*)(u_int32_t, const FN *, void *))); + */ +void +__db_inmemdbflags(flags, cookie, callback) + u_int32_t flags; + void *cookie; + void (*callback) __P((u_int32_t, const FN *, void *)); +{ + static const FN 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_OPEN_CALLED, "DB->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_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 } + }; + + callback(flags, fn, cookie); } /* @@ -121,40 +156,18 @@ __db_dump(dbp, op, name) * Print out the DB structure information. */ static void -__db_prdb(dbp, fp, flags) +__db_prdb(dbp, fp) DB *dbp; FILE *fp; - u_int32_t flags; { - static const FN fn[] = { - { DB_AM_DISCARD, "discard cached pages" }, - { DB_AM_DUP, "duplicates" }, - { DB_AM_INMEM, "in-memory" }, - { DB_AM_PGDEF, "default page size" }, - { DB_AM_RDONLY, "read-only" }, - { DB_AM_SUBDB, "multiple-databases" }, - { DB_AM_SWAP, "needswap" }, - { DB_BT_RECNUM, "btree:recnum" }, - { DB_BT_REVSPLIT, "btree:no reverse split" }, - { DB_DBM_ERROR, "dbm/ndbm error" }, - { DB_OPEN_CALLED, "DB->open called" }, - { DB_RE_DELIMITER, "recno:delimiter" }, - { DB_RE_FIXEDLEN, "recno:fixed-length" }, - { DB_RE_PAD, "recno:pad" }, - { DB_RE_RENUMBER, "recno:renumber" }, - { DB_RE_SNAPSHOT, "recno:snapshot" }, - { 0, NULL } - }; BTREE *bt; HASH *h; QUEUE *q; - COMPQUIET(flags, 0); - fprintf(fp, "In-memory DB structure:\n%s: %#lx", - __db_dbtype_to_string(dbp), (u_long)dbp->flags); - __db_prflags(dbp->flags, fn, fp); + __db_dbtype_to_string(dbp->type), (u_long)dbp->flags); + __db_inmemdbflags(dbp->flags, fp, __db_prflags); fprintf(fp, "\n"); switch (dbp->type) { @@ -166,7 +179,7 @@ __db_prdb(dbp, fp, flags) fprintf(fp, "bt_maxkey: %lu bt_minkey: %lu\n", (u_long)bt->bt_maxkey, (u_long)bt->bt_minkey); fprintf(fp, "bt_compare: %#lx bt_prefix: %#lx\n", - (u_long)bt->bt_compare, (u_long)bt->bt_prefix); + P_TO_ULONG(bt->bt_compare), P_TO_ULONG(bt->bt_prefix)); fprintf(fp, "bt_lpgno: %lu\n", (u_long)bt->bt_lpgno); if (dbp->type == DB_RECNO) { fprintf(fp, @@ -183,7 +196,7 @@ __db_prdb(dbp, fp, flags) fprintf(fp, "meta_pgno: %lu\n", (u_long)h->meta_pgno); fprintf(fp, "h_ffactor: %lu\n", (u_long)h->h_ffactor); fprintf(fp, "h_nelem: %lu\n", (u_long)h->h_nelem); - fprintf(fp, "h_hash: %#lx\n", (u_long)h->h_hash); + fprintf(fp, "h_hash: %#lx\n", P_TO_ULONG(h->h_hash)); break; case DB_QUEUE: q = dbp->q_internal; @@ -204,39 +217,34 @@ __db_prdb(dbp, fp, flags) * Print out the entire tree. */ static int -__db_prtree(dbp, flags) +__db_prtree(dbp, fp, flags) DB *dbp; + FILE *fp; u_int32_t flags; { + DB_MPOOLFILE *mpf; PAGE *h; db_pgno_t i, last; int ret; - if (set_psize == PSIZE_BOUNDARY) - __db_psize(dbp); + mpf = dbp->mpf; - if (dbp->type == DB_QUEUE) { - ret = __db_prqueue(dbp, flags); - goto done; - } + if (dbp->type == DB_QUEUE) + return (__db_prqueue(dbp, fp, flags)); - /* Find out the page number of the last page in the database. */ - if ((ret = memp_fget(dbp->mpf, &last, DB_MPOOL_LAST, &h)) != 0) - return (ret); - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) - return (ret); - - /* Dump each page. */ + /* + * Find out the page number of the last page in the database, then + * dump each page. + */ + mpf->last_pgno(mpf, &last); for (i = 0; i <= last; ++i) { - if ((ret = memp_fget(dbp->mpf, &i, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &i, 0, &h)) != 0) return (ret); - (void)__db_prpage(dbp, h, flags); - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) + (void)__db_prpage(dbp, h, fp, flags); + if ((ret = mpf->put(mpf, h, 0)) != 0) return (ret); } -done: - (void)fflush(__db_prinit(NULL)); return (0); } @@ -252,13 +260,15 @@ __db_meta(dbp, dbmeta, fp, fn, flags) FN const *fn; u_int32_t flags; { + DB_MPOOLFILE *mpf; PAGE *h; - int cnt; db_pgno_t pgno; u_int8_t *p; - int ret; + int cnt, ret; const char *sep; + mpf = dbp->mpf; + fprintf(fp, "\tmagic: %#lx\n", (u_long)dbmeta->magic); fprintf(fp, "\tversion: %lu\n", (u_long)dbmeta->version); fprintf(fp, "\tpagesize: %lu\n", (u_long)dbmeta->pagesize); @@ -275,14 +285,14 @@ __db_meta(dbp, dbmeta, fp, fn, flags) fprintf(fp, "\tfree list: %lu", (u_long)dbmeta->free); for (pgno = dbmeta->free, cnt = 0, sep = ", "; pgno != PGNO_INVALID;) { - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) { + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) { fprintf(fp, "Unable to retrieve free-list page: %lu: %s\n", (u_long)pgno, db_strerror(ret)); break; } pgno = h->next_pgno; - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); fprintf(fp, "%s%lu", sep, (u_long)pgno); if (++cnt % 10 == 0) { fprintf(fp, "\n"); @@ -292,6 +302,7 @@ __db_meta(dbp, dbmeta, fp, fn, flags) sep = ", "; } fprintf(fp, "\n"); + fprintf(fp, "\tlast_pgno: %lu\n", (u_long)dbmeta->last_pgno); } if (fn != NULL) { @@ -404,26 +415,28 @@ __db_qmeta(dbp, fp, 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_pgno_t, FILE *)); */ int -__db_prnpage(dbp, pgno) +__db_prnpage(dbp, pgno, fp) DB *dbp; db_pgno_t pgno; + FILE *fp; { + DB_MPOOLFILE *mpf; PAGE *h; - int ret; + int ret, t_ret; - if (set_psize == PSIZE_BOUNDARY) - __db_psize(dbp); + mpf = dbp->mpf; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) return (ret); - ret = __db_prpage(dbp, h, DB_PR_PAGE); - (void)fflush(__db_prinit(NULL)); + ret = __db_prpage(dbp, h, fp, DB_PR_PAGE); + + if ((t_ret = mpf->put(mpf, h, 0)) != 0 && ret == 0) + ret = t_ret; - (void)memp_fput(dbp->mpf, h, 0); return (ret); } @@ -431,32 +444,29 @@ __db_prnpage(dbp, pgno) * __db_prpage * -- Print out a page. * - * PUBLIC: int __db_prpage __P((DB *, PAGE *, u_int32_t)); + * PUBLIC: int __db_prpage __P((DB *, PAGE *, FILE *, u_int32_t)); */ int -__db_prpage(dbp, h, flags) +__db_prpage(dbp, h, fp, flags) DB *dbp; PAGE *h; + FILE *fp; u_int32_t flags; { BINTERNAL *bi; BKEYDATA *bk; - BTREE *t; - FILE *fp; HOFFPAGE a_hkd; QAMDATA *qp, *qep; RINTERNAL *ri; - db_indx_t dlen, len, i; + db_indx_t dlen, len, i, *inp; db_pgno_t pgno; db_recno_t recno; + u_int32_t pagesize, qlen; + u_int8_t *ep, *hk, *p; int deleted, ret; const char *s; - u_int32_t qlen; - u_int8_t *ep, *hk, *p; void *sp; - fp = __db_prinit(NULL); - /* * If we're doing recovery testing and this page is P_INVALID, * assume it's a page that's on the free list, and don't display it. @@ -471,6 +481,14 @@ __db_prpage(dbp, h, flags) return (1); } + /* + * !!! + * Find out the page size. We don't want to do it the "right" way, + * by reading the value from the meta-data page, that's going to be + * slow. Reach down into the mpool region. + */ + pagesize = (u_int32_t)dbp->mpf->mfp->stat.st_pagesize; + /* Page number, page type. */ fprintf(fp, "page %lu: %s level: %lu", (u_long)h->pgno, s, (u_long)h->level); @@ -500,7 +518,7 @@ __db_prpage(dbp, h, flags) qlen = ((QUEUE *)dbp->q_internal)->re_len; recno = (h->pgno - 1) * QAM_RECNO_PER_PAGE(dbp) + 1; i = 0; - qep = (QAMDATA *)((u_int8_t *)h + set_psize - qlen); + qep = (QAMDATA *)((u_int8_t *)h + pagesize - qlen); for (qp = QAM_GET_RECORD(dbp, h, i); qp < qep; recno++, i++, qp = QAM_GET_RECORD(dbp, h, i)) { if (!F_ISSET(qp, QAM_SET)) @@ -508,9 +526,9 @@ __db_prpage(dbp, h, flags) fprintf(fp, "%s", F_ISSET(qp, QAM_VALID) ? "\t" : " D"); - fprintf(fp, "[%03lu] %4lu ", - (u_long)recno, (u_long)qp - (u_long)h); - __db_pr(qp->data, qlen); + fprintf(fp, "[%03lu] %4lu ", (u_long)recno, + (u_long)((u_int8_t *)qp - (u_int8_t *)h)); + __db_pr(qp->data, qlen, fp); } return (0); } @@ -520,8 +538,6 @@ __db_prpage(dbp, h, flags) fprintf(fp, " (lsn.file: %lu lsn.offset: %lu)\n", (u_long)LSN(h).file, (u_long)LSN(h).offset); - t = dbp->bt_internal; - s = "\t"; if (TYPE(h) != P_IBTREE && TYPE(h) != P_IRECNO) { fprintf(fp, "%sprev: %4lu next: %4lu", @@ -530,7 +546,7 @@ __db_prpage(dbp, h, flags) } if (TYPE(h) == P_OVERFLOW) { fprintf(fp, "%sref cnt: %4lu ", s, (u_long)OV_REF(h)); - __db_pr((u_int8_t *)h + P_OVERHEAD, OV_LEN(h)); + __db_pr((u_int8_t *)h + P_OVERHEAD(dbp), OV_LEN(h), fp); return (0); } fprintf(fp, "%sentries: %4lu", s, (u_long)NUM_ENT(h)); @@ -540,12 +556,14 @@ __db_prpage(dbp, h, flags) return (0); ret = 0; + inp = P_INP(dbp, h); for (i = 0; i < NUM_ENT(h); i++) { - if (P_ENTRY(h, i) - (u_int8_t *)h < P_OVERHEAD || - (size_t)(P_ENTRY(h, i) - (u_int8_t *)h) >= set_psize) { + if ((db_alignp_t)(P_ENTRY(dbp, h, i) - (u_int8_t *)h) < + (db_alignp_t)(P_OVERHEAD(dbp)) || + (size_t)(P_ENTRY(dbp, h, i) - (u_int8_t *)h) >= pagesize) { fprintf(fp, "ILLEGAL PAGE OFFSET: indx: %lu of %lu\n", - (u_long)i, (u_long)h->inp[i]); + (u_long)i, (u_long)inp[i]); ret = EINVAL; continue; } @@ -554,17 +572,17 @@ __db_prpage(dbp, h, flags) case P_HASH: case P_IBTREE: case P_IRECNO: - sp = P_ENTRY(h, i); + sp = P_ENTRY(dbp, h, i); break; case P_LBTREE: - sp = P_ENTRY(h, i); + sp = P_ENTRY(dbp, h, i); deleted = i % 2 == 0 && - B_DISSET(GET_BKEYDATA(h, i + O_INDX)->type); + B_DISSET(GET_BKEYDATA(dbp, h, i + O_INDX)->type); break; case P_LDUP: case P_LRECNO: - sp = P_ENTRY(h, i); - deleted = B_DISSET(GET_BKEYDATA(h, i)->type); + sp = P_ENTRY(dbp, h, i); + deleted = B_DISSET(GET_BKEYDATA(dbp, h, i)->type); break; default: fprintf(fp, @@ -573,7 +591,7 @@ __db_prpage(dbp, h, flags) continue; } fprintf(fp, "%s", deleted ? " D" : "\t"); - fprintf(fp, "[%03lu] %4lu ", (u_long)i, (u_long)h->inp[i]); + fprintf(fp, "[%03lu] %4lu ", (u_long)i, (u_long)inp[i]); switch (TYPE(h)) { case P_HASH: hk = sp; @@ -592,7 +610,7 @@ __db_prpage(dbp, h, flags) * set. */ if (i != 0) - len = LEN_HKEYDATA(h, 0, i); + len = LEN_HKEYDATA(dbp, h, 0, i); else len = 1; @@ -602,13 +620,14 @@ __db_prpage(dbp, h, flags) memcpy(&dlen, p, sizeof(db_indx_t)); p += sizeof(db_indx_t); fprintf(fp, "\t\t"); - __db_pr(p, dlen); + __db_pr(p, dlen, fp); p += sizeof(db_indx_t) + dlen; } break; case H_KEYDATA: __db_pr(HKEYDATA_DATA(hk), - LEN_HKEYDATA(h, i == 0 ? set_psize : 0, i)); + LEN_HKEYDATA(dbp, h, i == 0 ? + pagesize : 0, i), fp); break; case H_OFFPAGE: memcpy(&a_hkd, hk, HOFFPAGE_SIZE); @@ -625,11 +644,11 @@ __db_prpage(dbp, h, flags) (u_long)bi->type); switch (B_TYPE(bi->type)) { case B_KEYDATA: - __db_pr(bi->data, bi->len); + __db_pr(bi->data, bi->len, fp); break; case B_DUPLICATE: case B_OVERFLOW: - __db_proff(bi->data); + __db_proff(bi->data, fp); break; default: fprintf(fp, "ILLEGAL BINTERNAL TYPE: %lu\n", @@ -649,11 +668,11 @@ __db_prpage(dbp, h, flags) bk = sp; switch (B_TYPE(bk->type)) { case B_KEYDATA: - __db_pr(bk->data, bk->len); + __db_pr(bk->data, bk->len, fp); break; case B_DUPLICATE: case B_OVERFLOW: - __db_proff(bk); + __db_proff(bk, fp); break; default: fprintf(fp, @@ -673,19 +692,17 @@ __db_prpage(dbp, h, flags) * __db_pr -- * Print out a data element. * - * PUBLIC: void __db_pr __P((u_int8_t *, u_int32_t)); + * PUBLIC: void __db_pr __P((u_int8_t *, u_int32_t, FILE *)); */ void -__db_pr(p, len) +__db_pr(p, len, fp) u_int8_t *p; u_int32_t len; -{ FILE *fp; +{ u_int lastch; int i; - fp = __db_prinit(NULL); - fprintf(fp, "len: %3lu", (u_long)len); lastch = '.'; if (len != 0) { @@ -744,6 +761,13 @@ __db_prdbt(dbtp, checkprint, prefix, handle, callback, is_recno, vdp) handle, callback, vdp, 0); F_CLR(vdp, SALVAGE_PRINTHEADER); F_SET(vdp, SALVAGE_PRINTFOOTER); + + /* + * Even if the printable flag wasn't set by our immediate + * caller, it may be set on a salvage-wide basis. + */ + if (F_ISSET(vdp, SALVAGE_PRINTABLE)) + checkprint = 1; } /* @@ -760,12 +784,12 @@ __db_prdbt(dbtp, checkprint, prefix, handle, callback, is_recno, vdp) * in a platform-independent way. So we use the numeral in * straight ASCII. */ - __ua_memcpy(&recno, dbtp->data, sizeof(recno)); + (void)__ua_memcpy(&recno, dbtp->data, sizeof(recno)); snprintf(buf, DBTBUFLEN, "%lu", (u_long)recno); /* If we're printing data as hex, print keys as hex too. */ if (!checkprint) { - for (len = strlen(buf), p = buf, hp = hbuf; + for (len = (u_int32_t)strlen(buf), p = buf, hp = hbuf; len-- > 0; ++p) { *hp++ = hex[(u_int8_t)(*p & 0xf0) >> 4]; *hp++ = hex[*p & 0x0f]; @@ -810,14 +834,12 @@ __db_prdbt(dbtp, checkprint, prefix, handle, callback, is_recno, vdp) * Print out an off-page element. */ static void -__db_proff(vp) +__db_proff(vp, fp) void *vp; -{ FILE *fp; +{ BOVERFLOW *bo; - fp = __db_prinit(NULL); - bo = vp; switch (B_TYPE(bo->type)) { case B_OVERFLOW: @@ -834,18 +856,25 @@ __db_proff(vp) * __db_prflags -- * Print out flags values. * - * PUBLIC: void __db_prflags __P((u_int32_t, const FN *, FILE *)); + * PUBLIC: void __db_prflags __P((u_int32_t, const FN *, void *)); */ void -__db_prflags(flags, fn, fp) +__db_prflags(flags, fn, vfp) u_int32_t flags; FN const *fn; - FILE *fp; + void *vfp; { + FILE *fp; const FN *fnp; int found; const char *sep; + /* + * We pass the FILE * through a void * so that we can use + * this function as as a callback. + */ + fp = (FILE *)vfp; + sep = " ("; for (found = 0, fnp = fn; fnp->mask != 0; ++fnp) if (LF_ISSET(fnp->mask)) { @@ -857,63 +886,22 @@ __db_prflags(flags, fn, fp) fprintf(fp, ")"); } -/* - * __db_prinit -- - * Initialize tree printing routines. - */ -static FILE * -__db_prinit(fp) - FILE *fp; -{ - if (set_fp == NULL) - set_fp = fp == NULL ? stdout : fp; - return (set_fp); -} - -/* - * __db_psize -- - * Get the page size. - */ -static void -__db_psize(dbp) - DB *dbp; -{ - DBMETA *mp; - db_pgno_t pgno; - - set_psize = PSIZE_BOUNDARY - 1; - - pgno = PGNO_BASE_MD; - if (memp_fget(dbp->mpf, &pgno, 0, &mp) != 0) - return; - - switch (mp->magic) { - case DB_BTREEMAGIC: - case DB_HASHMAGIC: - case DB_QAMMAGIC: - set_psize = mp->pagesize; - break; - } - (void)memp_fput(dbp->mpf, mp, 0); -} - /* * __db_dbtype_to_string -- * Return the name of the database type. + * PUBLIC: const char * __db_dbtype_to_string __P((DBTYPE)); */ -static const char * -__db_dbtype_to_string(dbp) - DB *dbp; +const char * +__db_dbtype_to_string(type) + DBTYPE type; { - switch (dbp->type) { + switch (type) { case DB_BTREE: return ("btree"); case DB_HASH: return ("hash"); - break; case DB_RECNO: return ("recno"); - break; case DB_QUEUE: return ("queue"); default: @@ -925,10 +913,8 @@ __db_dbtype_to_string(dbp) /* * __db_pagetype_to_string -- * Return the name of the specified page type. - * - * PUBLIC: const char *__db_pagetype_to_string __P((u_int32_t)); */ -const char * +static const char * __db_pagetype_to_string(type) u_int32_t type; { @@ -1000,6 +986,7 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) DB_ENV *dbenv; DB_HASH_STAT *hsp; DB_QUEUE_STAT *qsp; + DBT dbt; VRFY_PAGEINFO *pip; char *buf; int buflen, ret, t_ret; @@ -1021,10 +1008,16 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) * If we've been passed a verifier statistics object, use * that; we're being called in a context where dbp->stat * is unsafe. + * + * Also, the verifier may set the pflag on a per-salvage basis. + * If so, respect that. */ if (vdp != NULL) { if ((ret = __db_vrfy_getpageinfo(vdp, meta_pgno, &pip)) != 0) return (ret); + + if (F_ISSET(vdp, SALVAGE_PRINTABLE)) + pflag = 1; } else pip = NULL; @@ -1071,16 +1064,22 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) /* * 64 bytes is long enough, as a minimum bound, for any of the - * fields besides subname. Subname can be anything, and so - * 64 + subname is big enough for all the things we need to print here. + * fields besides subname. Subname uses __db_prdbt and therefore + * does not need buffer space here. */ - buflen = 64 + ((subname != NULL) ? strlen(subname) : 0); - if ((ret = __os_malloc(dbenv, buflen, NULL, &buf)) != 0) + buflen = 64; + if ((ret = __os_malloc(dbenv, buflen, &buf)) != 0) goto err; if (subname != NULL) { - snprintf(buf, buflen, "database=%s\n", subname); + snprintf(buf, buflen, "database="); if ((ret = callback(handle, buf)) != 0) goto err; + memset(&dbt, 0, sizeof(dbt)); + dbt.data = subname; + dbt.size = (u_int32_t)strlen(subname); + if ((ret = __db_prdbt(&dbt, + 1, NULL, handle, callback, 0, NULL)) != 0) + goto err; } switch (dbtype) { case DB_BTREE: @@ -1106,11 +1105,11 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) } break; } - if ((ret = dbp->stat(dbp, &btsp, NULL, 0)) != 0) { + if ((ret = dbp->stat(dbp, &btsp, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); goto err; } - if (F_ISSET(dbp, DB_BT_RECNUM)) + if (F_ISSET(dbp, DB_AM_RECNUM)) if ((ret = callback(handle, "recnum=1\n")) != 0) goto err; if (btsp->bt_maxkey != 0) { @@ -1144,7 +1143,7 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) } break; } - if ((ret = dbp->stat(dbp, &hsp, NULL, 0)) != 0) { + if ((ret = dbp->stat(dbp, &hsp, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); goto err; } @@ -1154,10 +1153,9 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) if ((ret = callback(handle, buf)) != 0) goto err; } - if (hsp->hash_nelem != 0 || hsp->hash_nkeys != 0) { - snprintf(buf, buflen, "h_nelem=%lu\n", - hsp->hash_nelem > hsp->hash_nkeys ? - (u_long)hsp->hash_nelem : (u_long)hsp->hash_nkeys); + if (hsp->hash_nkeys != 0) { + snprintf(buf, buflen, + "h_nelem=%lu\n", (u_long)hsp->hash_nkeys); if ((ret = callback(handle, buf)) != 0) goto err; } @@ -1172,15 +1170,24 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) goto err; break; } - if ((ret = dbp->stat(dbp, &qsp, NULL, 0)) != 0) { + if ((ret = dbp->stat(dbp, &qsp, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); goto err; } snprintf(buf, buflen, "re_len=%lu\n", (u_long)qsp->qs_re_len); - if (qsp->qs_re_pad != 0 && qsp->qs_re_pad != ' ') - snprintf(buf, buflen, "re_pad=%#x\n", qsp->qs_re_pad); if ((ret = callback(handle, buf)) != 0) goto err; + if (qsp->qs_re_pad != 0 && qsp->qs_re_pad != ' ') { + snprintf(buf, buflen, "re_pad=%#x\n", qsp->qs_re_pad); + if ((ret = callback(handle, buf)) != 0) + goto err; + } + if (qsp->qs_extentsize != 0) { + snprintf(buf, buflen, + "extentsize=%lu\n", (u_long)qsp->qs_extentsize); + if ((ret = callback(handle, buf)) != 0) + goto err; + } break; case DB_RECNO: if ((ret = callback(handle, "type=recno\n")) != 0) @@ -1198,14 +1205,14 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) } break; } - if ((ret = dbp->stat(dbp, &btsp, NULL, 0)) != 0) { + if ((ret = dbp->stat(dbp, &btsp, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); goto err; } - if (F_ISSET(dbp, DB_RE_RENUMBER)) + if (F_ISSET(dbp, DB_AM_RENUMBER)) if ((ret = callback(handle, "renumber=1\n")) != 0) goto err; - if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { + if (F_ISSET(dbp, DB_AM_FIXEDLEN)) { snprintf(buf, buflen, "re_len=%lu\n", (u_long)btsp->bt_re_len); if ((ret = callback(handle, buf)) != 0) @@ -1233,6 +1240,9 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) goto err; /* We should handle page size. XXX */ } else { + if (F_ISSET(dbp, DB_AM_CHKSUM)) + if ((ret = callback(handle, "chksum=1\n")) != 0) + goto err; if (F_ISSET(dbp, DB_AM_DUP)) if ((ret = callback(handle, "duplicates=1\n")) != 0) goto err; @@ -1253,16 +1263,16 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno) ret = callback(handle, "HEADER=END\n"); err: if (pip != NULL && - (t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) + (t_ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; if (btsp != NULL) - __os_free(btsp, 0); + __os_ufree(dbenv, btsp); if (hsp != NULL) - __os_free(hsp, 0); + __os_ufree(dbenv, hsp); if (qsp != NULL) - __os_free(qsp, 0); + __os_ufree(dbenv, qsp); if (buf != NULL) - __os_free(buf, buflen); + __os_free(dbenv, buf); return (ret); } diff --git a/bdb/db/db_rec.c b/bdb/db/db_rec.c index 998d074290d..303ab2fe1d4 100644 --- a/bdb/db/db_rec.c +++ b/bdb/db/db_rec.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_rec.c,v 11.10 2000/08/03 15:32:19 ubell Exp $"; +static const char revid[] = "$Id: db_rec.c,v 11.35 2002/08/08 03:57:49 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,9 +18,9 @@ static const char revid[] = "$Id: db_rec.c,v 11.10 2000/08/03 15:32:19 ubell Exp #endif #include "db_int.h" -#include "db_page.h" -#include "log.h" -#include "hash.h" +#include "dbinc/db_page.h" +#include "dbinc/log.h" +#include "dbinc/hash.h" /* * PUBLIC: int __db_addrem_recover @@ -45,11 +45,12 @@ __db_addrem_recover(dbenv, dbtp, lsnp, op, info) u_int32_t change; int cmp_n, cmp_p, ret; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__db_addrem_print); REC_INTRO(__db_addrem_read, 1); - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { + if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) { /* * We are undoing and the page doesn't exist. That @@ -59,7 +60,7 @@ __db_addrem_recover(dbenv, dbtp, lsnp, op, info) */ goto done; } else - if ((ret = memp_fget(mpf, + if ((ret = mpf->get(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } @@ -95,13 +96,16 @@ __db_addrem_recover(dbenv, dbtp, lsnp, op, info) LSN(pagep) = argp->pagelsn; } - if ((ret = memp_fput(mpf, pagep, change)) != 0) + if ((ret = mpf->put(mpf, pagep, change)) != 0) goto out; + pagep = NULL; done: *lsnp = argp->prev_lsn; ret = 0; -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } /* @@ -124,11 +128,12 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info) u_int32_t change; int cmp_n, cmp_p, ret; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__db_big_print); REC_INTRO(__db_big_read, 1); - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { + if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) { /* * We are undoing and the page doesn't exist. That @@ -139,7 +144,7 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info) ret = 0; goto ppage; } else - if ((ret = memp_fget(mpf, + if ((ret = mpf->get(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } @@ -161,7 +166,7 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info) argp->next_pgno, 0, P_OVERFLOW); OV_LEN(pagep) = argp->dbt.size; OV_REF(pagep) = 1; - memcpy((u_int8_t *)pagep + P_OVERHEAD, argp->dbt.data, + 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; @@ -177,13 +182,21 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info) if (change) LSN(pagep) = DB_REDO(op) ? *lsnp : argp->pagelsn; - if ((ret = memp_fput(mpf, pagep, change)) != 0) + if ((ret = mpf->put(mpf, pagep, change)) != 0) goto out; + pagep = NULL; + + /* + * We only delete a whole chain of overflow. + * Each page is handled individually + */ + if (argp->opcode == DB_REM_BIG) + goto done; /* Now check the previous page. */ ppage: if (argp->prev_pgno != PGNO_INVALID) { change = 0; - if ((ret = memp_fget(mpf, &argp->prev_pgno, 0, &pagep)) != 0) { + if ((ret = mpf->get(mpf, &argp->prev_pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) { /* * We are undoing and the page doesn't exist. @@ -195,7 +208,7 @@ ppage: if (argp->prev_pgno != PGNO_INVALID) { ret = 0; goto npage; } else - if ((ret = memp_fget(mpf, &argp->prev_pgno, + if ((ret = mpf->get(mpf, &argp->prev_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } @@ -204,28 +217,27 @@ ppage: if (argp->prev_pgno != PGNO_INVALID) { cmp_p = log_compare(&LSN(pagep), &argp->prevlsn); CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->prevlsn); - if ((cmp_p == 0 && DB_REDO(op) && argp->opcode == DB_ADD_BIG) || - (cmp_n == 0 && DB_UNDO(op) && argp->opcode == DB_REM_BIG)) { + if (cmp_p == 0 && DB_REDO(op) && argp->opcode == DB_ADD_BIG) { /* Redo add, undo delete. */ NEXT_PGNO(pagep) = argp->pgno; change = DB_MPOOL_DIRTY; - } else if ((cmp_n == 0 && - DB_UNDO(op) && argp->opcode == DB_ADD_BIG) || - (cmp_p == 0 && DB_REDO(op) && argp->opcode == DB_REM_BIG)) { + } else if (cmp_n == 0 && + DB_UNDO(op) && argp->opcode == DB_ADD_BIG) { /* Redo delete, undo add. */ NEXT_PGNO(pagep) = argp->next_pgno; change = DB_MPOOL_DIRTY; } if (change) LSN(pagep) = DB_REDO(op) ? *lsnp : argp->prevlsn; - if ((ret = memp_fput(mpf, pagep, change)) != 0) + if ((ret = mpf->put(mpf, pagep, change)) != 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; - if ((ret = memp_fget(mpf, &argp->next_pgno, 0, &pagep)) != 0) { + if ((ret = mpf->get(mpf, &argp->next_pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) { /* * We are undoing and the page doesn't exist. @@ -235,7 +247,7 @@ npage: if (argp->next_pgno != PGNO_INVALID) { */ goto done; } else - if ((ret = memp_fget(mpf, &argp->next_pgno, + if ((ret = mpf->get(mpf, &argp->next_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } @@ -252,21 +264,25 @@ npage: if (argp->next_pgno != PGNO_INVALID) { } if (change) LSN(pagep) = DB_REDO(op) ? *lsnp : argp->nextlsn; - if ((ret = memp_fput(mpf, pagep, change)) != 0) + if ((ret = mpf->put(mpf, pagep, change)) != 0) goto out; } + pagep = NULL; done: *lsnp = argp->prev_lsn; ret = 0; -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } /* * __db_ovref_recover -- * Recovery function for __db_ovref(). * - * PUBLIC: int __db_ovref_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + * PUBLIC: int __db_ovref_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); */ int __db_ovref_recover(dbenv, dbtp, lsnp, op, info) @@ -283,14 +299,15 @@ __db_ovref_recover(dbenv, dbtp, lsnp, op, info) PAGE *pagep; int cmp, modified, ret; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__db_ovref_print); REC_INTRO(__db_ovref_read, 1); - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { + if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) { if (DB_UNDO(op)) goto done; - (void)__db_pgerr(file_dbp, argp->pgno); + __db_pgerr(file_dbp, argp->pgno, ret); goto out; } @@ -310,13 +327,16 @@ __db_ovref_recover(dbenv, dbtp, lsnp, op, info) pagep->lsn = argp->lsn; modified = 1; } - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + pagep = NULL; done: *lsnp = argp->prev_lsn; ret = 0; -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } /* @@ -341,6 +361,7 @@ __db_relink_recover(dbenv, dbtp, lsnp, op, info) PAGE *pagep; int cmp_n, cmp_p, modified, ret; + pagep = NULL; COMPQUIET(info, NULL); REC_PRINT(__db_relink_print); REC_INTRO(__db_relink_read, 1); @@ -351,9 +372,9 @@ __db_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 = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) { if (DB_REDO(op)) { - (void)__db_pgerr(file_dbp, argp->pgno); + __db_pgerr(file_dbp, argp->pgno, ret); goto out; } goto next2; @@ -376,12 +397,13 @@ __db_relink_recover(dbenv, dbtp, lsnp, op, info) pagep->lsn = argp->lsn; modified = 1; } -next1: if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) +next1: if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + pagep = NULL; -next2: if ((ret = memp_fget(mpf, &argp->next, 0, &pagep)) != 0) { +next2: if ((ret = mpf->get(mpf, &argp->next, 0, &pagep)) != 0) { if (DB_REDO(op)) { - (void)__db_pgerr(file_dbp, argp->next); + __db_pgerr(file_dbp, argp->next, ret); goto out; } goto prev; @@ -409,14 +431,15 @@ next2: if ((ret = memp_fget(mpf, &argp->next, 0, &pagep)) != 0) { else pagep->lsn = *lsnp; } - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + pagep = NULL; if (argp->opcode == DB_ADD_PAGE) goto done; -prev: if ((ret = memp_fget(mpf, &argp->prev, 0, &pagep)) != 0) { +prev: if ((ret = mpf->get(mpf, &argp->prev, 0, &pagep)) != 0) { if (DB_REDO(op)) { - (void)__db_pgerr(file_dbp, argp->prev); + __db_pgerr(file_dbp, argp->prev, ret); goto out; } goto done; @@ -441,13 +464,16 @@ prev: if ((ret = memp_fget(mpf, &argp->prev, 0, &pagep)) != 0) { else pagep->lsn = *lsnp; } - if ((ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; + pagep = NULL; done: *lsnp = argp->prev_lsn; ret = 0; -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + REC_CLOSE; } /* @@ -468,8 +494,8 @@ __db_debug_recover(dbenv, dbtp, lsnp, op, info) __db_debug_args *argp; int ret; - COMPQUIET(op, 0); COMPQUIET(dbenv, NULL); + COMPQUIET(op, DB_TXN_ABORT); COMPQUIET(info, NULL); REC_PRINT(__db_debug_print); @@ -504,11 +530,12 @@ __db_noop_recover(dbenv, dbtp, lsnp, op, info) 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); - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) + if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) goto out; cmp_n = log_compare(lsnp, &LSN(pagep)); @@ -522,8 +549,349 @@ __db_noop_recover(dbenv, dbtp, lsnp, op, info) LSN(pagep) = argp->prevlsn; change = DB_MPOOL_DIRTY; } - ret = memp_fput(mpf, pagep, change); + ret = mpf->put(mpf, pagep, change); + pagep = NULL; done: *lsnp = argp->prev_lsn; -out: REC_CLOSE; +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + 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; + DBMETA *meta; + DB_MPOOLFILE *mpf; + PAGE *pagep; + db_pgno_t pgno; + int cmp_n, cmp_p, created, level, modified, ret; + + meta = NULL; + pagep = NULL; + REC_PRINT(__db_pg_alloc_print); + REC_INTRO(__db_pg_alloc_read, 0); + + /* + * Fix up the allocated page. 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. + * + * 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 = mpf->get(mpf, &pgno, 0, &meta)) != 0) { + /* The metadata page must always exist on redo. */ + if (DB_REDO(op)) { + __db_pgerr(file_dbp, pgno, ret); + goto out; + } else + goto done; + } + created = modified = 0; + if ((ret = mpf->get(mpf, &argp->pgno, 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 = + mpf->get(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) { + __db_pgerr(file_dbp, argp->pgno, ret); + goto out; + } + created = modified = 1; + } + + /* Fix up the allocated page. */ + cmp_n = log_compare(lsnp, &LSN(pagep)); + cmp_p = log_compare(&LSN(pagep), &argp->page_lsn); + + /* + * If an inital 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 (IS_ZERO_LSN(LSN(pagep))) + cmp_p = 0; + CHECK_LSN(op, cmp_p, &LSN(pagep), &argp->page_lsn); + /* + * If we we rolled back this allocation previously during an + * archive restore, the page may have the LSN of the meta page + * at the point of the roll back. This will be no more + * than the LSN of the metadata page at the time of this allocation. + * 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 || + (IS_ZERO_LSN(argp->page_lsn) && + log_compare(&LSN(pagep), &argp->meta_lsn) <= 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; + } + P_INIT(pagep, file_dbp->pgsize, + 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 + * is equal to PGNO_INVALID). + * Undo the allocation, reinitialize the page and + * link its next pointer to the free list. + */ + P_INIT(pagep, file_dbp->pgsize, + argp->pgno, PGNO_INVALID, argp->next, 0, P_INVALID); + + pagep->lsn = argp->page_lsn; + modified = 1; + } + + /* + * If the page was newly created, put it on the limbo list. + */ + if (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; + } + + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + goto out; + pagep = NULL; + + /* Fix up the metadata page. */ + 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); + if (cmp_p == 0 && DB_REDO(op)) { + /* Need to redo update described. */ + LSN(meta) = *lsnp; + meta->free = argp->next; + modified = 1; + } else if (cmp_n == 0 && DB_UNDO(op)) { + /* Need to undo update described. */ + LSN(meta) = argp->meta_lsn; + + /* + * If the page has a zero LSN then its newly created + * and will go into limbo rather than directly on the + * free list. + */ + if (!IS_ZERO_LSN(argp->page_lsn)) + meta->free = argp->pgno; + modified = 1; + } + if ((ret = mpf->put(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) + goto out; + meta = NULL; + /* + * This could be the metapage from a subdb which is read from disk + * to recover its creation. + */ + if (F_ISSET(file_dbp, DB_AM_SUBDB)) + switch (argp->type) { + case P_BTREEMETA: + case P_HASHMETA: + case P_QAMMETA: + file_dbp->sync(file_dbp, 0); + break; + } + +done: *lsnp = argp->prev_lsn; + ret = 0; + +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + if (meta != NULL) + (void)mpf->put(mpf, meta, 0); + if (ret == ENOENT && op == DB_TXN_BACKWARD_ALLOC) + ret = 0; + 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; + DBMETA *meta; + DB_LSN copy_lsn; + DB_MPOOLFILE *mpf; + PAGE *pagep; + db_pgno_t pgno; + int cmp_n, cmp_p, modified, ret; + + COMPQUIET(info, NULL); + meta = NULL; + pagep = NULL; + REC_PRINT(__db_pg_free_print); + REC_INTRO(__db_pg_free_read, 1); + + /* + * Fix up the freed page. 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. + * Create the page if necessary, we may be freeing an aborted + * create. + */ + if ((ret = mpf->get(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) + 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); + if (DB_REDO(op) && + (cmp_p == 0 || + (IS_ZERO_LSN(copy_lsn) && + log_compare(&LSN(pagep), &argp->meta_lsn) <= 0))) { + /* Need to redo update described. */ + 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 undo update described. */ + memcpy(pagep, argp->header.data, argp->header.size); + + modified = 1; + } + if ((ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) + goto out; + pagep = NULL; + + /* + * Fix up the metadata page. If we're redoing or undoing the operation + * we get the page and update its LSN and free pointer. + */ + pgno = PGNO_BASE_MD; + if ((ret = mpf->get(mpf, &pgno, 0, &meta)) != 0) { + /* The metadata page must always exist. */ + __db_pgerr(file_dbp, pgno, ret); + goto out; + } + + 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); + if (cmp_p == 0 && DB_REDO(op)) { + /* Need to redo the deallocation. */ + meta->free = argp->pgno; + LSN(meta) = *lsnp; + modified = 1; + } else if (cmp_n == 0 && DB_UNDO(op)) { + /* Need to undo the deallocation. */ + meta->free = argp->next; + LSN(meta) = argp->meta_lsn; + modified = 1; + } + if ((ret = mpf->put(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) + goto out; + meta = NULL; + +done: *lsnp = argp->prev_lsn; + ret = 0; + +out: if (pagep != NULL) + (void)mpf->put(mpf, pagep, 0); + if (meta != NULL) + (void)mpf->put(mpf, meta, 0); + REC_CLOSE; +} + +/* + * __db_cksum_recover -- + * Recovery function for checksum failure log record. + * + * PUBLIC: int __db_cksum_recover __P((DB_ENV *, + * PUBLIC: DBT *, DB_LSN *, db_recops, void *)); + */ +int +__db_cksum_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + __db_cksum_args *argp; + + int ret; + + COMPQUIET(info, NULL); + COMPQUIET(lsnp, NULL); + COMPQUIET(op, DB_TXN_ABORT); + + REC_PRINT(__db_cksum_print); + + if ((ret = __db_cksum_read(dbenv, dbtp->data, &argp)) != 0) + return (ret); + + /* + * We had a checksum failure -- the only option is to run catastrophic + * recovery. + */ + if (F_ISSET(dbenv, DB_ENV_FATAL)) + ret = 0; + else { + __db_err(dbenv, + "Checksum failure requires catastrophic recovery"); + ret = __db_panic(dbenv, DB_RUNRECOVERY); + } + + __os_free(dbenv, argp); + return (ret); } diff --git a/bdb/db/db_reclaim.c b/bdb/db/db_reclaim.c index 739f348407d..9aa39bcfa9b 100644 --- a/bdb/db/db_reclaim.c +++ b/bdb/db/db_reclaim.c @@ -1,74 +1,26 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_reclaim.c,v 11.5 2000/04/07 14:26:58 bostic Exp $"; +static const char revid[] = "$Id: db_reclaim.c,v 11.28 2002/08/06 06:11:17 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include +#include #endif #include "db_int.h" -#include "db_page.h" -#include "db_am.h" - -/* - * Assume that we enter with a valid pgno. We traverse a set of - * duplicate pages. The format of the callback routine is: - * callback(dbp, page, cookie, did_put). did_put is an output - * value that will be set to 1 by the callback routine if it - * already put the page back. Otherwise, this routine must - * put the page. - * - * PUBLIC: int __db_traverse_dup __P((DB *, - * PUBLIC: db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *)); - */ -int -__db_traverse_dup(dbp, pgno, callback, cookie) - DB *dbp; - db_pgno_t pgno; - int (*callback) __P((DB *, PAGE *, void *, int *)); - void *cookie; -{ - PAGE *p; - int did_put, i, opgno, ret; - - do { - did_put = 0; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &p)) != 0) - return (ret); - pgno = NEXT_PGNO(p); - - for (i = 0; i < NUM_ENT(p); i++) { - if (B_TYPE(GET_BKEYDATA(p, i)->type) == B_OVERFLOW) { - opgno = GET_BOVERFLOW(p, i)->pgno; - if ((ret = __db_traverse_big(dbp, - opgno, callback, cookie)) != 0) - goto err; - } - } - - if ((ret = callback(dbp, p, cookie, &did_put)) != 0) - goto err; - - if (!did_put) - if ((ret = memp_fput(dbp->mpf, p, 0)) != 0) - return (ret); - } while (pgno != PGNO_INVALID); - - if (0) { -err: if (did_put == 0) - (void)memp_fput(dbp->mpf, p, 0); - } - return (ret); -} +#include "dbinc/db_page.h" +#include "dbinc/db_shash.h" +#include "dbinc/btree.h" +#include "dbinc/lock.h" /* * __db_traverse_big @@ -88,17 +40,20 @@ __db_traverse_big(dbp, pgno, callback, cookie) int (*callback) __P((DB *, PAGE *, void *, int *)); void *cookie; { + DB_MPOOLFILE *mpf; PAGE *p; int did_put, ret; + mpf = dbp->mpf; + do { did_put = 0; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &p)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &p)) != 0) return (ret); pgno = NEXT_PGNO(p); if ((ret = callback(dbp, p, cookie, &did_put)) == 0 && !did_put) - ret = memp_fput(dbp->mpf, p, 0); + ret = mpf->put(mpf, p, 0); } while (ret == 0 && pgno != PGNO_INVALID); return (ret); @@ -132,3 +87,162 @@ __db_reclaim_callback(dbp, p, cookie, putp) return (0); } + +/* + * __db_truncate_callback + * This is the callback routine used during a truncate. + * we are traversing a btree or hash table and trying to free all the + * pages. + * + * PUBLIC: int __db_truncate_callback __P((DB *, PAGE *, void *, int *)); + */ +int +__db_truncate_callback(dbp, p, cookie, putp) + DB *dbp; + PAGE *p; + void *cookie; + int *putp; +{ + DBMETA *meta; + DBT ldbt; + DB_LOCK metalock; + DB_MPOOLFILE *mpf; + db_indx_t indx, len, off, tlen, top; + db_pgno_t pgno; + db_trunc_param *param; + u_int8_t *hk, type; + int ret; + + top = NUM_ENT(p); + mpf = dbp->mpf; + param = cookie; + *putp = 1; + + switch (TYPE(p)) { + case P_LBTREE: + /* Skip for off-page duplicates and deleted items. */ + for (indx = 0; indx < top; indx += P_INDX) { + type = GET_BKEYDATA(dbp, p, indx + O_INDX)->type; + if (!B_DISSET(type) && B_TYPE(type) != B_DUPLICATE) + ++param->count; + } + /* FALLTHROUGH */ + case P_IBTREE: + case P_IRECNO: + case P_INVALID: + if (dbp->type != DB_HASH && + ((BTREE *)dbp->bt_internal)->bt_root == PGNO(p)) { + type = dbp->type == DB_RECNO ? P_LRECNO : P_LBTREE; + goto reinit; + } + break; + case P_OVERFLOW: + if (DBC_LOGGING(param->dbc)) { + if ((ret = __db_ovref_log(dbp, param->dbc->txn, + &LSN(p), 0, p->pgno, -1, &LSN(p))) != 0) + return (ret); + } else + LSN_NOT_LOGGED(LSN(p)); + if (--OV_REF(p) != 0) + *putp = 0; + break; + case P_LRECNO: + param->count += top; + if (((BTREE *)dbp->bt_internal)->bt_root == PGNO(p)) { + type = P_LRECNO; + goto reinit; + } + break; + case P_LDUP: + /* Correct for deleted items. */ + for (indx = 0; indx < top; indx += O_INDX) + if (!B_DISSET(GET_BKEYDATA(dbp, p, indx)->type)) + ++param->count; + + break; + case P_HASH: + /* Correct for on-page duplicates and deleted items. */ + for (indx = 0; indx < top; indx += P_INDX) { + switch (*H_PAIRDATA(dbp, p, indx)) { + case H_OFFDUP: + case H_OFFPAGE: + break; + case H_KEYDATA: + ++param->count; + break; + case H_DUPLICATE: + tlen = LEN_HDATA(dbp, p, 0, indx); + hk = H_PAIRDATA(dbp, p, indx); + for (off = 0; off < tlen; + off += len + 2 * sizeof (db_indx_t)) { + ++param->count; + memcpy(&len, + HKEYDATA_DATA(hk) + + off, sizeof(db_indx_t)); + } + } + } + /* Don't free the head of the bucket. */ + if (PREV_PGNO(p) == PGNO_INVALID) { + type = P_HASH; + +reinit: *putp = 0; + if (DBC_LOGGING(param->dbc)) { + pgno = PGNO_BASE_MD; + if ((ret = __db_lget(param->dbc, LCK_ALWAYS, + pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) + return (ret); + if ((ret = mpf->get(mpf, + &pgno, 0, (PAGE **)&meta)) != 0) { + goto err; + } + memset(&ldbt, 0, sizeof(ldbt)); + ldbt.data = p; + ldbt.size = P_OVERHEAD(dbp); + if ((ret = __db_pg_free_log(dbp, + param->dbc->txn, &LSN(meta), 0, + p->pgno, &LSN(meta), + PGNO_BASE_MD, &ldbt, meta->free)) != 0) + goto err; + LSN(p) = LSN(meta); + + if ((ret = + __db_pg_alloc_log(dbp, + param->dbc->txn, &LSN(meta), 0, + &LSN(meta), PGNO_BASE_MD, + &p->lsn, p->pgno, type, meta->free)) != 0) { +err: (void)mpf->put(mpf, (PAGE *)meta, 0); + (void)__TLPUT(param->dbc, metalock); + return (ret); + } + LSN(p) = LSN(meta); + + if ((ret = mpf->put(mpf, + (PAGE *)meta, DB_MPOOL_DIRTY)) != 0) { + (void)__TLPUT(param->dbc, metalock); + return (ret); + } + if ((ret = __TLPUT(param->dbc, metalock)) != 0) + return (ret); + } else + LSN_NOT_LOGGED(LSN(p)); + + P_INIT(p, dbp->pgsize, PGNO(p), PGNO_INVALID, + PGNO_INVALID, type == P_HASH ? 0 : 1, type); + } + break; + default: + return (__db_pgfmt(dbp->dbenv, p->pgno)); + } + + if (*putp == 1) { + if ((ret = __db_free(param->dbc, p)) != 0) + return (ret); + } else { + if ((ret = mpf->put(mpf, p, DB_MPOOL_DIRTY)) != 0) + return (ret); + *putp = 1; + } + + return (0); +} diff --git a/bdb/db/db_remove.c b/bdb/db/db_remove.c new file mode 100644 index 00000000000..ef11c342555 --- /dev/null +++ b/bdb/db/db_remove.c @@ -0,0 +1,318 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2001-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: db_remove.c,v 11.203 2002/08/19 18:34:18 margo Exp $"; +#endif /* not lint */ + +#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" + +static int __db_subdb_remove __P((DB *, DB_TXN *, const char *, const char *)); +static int __db_dbtxn_remove __P((DB *, DB_TXN *, const char *)); + +/* + * __dbenv_dbremove + * Remove method for DB_ENV. + * + * PUBLIC: int __dbenv_dbremove __P((DB_ENV *, + * PUBLIC: DB_TXN *, const char *, const char *, u_int32_t)); + */ +int +__dbenv_dbremove(dbenv, txn, name, subdb, flags) + DB_ENV *dbenv; + DB_TXN *txn; + const char *name, *subdb; + u_int32_t flags; +{ + DB *dbp; + int ret, t_ret, txn_local; + + txn_local = 0; + + PANIC_CHECK(dbenv); + ENV_ILLEGAL_BEFORE_OPEN(dbenv, "DB_ENV->dbremove"); + + /* Validate arguments. */ + if ((ret = __db_fchk(dbenv, "DB->remove", flags, DB_AUTO_COMMIT)) != 0) + return (ret); + + if ((ret = db_create(&dbp, dbenv, 0)) != 0) + return (ret); + + /* + * Create local transaction as necessary, check for consistent + * transaction usage. + */ + if (IS_AUTO_COMMIT(dbenv, txn, flags)) { + if ((ret = __db_txn_auto(dbp, &txn)) != 0) + return (ret); + txn_local = 1; + } else + if (txn != NULL && !TXN_ON(dbenv)) + return (__db_not_txn_env(dbenv)); + + ret = __db_remove_i(dbp, txn, name, subdb); + + /* Commit for DB_AUTO_COMMIT. */ + if (txn_local) { + if (ret == 0) + ret = txn->commit(txn, 0); + else + if ((t_ret = txn->abort(txn)) != 0) + ret = __db_panic(dbenv, t_ret); + /* + * We created the DBP here and when we committed/aborted, + * we release all the tranasctional locks, which includes + * the handle lock; mark the handle cleared explicitly. + */ + LOCK_INIT(dbp->handle_lock); + dbp->lid = DB_LOCK_INVALIDID; + } + + /* + * We never opened this dbp for real, so don't call the transactional + * version of DB->close, and use NOSYNC to avoid calling into mpool. + */ + if ((t_ret = dbp->close(dbp, DB_NOSYNC)) != 0 && ret == 0) + ret = t_ret; + + return (ret); +} + +/* + * __db_remove + * Remove method for DB. + * + * PUBLIC: int __db_remove __P((DB *, const char *, const char *, u_int32_t)); + */ +int +__db_remove(dbp, name, subdb, flags) + DB *dbp; + const char *name, *subdb; + u_int32_t flags; +{ + DB_ENV *dbenv; + int ret, t_ret; + + dbenv = dbp->dbenv; + + PANIC_CHECK(dbenv); + + /* + * Validate arguments, continuing to destroy the handle on failure. + * + * Cannot use DB_ILLEGAL_AFTER_OPEN directly because it returns. + * + * !!! + * We have a serious problem if we're here with a handle used to open + * 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->remove", 1); + goto err; + } + + /* Validate arguments. */ + if ((ret = __db_fchk(dbenv, "DB->remove", flags, 0)) != 0) + goto err; + + /* Check for consistent transaction usage. */ + if ((ret = __db_check_txn(dbp, NULL, DB_LOCK_INVALIDID, 0)) != 0) + goto err; + + /* Remove the file. */ + ret = __db_remove_i(dbp, NULL, name, subdb); + + /* + * We never opened this dbp for real, use NOSYNC to avoid calling into + * mpool. + */ +err: if ((t_ret = dbp->close(dbp, DB_NOSYNC)) != 0 && ret == 0) + ret = t_ret; + + return (ret); +} + +/* + * __db_remove_i + * Internal remove method for DB. + * + * PUBLIC: int __db_remove_i __P((DB *, DB_TXN *, const char *, const char *)); + */ +int +__db_remove_i(dbp, txn, name, subdb) + DB *dbp; + DB_TXN *txn; + const char *name, *subdb; +{ + DB_ENV *dbenv; + DB_LSN newlsn; + int ret; + char *real_name; + + dbenv = dbp->dbenv; + real_name = NULL; + + /* Handle subdatabase removes separately. */ + if (subdb != NULL) + return (__db_subdb_remove(dbp, txn, name, subdb)); + + /* Handle transactional file removes separately. */ + if (txn != NULL) + return (__db_dbtxn_remove(dbp, txn, name)); + + /* + * The remaining case is a non-transactional file remove. + * + * Find the real name of the file. + */ + if ((ret = __db_appname(dbenv, + DB_APP_DATA, name, 0, NULL, &real_name)) != 0) + return (ret); + + if ((ret = __fop_remove_setup(dbp, NULL, real_name, 0)) != 0) + goto err; + + if (dbp->db_am_remove != NULL && + (ret = dbp->db_am_remove(dbp, NULL, name, subdb, &newlsn)) != 0) + goto err; + + ret = __fop_remove(dbenv, NULL, dbp->fileid, name, DB_APP_DATA); + +err: + if (real_name != NULL) + __os_free(dbenv, real_name); + + return (ret); +} + +/* + * __db_subdb_remove -- + * Remove a subdatabase. + */ +static int +__db_subdb_remove(dbp, txn, name, subdb) + DB *dbp; + DB_TXN *txn; + const char *name, *subdb; +{ + DB *mdbp, *sdbp; + int ret, t_ret; + + mdbp = sdbp = NULL; + + /* Open the subdatabase. */ + if ((ret = db_create(&sdbp, dbp->dbenv, 0)) != 0) + goto err; + if ((ret = __db_open(sdbp, + txn, name, subdb, DB_UNKNOWN, DB_WRITEOPEN, 0)) != 0) + goto err; + + DB_TEST_RECOVERY(sdbp, DB_TEST_PREDESTROY, ret, name); + + /* Free up the pages in the subdatabase. */ + switch (sdbp->type) { + case DB_BTREE: + case DB_RECNO: + if ((ret = __bam_reclaim(sdbp, txn)) != 0) + goto err; + break; + case DB_HASH: + if ((ret = __ham_reclaim(sdbp, txn)) != 0) + goto err; + break; + default: + ret = __db_unknown_type( + sdbp->dbenv, "__db_subdb_remove", sdbp->type); + goto err; + } + + /* + * Remove the entry from the main database and free the subdatabase + * metadata page. + */ + if ((ret = __db_master_open(sdbp, txn, name, 0, 0, &mdbp)) != 0) + goto err; + + if ((ret = __db_master_update( + mdbp, sdbp, txn, subdb, sdbp->type, MU_REMOVE, NULL, 0)) != 0) + goto err; + + DB_TEST_RECOVERY(sdbp, DB_TEST_POSTDESTROY, ret, name); + +DB_TEST_RECOVERY_LABEL +err: + /* Close the main and subdatabases. */ + if ((t_ret = __db_close_i(sdbp, txn, 0)) != 0 && ret == 0) + ret = t_ret; + + if (mdbp != NULL && + (t_ret = __db_close_i(mdbp, txn, 0)) != 0 && ret == 0) + ret = t_ret; + + return (ret); +} + +static int +__db_dbtxn_remove(dbp, txn, name) + DB *dbp; + DB_TXN *txn; + const char *name; +{ + DB_ENV *dbenv; + DB_LSN newlsn; + int ret; + char *tmpname; + + dbenv = dbp->dbenv; + tmpname = NULL; + + /* + * This is a transactional rename, 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) + return (ret); + + DB_TEST_RECOVERY(dbp, DB_TEST_PREDESTROY, ret, name); + + if ((ret = __db_rename_i(dbp, txn, name, NULL, tmpname)) != 0) + goto err; + + /* The internal removes will also translate into delayed removes. */ + if (dbp->db_am_remove != NULL && + (ret = dbp->db_am_remove(dbp, txn, tmpname, NULL, &newlsn)) != 0) + goto err; + + ret = __fop_remove(dbenv, txn, dbp->fileid, tmpname, DB_APP_DATA); + + DB_TEST_RECOVERY(dbp, DB_TEST_POSTDESTROY, ret, name); + +err: +DB_TEST_RECOVERY_LABEL + if (tmpname != NULL) + __os_free(dbenv, tmpname); + + return (ret); +} diff --git a/bdb/db/db_rename.c b/bdb/db/db_rename.c new file mode 100644 index 00000000000..87f88232cda --- /dev/null +++ b/bdb/db/db_rename.c @@ -0,0 +1,297 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2001-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: db_rename.c,v 11.203 2002/08/07 16:16:47 bostic Exp $"; +#endif /* not lint */ + +#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" + +static int __db_subdb_rename __P(( DB *, DB_TXN *, + const char *, const char *, const char *)); + +/* + * __dbenv_dbrename + * Rename method for DB_ENV. + * + * PUBLIC: int __dbenv_dbrename __P((DB_ENV *, DB_TXN *, + * PUBLIC: const char *, const char *, const char *, u_int32_t)); + */ +int +__dbenv_dbrename(dbenv, txn, name, subdb, newname, flags) + DB_ENV *dbenv; + DB_TXN *txn; + const char *name, *subdb, *newname; + u_int32_t flags; +{ + DB *dbp; + int ret, t_ret, txn_local; + + txn_local = 0; + + PANIC_CHECK(dbenv); + ENV_ILLEGAL_BEFORE_OPEN(dbenv, "DB_ENV->dbrename"); + + /* Validate arguments. */ + if ((ret = __db_fchk(dbenv, "DB->rename", flags, DB_AUTO_COMMIT)) != 0) + return (ret); + + if ((ret = db_create(&dbp, dbenv, 0)) != 0) + return (ret); + + /* + * Create local transaction as necessary, check for consistent + * transaction usage. + */ + if (IS_AUTO_COMMIT(dbenv, txn, flags)) { + if ((ret = __db_txn_auto(dbp, &txn)) != 0) + return (ret); + txn_local = 1; + } else + if (txn != NULL && !TXN_ON(dbenv)) + return (__db_not_txn_env(dbenv)); + + ret = __db_rename_i(dbp, txn, name, subdb, newname); + + /* Commit for DB_AUTO_COMMIT. */ + if (txn_local) { + if (ret == 0) + ret = txn->commit(txn, 0); + else + if ((t_ret = txn->abort(txn)) != 0) + ret = __db_panic(dbenv, t_ret); + + /* + * We created the DBP here and when we committed/aborted, + * we release all the tranasctional locks, which includes + * the handle lock; mark the handle cleared explicitly. + */ + LOCK_INIT(dbp->handle_lock); + dbp->lid = DB_LOCK_INVALIDID; + } + + /* + * We never opened this dbp for real, so don't call the transactional + * version of DB->close, and use NOSYNC to avoid calling into mpool. + */ + if ((t_ret = dbp->close(dbp, DB_NOSYNC)) != 0 && ret == 0) + ret = t_ret; + + return (ret); +} + +/* + * __db_rename + * Rename method for DB. + * + * PUBLIC: int __db_rename __P((DB *, + * PUBLIC: const char *, const char *, const char *, u_int32_t)); + */ +int +__db_rename(dbp, name, subdb, newname, flags) + DB *dbp; + const char *name, *subdb, *newname; + u_int32_t flags; +{ + DB_ENV *dbenv; + int ret, t_ret; + + dbenv = dbp->dbenv; + + PANIC_CHECK(dbenv); + + /* + * Validate arguments, continuing to destroy the handle on failure. + * + * Cannot use DB_ILLEGAL_AFTER_OPEN directly because it returns. + * + * !!! + * We have a serious problem if we're here with a handle used to open + * 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; + } + + /* Validate arguments. */ + if ((ret = __db_fchk(dbenv, "DB->rename", flags, 0)) != 0) + goto err; + + /* Check for consistent transaction usage. */ + if ((ret = __db_check_txn(dbp, NULL, DB_LOCK_INVALIDID, 0)) != 0) + goto err; + + /* Rename the file. */ + ret = __db_rename_i(dbp, NULL, name, subdb, newname); + + /* + * We never opened this dbp for real, use NOSYNC to avoid calling into + * mpool. + */ +err: if ((t_ret = dbp->close(dbp, DB_NOSYNC)) != 0 && ret == 0) + ret = t_ret; + + return (ret); +} + +/* + * __db_rename_i + * Internal rename method for DB. + * + * PUBLIC: int __db_rename_i __P((DB *, + * PUBLIC: DB_TXN *, const char *, const char *, const char *)); + */ +int +__db_rename_i(dbp, txn, name, subdb, newname) + DB *dbp; + DB_TXN *txn; + const char *name, *subdb, *newname; +{ + DB_ENV *dbenv; + int ret; + char *real_name; + + dbenv = dbp->dbenv; + real_name = NULL; + + DB_TEST_RECOVERY(dbp, DB_TEST_PREDESTROY, ret, name); + + if (subdb != NULL) { + ret = __db_subdb_rename(dbp, txn, name, subdb, newname); + goto err; + } + + /* From here on down, this pertains to files. */ + + /* Find the real name of the file. */ + if ((ret = __db_appname(dbenv, + DB_APP_DATA, name, 0, NULL, &real_name)) != 0) + goto err; + + if ((ret = __fop_remove_setup(dbp, txn, real_name, 0)) != 0) + goto err; + + if (dbp->db_am_rename != NULL && + (ret = dbp->db_am_rename(dbp, txn, name, subdb, newname)) != 0) + goto err; + + /* + * The transactional case and non-transactional case are + * quite different. In the non-transactional case, we simply + * do the rename. In the transactional case, since we need + * the ability to back out and maintain locking, we have to + * 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) + goto err; + } else { + if ((ret = __fop_dbrename(dbp, name, newname)) != 0) + goto err; + } + + /* + * 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 || + 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) + __os_free(dbenv, real_name); + + return (ret); +} + +/* + * __db_subdb_rename -- + * Rename a subdatabase. + */ +static int +__db_subdb_rename(dbp, txn, name, subdb, newname) + DB *dbp; + DB_TXN *txn; + const char *name, *subdb, *newname; +{ + DB *mdbp; + DB_ENV *dbenv; + PAGE *meta; + int ret, t_ret; + + mdbp = NULL; + meta = NULL; + dbenv = dbp->dbenv; + + /* + * We have not opened this dbp so it isn't marked as a subdb, + * but it ought to be. + */ + F_SET(dbp, DB_AM_SUBDB); + + /* + * Rename the entry in the main database. We need to first + * get the meta-data page number (via MU_OPEN) so that we can + * read the meta-data page and obtain a handle lock. Once we've + * done that, we can proceed to do the rename in the master. + */ + if ((ret = __db_master_open(dbp, txn, name, 0, 0, &mdbp)) != 0) + goto err; + + if ((ret = __db_master_update(mdbp, dbp, txn, subdb, dbp->type, + MU_OPEN, NULL, 0)) != 0) + goto err; + + if ((ret = mdbp->mpf->get(mdbp->mpf, &dbp->meta_pgno, 0, &meta)) != 0) + goto err; + memcpy(&dbp->fileid, ((DBMETA *)meta)->uid, DB_FILE_ID_LEN); + if ((ret = __fop_lock_handle(dbenv, + dbp, mdbp->lid, DB_LOCK_WRITE, NULL, 0)) != 0) + goto err; + + ret = mdbp->mpf->put(mdbp->mpf, meta, 0); + meta = NULL; + if (ret != 0) + goto err; + + if ((ret = __db_master_update(mdbp, dbp, txn, + subdb, dbp->type, MU_RENAME, newname, 0)) != 0) + goto err; + + DB_TEST_RECOVERY(dbp, DB_TEST_POSTDESTROY, ret, name); + +DB_TEST_RECOVERY_LABEL +err: + if (meta != NULL && + (t_ret = mdbp->mpf->put(mdbp->mpf, meta, 0)) != 0 && ret == 0) + ret = t_ret; + + if (mdbp != NULL && + (t_ret = __db_close_i(mdbp, txn, 0)) != 0 && ret == 0) + ret = t_ret; + + return (ret); +} diff --git a/bdb/db/db_ret.c b/bdb/db/db_ret.c index 0782de3e450..b1af7b4ffeb 100644 --- a/bdb/db/db_ret.c +++ b/bdb/db/db_ret.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_ret.c,v 11.12 2000/11/30 00:58:33 ubell Exp $"; +static const char revid[] = "$Id: db_ret.c,v 11.21 2002/03/28 19:21:47 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,9 +18,8 @@ static const char revid[] = "$Id: db_ret.c,v 11.12 2000/11/30 00:58:33 ubell Exp #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" -#include "db_am.h" +#include "dbinc/db_page.h" +#include "dbinc/db_am.h" /* * __db_ret -- @@ -47,19 +46,19 @@ __db_ret(dbp, h, indx, dbt, memp, memsize) switch (TYPE(h)) { case P_HASH: - hk = P_ENTRY(h, indx); + hk = P_ENTRY(dbp, h, indx); if (HPAGE_PTYPE(hk) == H_OFFPAGE) { memcpy(&ho, hk, sizeof(HOFFPAGE)); return (__db_goff(dbp, dbt, ho.tlen, ho.pgno, memp, memsize)); } - len = LEN_HKEYDATA(h, dbp->pgsize, indx); + len = LEN_HKEYDATA(dbp, h, dbp->pgsize, indx); data = HKEYDATA_DATA(hk); break; case P_LBTREE: case P_LDUP: case P_LRECNO: - bk = GET_BKEYDATA(h, indx); + bk = GET_BKEYDATA(dbp, h, indx); if (B_TYPE(bk->type) == B_OVERFLOW) { bo = (BOVERFLOW *)bk; return (__db_goff(dbp, dbt, @@ -69,33 +68,30 @@ __db_ret(dbp, h, indx, dbt, memp, memsize) data = bk->data; break; default: - return (__db_pgfmt(dbp, h->pgno)); + return (__db_pgfmt(dbp->dbenv, h->pgno)); } - return (__db_retcopy(dbp, dbt, data, len, memp, memsize)); + return (__db_retcopy(dbp->dbenv, dbt, data, len, memp, memsize)); } /* * __db_retcopy -- * Copy the returned data into the user's DBT, handling special flags. * - * PUBLIC: int __db_retcopy __P((DB *, DBT *, + * PUBLIC: int __db_retcopy __P((DB_ENV *, DBT *, * PUBLIC: void *, u_int32_t, void **, u_int32_t *)); */ int -__db_retcopy(dbp, dbt, data, len, memp, memsize) - DB *dbp; +__db_retcopy(dbenv, dbt, data, len, memp, memsize) + DB_ENV *dbenv; DBT *dbt; void *data; u_int32_t len; void **memp; u_int32_t *memsize; { - DB_ENV *dbenv; int ret; - dbenv = dbp == NULL ? NULL : dbp->dbenv; - /* If returning a partial record, reset the length. */ if (F_ISSET(dbt, DB_DBT_PARTIAL)) { data = (u_int8_t *)data + dbt->doff; @@ -131,12 +127,10 @@ __db_retcopy(dbp, dbt, data, len, memp, memsize) * memory pointer is allowed to be NULL. */ if (F_ISSET(dbt, DB_DBT_MALLOC)) { - if ((ret = __os_malloc(dbenv, len, - dbp == NULL ? NULL : dbp->db_malloc, &dbt->data)) != 0) + if ((ret = __os_umalloc(dbenv, len, &dbt->data)) != 0) return (ret); } else if (F_ISSET(dbt, DB_DBT_REALLOC)) { - if ((ret = __os_realloc(dbenv, len, - dbp == NULL ? NULL : dbp->db_realloc, &dbt->data)) != 0) + if ((ret = __os_urealloc(dbenv, len, &dbt->data)) != 0) return (ret); } else if (F_ISSET(dbt, DB_DBT_USERMEM)) { if (len != 0 && (dbt->data == NULL || dbt->ulen < len)) @@ -145,7 +139,7 @@ __db_retcopy(dbp, dbt, data, len, memp, memsize) return (EINVAL); } else { if (len != 0 && (*memsize == 0 || *memsize < len)) { - if ((ret = __os_realloc(dbenv, len, NULL, memp)) != 0) { + if ((ret = __os_realloc(dbenv, len, memp)) != 0) { *memsize = 0; return (ret); } diff --git a/bdb/db/db_truncate.c b/bdb/db/db_truncate.c new file mode 100644 index 00000000000..49546ae51b9 --- /dev/null +++ b/bdb/db/db_truncate.c @@ -0,0 +1,95 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2001-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: db_truncate.c,v 11.185 2002/08/07 16:16:48 bostic Exp $"; +#endif /* not lint */ + +#ifndef NO_SYSTEM_INCLUDES +#include +#endif + +#include "db_int.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" +#include "dbinc/hash.h" +#include "dbinc/qam.h" + +/* + * __db_truncate + * truncate method for DB. + * + * PUBLIC: int __db_truncate __P((DB *, DB_TXN *, u_int32_t *, u_int32_t)); + */ +int +__db_truncate(dbp, txn, countp, flags) + DB *dbp; + DB_TXN *txn; + u_int32_t *countp, flags; +{ + DB_ENV *dbenv; + int ret, t_ret, txn_local; + + dbenv = dbp->dbenv; + ret = txn_local = 0; + + PANIC_CHECK(dbenv); + + /* Check for invalid flags. */ + if ((ret = + __db_fchk(dbenv, "DB->truncate", flags, DB_AUTO_COMMIT)) != 0) + return (ret); + + /* + * Create local transaction as necessary, check for consistent + * transaction usage. + */ + if (IS_AUTO_COMMIT(dbenv, txn, flags)) { + if ((ret = __db_txn_auto(dbp, &txn)) != 0) + return (ret); + txn_local = 1; + } else + if (txn != NULL && !TXN_ON(dbenv)) + return (__db_not_txn_env(dbenv)); + + DB_TEST_RECOVERY(dbp, DB_TEST_PREDESTROY, ret, NULL); + switch (dbp->type) { + case DB_BTREE: + case DB_RECNO: + if ((ret = __bam_truncate(dbp, txn, countp)) != 0) + goto err; + break; + case DB_HASH: + if ((ret = __ham_truncate(dbp, txn, countp)) != 0) + goto err; + break; + case DB_QUEUE: + if ((ret = __qam_truncate(dbp, txn, countp)) != 0) + goto err; + break; + default: + ret = __db_unknown_type( + dbenv, "__db_truncate", dbp->type); + goto err; + } + DB_TEST_RECOVERY(dbp, DB_TEST_POSTDESTROY, ret, NULL); + +DB_TEST_RECOVERY_LABEL +err: + /* Commit for DB_AUTO_COMMIT. */ + if (txn_local) { + if (ret == 0) + ret = txn->commit(txn, 0); + else + if ((t_ret = txn->abort(txn)) != 0) + ret = __db_panic(dbenv, t_ret); + } + + return (ret); +} diff --git a/bdb/db/db_upg.c b/bdb/db/db_upg.c index d8573146ad6..c0eb72f3713 100644 --- a/bdb/db/db_upg.c +++ b/bdb/db/db_upg.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_upg.c,v 11.20 2000/12/12 17:35:30 bostic Exp $"; +static const char revid[] = "$Id: db_upg.c,v 11.29 2002/03/27 18:59:04 krinsky Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,11 +18,11 @@ static const char revid[] = "$Id: db_upg.c,v 11.20 2000/12/12 17:35:30 bostic Ex #endif #include "db_int.h" -#include "db_page.h" -#include "db_swap.h" -#include "btree.h" -#include "hash.h" -#include "qam.h" +#include "dbinc/db_page.h" +#include "dbinc/db_swap.h" +#include "dbinc/btree.h" +#include "dbinc/hash.h" +#include "dbinc/qam.h" static int (* const func_31_list[P_PAGETYPE_MAX]) __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *)) = { @@ -68,7 +68,7 @@ __db_upgrade(dbp, fname, flags) /* Get the real backing file name. */ if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, fname, 0, NULL, &real_name)) != 0) + DB_APP_DATA, fname, 0, NULL, &real_name)) != 0) return (ret); /* Open the file. */ @@ -117,6 +117,7 @@ __db_upgrade(dbp, fname, flags) goto err; /* FALLTHROUGH */ case 8: + case 9: break; default: __db_err(dbenv, "%s: unsupported btree version: %lu", @@ -173,6 +174,7 @@ __db_upgrade(dbp, fname, flags) goto err; /* FALLTHROUGH */ case 7: + case 8: break; default: __db_err(dbenv, "%s: unsupported hash version: %lu", @@ -202,6 +204,7 @@ __db_upgrade(dbp, fname, flags) goto err; /* FALLTHROUGH */ case 3: + case 4: break; default: __db_err(dbenv, "%s: unsupported queue version: %lu", @@ -231,9 +234,9 @@ __db_upgrade(dbp, fname, flags) ret = __os_fsync(dbenv, &fh); -err: if ((t_ret = __os_closehandle(&fh)) != 0 && ret == 0) +err: if ((t_ret = __os_closehandle(dbenv, &fh)) != 0 && ret == 0) ret = t_ret; - __os_freestr(real_name); + __os_free(dbenv, real_name); /* We're done. */ if (dbp->db_feedback != NULL) @@ -268,7 +271,7 @@ __db_page_pass(dbp, real_name, flags, fl, fhp) return (ret); /* Allocate memory for a single page. */ - if ((ret = __os_malloc(dbenv, dbp->pgsize, NULL, &page)) != 0) + if ((ret = __os_malloc(dbenv, dbp->pgsize, &page)) != 0) return (ret); /* Walk the file, calling the underlying conversion functions. */ @@ -294,7 +297,7 @@ __db_page_pass(dbp, real_name, flags, fl, fhp) } } - __os_free(page, dbp->pgsize); + __os_free(dbp->dbenv, page); return (ret); } diff --git a/bdb/db/db_upg_opd.c b/bdb/db/db_upg_opd.c index a7be784afb8..f410b797bff 100644 --- a/bdb/db/db_upg_opd.c +++ b/bdb/db/db_upg_opd.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_upg_opd.c,v 11.9 2000/11/30 00:58:33 ubell Exp $"; +static const char revid[] = "$Id: db_upg_opd.c,v 11.18 2002/08/06 06:11:18 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -18,11 +18,8 @@ static const char revid[] = "$Id: db_upg_opd.c,v 11.9 2000/11/30 00:58:33 ubell #endif #include "db_int.h" -#include "db_page.h" -#include "db_swap.h" -#include "btree.h" -#include "hash.h" -#include "qam.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" static int __db_build_bi __P((DB *, DB_FH *, PAGE *, PAGE *, u_int32_t, int *)); static int __db_build_ri __P((DB *, DB_FH *, PAGE *, PAGE *, u_int32_t, int *)); @@ -71,7 +68,7 @@ __db_31_offdup(dbp, real_name, fhp, sorted, pgnop) pgno_cur = pgno_next = NULL; /* Allocate room to hold a page. */ - if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, NULL, &page)) != 0) + if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, &page)) != 0) goto err; /* @@ -85,7 +82,7 @@ __db_31_offdup(dbp, real_name, fhp, sorted, pgnop) if (pgno_max == cur_cnt) { pgno_max += 20; if ((ret = __os_realloc(dbp->dbenv, pgno_max * - sizeof(db_pgno_t), NULL, &pgno_cur)) != 0) + sizeof(db_pgno_t), &pgno_cur)) != 0) goto err; } pgno_cur[cur_cnt++] = pgno; @@ -112,7 +109,7 @@ __db_31_offdup(dbp, real_name, fhp, sorted, pgnop) * list while we do so. */ if ((ret = __os_malloc(dbp->dbenv, - cur_cnt * sizeof(db_pgno_t), NULL, &pgno_next)) != 0) + cur_cnt * sizeof(db_pgno_t), &pgno_next)) != 0) goto err; /* Figure out where we can start allocating new pages. */ @@ -121,7 +118,7 @@ __db_31_offdup(dbp, real_name, fhp, sorted, pgnop) /* Allocate room for an internal page. */ if ((ret = __os_malloc(dbp->dbenv, - dbp->pgsize, NULL, &ipage)) != 0) + dbp->pgsize, &ipage)) != 0) goto err; PGNO(ipage) = PGNO_INVALID; } @@ -187,13 +184,13 @@ __db_31_offdup(dbp, real_name, fhp, sorted, pgnop) *pgnop = pgno_cur[0]; err: if (pgno_cur != NULL) - __os_free(pgno_cur, 0); + __os_free(dbp->dbenv, pgno_cur); if (pgno_next != NULL) - __os_free(pgno_next, 0); + __os_free(dbp->dbenv, pgno_next); if (ipage != NULL) - __os_free(ipage, dbp->pgsize); + __os_free(dbp->dbenv, ipage); if (page != NULL) - __os_free(page, dbp->pgsize); + __os_free(dbp->dbenv, page); return (ret); } @@ -214,22 +211,24 @@ __db_build_bi(dbp, fhp, ipage, page, indx, nomemp) BKEYDATA *child_bk; u_int8_t *p; int ret; + db_indx_t *inp; + inp = P_INP(dbp, ipage); switch (TYPE(page)) { case P_IBTREE: - child_bi = GET_BINTERNAL(page, 0); - if (P_FREESPACE(ipage) < BINTERNAL_PSIZE(child_bi->len)) { + child_bi = GET_BINTERNAL(dbp, page, 0); + if (P_FREESPACE(dbp, ipage) < BINTERNAL_PSIZE(child_bi->len)) { *nomemp = 1; return (0); } - ipage->inp[indx] = - HOFFSET(ipage) -= BINTERNAL_SIZE(child_bi->len); - p = P_ENTRY(ipage, indx); + inp[indx] = + HOFFSET(ipage) -= BINTERNAL_SIZE(child_bi->len); + p = P_ENTRY(dbp, ipage, indx); bi.len = child_bi->len; B_TSET(bi.type, child_bi->type, 0); bi.pgno = PGNO(page); - bi.nrecs = __bam_total(page); + bi.nrecs = __bam_total(dbp, page); memcpy(p, &bi, SSZA(BINTERNAL, data)); p += SSZA(BINTERNAL, data); memcpy(p, child_bi->data, child_bi->len); @@ -241,40 +240,40 @@ __db_build_bi(dbp, fhp, ipage, page, indx, nomemp) return (ret); break; case P_LDUP: - child_bk = GET_BKEYDATA(page, 0); + child_bk = GET_BKEYDATA(dbp, page, 0); switch (B_TYPE(child_bk->type)) { case B_KEYDATA: - if (P_FREESPACE(ipage) < + if (P_FREESPACE(dbp, ipage) < BINTERNAL_PSIZE(child_bk->len)) { *nomemp = 1; return (0); } - ipage->inp[indx] = + inp[indx] = HOFFSET(ipage) -= BINTERNAL_SIZE(child_bk->len); - p = P_ENTRY(ipage, indx); + p = P_ENTRY(dbp, ipage, indx); bi.len = child_bk->len; B_TSET(bi.type, child_bk->type, 0); bi.pgno = PGNO(page); - bi.nrecs = __bam_total(page); + bi.nrecs = __bam_total(dbp, page); memcpy(p, &bi, SSZA(BINTERNAL, data)); p += SSZA(BINTERNAL, data); memcpy(p, child_bk->data, child_bk->len); break; case B_OVERFLOW: - if (P_FREESPACE(ipage) < + if (P_FREESPACE(dbp, ipage) < BINTERNAL_PSIZE(BOVERFLOW_SIZE)) { *nomemp = 1; return (0); } - ipage->inp[indx] = + inp[indx] = HOFFSET(ipage) -= BINTERNAL_SIZE(BOVERFLOW_SIZE); - p = P_ENTRY(ipage, indx); + p = P_ENTRY(dbp, ipage, indx); bi.len = BOVERFLOW_SIZE; B_TSET(bi.type, child_bk->type, 0); bi.pgno = PGNO(page); - bi.nrecs = __bam_total(page); + bi.nrecs = __bam_total(dbp, page); memcpy(p, &bi, SSZA(BINTERNAL, data)); p += SSZA(BINTERNAL, data); memcpy(p, child_bk, BOVERFLOW_SIZE); @@ -285,11 +284,11 @@ __db_build_bi(dbp, fhp, ipage, page, indx, nomemp) return (ret); break; default: - return (__db_pgfmt(dbp, PGNO(page))); + return (__db_pgfmt(dbp->dbenv, PGNO(page))); } break; default: - return (__db_pgfmt(dbp, PGNO(page))); + return (__db_pgfmt(dbp->dbenv, PGNO(page))); } return (0); @@ -308,19 +307,19 @@ __db_build_ri(dbp, fhp, ipage, page, indx, nomemp) int *nomemp; { RINTERNAL ri; + db_indx_t *inp; - COMPQUIET(dbp, NULL); COMPQUIET(fhp, NULL); - - if (P_FREESPACE(ipage) < RINTERNAL_PSIZE) { + inp = P_INP(dbp, ipage); + if (P_FREESPACE(dbp, ipage) < RINTERNAL_PSIZE) { *nomemp = 1; return (0); } ri.pgno = PGNO(page); - ri.nrecs = __bam_total(page); - ipage->inp[indx] = HOFFSET(ipage) -= RINTERNAL_SIZE; - memcpy(P_ENTRY(ipage, indx), &ri, RINTERNAL_SIZE); + ri.nrecs = __bam_total(dbp, page); + inp[indx] = HOFFSET(ipage) -= RINTERNAL_SIZE; + memcpy(P_ENTRY(dbp, ipage, indx), &ri, RINTERNAL_SIZE); return (0); } @@ -340,14 +339,14 @@ __db_up_ovref(dbp, fhp, pgno) int ret; /* Allocate room to hold a page. */ - if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, NULL, &page)) != 0) + if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, &page)) != 0) return (ret); GET_PAGE(dbp, fhp, pgno, page); ++OV_REF(page); PUT_PAGE(dbp, fhp, pgno, page); -err: __os_free(page, dbp->pgsize); +err: __os_free(dbp->dbenv, page); return (ret); } diff --git a/bdb/db/db_vrfy.c b/bdb/db/db_vrfy.c index 3509e05e91f..1bbecdbd87a 100644 --- a/bdb/db/db_vrfy.c +++ b/bdb/db/db_vrfy.c @@ -1,16 +1,16 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2000 + * Copyright (c) 2000-2002 * Sleepycat Software. All rights reserved. * - * $Id: db_vrfy.c,v 1.53 2001/01/11 18:19:51 bostic Exp $ + * $Id: db_vrfy.c,v 1.107 2002/09/03 17:27:15 bostic Exp $ */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_vrfy.c,v 1.53 2001/01/11 18:19:51 bostic Exp $"; +static const char revid[] = "$Id: db_vrfy.c,v 1.107 2002/09/03 17:27:15 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -20,19 +20,25 @@ static const char revid[] = "$Id: db_vrfy.c,v 1.53 2001/01/11 18:19:51 bostic Ex #endif #include "db_int.h" -#include "db_page.h" -#include "db_swap.h" -#include "db_verify.h" -#include "db_ext.h" -#include "btree.h" -#include "hash.h" -#include "qam.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" +#include "dbinc/hash.h" +#include "dbinc/lock.h" +#include "dbinc/qam.h" +#include "dbinc/txn.h" static int __db_guesspgsize __P((DB_ENV *, DB_FH *)); static int __db_is_valid_magicno __P((u_int32_t, DBTYPE *)); static int __db_is_valid_pagetype __P((u_int32_t)); static int __db_meta2pgset __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, DB *)); +static int __db_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, + PAGE *, void *, int (*)(void *, const void *), u_int32_t)); +static int __db_salvage_subdbpg __P((DB *, VRFY_DBINFO *, + PAGE *, void *, int (*)(void *, const void *), u_int32_t)); static int __db_salvage_subdbs __P((DB *, VRFY_DBINFO *, void *, int(*)(void *, const void *), u_int32_t, int *)); @@ -136,9 +142,7 @@ __db_verify_internal(dbp_orig, name, subdb, handle, callback, flags) DB *dbp; DB_ENV *dbenv; DB_FH fh, *fhp; - PAGE *h; VRFY_DBINFO *vdp; - db_pgno_t last; int has, ret, isbad; char *real_name; @@ -153,16 +157,22 @@ __db_verify_internal(dbp_orig, name, subdb, handle, callback, flags) PANIC_CHECK(dbenv); DB_ILLEGAL_AFTER_OPEN(dbp_orig, "verify"); -#define OKFLAGS (DB_AGGRESSIVE | DB_NOORDERCHK | DB_ORDERCHKONLY | DB_SALVAGE) +#define OKFLAGS (DB_AGGRESSIVE | DB_NOORDERCHK | DB_ORDERCHKONLY | \ + DB_PRINTABLE | DB_SALVAGE) if ((ret = __db_fchk(dbenv, "DB->verify", flags, OKFLAGS)) != 0) return (ret); /* * DB_SALVAGE is mutually exclusive with the other flags except - * DB_AGGRESSIVE. + * DB_AGGRESSIVE and DB_PRINTABLE. */ if (LF_ISSET(DB_SALVAGE) && - (flags & ~DB_AGGRESSIVE) != DB_SALVAGE) + (flags & ~DB_AGGRESSIVE & ~DB_PRINTABLE) != DB_SALVAGE) + return (__db_ferr(dbenv, "__db_verify", 1)); + + /* DB_AGGRESSIVE and DB_PRINTABLE are only meaningful when salvaging. */ + if ((LF_ISSET(DB_AGGRESSIVE) || LF_ISSET(DB_PRINTABLE)) && + !LF_ISSET(DB_SALVAGE)) return (__db_ferr(dbenv, "__db_verify", 1)); if (LF_ISSET(DB_ORDERCHKONLY) && flags != DB_ORDERCHKONLY) @@ -232,9 +242,17 @@ __db_verify_internal(dbp_orig, name, subdb, handle, callback, flags) if ((ret = __db_vrfy_dbinfo_create(dbenv, 1024, &vdp)) != 0) goto err; + /* + * Note whether the user has requested that we use printable + * chars where possible. We won't get here with this flag if + * we're not salvaging. + */ + if (LF_ISSET(DB_PRINTABLE)) + F_SET(vdp, SALVAGE_PRINTABLE); + /* Find the real name of the file. */ if ((ret = __db_appname(dbenv, - DB_APP_DATA, NULL, name, 0, NULL, &real_name)) != 0) + DB_APP_DATA, name, 0, NULL, &real_name)) != 0) goto err; /* @@ -271,25 +289,15 @@ __db_verify_internal(dbp_orig, name, subdb, handle, callback, flags) * the [safe] part of __db_open that initializes the environment-- * and the mpool--manually. */ - if ((ret = __db_dbenv_setup(dbp, - name, DB_ODDFILESIZE | DB_RDONLY)) != 0) + if ((ret = __db_dbenv_setup(dbp, NULL, + name, TXN_INVALID, DB_ODDFILESIZE | DB_RDONLY)) != 0) return (ret); /* Mark the dbp as opened, so that we correctly handle its close. */ - F_SET(dbp, DB_OPEN_CALLED); + F_SET(dbp, DB_AM_OPEN_CALLED); - /* - * Find out the page number of the last page in the database. - * - * XXX: This currently fails if the last page is of bad type, - * because it calls __db_pgin and that pukes. This is bad. - */ - if ((ret = memp_fget(dbp->mpf, &last, DB_MPOOL_LAST, &h)) != 0) - goto err; - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) - goto err; - - vdp->last_pgno = last; + /* Find out the page number of the last page in the database. */ + dbp->mpf->last_pgno(dbp->mpf, &vdp->last_pgno); /* * DB_ORDERCHKONLY is a special case; our file consists of @@ -373,7 +381,10 @@ __db_verify_internal(dbp_orig, name, subdb, handle, callback, flags) } if (0) { -err: (void)__db_err(dbenv, "%s: %s", name, db_strerror(ret)); + /* Don't try to strerror() DB_VERIFY_FATAL; it's private. */ +err: if (ret == DB_VERIFY_FATAL) + ret = DB_VERIFY_BAD; + (void)__db_err(dbenv, "%s: %s", name, db_strerror(ret)); } if (LF_ISSET(DB_SALVAGE) && @@ -385,13 +396,13 @@ done: if (!LF_ISSET(DB_SALVAGE) && dbp->db_feedback != NULL) dbp->db_feedback(dbp, DB_VERIFY, 100); if (F_ISSET(fhp, DB_FH_VALID)) - (void)__os_closehandle(fhp); + (void)__os_closehandle(dbenv, fhp); if (dbp) (void)dbp->close(dbp, 0); if (vdp) - (void)__db_vrfy_dbinfo_destroy(vdp); + (void)__db_vrfy_dbinfo_destroy(dbenv, vdp); if (real_name) - __os_freestr(real_name); + __os_free(dbenv, real_name); if ((ret == 0 && isbad == 1) || ret == DB_VERIFY_FATAL) ret = DB_VERIFY_BAD; @@ -417,10 +428,11 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags) DB_ENV *dbenv; VRFY_PAGEINFO *pip; db_pgno_t freelist; - int t_ret, ret, nr, swapped; + size_t nr; + int isbad, ret, swapped; u_int8_t mbuf[DBMETASIZE]; - swapped = ret = t_ret = 0; + isbad = ret = swapped = 0; freelist = 0; dbenv = dbp->dbenv; meta = (DBMETA *)mbuf; @@ -432,29 +444,43 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags) * 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) - goto err; - - if ((ret = __os_read(dbenv, fhp, mbuf, DBMETASIZE, (size_t *)&nr)) != 0) - goto err; + if ((ret = __os_seek(dbenv, fhp, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 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)); + return (ret); + } if (nr != DBMETASIZE) { - EPRINT((dbp->dbenv, - "Incomplete metadata page %lu", (u_long)PGNO_BASE_MD)); - t_ret = DB_VERIFY_FATAL; - goto err; + EPRINT((dbenv, + "Page %lu: Incomplete metadata page", + (u_long)PGNO_BASE_MD)); + return (DB_VERIFY_FATAL); + } + + if ((ret = __db_chk_meta(dbenv, dbp, meta, 1)) != 0) { + EPRINT((dbenv, + "Page %lu: metadata page corrupted, (u_long)PGNO_BASE_MD")); + isbad = 1; + if (ret != -1) { + EPRINT((dbenv, + "Page %lu: could not check metadata page", + (u_long)PGNO_BASE_MD)); + return (DB_VERIFY_FATAL); + } } /* * Check all of the fields that we can. + * + * 08-11: Current page number. Must == pgno. + * Note that endianness doesn't matter--it's zero. */ - - /* 08-11: Current page number. Must == pgno. */ - /* Note that endianness doesn't matter--it's zero. */ if (meta->pgno != PGNO_BASE_MD) { - EPRINT((dbp->dbenv, "Bad pgno: was %lu, should be %lu", - (u_long)meta->pgno, (u_long)PGNO_BASE_MD)); - ret = DB_VERIFY_BAD; + isbad = 1; + EPRINT((dbenv, "Page %lu: pgno incorrectly set to %lu", + (u_long)PGNO_BASE_MD, (u_long)meta->pgno)); } /* 12-15: Magic number. Must be one of valid set. */ @@ -466,9 +492,10 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags) &dbp->type)) swapped = 1; else { - EPRINT((dbp->dbenv, - "Bad magic number: %lu", (u_long)meta->magic)); - ret = DB_VERIFY_BAD; + isbad = 1; + EPRINT((dbenv, + "Page %lu: bad magic number %lu", + (u_long)PGNO_BASE_MD, (u_long)meta->magic)); } } @@ -478,12 +505,19 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags) */ if (swapped) M_32_SWAP(meta->version); - if ((dbp->type == DB_BTREE && meta->version != DB_BTREEVERSION) || - (dbp->type == DB_HASH && meta->version != DB_HASHVERSION) || - (dbp->type == DB_QUEUE && meta->version != DB_QAMVERSION)) { - ret = DB_VERIFY_BAD; - EPRINT((dbp->dbenv, "%s%s", "Old or incorrect DB ", - "version; extraneous errors may result")); + if ((dbp->type == DB_BTREE && + (meta->version > DB_BTREEVERSION || + meta->version < DB_BTREEOLDVER)) || + (dbp->type == DB_HASH && + (meta->version > DB_HASHVERSION || + meta->version < DB_HASHOLDVER)) || + (dbp->type == DB_QUEUE && + (meta->version > DB_QAMVERSION || + meta->version < DB_QAMOLDVER))) { + isbad = 1; + EPRINT((dbenv, + "Page %lu: unsupported DB version %lu; extraneous errors may result", + (u_long)PGNO_BASE_MD, (u_long)meta->version)); } /* @@ -495,9 +529,9 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags) if (IS_VALID_PAGESIZE(meta->pagesize)) dbp->pgsize = meta->pagesize; else { - EPRINT((dbp->dbenv, - "Bad page size: %lu", (u_long)meta->pagesize)); - ret = DB_VERIFY_BAD; + isbad = 1; + EPRINT((dbenv, "Page %lu: bad page size %lu", + (u_long)PGNO_BASE_MD, (u_long)meta->pagesize)); /* * Now try to settle on a pagesize to use. @@ -516,8 +550,9 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags) if ((dbp->type == DB_BTREE && meta->type != P_BTREEMETA) || (dbp->type == DB_HASH && meta->type != P_HASHMETA) || (dbp->type == DB_QUEUE && meta->type != P_QAMMETA)) { - ret = DB_VERIFY_BAD; - EPRINT((dbp->dbenv, "Bad page type: %lu", (u_long)meta->type)); + isbad = 1; + EPRINT((dbenv, "Page %lu: bad page type %lu", + (u_long)PGNO_BASE_MD, (u_long)meta->type)); } /* @@ -547,21 +582,16 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags) pip->free = freelist; - if ((ret = __db_vrfy_putpageinfo(vdp, pip)) != 0) + if ((ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0) return (ret); /* Set up the dbp's fileid. We don't use the regular open path. */ memcpy(dbp->fileid, meta->uid, DB_FILE_ID_LEN); - if (0) { -err: __db_err(dbenv, "%s", db_strerror(ret)); - } - if (swapped == 1) F_SET(dbp, DB_AM_SWAP); - if (t_ret != 0) - ret = t_ret; - return (ret); + + return (isbad ? DB_VERIFY_BAD : 0); } /* @@ -578,12 +608,14 @@ __db_vrfy_walkpages(dbp, vdp, handle, callback, flags) u_int32_t flags; { DB_ENV *dbenv; + DB_MPOOLFILE *mpf; PAGE *h; db_pgno_t i; int ret, t_ret, isbad; - ret = isbad = t_ret = 0; dbenv = dbp->dbenv; + mpf = dbp->mpf; + ret = isbad = t_ret = 0; if ((ret = __db_fchk(dbenv, "__db_vrfy_walkpages", flags, OKFLAGS)) != 0) @@ -598,11 +630,17 @@ __db_vrfy_walkpages(dbp, vdp, handle, callback, flags) if (LF_ISSET(DB_SALVAGE) && (__db_salvage_isdone(vdp, i) != 0)) continue; - /* If an individual page get fails, keep going. */ - if ((t_ret = memp_fget(dbp->mpf, &i, 0, &h)) != 0) { + /* + * If an individual page get fails, keep going if and only + * if we're salvaging. + */ + if ((t_ret = mpf->get(mpf, &i, 0, &h)) != 0) { if (ret == 0) ret = t_ret; - continue; + if (LF_ISSET(DB_SALVAGE)) + continue; + else + return (ret); } if (LF_ISSET(DB_SALVAGE)) { @@ -618,64 +656,76 @@ __db_vrfy_walkpages(dbp, vdp, handle, callback, flags) isbad = 1; } } else { + /* + * If we are not salvaging, and we get any error + * other than DB_VERIFY_BAD, return immediately; + * it may not be safe to proceed. If we get + * 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. */ - if (i != PGNO_BASE_MD) - if ((t_ret = __db_vrfy_common(dbp, - vdp, h, i, flags)) == DB_VERIFY_BAD) + if (i != PGNO_BASE_MD) { + ret = __db_vrfy_common(dbp, vdp, h, i, flags); + if (ret == DB_VERIFY_BAD) isbad = 1; + else if (ret != 0) + goto err; + } switch (TYPE(h)) { case P_INVALID: - t_ret = __db_vrfy_invalid(dbp, - vdp, h, i, flags); + ret = __db_vrfy_invalid(dbp, vdp, h, i, flags); break; case __P_DUPLICATE: isbad = 1; - EPRINT((dbp->dbenv, - "Old-style duplicate page: %lu", + EPRINT((dbenv, + "Page %lu: old-style duplicate page", (u_long)i)); break; case P_HASH: - t_ret = __ham_vrfy(dbp, + ret = __ham_vrfy(dbp, vdp, h, i, flags); break; case P_IBTREE: case P_IRECNO: case P_LBTREE: case P_LDUP: - t_ret = __bam_vrfy(dbp, + ret = __bam_vrfy(dbp, vdp, h, i, flags); break; case P_LRECNO: - t_ret = __ram_vrfy_leaf(dbp, + ret = __ram_vrfy_leaf(dbp, vdp, h, i, flags); break; case P_OVERFLOW: - t_ret = __db_vrfy_overflow(dbp, + ret = __db_vrfy_overflow(dbp, vdp, h, i, flags); break; case P_HASHMETA: - t_ret = __ham_vrfy_meta(dbp, + ret = __ham_vrfy_meta(dbp, vdp, (HMETA *)h, i, flags); break; case P_BTREEMETA: - t_ret = __bam_vrfy_meta(dbp, + ret = __bam_vrfy_meta(dbp, vdp, (BTMETA *)h, i, flags); break; case P_QAMMETA: - t_ret = __qam_vrfy_meta(dbp, + ret = __qam_vrfy_meta(dbp, vdp, (QMETA *)h, i, flags); break; case P_QAMDATA: - t_ret = __qam_vrfy_data(dbp, + ret = __qam_vrfy_data(dbp, vdp, (QPAGE *)h, i, flags); break; default: - EPRINT((dbp->dbenv, - "Unknown page type: %lu", (u_long)TYPE(h))); + EPRINT((dbenv, + "Page %lu: unknown page type %lu", + (u_long)i, (u_long)TYPE(h))); isbad = 1; break; } @@ -683,12 +733,10 @@ __db_vrfy_walkpages(dbp, vdp, handle, callback, flags) /* * Set up error return. */ - if (t_ret == DB_VERIFY_BAD) + if (ret == DB_VERIFY_BAD) isbad = 1; - else if (t_ret == DB_VERIFY_FATAL) + else if (ret != 0) goto err; - else - ret = t_ret; /* * Provide feedback to the application about our @@ -701,14 +749,21 @@ __db_vrfy_walkpages(dbp, vdp, handle, callback, flags) (i + 1) * 50 / (vdp->last_pgno + 1)); } - if ((t_ret = memp_fput(dbp->mpf, h, 0)) != 0 && ret == 0) - ret = t_ret; + /* + * Just as with the page get, bail if and only if we're + * not salvaging. + */ + if ((t_ret = mpf->put(mpf, h, 0)) != 0) { + if (ret == 0) + ret = t_ret; + if (!LF_ISSET(DB_SALVAGE)) + return (ret); + } } if (0) { -err: if ((t_ret = memp_fput(dbp->mpf, h, 0)) != 0) +err: if ((t_ret = mpf->put(mpf, h, 0)) != 0) return (ret == 0 ? t_ret : ret); - return (DB_VERIFY_BAD); } return ((isbad == 1 && ret == 0) ? DB_VERIFY_BAD : ret); @@ -786,8 +841,8 @@ __db_vrfy_structure(dbp, vdp, dbname, meta_pgno, flags) */ if ((ret = __db_vrfy_getpageinfo(vdp, 0, &pip)) != 0) goto err; - hassubs = F_ISSET(pip, VRFY_HAS_SUBDBS); - if ((ret = __db_vrfy_putpageinfo(vdp, pip)) != 0) + hassubs = F_ISSET(pip, VRFY_HAS_SUBDBS) ? 1 : 0; + if ((ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0) goto err; if (isbad == 0 && hassubs) @@ -855,23 +910,23 @@ __db_vrfy_structure(dbp, vdp, dbname, meta_pgno, flags) if ((ret = __db_vrfy_pgset_get(pgset, i, &p)) != 0) goto err; if (p == 0) { - EPRINT((dbp->dbenv, - "Unreferenced page %lu", (u_long)i)); + EPRINT((dbenv, + "Page %lu: unreferenced page", (u_long)i)); isbad = 1; } if (F_ISSET(pip, VRFY_IS_ALLZEROES)) { - EPRINT((dbp->dbenv, - "Totally zeroed page %lu", (u_long)i)); + EPRINT((dbenv, + "Page %lu: totally zeroed page", (u_long)i)); isbad = 1; } - if ((ret = __db_vrfy_putpageinfo(vdp, pip)) != 0) + if ((ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0) goto err; pip = NULL; } err: if (pip != NULL) - (void)__db_vrfy_putpageinfo(vdp, pip); + (void)__db_vrfy_putpageinfo(dbenv, vdp, pip); return ((isbad == 1 && ret == 0) ? DB_VERIFY_BAD : ret); } @@ -936,10 +991,13 @@ __db_vrfy_common(dbp, vdp, h, pgno, flags) db_pgno_t pgno; u_int32_t flags; { + DB_ENV *dbenv; VRFY_PAGEINFO *pip; int ret, t_ret; u_int8_t *p; + dbenv = dbp->dbenv; + if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); @@ -957,8 +1015,8 @@ __db_vrfy_common(dbp, vdp, h, pgno, flags) if (pgno != 0 && PGNO(h) == 0) { for (p = (u_int8_t *)h; p < (u_int8_t *)h + dbp->pgsize; p++) if (*p != 0) { - EPRINT((dbp->dbenv, - "Page %lu should be zeroed and is not", + EPRINT((dbenv, + "Page %lu: partially zeroed page", (u_long)pgno)); ret = DB_VERIFY_BAD; goto err; @@ -976,19 +1034,19 @@ __db_vrfy_common(dbp, vdp, h, pgno, flags) } if (PGNO(h) != pgno) { - EPRINT((dbp->dbenv, - "Bad page number: %lu should be %lu", - (u_long)h->pgno, (u_long)pgno)); + EPRINT((dbenv, "Page %lu: bad page number %lu", + (u_long)pgno, (u_long)h->pgno)); ret = DB_VERIFY_BAD; } if (!__db_is_valid_pagetype(h->type)) { - EPRINT((dbp->dbenv, "Bad page type: %lu", (u_long)h->type)); + EPRINT((dbenv, "Page %lu: bad page type %lu", + (u_long)pgno, (u_long)h->type)); ret = DB_VERIFY_BAD; } pip->type = h->type; -err: if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) +err: if ((t_ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; return (ret); @@ -1007,22 +1065,24 @@ __db_vrfy_invalid(dbp, vdp, h, pgno, flags) db_pgno_t pgno; u_int32_t flags; { + DB_ENV *dbenv; VRFY_PAGEINFO *pip; int ret, t_ret; + dbenv = dbp->dbenv; + if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); pip->next_pgno = pip->prev_pgno = 0; if (!IS_VALID_PGNO(NEXT_PGNO(h))) { - EPRINT((dbp->dbenv, - "Invalid next_pgno %lu on page %lu", - (u_long)NEXT_PGNO(h), (u_long)pgno)); + EPRINT((dbenv, "Page %lu: invalid next_pgno %lu", + (u_long)pgno, (u_long)NEXT_PGNO(h))); ret = DB_VERIFY_BAD; } else pip->next_pgno = NEXT_PGNO(h); - if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) + if ((t_ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; return (ret); } @@ -1048,9 +1108,12 @@ __db_vrfy_datapage(dbp, vdp, h, pgno, flags) db_pgno_t pgno; u_int32_t flags; { + DB_ENV *dbenv; VRFY_PAGEINFO *pip; int isbad, ret, t_ret; + dbenv = dbp->dbenv; + if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); isbad = 0; @@ -1066,12 +1129,12 @@ __db_vrfy_datapage(dbp, vdp, h, pgno, flags) if (TYPE(h) != P_IBTREE && TYPE(h) != P_IRECNO) { if (!IS_VALID_PGNO(PREV_PGNO(h)) || PREV_PGNO(h) == pip->pgno) { isbad = 1; - EPRINT((dbp->dbenv, "Page %lu: Invalid prev_pgno %lu", + EPRINT((dbenv, "Page %lu: invalid prev_pgno %lu", (u_long)pip->pgno, (u_long)PREV_PGNO(h))); } if (!IS_VALID_PGNO(NEXT_PGNO(h)) || NEXT_PGNO(h) == pip->pgno) { isbad = 1; - EPRINT((dbp->dbenv, "Page %lu: Invalid next_pgno %lu", + EPRINT((dbenv, "Page %lu: invalid next_pgno %lu", (u_long)pip->pgno, (u_long)NEXT_PGNO(h))); } pip->prev_pgno = PREV_PGNO(h); @@ -1089,8 +1152,7 @@ __db_vrfy_datapage(dbp, vdp, h, pgno, flags) if (TYPE(h) != P_OVERFLOW) { if (BKEYDATA_PSIZE(0) * NUM_ENT(h) > dbp->pgsize) { isbad = 1; - EPRINT((dbp->dbenv, - "Page %lu: Too many entries: %lu", + EPRINT((dbenv, "Page %lu: too many entries: %lu", (u_long)pgno, (u_long)NUM_ENT(h))); } pip->entries = NUM_ENT(h); @@ -1106,8 +1168,8 @@ __db_vrfy_datapage(dbp, vdp, h, pgno, flags) case P_IRECNO: if (LEVEL(h) < LEAFLEVEL + 1 || LEVEL(h) > MAXBTREELEVEL) { isbad = 1; - EPRINT((dbp->dbenv, "Bad btree level %lu on page %lu", - (u_long)LEVEL(h), (u_long)pgno)); + EPRINT((dbenv, "Page %lu: bad btree level %lu", + (u_long)pgno, (u_long)LEVEL(h))); } pip->bt_level = LEVEL(h); break; @@ -1116,17 +1178,17 @@ __db_vrfy_datapage(dbp, vdp, h, pgno, flags) case P_LRECNO: if (LEVEL(h) != LEAFLEVEL) { isbad = 1; - EPRINT((dbp->dbenv, - "Btree leaf page %lu has incorrect level %lu", + EPRINT((dbenv, + "Page %lu: btree leaf page has incorrect level %lu", (u_long)pgno, (u_long)LEVEL(h))); } break; default: if (LEVEL(h) != 0) { isbad = 1; - EPRINT((dbp->dbenv, - "Nonzero level %lu in non-btree database page %lu", - (u_long)LEVEL(h), (u_long)pgno)); + EPRINT((dbenv, + "Page %lu: nonzero level %lu in non-btree database", + (u_long)pgno, (u_long)LEVEL(h))); } break; } @@ -1139,7 +1201,7 @@ __db_vrfy_datapage(dbp, vdp, h, pgno, flags) * by offset and length--cover the right part of the page * without overlaps, gaps, or violations of the page boundary. */ - if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) + if ((t_ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); @@ -1161,11 +1223,14 @@ __db_vrfy_meta(dbp, vdp, meta, pgno, flags) db_pgno_t pgno; u_int32_t flags; { + DB_ENV *dbenv; DBTYPE dbtype, magtype; VRFY_PAGEINFO *pip; int isbad, ret, t_ret; isbad = 0; + dbenv = dbp->dbenv; + if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); @@ -1190,31 +1255,37 @@ __db_vrfy_meta(dbp, vdp, meta, pgno, flags) /* magic number valid */ if (!__db_is_valid_magicno(meta->magic, &magtype)) { isbad = 1; - EPRINT((dbp->dbenv, - "Magic number invalid on page %lu", (u_long)pgno)); + EPRINT((dbenv, + "Page %lu: invalid magic number", (u_long)pgno)); } if (magtype != dbtype) { isbad = 1; - EPRINT((dbp->dbenv, - "Magic number does not match type of page %lu", + EPRINT((dbenv, + "Page %lu: magic number does not match database type", (u_long)pgno)); } /* version */ - if ((dbtype == DB_BTREE && meta->version != DB_BTREEVERSION) || - (dbtype == DB_HASH && meta->version != DB_HASHVERSION) || - (dbtype == DB_QUEUE && meta->version != DB_QAMVERSION)) { + if ((dbtype == DB_BTREE && + (meta->version > DB_BTREEVERSION || + meta->version < DB_BTREEOLDVER)) || + (dbtype == DB_HASH && + (meta->version > DB_HASHVERSION || + meta->version < DB_HASHOLDVER)) || + (dbtype == DB_QUEUE && + (meta->version > DB_QAMVERSION || + meta->version < DB_QAMOLDVER))) { isbad = 1; - EPRINT((dbp->dbenv, "%s%s", "Old of incorrect DB ", - "version; extraneous errors may result")); + EPRINT((dbenv, + "Page %lu: unsupported database version %lu; extraneous errors may result", + (u_long)pgno, (u_long)meta->version)); } /* pagesize */ if (meta->pagesize != dbp->pgsize) { isbad = 1; - EPRINT((dbp->dbenv, - "Invalid pagesize %lu on page %lu", - (u_long)meta->pagesize, (u_long)pgno)); + EPRINT((dbenv, "Page %lu: invalid pagesize %lu", + (u_long)pgno, (u_long)meta->pagesize)); } /* free list */ @@ -1224,9 +1295,9 @@ __db_vrfy_meta(dbp, vdp, meta, pgno, flags) */ if (pgno != PGNO_BASE_MD && meta->free != PGNO_INVALID) { isbad = 1; - EPRINT((dbp->dbenv, - "Nonempty free list on subdatabase metadata page %lu", - pgno)); + EPRINT((dbenv, + "Page %lu: nonempty free list on subdatabase metadata page", + (u_long)pgno)); } /* Can correctly be PGNO_INVALID--that's just the end of the list. */ @@ -1234,9 +1305,9 @@ __db_vrfy_meta(dbp, vdp, meta, pgno, flags) pip->free = meta->free; else if (!IS_VALID_PGNO(meta->free)) { isbad = 1; - EPRINT((dbp->dbenv, - "Nonsensical free list pgno %lu on page %lu", - (u_long)meta->free, (u_long)pgno)); + EPRINT((dbenv, + "Page %lu: nonsensical free list pgno %lu", + (u_long)pgno, (u_long)meta->free)); } /* @@ -1245,7 +1316,7 @@ __db_vrfy_meta(dbp, vdp, meta, pgno, flags) */ F_CLR(pip, VRFY_INCOMPLETE); -err: if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) +err: if ((t_ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); @@ -1264,51 +1335,56 @@ __db_vrfy_freelist(dbp, vdp, meta, flags) u_int32_t flags; { DB *pgset; + DB_ENV *dbenv; VRFY_PAGEINFO *pip; - db_pgno_t pgno; + db_pgno_t cur_pgno, next_pgno; int p, ret, t_ret; pgset = vdp->pgset; DB_ASSERT(pgset != NULL); + dbenv = dbp->dbenv; if ((ret = __db_vrfy_getpageinfo(vdp, meta, &pip)) != 0) return (ret); - for (pgno = pip->free; pgno != PGNO_INVALID; pgno = pip->next_pgno) { - if ((ret = __db_vrfy_putpageinfo(vdp, pip)) != 0) + for (next_pgno = pip->free; + next_pgno != PGNO_INVALID; next_pgno = pip->next_pgno) { + cur_pgno = pip->pgno; + if ((ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0) return (ret); /* This shouldn't happen, but just in case. */ - if (!IS_VALID_PGNO(pgno)) { - EPRINT((dbp->dbenv, - "Invalid next_pgno on free list page %lu", - (u_long)pgno)); + if (!IS_VALID_PGNO(next_pgno)) { + EPRINT((dbenv, + "Page %lu: invalid next_pgno %lu on free list page", + (u_long)cur_pgno, (u_long)next_pgno)); return (DB_VERIFY_BAD); } /* Detect cycles. */ - if ((ret = __db_vrfy_pgset_get(pgset, pgno, &p)) != 0) + if ((ret = __db_vrfy_pgset_get(pgset, next_pgno, &p)) != 0) return (ret); if (p != 0) { - EPRINT((dbp->dbenv, - "Page %lu encountered a second time on free list", - (u_long)pgno)); + EPRINT((dbenv, + "Page %lu: page %lu encountered a second time on free list", + (u_long)cur_pgno, (u_long)next_pgno)); return (DB_VERIFY_BAD); } - if ((ret = __db_vrfy_pgset_inc(pgset, pgno)) != 0) + if ((ret = __db_vrfy_pgset_inc(pgset, next_pgno)) != 0) return (ret); - if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) + if ((ret = __db_vrfy_getpageinfo(vdp, next_pgno, &pip)) != 0) return (ret); if (pip->type != P_INVALID) { - EPRINT((dbp->dbenv, - "Non-invalid page %lu on free list", (u_long)pgno)); + EPRINT((dbenv, + "Page %lu: non-invalid page %lu on free list", + (u_long)cur_pgno, (u_long)next_pgno)); ret = DB_VERIFY_BAD; /* unsafe to continue */ break; } } - if ((t_ret = __db_vrfy_putpageinfo(vdp, pip)) != 0) + if ((t_ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0) ret = t_ret; return (ret); } @@ -1328,6 +1404,7 @@ __db_vrfy_subdbs(dbp, vdp, dbname, flags) DB *mdbp; DBC *dbc; DBT key, data; + DB_ENV *dbenv; VRFY_PAGEINFO *pip; db_pgno_t meta_pgno; int ret, t_ret, isbad; @@ -1335,19 +1412,22 @@ __db_vrfy_subdbs(dbp, vdp, dbname, flags) isbad = 0; dbc = NULL; - - if ((ret = __db_master_open(dbp, dbname, DB_RDONLY, 0, &mdbp)) != 0) - return (ret); + dbenv = dbp->dbenv; if ((ret = - __db_icursor(mdbp, NULL, DB_BTREE, PGNO_INVALID, 0, &dbc)) != 0) + __db_master_open(dbp, NULL, dbname, DB_RDONLY, 0, &mdbp)) != 0) + return (ret); + + if ((ret = __db_icursor(mdbp, + NULL, DB_BTREE, PGNO_INVALID, 0, DB_LOCK_INVALIDID, &dbc)) != 0) goto err; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); while ((ret = dbc->c_get(dbc, &key, &data, DB_NEXT)) == 0) { if (data.size != sizeof(db_pgno_t)) { - EPRINT((dbp->dbenv, "Database entry of invalid size")); + EPRINT((dbenv, + "Subdatabase entry not page-number size")); isbad = 1; goto err; } @@ -1358,8 +1438,8 @@ __db_vrfy_subdbs(dbp, vdp, dbname, flags) */ DB_NTOHL(&meta_pgno); if (meta_pgno == PGNO_INVALID || meta_pgno > vdp->last_pgno) { - EPRINT((dbp->dbenv, - "Database entry references invalid page %lu", + EPRINT((dbenv, + "Subdatabase entry references invalid page %lu", (u_long)meta_pgno)); isbad = 1; goto err; @@ -1367,7 +1447,7 @@ __db_vrfy_subdbs(dbp, vdp, dbname, flags) if ((ret = __db_vrfy_getpageinfo(vdp, meta_pgno, &pip)) != 0) goto err; type = pip->type; - if ((ret = __db_vrfy_putpageinfo(vdp, pip)) != 0) + if ((ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0) goto err; switch (type) { case P_BTREEMETA: @@ -1390,8 +1470,8 @@ __db_vrfy_subdbs(dbp, vdp, dbname, flags) break; case P_QAMMETA: default: - EPRINT((dbp->dbenv, - "Database entry references page %lu of invalid type %lu", + EPRINT((dbenv, + "Subdatabase entry references page %lu of invalid type %lu", (u_long)meta_pgno, (u_long)type)); ret = DB_VERIFY_BAD; goto err; @@ -1416,9 +1496,9 @@ err: if (dbc != NULL && (t_ret = __db_c_close(dbc)) != 0 && ret == 0) * Provide feedback during top-down database structure traversal. * (See comment at the beginning of __db_vrfy_structure.) * - * PUBLIC: int __db_vrfy_struct_feedback __P((DB *, VRFY_DBINFO *)); + * PUBLIC: void __db_vrfy_struct_feedback __P((DB *, VRFY_DBINFO *)); */ -int +void __db_vrfy_struct_feedback(dbp, vdp) DB *dbp; VRFY_DBINFO *vdp; @@ -1426,7 +1506,7 @@ __db_vrfy_struct_feedback(dbp, vdp) int progress; if (dbp->db_feedback == NULL) - return (0); + return; if (vdp->pgs_remaining > 0) vdp->pgs_remaining--; @@ -1434,8 +1514,6 @@ __db_vrfy_struct_feedback(dbp, vdp) /* Don't allow a feedback call of 100 until we're really done. */ progress = 100 - (vdp->pgs_remaining * 50 / (vdp->last_pgno + 1)); dbp->db_feedback(dbp, DB_VERIFY, progress == 100 ? 99 : progress); - - return (0); } /* @@ -1453,6 +1531,8 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags) DB *mdbp, *pgset; DBC *pgsc; DBT key, data; + DB_ENV *dbenv; + DB_MPOOLFILE *mpf; HASH *h_internal; HMETA *hmeta; PAGE *h, *currpg; @@ -1460,36 +1540,45 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags) u_int32_t bucket; int t_ret, ret; - currpg = h = NULL; - pgsc = NULL; pgset = NULL; + pgsc = NULL; + dbenv = dbp->dbenv; + mpf = dbp->mpf; + currpg = h = NULL; LF_CLR(DB_NOORDERCHK); /* Open the master database and get the meta_pgno for the subdb. */ if ((ret = db_create(&mdbp, NULL, 0)) != 0) return (ret); - if ((ret = __db_master_open(dbp, name, DB_RDONLY, 0, &mdbp)) != 0) + 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); memset(&data, 0, sizeof(data)); - if ((ret = dbp->get(dbp, NULL, &key, &data, 0)) != 0) + if ((ret = mdbp->get(mdbp, NULL, &key, &data, 0)) != 0) goto err; if (data.size != sizeof(db_pgno_t)) { - EPRINT((dbp->dbenv, "Database entry of invalid size")); + EPRINT((dbenv, "Subdatabase entry of invalid size")); ret = DB_VERIFY_BAD; goto err; } memcpy(&meta_pgno, data.data, data.size); - if ((ret = memp_fget(dbp->mpf, &meta_pgno, 0, &h)) != 0) + /* + * Subdatabase meta pgnos are stored in network byte + * order for cross-endian compatibility. Swap if appropriate. + */ + DB_NTOHL(&meta_pgno); + + if ((ret = mpf->get(mpf, &meta_pgno, 0, &h)) != 0) goto err; - if ((ret = __db_vrfy_pgset(dbp->dbenv, dbp->pgsize, &pgset)) != 0) + if ((ret = __db_vrfy_pgset(dbenv, dbp->pgsize, &pgset)) != 0) goto err; switch (TYPE(h)) { @@ -1506,18 +1595,24 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags) if ((ret = pgset->cursor(pgset, NULL, &pgsc, 0)) != 0) goto err; while ((ret = __db_vrfy_pgset_next(pgsc, &p)) == 0) { - if ((ret = memp_fget(dbp->mpf, &p, 0, &currpg)) != 0) + if ((ret = mpf->get(mpf, &p, 0, &currpg)) != 0) goto err; if ((ret = __bam_vrfy_itemorder(dbp, NULL, currpg, p, NUM_ENT(currpg), 1, F_ISSET(&btmeta->dbmeta, BTM_DUP), flags)) != 0) goto err; - if ((ret = memp_fput(dbp->mpf, currpg, 0)) != 0) + if ((ret = mpf->put(mpf, currpg, 0)) != 0) goto err; currpg = NULL; } - if ((ret = pgsc->c_close(pgsc)) != 0) - goto err; + + /* + * The normal exit condition for the loop above is DB_NOTFOUND. + * If we see that, zero it and continue on to cleanup. + * Otherwise, it's a real error and will be returned. + */ + if (ret == DB_NOTFOUND) + ret = 0; break; case P_HASHMETA: hmeta = (HMETA *)h; @@ -1525,16 +1620,21 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags) /* * Make sure h_charkey is right. */ - if (h_internal == NULL || h_internal->h_hash == NULL) { - EPRINT((dbp->dbenv, - "DB_ORDERCHKONLY requires that a hash function be set")); + if (h_internal == NULL) { + EPRINT((dbenv, + "Page %lu: DB->h_internal field is NULL", + (u_long)meta_pgno)); ret = DB_VERIFY_BAD; goto err; } + if (h_internal->h_hash == NULL) + h_internal->h_hash = hmeta->dbmeta.version < 5 + ? __ham_func4 : __ham_func5; if (hmeta->h_charkey != h_internal->h_hash(dbp, CHARKEY, sizeof(CHARKEY))) { - EPRINT((dbp->dbenv, - "Incorrect hash function for database")); + EPRINT((dbenv, + "Page %lu: incorrect hash function for database", + (u_long)meta_pgno)); ret = DB_VERIFY_BAD; goto err; } @@ -1546,34 +1646,35 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags) for (bucket = 0; bucket <= hmeta->max_bucket; bucket++) { pgno = BS_TO_PAGE(bucket, hmeta->spares); while (pgno != PGNO_INVALID) { - if ((ret = memp_fget(dbp->mpf, + if ((ret = mpf->get(mpf, &pgno, 0, &currpg)) != 0) goto err; if ((ret = __ham_vrfy_hashing(dbp, - NUM_ENT(currpg),hmeta, bucket, pgno, + NUM_ENT(currpg), hmeta, bucket, pgno, flags, h_internal->h_hash)) != 0) goto err; pgno = NEXT_PGNO(currpg); - if ((ret = memp_fput(dbp->mpf, currpg, 0)) != 0) + if ((ret = mpf->put(mpf, currpg, 0)) != 0) goto err; currpg = NULL; } } break; default: - EPRINT((dbp->dbenv, "Database meta page %lu of bad type %lu", + EPRINT((dbenv, "Page %lu: database metapage of bad type %lu", (u_long)meta_pgno, (u_long)TYPE(h))); ret = DB_VERIFY_BAD; break; } -err: if (pgsc != NULL) - (void)pgsc->c_close(pgsc); - if (pgset != NULL) - (void)pgset->close(pgset, 0); - if (h != NULL && (t_ret = memp_fput(dbp->mpf, h, 0)) != 0) +err: if (pgsc != NULL && (t_ret = pgsc->c_close(pgsc)) != 0 && ret == 0) ret = t_ret; - if (currpg != NULL && (t_ret = memp_fput(dbp->mpf, currpg, 0)) != 0) + if (pgset != NULL && + (t_ret = pgset->close(pgset, 0)) != 0 && ret == 0) + ret = t_ret; + if (h != NULL && (t_ret = mpf->put(mpf, h, 0)) != 0) + ret = t_ret; + if (currpg != NULL && (t_ret = mpf->put(mpf, currpg, 0)) != 0) ret = t_ret; if ((t_ret = mdbp->close(mdbp, 0)) != 0) ret = t_ret; @@ -1584,11 +1685,8 @@ err: if (pgsc != NULL) * __db_salvage -- * Walk through a page, salvaging all likely or plausible (w/ * DB_AGGRESSIVE) key/data pairs. - * - * PUBLIC: int __db_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, PAGE *, - * PUBLIC: void *, int (*)(void *, const void *), u_int32_t)); */ -int +static int __db_salvage(dbp, vdp, pgno, h, handle, callback, flags) DB *dbp; VRFY_DBINFO *vdp; @@ -1659,24 +1757,29 @@ __db_salvage_unknowns(dbp, vdp, handle, callback, flags) u_int32_t flags; { DBT unkdbt, key, *dbt; + DB_ENV *dbenv; + DB_MPOOLFILE *mpf; PAGE *h; db_pgno_t pgno; u_int32_t pgtype; int ret, err_ret; void *ovflbuf; + dbenv = dbp->dbenv; + mpf = dbp->mpf; + memset(&unkdbt, 0, sizeof(DBT)); - unkdbt.size = strlen("UNKNOWN") + 1; + unkdbt.size = (u_int32_t)strlen("UNKNOWN") + 1; unkdbt.data = "UNKNOWN"; - if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, 0, &ovflbuf)) != 0) + 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(dbp->mpf, &pgno, 0, &h)) != 0) { + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) { err_ret = ret; continue; } @@ -1699,17 +1802,11 @@ __db_salvage_unknowns(dbp, vdp, handle, callback, flags) * a database with no dups. What to do? */ if ((ret = __db_safe_goff(dbp, - vdp, pgno, &key, &ovflbuf, flags)) != 0) { - err_ret = ret; - continue; - } - if ((ret = __db_prdbt(&key, - 0, " ", handle, callback, 0, NULL)) != 0) { - err_ret = ret; - continue; - } - if ((ret = __db_prdbt(&unkdbt, - 0, " ", handle, callback, 0, NULL)) != 0) + vdp, pgno, &key, &ovflbuf, flags)) != 0 || + (ret = __db_prdbt(&key, + 0, " ", handle, callback, 0, vdp)) != 0 || + (ret = __db_prdbt(&unkdbt, + 0, " ", handle, callback, 0, vdp)) != 0) err_ret = ret; break; case SALVAGE_HASH: @@ -1727,11 +1824,11 @@ __db_salvage_unknowns(dbp, vdp, handle, callback, flags) DB_ASSERT(0); break; } - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) + if ((ret = mpf->put(mpf, h, 0)) != 0) err_ret = ret; } - __os_free(ovflbuf, 0); + __os_free(dbenv, ovflbuf); if (err_ret != 0 && ret == 0) ret = err_ret; @@ -1743,8 +1840,8 @@ __db_salvage_unknowns(dbp, vdp, handle, callback, flags) * Offset of the ith inp array entry, which we can compare to the offset * the entry stores. */ -#define INP_OFFSET(h, i) \ - ((db_indx_t)((u_int8_t *)(h)->inp + (i) - (u_int8_t *)(h))) +#define INP_OFFSET(dbp, h, i) \ + ((db_indx_t)((u_int8_t *)((P_INP(dbp,(h))) + (i)) - (u_int8_t *)(h))) /* * __db_vrfy_inpitem -- @@ -1770,33 +1867,35 @@ __db_vrfy_inpitem(dbp, h, pgno, i, is_btree, flags, himarkp, offsetp) u_int32_t flags, *himarkp, *offsetp; { BKEYDATA *bk; - db_indx_t offset, len; + DB_ENV *dbenv; + db_indx_t *inp, offset, len; + + dbenv = dbp->dbenv; DB_ASSERT(himarkp != NULL); + inp = P_INP(dbp, h); /* * Check that the inp array, which grows from the beginning of the * page forward, has not collided with the data, which grow from the * end of the page backward. */ - if (h->inp + i >= (db_indx_t *)((u_int8_t *)h + *himarkp)) { + if (inp + i >= (db_indx_t *)((u_int8_t *)h + *himarkp)) { /* We've collided with the data. We need to bail. */ - EPRINT((dbp->dbenv, - "Page %lu entries listing %lu overlaps data", + EPRINT((dbenv, "Page %lu: entries listing %lu overlaps data", (u_long)pgno, (u_long)i)); return (DB_VERIFY_FATAL); } - offset = h->inp[i]; + offset = inp[i]; /* * Check that the item offset is reasonable: it points somewhere * after the inp array and before the end of the page. */ - if (offset <= INP_OFFSET(h, i) || offset > dbp->pgsize) { - EPRINT((dbp->dbenv, - "Bad offset %lu at page %lu index %lu", - (u_long)offset, (u_long)pgno, (u_long)i)); + if (offset <= INP_OFFSET(dbp, h, i) || offset > dbp->pgsize) { + EPRINT((dbenv, "Page %lu: bad offset %lu at page index %lu", + (u_long)pgno, (u_long)offset, (u_long)i)); return (DB_VERIFY_BAD); } @@ -1808,7 +1907,7 @@ __db_vrfy_inpitem(dbp, h, pgno, i, is_btree, flags, himarkp, offsetp) /* * Check that the item length remains on-page. */ - bk = GET_BKEYDATA(h, i); + bk = GET_BKEYDATA(dbp, h, i); /* * We need to verify the type of the item here; @@ -1826,16 +1925,16 @@ __db_vrfy_inpitem(dbp, h, pgno, i, is_btree, flags, himarkp, offsetp) len = BOVERFLOW_SIZE; break; default: - EPRINT((dbp->dbenv, - "Item %lu on page %lu of unrecognizable type", - i, pgno)); + EPRINT((dbenv, + "Page %lu: item %lu of unrecognizable type", + (u_long)pgno, (u_long)i)); return (DB_VERIFY_BAD); } if ((size_t)(offset + len) > dbp->pgsize) { - EPRINT((dbp->dbenv, - "Item %lu on page %lu extends past page boundary", - (u_long)i, (u_long)pgno)); + EPRINT((dbenv, + "Page %lu: item %lu extends past page boundary", + (u_long)pgno, (u_long)i)); return (DB_VERIFY_BAD); } } @@ -1861,9 +1960,11 @@ __db_vrfy_duptype(dbp, vdp, pgno, flags) db_pgno_t pgno; u_int32_t flags; { + DB_ENV *dbenv; VRFY_PAGEINFO *pip; int ret, isbad; + dbenv = dbp->dbenv; isbad = 0; if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) @@ -1873,8 +1974,8 @@ __db_vrfy_duptype(dbp, vdp, pgno, flags) case P_IBTREE: case P_LDUP: if (!LF_ISSET(ST_DUPSORT)) { - EPRINT((dbp->dbenv, - "Sorted duplicate set at page %lu in unsorted-dup database", + EPRINT((dbenv, + "Page %lu: sorted duplicate set in unsorted-dup database", (u_long)pgno)); isbad = 1; } @@ -1882,21 +1983,29 @@ __db_vrfy_duptype(dbp, vdp, pgno, flags) case P_IRECNO: case P_LRECNO: if (LF_ISSET(ST_DUPSORT)) { - EPRINT((dbp->dbenv, - "Unsorted duplicate set at page %lu in sorted-dup database", + EPRINT((dbenv, + "Page %lu: unsorted duplicate set in sorted-dup database", (u_long)pgno)); isbad = 1; } break; default: - EPRINT((dbp->dbenv, - "Duplicate page %lu of inappropriate type %lu", - (u_long)pgno, (u_long)pip->type)); + /* + * If the page is entirely zeroed, its pip->type will be a lie + * (we assumed it was a hash page, as they're allowed to be + * zeroed); handle this case specially. + */ + if (F_ISSET(pip, VRFY_IS_ALLZEROES)) + ZEROPG_ERR_PRINT(dbenv, pgno, "duplicate page"); + else + EPRINT((dbenv, + "Page %lu: duplicate page of inappropriate type %lu", + (u_long)pgno, (u_long)pip->type)); isbad = 1; break; } - if ((ret = __db_vrfy_putpageinfo(vdp, pip)) != 0) + if ((ret = __db_vrfy_putpageinfo(dbenv, vdp, pip)) != 0) return (ret); return (isbad == 1 ? DB_VERIFY_BAD : 0); } @@ -1934,14 +2043,17 @@ __db_salvage_duptree(dbp, vdp, pgno, key, handle, callback, flags) int (*callback) __P((void *, const void *)); u_int32_t flags; { + DB_MPOOLFILE *mpf; PAGE *h; int ret, t_ret; + mpf = dbp->mpf; + if (pgno == PGNO_INVALID || !IS_VALID_PGNO(pgno)) return (DB_VERIFY_BAD); /* We have a plausible page. Try it. */ - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) return (ret); switch (TYPE(h)) { @@ -1972,7 +2084,7 @@ __db_salvage_duptree(dbp, vdp, pgno, key, handle, callback, flags) /* NOTREACHED */ } -err: if ((t_ret = memp_fput(dbp->mpf, h, 0)) != 0 && ret == 0) +err: if ((t_ret = mpf->put(mpf, h, 0)) != 0 && ret == 0) ret = t_ret; return (ret); } @@ -1994,16 +2106,18 @@ __db_salvage_subdbs(dbp, vdp, handle, callback, flags, hassubsp) BTMETA *btmeta; DB *pgset; DBC *pgsc; + DB_MPOOLFILE *mpf; PAGE *h; db_pgno_t p, meta_pgno; int ret, err_ret; - err_ret = 0; - pgsc = NULL; pgset = NULL; + pgsc = NULL; + mpf = dbp->mpf; + err_ret = 0; meta_pgno = PGNO_BASE_MD; - if ((ret = memp_fget(dbp->mpf, &meta_pgno, 0, &h)) != 0) + if ((ret = mpf->get(mpf, &meta_pgno, 0, &h)) != 0) return (ret); if (TYPE(h) == P_BTREEMETA) @@ -2028,7 +2142,7 @@ __db_salvage_subdbs(dbp, vdp, handle, callback, flags, hassubsp) /* We think we've got subdbs. Mark it so. */ *hassubsp = 1; - if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) + if ((ret = mpf->put(mpf, h, 0)) != 0) return (ret); /* @@ -2048,7 +2162,7 @@ __db_salvage_subdbs(dbp, vdp, handle, callback, flags, hassubsp) if ((ret = pgset->cursor(pgset, NULL, &pgsc, 0)) != 0) goto err; while ((ret = __db_vrfy_pgset_next(pgsc, &p)) == 0) { - if ((ret = memp_fget(dbp->mpf, &p, 0, &h)) != 0) { + if ((ret = mpf->get(mpf, &p, 0, &h)) != 0) { err_ret = ret; continue; } @@ -2061,7 +2175,7 @@ __db_salvage_subdbs(dbp, vdp, handle, callback, flags, hassubsp) else if ((ret = __db_salvage_subdbpg( dbp, vdp, h, handle, callback, flags)) != 0) err_ret = ret; -nextpg: if ((ret = memp_fput(dbp->mpf, h, 0)) != 0) +nextpg: if ((ret = mpf->put(mpf, h, 0)) != 0) err_ret = ret; } @@ -2079,7 +2193,7 @@ err: if (pgsc != NULL) (void)pgsc->c_close(pgsc); if (pgset != NULL) (void)pgset->close(pgset, 0); - (void)memp_fput(dbp->mpf, h, 0); + (void)mpf->put(mpf, h, 0); return (ret); } @@ -2087,12 +2201,8 @@ err: if (pgsc != NULL) * __db_salvage_subdbpg -- * Given a known-good leaf page in the master database, salvage all * leaf pages corresponding to each subdb. - * - * PUBLIC: int __db_salvage_subdbpg - * PUBLIC: __P((DB *, VRFY_DBINFO *, PAGE *, void *, - * PUBLIC: int (*)(void *, const void *), u_int32_t)); */ -int +static int __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) DB *dbp; VRFY_DBINFO *vdp; @@ -2106,16 +2216,20 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) DB *pgset; DBC *pgsc; DBT key; + DB_ENV *dbenv; + DB_MPOOLFILE *mpf; PAGE *subpg; db_indx_t i; db_pgno_t meta_pgno, p; int ret, err_ret, t_ret; char *subdbname; + dbenv = dbp->dbenv; + mpf = dbp->mpf; ret = err_ret = 0; subdbname = NULL; - if ((ret = __db_vrfy_pgset(dbp->dbenv, dbp->pgsize, &pgset)) != 0) + if ((ret = __db_vrfy_pgset(dbenv, dbp->pgsize, &pgset)) != 0) return (ret); /* @@ -2123,8 +2237,8 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) * corresponding to that entry. */ for (i = 0; i < NUM_ENT(master); i += P_INDX) { - bkkey = GET_BKEYDATA(master, i); - bkdata = GET_BKEYDATA(master, i + O_INDX); + bkkey = GET_BKEYDATA(dbp, master, i); + bkdata = GET_BKEYDATA(dbp, master, i + O_INDX); /* Get the subdatabase name. */ if (B_TYPE(bkkey->type) == B_OVERFLOW) { @@ -2140,13 +2254,13 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) } /* Nul-terminate it. */ - if ((ret = __os_realloc(dbp->dbenv, - key.size + 1, NULL, &subdbname)) != 0) + if ((ret = __os_realloc(dbenv, + key.size + 1, &subdbname)) != 0) goto err; subdbname[key.size] = '\0'; } else if (B_TYPE(bkkey->type == B_KEYDATA)) { - if ((ret = __os_realloc(dbp->dbenv, - bkkey->len + 1, NULL, &subdbname)) != 0) + if ((ret = __os_realloc(dbenv, + bkkey->len + 1, &subdbname)) != 0) goto err; memcpy(subdbname, bkkey->data, bkkey->len); subdbname[bkkey->len] = '\0'; @@ -2159,9 +2273,15 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) } memcpy(&meta_pgno, bkdata->data, sizeof(db_pgno_t)); + /* + * Subdatabase meta pgnos are stored in network byte + * order for cross-endian compatibility. Swap if appropriate. + */ + 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(dbp->mpf, &meta_pgno, 0, &subpg)) != 0) { + (ret = mpf->get(mpf, &meta_pgno, 0, &subpg)) != 0) { err_ret = ret; continue; } @@ -2177,7 +2297,7 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) if ((ret = __db_vrfy_common(dbp, vdp, subpg, meta_pgno, flags)) != 0) { err_ret = ret; - (void)memp_fput(dbp->mpf, subpg, 0); + (void)mpf->put(mpf, subpg, 0); continue; } switch (TYPE(subpg)) { @@ -2185,7 +2305,7 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) if ((ret = __bam_vrfy_meta(dbp, vdp, (BTMETA *)subpg, meta_pgno, flags)) != 0) { err_ret = ret; - (void)memp_fput(dbp->mpf, subpg, 0); + (void)mpf->put(mpf, subpg, 0); continue; } break; @@ -2193,7 +2313,7 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) if ((ret = __ham_vrfy_meta(dbp, vdp, (HMETA *)subpg, meta_pgno, flags)) != 0) { err_ret = ret; - (void)memp_fput(dbp->mpf, subpg, 0); + (void)mpf->put(mpf, subpg, 0); continue; } break; @@ -2204,7 +2324,7 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) /* NOTREACHED */ } - if ((ret = memp_fput(dbp->mpf, subpg, 0)) != 0) { + if ((ret = mpf->put(mpf, subpg, 0)) != 0) { err_ret = ret; continue; } @@ -2223,14 +2343,14 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) if ((ret = pgset->cursor(pgset, NULL, &pgsc, 0)) != 0) goto err; while ((ret = __db_vrfy_pgset_next(pgsc, &p)) == 0) { - if ((ret = memp_fget(dbp->mpf, &p, 0, &subpg)) != 0) { + if ((ret = mpf->get(mpf, &p, 0, &subpg)) != 0) { err_ret = ret; continue; } if ((ret = __db_salvage(dbp, vdp, p, subpg, handle, callback, flags)) != 0) err_ret = ret; - if ((ret = memp_fput(dbp->mpf, subpg, 0)) != 0) + if ((ret = mpf->put(mpf, subpg, 0)) != 0) err_ret = ret; } @@ -2243,7 +2363,7 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) goto err; } err: if (subdbname) - __os_free(subdbname, 0); + __os_free(dbenv, subdbname); if ((t_ret = pgset->close(pgset, 0)) != 0) ret = t_ret; @@ -2268,10 +2388,13 @@ __db_meta2pgset(dbp, vdp, pgno, flags, pgset) u_int32_t flags; DB *pgset; { + DB_MPOOLFILE *mpf; PAGE *h; int ret, t_ret; - if ((ret = memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) + mpf = dbp->mpf; + + if ((ret = mpf->get(mpf, &pgno, 0, &h)) != 0) return (ret); switch (TYPE(h)) { @@ -2286,7 +2409,7 @@ __db_meta2pgset(dbp, vdp, pgno, flags, pgset) break; } - if ((t_ret = memp_fput(dbp->mpf, h, 0)) != 0) + if ((t_ret = mpf->put(mpf, h, 0)) != 0) return (t_ret); return (ret); } @@ -2305,7 +2428,6 @@ __db_guesspgsize(dbenv, fhp) size_t nr; u_int32_t guess; u_int8_t type; - int ret; for (guess = DB_MAX_PGSIZE; guess >= DB_MIN_PGSIZE; guess >>= 1) { /* @@ -2321,11 +2443,11 @@ __db_guesspgsize(dbenv, fhp) * our previous guess; that last one was probably the page size. */ for (i = 1; i <= 3; i++) { - if ((ret = __os_seek(dbenv, fhp, guess, - i, SSZ(DBMETA, type), 0, DB_OS_SEEK_SET)) != 0) + if (__os_seek(dbenv, fhp, guess, + i, SSZ(DBMETA, type), 0, DB_OS_SEEK_SET) != 0) break; - if ((ret = __os_read(dbenv, - fhp, &type, 1, &nr)) != 0 || nr == 0) + if (__os_read(dbenv, + fhp, &type, 1, &nr) != 0 || nr == 0) break; if (type == P_INVALID || type >= P_PAGETYPE_MAX) return (guess << 1); diff --git a/bdb/db/db_vrfyutil.c b/bdb/db/db_vrfyutil.c index 89dccdcc760..44344ceed11 100644 --- a/bdb/db/db_vrfyutil.c +++ b/bdb/db/db_vrfyutil.c @@ -1,16 +1,16 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2000 + * Copyright (c) 2000-2002 * Sleepycat Software. All rights reserved. * - * $Id: db_vrfyutil.c,v 11.11 2000/11/28 21:36:04 bostic Exp $ + * $Id: db_vrfyutil.c,v 11.29 2002/08/08 03:57:50 bostic Exp $ */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_vrfyutil.c,v 11.11 2000/11/28 21:36:04 bostic Exp $"; +static const char revid[] = "$Id: db_vrfyutil.c,v 11.29 2002/08/08 03:57:50 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -20,10 +20,11 @@ static const char revid[] = "$Id: db_vrfyutil.c,v 11.11 2000/11/28 21:36:04 bost #endif #include "db_int.h" -#include "db_page.h" -#include "db_verify.h" -#include "db_ext.h" +#include "dbinc/db_page.h" +#include "dbinc/db_verify.h" +#include "dbinc/db_am.h" +static int __db_vrfy_pageinfo_create __P((DB_ENV *, VRFY_PAGEINFO **)); static int __db_vrfy_pgset_iinc __P((DB *, db_pgno_t, int)); /* @@ -34,7 +35,7 @@ static int __db_vrfy_pgset_iinc __P((DB *, db_pgno_t, int)); * PUBLIC: __P((DB_ENV *, u_int32_t, VRFY_DBINFO **)); */ int -__db_vrfy_dbinfo_create (dbenv, pgsize, vdpp) +__db_vrfy_dbinfo_create(dbenv, pgsize, vdpp) DB_ENV *dbenv; u_int32_t pgsize; VRFY_DBINFO **vdpp; @@ -53,14 +54,14 @@ __db_vrfy_dbinfo_create (dbenv, pgsize, vdpp) if ((ret = db_create(&cdbp, dbenv, 0)) != 0) goto err; - if ((ret = cdbp->set_flags(cdbp, DB_DUP | DB_DUPSORT)) != 0) + if ((ret = cdbp->set_flags(cdbp, DB_DUP)) != 0) goto err; if ((ret = cdbp->set_pagesize(cdbp, pgsize)) != 0) goto err; if ((ret = - cdbp->open(cdbp, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) != 0) + cdbp->open(cdbp, NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) != 0) goto err; if ((ret = db_create(&pgdbp, dbenv, 0)) != 0) @@ -69,8 +70,8 @@ __db_vrfy_dbinfo_create (dbenv, pgsize, vdpp) if ((ret = pgdbp->set_pagesize(pgdbp, pgsize)) != 0) goto err; - if ((ret = - pgdbp->open(pgdbp, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) != 0) + if ((ret = pgdbp->open(pgdbp, + NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) != 0) goto err; if ((ret = __db_vrfy_pgset(dbenv, pgsize, &pgset)) != 0) @@ -90,7 +91,7 @@ err: if (cdbp != NULL) if (pgdbp != NULL) (void)pgdbp->close(pgdbp, 0); if (vdp != NULL) - __os_free(vdp, sizeof(VRFY_DBINFO)); + __os_free(dbenv, vdp); return (ret); } @@ -99,10 +100,11 @@ err: if (cdbp != NULL) * Destructor for VRFY_DBINFO. Destroys VRFY_PAGEINFOs and deallocates * structure. * - * PUBLIC: int __db_vrfy_dbinfo_destroy __P((VRFY_DBINFO *)); + * PUBLIC: int __db_vrfy_dbinfo_destroy __P((DB_ENV *, VRFY_DBINFO *)); */ int -__db_vrfy_dbinfo_destroy(vdp) +__db_vrfy_dbinfo_destroy(dbenv, vdp) + DB_ENV *dbenv; VRFY_DBINFO *vdp; { VRFY_CHILDINFO *c, *d; @@ -112,7 +114,7 @@ __db_vrfy_dbinfo_destroy(vdp) for (c = LIST_FIRST(&vdp->subdbs); c != NULL; c = d) { d = LIST_NEXT(c, links); - __os_free(c, 0); + __os_free(NULL, c); } if ((t_ret = vdp->pgdbp->close(vdp->pgdbp, 0)) != 0) @@ -126,7 +128,7 @@ __db_vrfy_dbinfo_destroy(vdp) DB_ASSERT(LIST_FIRST(&vdp->activepips) == NULL); - __os_free(vdp, sizeof(VRFY_DBINFO)); + __os_free(dbenv, vdp); return (ret); } @@ -192,7 +194,7 @@ __db_vrfy_getpageinfo(vdp, pgno, pipp) return (ret); /* Case 3 */ - if ((ret = __db_vrfy_pageinfo_create(&pip)) != 0) + if ((ret = __db_vrfy_pageinfo_create(pgdbp->dbenv, &pip)) != 0) return (ret); LIST_INSERT_HEAD(&vdp->activepips, pip, links); @@ -208,10 +210,12 @@ found: pip->pi_refcount++; * __db_vrfy_putpageinfo -- * Put back a VRFY_PAGEINFO that we're done with. * - * PUBLIC: int __db_vrfy_putpageinfo __P((VRFY_DBINFO *, VRFY_PAGEINFO *)); + * PUBLIC: int __db_vrfy_putpageinfo __P((DB_ENV *, + * PUBLIC: VRFY_DBINFO *, VRFY_PAGEINFO *)); */ int -__db_vrfy_putpageinfo(vdp, pip) +__db_vrfy_putpageinfo(dbenv, vdp, pip) + DB_ENV *dbenv; VRFY_DBINFO *vdp; VRFY_PAGEINFO *pip; { @@ -255,7 +259,7 @@ __db_vrfy_putpageinfo(vdp, pip) #endif DB_ASSERT(pip->pi_refcount == 0); - __os_free(pip, 0); + __os_ufree(dbenv, pip); return (0); } @@ -280,7 +284,8 @@ __db_vrfy_pgset(dbenv, pgsize, dbpp) return (ret); if ((ret = dbp->set_pagesize(dbp, pgsize)) != 0) goto err; - if ((ret = dbp->open(dbp, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) == 0) + if ((ret = dbp->open(dbp, + NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) == 0) *dbpp = dbp; else err: (void)dbp->close(dbp, 0); @@ -382,7 +387,7 @@ __db_vrfy_pgset_iinc(dbp, pgno, i) F_SET(&data, DB_DBT_USERMEM); if ((ret = dbp->get(dbp, NULL, &key, &data, 0)) == 0) { - DB_ASSERT(data.size = sizeof(int)); + DB_ASSERT(data.size == sizeof(int)); memcpy(&val, data.data, sizeof(int)); } else if (ret != DB_NOTFOUND) return (ret); @@ -463,8 +468,10 @@ __db_vrfy_childput(vdp, pgno, cip) db_pgno_t pgno; VRFY_CHILDINFO *cip; { - DBT key, data; DB *cdbp; + DBC *cc; + DBT key, data; + VRFY_CHILDINFO *oldcip; int ret; cdbp = vdp->cdbp; @@ -474,17 +481,44 @@ __db_vrfy_childput(vdp, pgno, cip) key.data = &pgno; key.size = sizeof(db_pgno_t); + /* + * We want to avoid adding multiple entries for a single child page; + * we only need to verify each child once, even if a child (such + * as an overflow key) is multiply referenced. + * + * However, we also need to make sure that when walking the list + * of children, we encounter them in the order they're referenced + * on a page. (This permits us, for example, to verify the + * prev_pgno/next_pgno chain of Btree leaf pages.) + * + * Check the child database to make sure that this page isn't + * already a child of the specified page number. If it's not, + * put it at the end of the duplicate set. + */ + if ((ret = __db_vrfy_childcursor(vdp, &cc)) != 0) + return (ret); + for (ret = __db_vrfy_ccset(cc, pgno, &oldcip); ret == 0; + ret = __db_vrfy_ccnext(cc, &oldcip)) + if (oldcip->pgno == cip->pgno) { + /* + * Found a matching child. Return without + * putting it again. + */ + if ((ret = __db_vrfy_ccclose(cc)) != 0) + return (ret); + return (0); + } + if (ret != DB_NOTFOUND) { + (void)__db_vrfy_ccclose(cc); + return (ret); + } + if ((ret = __db_vrfy_ccclose(cc)) != 0) + return (ret); + data.data = cip; data.size = sizeof(VRFY_CHILDINFO); - /* - * Don't add duplicate (data) entries for a given child, and accept - * DB_KEYEXIST as a successful return; we only need to verify - * each child once, even if a child (such as an overflow key) is - * multiply referenced. - */ - ret = cdbp->put(cdbp, NULL, &key, &data, DB_NODUPDATA); - return (ret == DB_KEYEXIST ? 0 : ret); + return (cdbp->put(cdbp, NULL, &key, &data, 0)); } /* @@ -568,19 +602,26 @@ __db_vrfy_ccclose(dbc) /* * __db_vrfy_pageinfo_create -- * Constructor for VRFY_PAGEINFO; allocates and initializes. - * - * PUBLIC: int __db_vrfy_pageinfo_create __P((VRFY_PAGEINFO **)); */ -int -__db_vrfy_pageinfo_create(pgipp) +static int +__db_vrfy_pageinfo_create(dbenv, pgipp) + DB_ENV *dbenv; VRFY_PAGEINFO **pgipp; { VRFY_PAGEINFO *pgip; int ret; - if ((ret = __os_calloc(NULL, - 1, sizeof(VRFY_PAGEINFO), (void **)&pgip)) != 0) + /* + * pageinfo structs are sometimes allocated here and sometimes + * allocated by fetching them from a database with DB_DBT_MALLOC. + * There's no easy way for the destructor to tell which was + * used, and so we always allocate with __os_umalloc so we can free + * with __os_ufree. + */ + if ((ret = __os_umalloc(dbenv, + sizeof(VRFY_PAGEINFO), (void **)&pgip)) != 0) return (ret); + memset(pgip, 0, sizeof(VRFY_PAGEINFO)); DB_ASSERT(pgip->pi_refcount == 0); @@ -607,7 +648,8 @@ __db_salvage_init(vdp) if ((ret = dbp->set_pagesize(dbp, 1024)) != 0) goto err; - if ((ret = dbp->open(dbp, NULL, NULL, DB_BTREE, DB_CREATE, 0)) != 0) + if ((ret = dbp->open(dbp, + NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0)) != 0) goto err; vdp->salvage_pages = dbp; diff --git a/bdb/db185/db185.c b/bdb/db185/db185.c index 84327542485..99d37bcf341 100644 --- a/bdb/db185/db185.c +++ b/bdb/db185/db185.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,9 +9,9 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db185.c,v 11.15 2001/01/23 21:27:03 bostic Exp $"; + "$Id: db185.c,v 11.28 2002/05/09 01:55:14 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES @@ -38,6 +38,15 @@ static int db185_put __P((const DB185 *, DBT185 *, const DBT185 *, u_int)); static int db185_seq __P((const DB185 *, DBT185 *, DBT185 *, u_int)); static int db185_sync __P((const DB185 *, u_int)); +/* + * EXTERN: #ifdef _DB185_INT_H_ + * EXTERN: DB185 *__db185_open + * EXTERN: __P((const char *, int, int, DBTYPE, const void *)); + * EXTERN: #else + * EXTERN: DB *__db185_open + * EXTERN: __P((const char *, int, int, DBTYPE, const void *)); + * EXTERN: #endif + */ DB185 * __db185_open(file, oflags, mode, type, openinfo) const char *file; @@ -153,7 +162,7 @@ __db185_open(file, oflags, mode, type, openinfo) if (oflags & O_CREAT && __os_exists(file, NULL) != 0) if (__os_openhandle(NULL, file, oflags, mode, &fh) == 0) - (void)__os_closehandle(&fh); + (void)__os_closehandle(NULL, &fh); (void)dbp->set_re_source(dbp, file); if (O_RDONLY) @@ -220,15 +229,12 @@ __db185_open(file, oflags, mode, type, openinfo) * to the underlying DB structure, and vice-versa. This has to be * done BEFORE the DB::open method call because the hash callback * is exercised as part of hash database initialiation. - * - * XXX - * Overload the cj_internal field for this purpose. */ db185p->dbp = dbp; - dbp->cj_internal = db185p; + dbp->api_internal = db185p; /* Open the database. */ - if ((ret = dbp->open(dbp, + if ((ret = dbp->open(dbp, NULL, file, NULL, type, __db_oflags(oflags), mode)) != 0) goto err; @@ -238,10 +244,10 @@ __db185_open(file, oflags, mode, type, openinfo) return (db185p); -einval: ret = EINVAL; - -err: if (db185p != NULL) - __os_free(db185p, sizeof(DB185)); +err: if (ret < 0) /* DB 1.85 can't handle DB 2.0's errors. */ +einval: ret = EINVAL; + if (db185p != NULL) + __os_free(NULL, db185p); if (dbp != NULL) (void)dbp->close(dbp, 0); @@ -260,11 +266,13 @@ db185_close(db185p) ret = dbp->close(dbp, 0); - __os_free(db185p, sizeof(DB185)); + __os_free(NULL, db185p); if (ret == 0) return (0); + if (ret < 0) /* DB 1.85 can't handle DB 2.0's errors. */ + ret = EINVAL; __os_set_errno(ret); return (-1); } @@ -299,11 +307,10 @@ db185_del(db185p, key185, flags) return (1); } + if (ret < 0) /* DB 1.85 can't handle DB 2.0's errors. */ +einval: ret = EINVAL; __os_set_errno(ret); return (-1); - -einval: __os_set_errno(EINVAL); - return (-1); } static int @@ -318,6 +325,8 @@ db185_fd(db185p) if ((ret = dbp->fd(dbp, &fd)) == 0) return (fd); + if (ret < 0) /* DB 1.85 can't handle DB 2.0's errors. */ + ret = EINVAL; __os_set_errno(ret); return (-1); } @@ -354,11 +363,10 @@ db185_get(db185p, key185, data185, flags) return (1); } + if (ret < 0) /* DB 1.85 can't handle DB 2.0's errors. */ +einval: ret = EINVAL; __os_set_errno(ret); return (-1); - -einval: __os_set_errno(EINVAL); - return (-1); } static int @@ -371,7 +379,7 @@ db185_put(db185p, key185, data185, flags) DB *dbp; DBC *dbcp_put; DBT key, data; - int ret; + int ret, t_ret; dbp = db185p->dbp; @@ -394,23 +402,18 @@ db185_put(db185p, key185, data185, flags) if (dbp->type != DB_RECNO) goto einval; - if ((ret = dbp->cursor(dbp, NULL, &dbcp_put, 0)) != 0) { - __os_set_errno(ret); - return (-1); - } + if ((ret = dbp->cursor(dbp, NULL, &dbcp_put, 0)) != 0) + break; if ((ret = - dbcp_put->c_get(dbcp_put, &key, &data, DB_SET)) != 0) { - (void)dbcp_put->c_close(dbcp_put); - __os_set_errno(ret); - return (-1); + dbcp_put->c_get(dbcp_put, &key, &data, DB_SET)) == 0) { + memset(&data, 0, sizeof(data)); + data.data = data185->data; + data.size = data185->size; + ret = dbcp_put->c_put(dbcp_put, &key, &data, + flags == R_IAFTER ? DB_AFTER : DB_BEFORE); } - memset(&data, 0, sizeof(data)); - data.data = data185->data; - data.size = data185->size; - ret = dbcp_put->c_put(dbcp_put, - &key, &data, flags == R_IAFTER ? DB_AFTER : DB_BEFORE); - (void)dbcp_put->c_close(dbcp_put); - __os_set_errno(ret); + if ((t_ret = dbcp_put->c_close(dbcp_put)) != 0 && ret == 0) + ret = t_ret; break; case R_NOOVERWRITE: ret = dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE); @@ -436,10 +439,10 @@ db185_put(db185p, key185, data185, flags) case DB_KEYEXIST: return (1); } - __os_set_errno(ret); - return (-1); -einval: __os_set_errno(EINVAL); + if (ret < 0) /* DB 1.85 can't handle DB 2.0's errors. */ +einval: ret = EINVAL; + __os_set_errno(ret); return (-1); } @@ -496,11 +499,10 @@ db185_seq(db185p, key185, data185, flags) return (1); } + if (ret < 0) /* DB 1.85 can't handle DB 2.0's errors. */ +einval: ret = EINVAL; __os_set_errno(ret); return (-1); - -einval: __os_set_errno(EINVAL); - return (-1); } static int @@ -534,11 +536,10 @@ db185_sync(db185p, flags) if ((ret = dbp->sync(dbp, 0)) == 0) return (0); + if (ret < 0) /* DB 1.85 can't handle DB 2.0's errors. */ +einval: ret = EINVAL; __os_set_errno(ret); return (-1); - -einval: __os_set_errno(EINVAL); - return (-1); } static void @@ -564,7 +565,7 @@ db185_compare(dbp, a, b) DB *dbp; const DBT *a, *b; { - return (((DB185 *)dbp->cj_internal)->compare(a, b)); + return (((DB185 *)dbp->api_internal)->compare(a, b)); } /* @@ -576,7 +577,7 @@ db185_prefix(dbp, a, b) DB *dbp; const DBT *a, *b; { - return (((DB185 *)dbp->cj_internal)->prefix(a, b)); + return (((DB185 *)dbp->api_internal)->prefix(a, b)); } /* @@ -589,5 +590,5 @@ db185_hash(dbp, key, len) const void *key; u_int32_t len; { - return (((DB185 *)dbp->cj_internal)->hash(key, (size_t)len)); + return (((DB185 *)dbp->api_internal)->hash(key, (size_t)len)); } diff --git a/bdb/db185/db185_int.h b/bdb/db185/db185_int.in similarity index 96% rename from bdb/db185/db185_int.h rename to bdb/db185/db185_int.in index 172019d3f00..a4a3ce19c17 100644 --- a/bdb/db185/db185_int.h +++ b/bdb/db185/db185_int.in @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. */ /* @@ -36,11 +36,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: db185_int.h,v 11.7 2001/01/22 22:22:46 krinsky Exp $ + * $Id: db185_int.in,v 11.12 2002/01/11 15:51:51 bostic Exp $ */ -#ifndef _DB185_H_ -#define _DB185_H_ +#ifndef _DB185_INT_H_ +#define _DB185_INT_H_ /* Routine flags. */ #define R_CURSOR 1 /* del, put, seq */ @@ -126,4 +126,4 @@ typedef struct { u_char bval; /* delimiting byte (variable-length records */ char *bfname; /* btree file name */ } RECNOINFO; -#endif /* !_DB185_H_ */ +#endif /* !_DB185_INT_H_ */ diff --git a/bdb/db_archive/db_archive.c b/bdb/db_archive/db_archive.c index 7c91e42f390..dc8718e4c03 100644 --- a/bdb/db_archive/db_archive.c +++ b/bdb/db_archive/db_archive.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,29 +9,25 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_archive.c,v 11.18 2001/01/18 18:36:56 bostic Exp $"; + "$Id: db_archive.c,v 11.36 2002/03/28 20:13:34 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES #include -#include #include +#include +#include #include #endif #include "db_int.h" -#include "common_ext.h" -int main __P((int, char *[])); -void usage __P((void)); -void version_check __P((void)); - -DB_ENV *dbenv; -const char - *progname = "db_archive"; /* Program name. */ +int main __P((int, char *[])); +int usage __P((void)); +int version_check __P((const char *)); int main(argc, argv) @@ -40,16 +36,19 @@ main(argc, argv) { extern char *optarg; extern int optind; + const char *progname = "db_archive"; + DB_ENV *dbenv; u_int32_t flags; int ch, e_close, exitval, ret, verbose; - char **file, *home, **list; + char **file, *home, **list, *passwd; - version_check(); + if ((ret = version_check(progname)) != 0) + return (ret); flags = 0; e_close = exitval = verbose = 0; - home = NULL; - while ((ch = getopt(argc, argv, "ah:lsVv")) != EOF) + home = passwd = NULL; + while ((ch = getopt(argc, argv, "ah:lP:sVv")) != EOF) switch (ch) { case 'a': LF_SET(DB_ARCH_ABS); @@ -60,24 +59,33 @@ main(argc, argv) case 'l': LF_SET(DB_ARCH_LOG); 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 's': LF_SET(DB_ARCH_DATA); break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); case 'v': verbose = 1; break; case '?': default: - usage(); + return (usage()); } argc -= optind; argv += optind; if (argc != 0) - usage(); + return (usage()); /* Handle possible interruptions. */ __db_util_siginit(); @@ -99,6 +107,11 @@ main(argc, argv) if (verbose) (void)dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, 1); + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto shutdown; + } /* * If attaching to a pre-existing environment fails, create a * private one and try again. @@ -112,8 +125,8 @@ main(argc, argv) } /* Get the list of names. */ - if ((ret = log_archive(dbenv, &list, flags, NULL)) != 0) { - dbenv->err(dbenv, ret, "log_archive"); + if ((ret = dbenv->log_archive(dbenv, &list, flags)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->log_archive"); goto shutdown; } @@ -121,7 +134,7 @@ main(argc, argv) if (list != NULL) { for (file = list; *file != NULL; ++file) printf("%s\n", *file); - __os_free(list, 0); + free(list); } if (0) { @@ -136,18 +149,20 @@ shutdown: exitval = 1; /* Resend any caught signal. */ __db_util_sigresend(); - return (exitval); + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } -void +int usage() { - (void)fprintf(stderr, "usage: db_archive [-alsVv] [-h home]\n"); - exit (1); + (void)fprintf(stderr, + "usage: db_archive [-alsVv] [-h home] [-P password]\n"); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -159,6 +174,7 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); } diff --git a/bdb/db_checkpoint/db_checkpoint.c b/bdb/db_checkpoint/db_checkpoint.c index c7d16e02334..a59572c5f76 100644 --- a/bdb/db_checkpoint/db_checkpoint.c +++ b/bdb/db_checkpoint/db_checkpoint.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,9 +9,9 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_checkpoint.c,v 11.25 2001/01/18 18:36:57 bostic Exp $"; + "$Id: db_checkpoint.c,v 11.46 2002/08/08 03:50:31 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES @@ -31,25 +31,17 @@ static const char revid[] = #include #include #include +#include #include #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" -#include "hash.h" -#include "qam.h" -#include "common_ext.h" -#include "clib_ext.h" +#include "dbinc/db_page.h" +#include "dbinc/db_am.h" -char *check __P((DB_ENV *, long, long)); int main __P((int, char *[])); -void usage __P((void)); -void version_check __P((void)); - -DB_ENV *dbenv; -const char - *progname = "db_checkpoint"; /* Program name. */ +int usage __P((void)); +int version_check __P((const char *)); int main(argc, argv) @@ -58,13 +50,16 @@ 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, e_close, exitval, once, ret, verbose; - char *home, *logfile; + char *home, *logfile, *passwd; - version_check(); + if ((ret = version_check(progname)) != 0) + return (ret); /* * !!! @@ -76,8 +71,8 @@ main(argc, argv) kbytes = minutes = 0; e_close = exitval = once = verbose = 0; flags = 0; - home = logfile = NULL; - while ((ch = getopt(argc, argv, "1h:k:L:p:Vv")) != EOF) + home = logfile = passwd = NULL; + while ((ch = getopt(argc, argv, "1h:k:L:P:p:Vv")) != EOF) switch (ch) { case '1': once = 1; @@ -87,40 +82,50 @@ main(argc, argv) home = optarg; break; case 'k': - (void)__db_getlong(NULL, progname, - optarg, 1, (long)MAX_UINT32_T, &argval); + if (__db_getlong(NULL, progname, + optarg, 1, (long)MAX_UINT32_T, &argval)) + return (EXIT_FAILURE); kbytes = argval; break; 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 'p': - (void)__db_getlong(NULL, progname, - optarg, 1, (long)MAX_UINT32_T, &argval); + if (__db_getlong(NULL, progname, + optarg, 1, (long)MAX_UINT32_T, &argval)) + return (EXIT_FAILURE); minutes = argval; break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); case 'v': verbose = 1; break; case '?': default: - usage(); - goto shutdown; + return (usage()); } argc -= optind; argv += optind; if (argc != 0) - usage(); + return (usage()); if (once == 0 && kbytes == 0 && minutes == 0) { (void)fprintf(stderr, "%s: at least one of -1, -k and -p must be specified\n", progname); - exit (1); + return (EXIT_FAILURE); } /* Handle possible interruptions. */ @@ -144,6 +149,11 @@ 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; + } /* Initialize the environment. */ if ((ret = dbenv->open(dbenv, home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0) { @@ -152,10 +162,10 @@ main(argc, argv) } /* Register the standard pgin/pgout functions, in case we do I/O. */ - if ((ret = - memp_register(dbenv, DB_FTYPE_SET, __db_pgin, __db_pgout)) != 0) { + if ((ret = dbenv->memp_register( + dbenv, DB_FTYPE_SET, __db_pgin, __db_pgout)) != 0) { dbenv->err(dbenv, ret, - "failed to register access method functions"); + "DB_ENV->memp_register: failed to register access method functions"); goto shutdown; } @@ -171,15 +181,8 @@ main(argc, argv) dbenv->errx(dbenv, "checkpoint: %s", ctime(&now)); } - ret = txn_checkpoint(dbenv, kbytes, minutes, flags); - while (ret == DB_INCOMPLETE) { - if (verbose) - dbenv->errx(dbenv, - "checkpoint did not finish, retrying\n"); - (void)__os_sleep(dbenv, 2, 0); - ret = txn_checkpoint(dbenv, 0, 0, flags); - } - if (ret != 0) { + if ((ret = dbenv->txn_checkpoint(dbenv, + kbytes, minutes, flags)) != 0) { dbenv->err(dbenv, ret, "txn_checkpoint"); goto shutdown; } @@ -208,19 +211,21 @@ shutdown: exitval = 1; /* Resend any caught signal. */ __db_util_sigresend(); - return (exitval); + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } -void +int usage() { - (void)fprintf(stderr, - "usage: db_checkpoint [-1Vv] [-h home] [-k kbytes] [-L file] [-p min]\n"); - exit(1); + (void)fprintf(stderr, "%s\n\t%s\n", + "usage: db_checkpoint [-1Vv]", + "[-h home] [-k kbytes] [-L file] [-P password] [-p min]"); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -232,6 +237,7 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); } diff --git a/bdb/db_deadlock/db_deadlock.c b/bdb/db_deadlock/db_deadlock.c index ac151db127a..523918b9ea4 100644 --- a/bdb/db_deadlock/db_deadlock.c +++ b/bdb/db_deadlock/db_deadlock.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,9 +9,9 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_deadlock.c,v 11.19 2001/01/18 18:36:57 bostic Exp $"; + "$Id: db_deadlock.c,v 11.38 2002/08/08 03:50:32 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES @@ -31,19 +31,15 @@ static const char revid[] = #include #include #include +#include #include #endif #include "db_int.h" -#include "clib_ext.h" -int main __P((int, char *[])); -void usage __P((void)); -void version_check __P((void)); - -DB_ENV *dbenv; -const char - *progname = "db_deadlock"; /* Program name. */ +int main __P((int, char *[])); +int usage __P((void)); +int version_check __P((const char *)); int main(argc, argv) @@ -52,36 +48,49 @@ main(argc, argv) { extern char *optarg; extern int optind; + const char *progname = "db_deadlock"; + DB_ENV *dbenv; u_int32_t atype; time_t now; - long usecs; - u_int32_t flags; + long secs, usecs; int ch, e_close, exitval, ret, verbose; - char *home, *logfile; + char *home, *logfile, *str; - version_check(); + if ((ret = version_check(progname)) != 0) + return (ret); atype = DB_LOCK_DEFAULT; home = logfile = NULL; - usecs = 0; - flags = 0; + secs = usecs = 0; e_close = exitval = verbose = 0; while ((ch = getopt(argc, argv, "a:h:L:t:Vvw")) != EOF) switch (ch) { case 'a': switch (optarg[0]) { + case 'e': + atype = DB_LOCK_EXPIRE; + break; + case 'm': + atype = DB_LOCK_MAXLOCKS; + break; + case 'n': + atype = DB_LOCK_MINLOCKS; + break; case 'o': atype = DB_LOCK_OLDEST; break; + case 'w': + atype = DB_LOCK_MINWRITE; + break; case 'y': atype = DB_LOCK_YOUNGEST; break; default: - usage(); + return (usage()); /* NOTREACHED */ } if (optarg[1] != '\0') - usage(); + return (usage()); break; case 'h': home = optarg; @@ -90,42 +99,40 @@ main(argc, argv) logfile = optarg; break; case 't': - (void)__db_getlong(NULL, - progname, optarg, 1, LONG_MAX, &usecs); - usecs *= 1000000; + if ((str = strchr(optarg, '.')) != NULL) { + *str++ = '\0'; + if (*str != '\0' && __db_getlong( + NULL, progname, str, 0, LONG_MAX, &usecs)) + return (EXIT_FAILURE); + } + if (*optarg != '\0' && __db_getlong( + NULL, progname, optarg, 0, LONG_MAX, &secs)) + return (EXIT_FAILURE); + if (secs == 0 && usecs == 0) + return (usage()); + break; + case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); case 'v': verbose = 1; break; - case 'w': - LF_SET(DB_LOCK_CONFLICT); + case 'w': /* Undocumented. */ + /* Detect every 100ms (100000 us) when polling. */ + secs = 0; + usecs = 100000; break; case '?': default: - usage(); + return (usage()); } argc -= optind; argv += optind; if (argc != 0) - usage(); - - if (usecs == 0 && !LF_ISSET(DB_LOCK_CONFLICT)) { - fprintf(stderr, - "%s: at least one of -t and -w must be specified\n", - progname); - exit(1); - } - - /* - * We detect every 100ms (100000 us) when we're running in - * DB_LOCK_CONFLICT mode. - */ - if (usecs == 0) - usecs = 100000; + return (usage()); /* Handle possible interruptions. */ __db_util_siginit(); @@ -166,13 +173,15 @@ main(argc, argv) dbenv->errx(dbenv, "running at %.24s", ctime(&now)); } - if ((ret = lock_detect(dbenv, flags, atype, NULL)) != 0) { - dbenv->err(dbenv, ret, "lock_detect"); + if ((ret = dbenv->lock_detect(dbenv, 0, atype, NULL)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->lock_detect"); goto shutdown; } - /* Make a pass every "usecs" usecs. */ - (void)__os_sleep(dbenv, 0, usecs); + /* Make a pass every "secs" secs and "usecs" usecs. */ + if (secs == 0 && usecs == 0) + break; + (void)__os_sleep(dbenv, secs, usecs); } if (0) { @@ -193,19 +202,21 @@ shutdown: exitval = 1; /* Resend any caught signal. */ __db_util_sigresend(); - return (exitval); + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } -void +int usage() { - (void)fprintf(stderr, - "usage: db_deadlock [-Vvw] [-a o | y] [-h home] [-L file] [-t sec]\n"); - exit(1); + (void)fprintf(stderr, "%s\n\t%s\n", + "usage: db_deadlock [-Vv]", + "[-a e | m | n | o | w | y] [-h home] [-L file] [-t sec.usec]"); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -217,6 +228,7 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); } diff --git a/bdb/db_dump/db_dump.c b/bdb/db_dump/db_dump.c index ba24dd6cc09..143884a3fa8 100644 --- a/bdb/db_dump/db_dump.c +++ b/bdb/db_dump/db_dump.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,9 +9,9 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_dump.c,v 11.41 2001/01/18 18:36:57 bostic Exp $"; + "$Id: db_dump.c,v 11.80 2002/08/08 03:50:34 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES @@ -24,25 +24,17 @@ static const char revid[] = #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "btree.h" -#include "hash.h" -#include "lock.h" +#include "dbinc/db_page.h" +#include "dbinc/db_am.h" -void configure __P((char *)); -int db_init __P((char *)); +int db_init __P((DB_ENV *, char *, int, u_int32_t, int *)); int dump __P((DB *, int, int)); -int dump_sub __P((DB *, char *, int, 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 *)); -void usage __P((void)); -void version_check __P((void)); - -DB_ENV *dbenv; -const char - *progname = "db_dump"; /* Program name. */ +int usage __P((void)); +int version_check __P((const char *)); int main(argc, argv) @@ -51,19 +43,25 @@ main(argc, argv) { extern char *optarg; extern int optind; + const char *progname = "db_dump"; + DB_ENV *dbenv; DB *dbp; + u_int32_t cache; int ch, d_close; - int e_close, exitval; - int lflag, nflag, pflag, ret, rflag, Rflag, subs, keyflag; - char *dopt, *home, *subname; + int e_close, exitval, keyflag, lflag, nflag, pflag, private; + int ret, Rflag, rflag, resize, subs; + char *dopt, *home, *passwd, *subname; - version_check(); + if ((ret = version_check(progname)) != 0) + return (ret); dbp = NULL; d_close = e_close = exitval = lflag = nflag = pflag = rflag = Rflag = 0; keyflag = 0; - dopt = home = subname = NULL; - while ((ch = getopt(argc, argv, "d:f:h:klNprRs:V")) != EOF) + cache = MEGABYTE; + private = 0; + dopt = home = passwd = subname = NULL; + while ((ch = getopt(argc, argv, "d:f:h:klNpP:rRs:V")) != EOF) switch (ch) { case 'd': dopt = optarg; @@ -72,7 +70,7 @@ main(argc, argv) if (freopen(optarg, "w", stdout) == NULL) { fprintf(stderr, "%s: %s: reopen: %s\n", progname, optarg, strerror(errno)); - exit (1); + return (EXIT_FAILURE); } break; case 'h': @@ -86,11 +84,14 @@ main(argc, argv) break; case 'N': nflag = 1; - if ((ret = db_env_set_panicstate(0)) != 0) { - fprintf(stderr, - "%s: db_env_set_panicstate: %s\n", - progname, db_strerror(ret)); - return (1); + 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 'p': @@ -108,42 +109,42 @@ main(argc, argv) break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); case '?': default: - usage(); + return (usage()); } argc -= optind; argv += optind; if (argc != 1) - usage(); + return (usage()); if (dopt != NULL && pflag) { fprintf(stderr, "%s: the -d and -p options may not both be specified\n", progname); - exit (1); + return (EXIT_FAILURE); } if (lflag && subname != NULL) { fprintf(stderr, "%s: the -l and -s options may not both be specified\n", progname); - exit (1); + return (EXIT_FAILURE); } if (keyflag && rflag) { fprintf(stderr, "%s: %s", "the -k and -r or -R options may not both be specified\n", progname); - exit(1); + return (EXIT_FAILURE); } if (subname != NULL && rflag) { fprintf(stderr, "%s: %s", "the -s and -r or R options may not both be specified\n", progname); - exit(1); + return (EXIT_FAILURE); } /* Handle possible interruptions. */ @@ -153,7 +154,7 @@ main(argc, argv) * Create an environment object and initialize it for error * reporting. */ - if ((ret = db_env_create(&dbenv, 0)) != 0) { +retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "%s: db_env_create: %s\n", progname, db_strerror(ret)); goto err; @@ -162,14 +163,24 @@ main(argc, argv) dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); - - if (nflag && (ret = dbenv->set_mutexlocks(dbenv, 0)) != 0) { - dbenv->err(dbenv, ret, "set_mutexlocks"); + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto err; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto err; + } + } + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); goto err; } /* Initialize the environment. */ - if (db_init(home) != 0) + if (db_init(dbenv, home, rflag, cache, &private) != 0) goto err; /* Create the DB object and open the file. */ @@ -185,17 +196,31 @@ main(argc, argv) */ if (rflag) { if ((ret = dbp->verify(dbp, argv[0], NULL, stdout, - DB_SALVAGE | (Rflag ? DB_AGGRESSIVE : 0))) != 0) + DB_SALVAGE | + (Rflag ? DB_AGGRESSIVE : 0) | + (pflag ? DB_PRINTABLE : 0))) != 0) goto err; exitval = 0; goto done; } - if ((ret = dbp->open(dbp, + if ((ret = dbp->open(dbp, NULL, argv[0], subname, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { dbp->err(dbp, ret, "open: %s", argv[0]); goto err; } + if (private != 0) { + if ((ret = __db_util_cache(dbenv, dbp, &cache, &resize)) != 0) + goto err; + if (resize) { + (void)dbp->close(dbp, 0); + d_close = 0; + + (void)dbenv->close(dbenv, 0); + e_close = 0; + goto retry; + } + } if (dopt != NULL) { if (__db_dump(dbp, dopt, NULL)) { @@ -217,7 +242,7 @@ main(argc, argv) if (subname == NULL && is_sub(dbp, &subs)) goto err; if (subs) { - if (dump_sub(dbp, argv[0], pflag, keyflag)) + if (dump_sub(dbenv, dbp, argv[0], pflag, keyflag)) goto err; } else if (__db_prheader(dbp, NULL, pflag, keyflag, stdout, @@ -231,7 +256,7 @@ err: exitval = 1; } done: if (d_close && (ret = dbp->close(dbp, 0)) != 0) { exitval = 1; - dbp->err(dbp, ret, "close"); + dbenv->err(dbenv, ret, "close"); } if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { exitval = 1; @@ -242,7 +267,7 @@ done: if (d_close && (ret = dbp->close(dbp, 0)) != 0) { /* Resend any caught signal. */ __db_util_sigresend(); - return (exitval); + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } /* @@ -250,24 +275,36 @@ done: if (d_close && (ret = dbp->close(dbp, 0)) != 0) { * Initialize the environment. */ int -db_init(home) +db_init(dbenv, home, is_salvage, cache, is_privatep) + DB_ENV *dbenv; char *home; + int is_salvage; + u_int32_t cache; + int *is_privatep; { int ret; /* - * Try and use the underlying environment when opening a database. 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; we wish to - * use the locking system, if present, so that we are safe to use with - * transactions. (We don't need to use transactions explicitly, as - * we're read-only.) + * Try and use the underlying environment when opening a database. + * 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. * - * Note that in CDB, too, this will configure our environment + * If we are not doing a salvage, we wish to use the DB_JOINENV flag; + * 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 + * that in CDB, too, this will configure our environment * appropriately, and our cursors will (correctly) do locking as CDB * read cursors. + * + * If we are doing a salvage, the verification code will protest + * if we initialize transactions, logging, or locking; do an + * explicit DB_INIT_MPOOL to try to join any existing environment + * before we create our own. */ - if (dbenv->open(dbenv, home, DB_JOINENV | DB_USE_ENVIRON, 0) == 0) + *is_privatep = 0; + if (dbenv->open(dbenv, home, + DB_USE_ENVIRON | (is_salvage ? DB_INIT_MPOOL : DB_JOINENV), 0) == 0) return (0); /* @@ -280,7 +317,9 @@ db_init(home) * an mpool region exists). Create one, but make it private so that * no files are actually created. */ - if ((ret = dbenv->open(dbenv, home, + *is_privatep = 1; + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) == 0 && + (ret = dbenv->open(dbenv, home, DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) == 0) return (0); @@ -305,18 +344,20 @@ is_sub(dbp, yesno) switch (dbp->type) { case DB_BTREE: case DB_RECNO: - if ((ret = dbp->stat(dbp, &btsp, NULL, 0)) != 0) { + if ((ret = dbp->stat(dbp, &btsp, DB_FAST_STAT)) != 0) { dbp->err(dbp, ret, "DB->stat"); return (ret); } *yesno = btsp->bt_metaflags & BTM_SUBDB ? 1 : 0; + free(btsp); break; case DB_HASH: - if ((ret = dbp->stat(dbp, &hsp, NULL, 0)) != 0) { + if ((ret = dbp->stat(dbp, &hsp, DB_FAST_STAT)) != 0) { dbp->err(dbp, ret, "DB->stat"); return (ret); } *yesno = hsp->hash_metaflags & DB_HASH_SUBDB ? 1 : 0; + free(hsp); break; case DB_QUEUE: break; @@ -332,7 +373,8 @@ is_sub(dbp, yesno) * Dump out the records for a DB containing subdatabases. */ int -dump_sub(parent_dbp, parent_name, pflag, keyflag) +dump_sub(dbenv, parent_dbp, parent_name, pflag, keyflag) + DB_ENV *dbenv; DB *parent_dbp; char *parent_name; int pflag, keyflag; @@ -369,7 +411,7 @@ dump_sub(parent_dbp, parent_name, pflag, keyflag) free(subdb); return (1); } - if ((ret = dbp->open(dbp, + if ((ret = dbp->open(dbp, NULL, parent_name, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) dbp->err(dbp, ret, "DB->open: %s:%s", parent_name, subdb); @@ -449,7 +491,10 @@ dump(dbp, pflag, keyflag) { DBC *dbcp; DBT key, data; - int ret, is_recno; + DBT keyret, dataret; + db_recno_t recno; + int is_recno, failed, ret; + void *pointer; /* * Get a cursor and step through the database, printing out each @@ -460,47 +505,95 @@ dump(dbp, pflag, keyflag) return (1); } + failed = 0; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); + data.data = malloc(1024 * 1024); + if (data.data == NULL) { + dbp->err(dbp, ENOMEM, "bulk get buffer"); + failed = 1; + goto err; + } + data.ulen = 1024 * 1024; + data.flags = DB_DBT_USERMEM; is_recno = (dbp->type == DB_RECNO || dbp->type == DB_QUEUE); keyflag = is_recno ? keyflag : 1; - while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0) - if ((keyflag && (ret = __db_prdbt(&key, - pflag, " ", stdout, __db_verify_callback, - is_recno, NULL)) != 0) || (ret = - __db_prdbt(&data, pflag, " ", stdout, - __db_verify_callback, 0, NULL)) != 0) { - dbp->errx(dbp, NULL); - return (1); + if (is_recno) { + keyret.data = &recno; + keyret.size = sizeof(recno); + } + +retry: + while ((ret = + dbcp->c_get(dbcp, &key, &data, DB_NEXT | DB_MULTIPLE_KEY)) == 0) { + DB_MULTIPLE_INIT(pointer, &data); + for (;;) { + if (is_recno) + DB_MULTIPLE_RECNO_NEXT(pointer, &data, + recno, dataret.data, dataret.size); + else + DB_MULTIPLE_KEY_NEXT(pointer, + &data, keyret.data, + keyret.size, dataret.data, dataret.size); + + if (dataret.data == NULL) + break; + + if ((keyflag && (ret = __db_prdbt(&keyret, + pflag, " ", stdout, __db_verify_callback, + is_recno, NULL)) != 0) || (ret = + __db_prdbt(&dataret, pflag, " ", stdout, + __db_verify_callback, 0, NULL)) != 0) { + dbp->errx(dbp, NULL); + failed = 1; + goto err; + } } + } + if (ret == ENOMEM) { + data.data = realloc(data.data, data.size); + if (data.data == NULL) { + dbp->err(dbp, ENOMEM, "bulk get buffer"); + failed = 1; + goto err; + } + data.ulen = data.size; + goto retry; + } + if (ret != DB_NOTFOUND) { dbp->err(dbp, ret, "DBcursor->get"); - return (1); + failed = 1; } +err: if (data.data != NULL) + free(data.data); + if ((ret = dbcp->c_close(dbcp)) != 0) { dbp->err(dbp, ret, "DBcursor->close"); - return (1); + failed = 1; } (void)__db_prfooter(stdout, __db_verify_callback); - return (0); + return (failed); } /* * usage -- * Display the usage message. */ -void +int usage() { - (void)fprintf(stderr, "usage: %s\n", -"db_dump [-klNprRV] [-d ahr] [-f output] [-h home] [-s database] db_file"); - exit(1); + (void)fprintf(stderr, "%s\n\t%s\n", + "usage: db_dump [-klNprRV]", + "[-d ahr] [-f output] [-h home] [-P password] [-s database] db_file"); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -512,6 +605,7 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); } diff --git a/bdb/db_dump185/db_dump185.c b/bdb/db_dump185/db_dump185.c index 4b57fffd2dc..97164f34a9a 100644 --- a/bdb/db_dump185/db_dump185.c +++ b/bdb/db_dump185/db_dump185.c @@ -1,15 +1,15 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #ifndef lint static char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static char revid[] = - "$Id: db_dump185.c,v 11.8 2001/01/10 17:26:21 bostic Exp $"; + "$Id: db_dump185.c,v 11.17 2002/08/08 03:50:35 bostic Exp $"; #endif #include @@ -65,9 +65,11 @@ typedef struct hashhdr186 { /* Disk resident portion */ int32_t h_charkey; /* value of hash(CHARKEY) */ #define NCACHED 32 /* number of bit maps and spare points */ int32_t spares[NCACHED];/* spare pages for overflow */ - u_int16_t bitmaps[NCACHED]; /* address of overflow page bitmaps */ + /* address of overflow page bitmaps */ + u_int16_t bitmaps[NCACHED]; } HASHHDR186; typedef struct htab186 { /* Memory resident data structure */ + void *unused[2]; HASHHDR186 hdr; /* Header */ } HTAB186; @@ -171,7 +173,7 @@ void db_hash __P((DB *, int)); void dbt_dump __P((DBT *)); void dbt_print __P((DBT *)); int main __P((int, char *[])); -void usage __P((void)); +int usage __P((void)); int main(argc, argv) @@ -191,7 +193,7 @@ main(argc, argv) if (freopen(optarg, "w", stdout) == NULL) { fprintf(stderr, "db_dump185: %s: %s\n", optarg, strerror(errno)); - exit (1); + return (EXIT_FAILURE); } break; case 'p': @@ -199,20 +201,20 @@ main(argc, argv) break; case '?': default: - usage(); + return (usage()); } argc -= optind; argv += optind; if (argc != 1) - usage(); + return (usage()); if ((dbp = dbopen(argv[0], O_RDONLY, 0, DB_BTREE, NULL)) == NULL) { if ((dbp = dbopen(argv[0], O_RDONLY, 0, DB_HASH, NULL)) == NULL) { fprintf(stderr, "db_dump185: %s: %s\n", argv[0], strerror(errno)); - exit (1); + return (EXIT_FAILURE); } db_hash(dbp, pflag); } else @@ -236,9 +238,9 @@ main(argc, argv) if (rval == -1) { fprintf(stderr, "db_dump185: seq: %s\n", strerror(errno)); - exit (1); + return (EXIT_FAILURE); } - return (0); + return (EXIT_SUCCESS); } /* @@ -345,9 +347,9 @@ dbt_print(dbtp) * usage -- * Display the usage message. */ -void +int usage() { (void)fprintf(stderr, "usage: db_dump185 [-p] [-f file] db_file\n"); - exit(1); + return (EXIT_FAILURE); } diff --git a/bdb/db_load/db_load.c b/bdb/db_load/db_load.c index 33e2eb5e02b..d27fca04ec0 100644 --- a/bdb/db_load/db_load.c +++ b/bdb/db_load/db_load.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,9 +9,9 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_load.c,v 11.33 2001/01/22 17:25:07 krinsky Exp $"; + "$Id: db_load.c,v 11.71 2002/08/08 03:50:36 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES @@ -25,33 +25,45 @@ static const char revid[] = #endif #include "db_int.h" -#include "db_page.h" -#include "db_am.h" -#include "clib_ext.h" +#include "dbinc/db_page.h" +#include "dbinc/db_am.h" -void badend __P((void)); -void badnum __P((void)); -int configure __P((DB *, char **, char **, int *)); -int db_init __P((char *)); -int dbt_rdump __P((DBT *)); -int dbt_rprint __P((DBT *)); -int dbt_rrecno __P((DBT *, int)); -int digitize __P((int, int *)); -int load __P((char *, DBTYPE, char **, int, u_int32_t)); +typedef struct { /* XXX: Globals. */ + const char *progname; /* Program name. */ + char *hdrbuf; /* Input file header. */ + u_long lineno; /* Input file line number. */ + u_long origline; /* Original file line number. */ + int endodata; /* Reached the end of a database. */ + int endofile; /* Reached the end of the input. */ + int version; /* Input version. */ + char *home; /* Env home. */ + char *passwd; /* Env passwd. */ + int private; /* Private env. */ + u_int32_t cache; /* Env cache size. */ +} LDG; + +void 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 **)); +int db_init __P((DB_ENV *, char *, u_int32_t, int *)); +int dbt_rdump __P((DB_ENV *, DBT *)); +int dbt_rprint __P((DB_ENV *, DBT *)); +int dbt_rrecno __P((DB_ENV *, DBT *, int)); +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 *, DBTYPE *, char **, int *, int *)); -void usage __P((void)); -void version_check __P((void)); +int rheader __P((DB_ENV *, DB *, DBTYPE *, char **, int *, int *)); +int usage __P((void)); +int version_check __P((const char *)); -int endodata; /* Reached the end of a database. */ -int endofile; /* Reached the end of the input. */ -int existed; /* Tried to load existing key. */ -u_long lineno; /* Input file line number. */ -int version = 1; /* Input version. */ +#define G(f) ((LDG *)dbenv->app_private)->f -DB_ENV *dbenv; -const char - *progname = "db_load"; /* Program name. */ + /* Flags to the load function. */ +#define LDF_NOHEADER 0x01 /* No dump header. */ +#define LDF_NOOVERWRITE 0x02 /* Don't overwrite existing rows. */ +#define LDF_PASSWORD 0x04 /* Encrypt created databases. */ int main(argc, argv) @@ -61,24 +73,35 @@ main(argc, argv) extern char *optarg; extern int optind; DBTYPE dbtype; - u_int32_t db_nooverwrite; - int ch, exitval, no_header, ret; - char **clist, **clp, *home; + DB_ENV *dbenv; + LDG ldg; + u_int32_t ldf; + int ch, existed, exitval, ret; + char **clist, **clp; - version_check(); + ldg.progname = "db_load"; + ldg.lineno = 0; + ldg.endodata = ldg.endofile = 0; + ldg.version = 1; + ldg.cache = MEGABYTE; + ldg.hdrbuf = NULL; + ldg.home = NULL; + ldg.passwd = NULL; - home = NULL; - db_nooverwrite = 0; - exitval = no_header = 0; + if ((ret = version_check(ldg.progname)) != 0) + return (ret); + + ldf = 0; + exitval = 0; dbtype = DB_UNKNOWN; /* Allocate enough room for configuration arguments. */ if ((clp = clist = (char **)calloc(argc + 1, sizeof(char *))) == NULL) { - fprintf(stderr, "%s: %s\n", progname, strerror(ENOMEM)); - exit(1); + fprintf(stderr, "%s: %s\n", ldg.progname, strerror(ENOMEM)); + return (EXIT_FAILURE); } - while ((ch = getopt(argc, argv, "c:f:h:nTt:V")) != EOF) + while ((ch = getopt(argc, argv, "c:f:h:nP:Tt:V")) != EOF) switch (ch) { case 'c': *clp++ = optarg; @@ -86,18 +109,28 @@ main(argc, argv) case 'f': if (freopen(optarg, "r", stdin) == NULL) { fprintf(stderr, "%s: %s: reopen: %s\n", - progname, optarg, strerror(errno)); - exit(1); + ldg.progname, optarg, strerror(errno)); + return (EXIT_FAILURE); } break; case 'h': - home = optarg; + ldg.home = optarg; break; case 'n': - db_nooverwrite = DB_NOOVERWRITE; + ldf |= LDF_NOOVERWRITE; + break; + case 'P': + ldg.passwd = strdup(optarg); + memset(optarg, 0, strlen(optarg)); + if (ldg.passwd == NULL) { + fprintf(stderr, "%s: strdup: %s\n", + ldg.progname, strerror(errno)); + return (EXIT_FAILURE); + } + ldf |= LDF_PASSWORD; break; case 'T': - no_header = 1; + ldf |= LDF_NOHEADER; break; case 't': if (strcmp(optarg, "btree") == 0) { @@ -116,21 +149,19 @@ main(argc, argv) dbtype = DB_QUEUE; break; } - usage(); - /* NOTREACHED */ + return (usage()); case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); case '?': default: - usage(); - /* NOTREACHED */ + return (usage()); } argc -= optind; argv += optind; if (argc != 1) - usage(); + return (usage()); /* Handle possible interruptions. */ __db_util_siginit(); @@ -139,19 +170,12 @@ main(argc, argv) * Create an environment object initialized for error reporting, and * then open it. */ - if ((ret = db_env_create(&dbenv, 0)) != 0) { - fprintf(stderr, - "%s: db_env_create: %s\n", progname, db_strerror(ret)); - goto shutdown; - } - dbenv->set_errfile(dbenv, stderr); - dbenv->set_errpfx(dbenv, progname); - if (db_init(home) != 0) + if (env_create(&dbenv, &ldg) != 0) goto shutdown; - while (!endofile) - if (load(argv[0], - dbtype, clist, no_header, db_nooverwrite) != 0) + while (!ldg.endofile) + if (load(dbenv, argv[0], dbtype, clist, ldf, + &ldg, &existed) != 0) goto shutdown; if (0) { @@ -160,13 +184,20 @@ shutdown: exitval = 1; if ((ret = dbenv->close(dbenv, 0)) != 0) { exitval = 1; fprintf(stderr, - "%s: dbenv->close: %s\n", progname, db_strerror(ret)); + "%s: dbenv->close: %s\n", ldg.progname, db_strerror(ret)); } /* Resend any caught signal. */ __db_util_sigresend(); + free(clist); - /* Return 0 on success, 1 if keys existed already, and 2 on failure. */ + /* + * Return 0 on success, 1 if keys existed already, and 2 on failure. + * + * Technically, this is wrong, because exit of anything other than + * 0 is implementation-defined by the ANSI C standard. I don't see + * any good solutions that don't involve API changes. + */ return (exitval == 0 ? (existed == 0 ? 0 : 1) : 2); } @@ -175,32 +206,39 @@ shutdown: exitval = 1; * Load a database. */ int -load(name, argtype, clist, no_header, db_nooverwrite) +load(dbenv, name, argtype, clist, flags, ldg, existedp) + DB_ENV *dbenv; char *name, **clist; DBTYPE argtype; - int no_header; - u_int32_t db_nooverwrite; + u_int flags; + LDG *ldg; + int *existedp; { DB *dbp; DBT key, rkey, data, *readp, *writep; DBTYPE dbtype; DB_TXN *ctxn, *txn; db_recno_t recno, datarecno; - int checkprint, hexkeys, keys, ret, rval; - int keyflag, ascii_recno; + u_int32_t put_flags; + int ascii_recno, checkprint, hexkeys, keyflag, keys, resize, ret, rval; char *subdb; - endodata = 0; + *existedp = 0; + + put_flags = LF_ISSET(LDF_NOOVERWRITE) ? DB_NOOVERWRITE : 0; + G(endodata) = 0; + subdb = NULL; ctxn = txn = NULL; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); memset(&rkey, 0, sizeof(DBT)); +retry_db: /* Create the DB object. */ if ((ret = db_create(&dbp, dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "db_create"); - return (1); + goto err; } dbtype = DB_UNKNOWN; @@ -208,13 +246,14 @@ load(name, argtype, clist, no_header, db_nooverwrite) hexkeys = -1; keyflag = -1; /* Read the header -- if there's no header, we expect flat text. */ - if (no_header) { + if (LF_ISSET(LDF_NOHEADER)) { checkprint = 1; dbtype = argtype; } else { - if (rheader(dbp, &dbtype, &subdb, &checkprint, &keys) != 0) + if (rheader(dbenv, + dbp, &dbtype, &subdb, &checkprint, &keys) != 0) goto err; - if (endofile) + if (G(endofile)) goto done; } @@ -223,7 +262,7 @@ load(name, argtype, clist, no_header, db_nooverwrite) * configuration changes to all databases that are loaded, e.g., all * subdatabases.) */ - if (configure(dbp, clist, &subdb, &keyflag)) + if (configure(dbenv, dbp, clist, &subdb, &keyflag)) goto err; if (keys != 1) { @@ -250,8 +289,8 @@ load(name, argtype, clist, no_header, db_nooverwrite) if (argtype != DB_UNKNOWN) { if (dbtype == DB_RECNO || dbtype == DB_QUEUE) - if (keyflag != 1 && argtype != DB_RECNO - && argtype != DB_QUEUE) { + if (keyflag != 1 && argtype != DB_RECNO && + argtype != DB_QUEUE) { dbenv->errx(dbenv, "improper database type conversion specified"); goto err; @@ -267,27 +306,48 @@ load(name, argtype, clist, no_header, db_nooverwrite) if (keyflag == -1) keyflag = 0; - /* + /* * Recno keys have only been printed in hexadecimal starting - * with db_dump format version 3 (DB 3.2). + * with db_dump format version 3 (DB 3.2). * - * !!! - * Note that version is set in rheader(), which must be called before + * !!! + * Note that version is set in rheader(), which must be called before * this assignment. */ - hexkeys = (version >= 3 && keyflag == 1 && checkprint == 0); + hexkeys = (G(version) >= 3 && keyflag == 1 && checkprint == 0); if (keyflag == 1 && (dbtype == DB_RECNO || dbtype == DB_QUEUE)) ascii_recno = 1; else ascii_recno = 0; + /* If configured with a password, encrypt databases we create. */ + if (LF_ISSET(LDF_PASSWORD) && + (ret = dbp->set_flags(dbp, DB_ENCRYPT)) != 0) { + dbp->err(dbp, ret, "DB->set_flags: DB_ENCRYPT"); + goto err; + } + /* Open the DB file. */ - if ((ret = dbp->open(dbp, - name, subdb, dbtype, DB_CREATE, __db_omode("rwrwrw"))) != 0) { + if ((ret = dbp->open(dbp, NULL, name, subdb, dbtype, + DB_CREATE | (TXN_ON(dbenv) ? DB_AUTO_COMMIT : 0), + __db_omode("rwrwrw"))) != 0) { dbp->err(dbp, ret, "DB->open: %s", name); goto err; } + if (ldg->private != 0) { + if ((ret = + __db_util_cache(dbenv, dbp, &ldg->cache, &resize)) != 0) + goto err; + if (resize) { + dbp->close(dbp, 0); + dbp = NULL; + dbenv->close(dbenv, 0); + if ((ret = env_create(&dbenv, ldg)) != 0) + goto err; + goto retry_db; + } + } /* Initialize the key/data pair. */ readp = &key; @@ -314,39 +374,40 @@ key_data: if ((readp->data = goto err; } - if (TXN_ON(dbenv) && (ret = txn_begin(dbenv, NULL, &txn, 0)) != 0) + if (TXN_ON(dbenv) && + (ret = dbenv->txn_begin(dbenv, NULL, &txn, 0)) != 0) goto err; /* Get each key/data pair and add them to the database. */ for (recno = 1; !__db_util_interrupted(); ++recno) { if (!keyflag) if (checkprint) { - if (dbt_rprint(&data)) + if (dbt_rprint(dbenv, &data)) goto err; } else { - if (dbt_rdump(&data)) + if (dbt_rdump(dbenv, &data)) goto err; } else if (checkprint) { - if (dbt_rprint(readp)) + if (dbt_rprint(dbenv, readp)) goto err; - if (!endodata && dbt_rprint(&data)) + if (!G(endodata) && dbt_rprint(dbenv, &data)) goto fmt; } else { if (ascii_recno) { - if (dbt_rrecno(readp, hexkeys)) + if (dbt_rrecno(dbenv, readp, hexkeys)) goto err; } else - if (dbt_rdump(readp)) + if (dbt_rdump(dbenv, readp)) goto err; - if (!endodata && dbt_rdump(&data)) { + if (!G(endodata) && dbt_rdump(dbenv, &data)) { fmt: dbenv->errx(dbenv, "odd number of key/data pairs"); goto err; } } - if (endodata) + if (G(endodata)) break; if (readp != writep) { if (sscanf(readp->data, "%ud", &datarecno) != 1) @@ -359,20 +420,19 @@ fmt: dbenv->errx(dbenv, !keyflag ? recno : recno * 2 - 1); } retry: if (txn != NULL) - if ((ret = txn_begin(dbenv, txn, &ctxn, 0)) != 0) + if ((ret = dbenv->txn_begin(dbenv, txn, &ctxn, 0)) != 0) goto err; - switch (ret = - dbp->put(dbp, txn, writep, &data, db_nooverwrite)) { + switch (ret = dbp->put(dbp, ctxn, writep, &data, put_flags)) { case 0: if (ctxn != NULL) { if ((ret = - txn_commit(ctxn, DB_TXN_NOSYNC)) != 0) + ctxn->commit(ctxn, DB_TXN_NOSYNC)) != 0) goto err; ctxn = NULL; } break; case DB_KEYEXIST: - existed = 1; + *existedp = 1; dbenv->errx(dbenv, "%s: line %d: key already exists, not loaded:", name, @@ -384,7 +444,7 @@ retry: if (txn != NULL) case DB_LOCK_DEADLOCK: /* If we have a child txn, retry--else it's fatal. */ if (ctxn != NULL) { - if ((ret = txn_abort(ctxn)) != 0) + if ((ret = ctxn->abort(ctxn)) != 0) goto err; ctxn = NULL; goto retry; @@ -393,20 +453,20 @@ retry: if (txn != NULL) default: dbenv->err(dbenv, ret, NULL); if (ctxn != NULL) { - (void)txn_abort(ctxn); + (void)ctxn->abort(ctxn); ctxn = NULL; } goto err; } if (ctxn != NULL) { - if ((ret = txn_abort(ctxn)) != 0) + if ((ret = ctxn->abort(ctxn)) != 0) goto err; ctxn = NULL; } } done: rval = 0; DB_ASSERT(ctxn == NULL); - if (txn != NULL && (ret = txn_commit(txn, 0)) != 0) { + if (txn != NULL && (ret = txn->commit(txn, 0)) != 0) { txn = NULL; goto err; } @@ -415,15 +475,18 @@ done: rval = 0; err: rval = 1; DB_ASSERT(ctxn == NULL); if (txn != NULL) - (void)txn_abort(txn); + (void)txn->abort(txn); } /* Close the database. */ - if ((ret = dbp->close(dbp, 0)) != 0) { - dbp->err(dbp, ret, "DB->close"); + if (dbp != NULL && (ret = dbp->close(dbp, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->close"); rval = 1; } + if (G(hdrbuf) != NULL) + free(G(hdrbuf)); + G(hdrbuf) = NULL; /* Free allocated memory. */ if (subdb != NULL) free(subdb); @@ -441,12 +504,16 @@ err: rval = 1; * Initialize the environment. */ int -db_init(home) +db_init(dbenv, home, cache, is_private) + DB_ENV *dbenv; char *home; + u_int32_t cache; + int *is_private; { u_int32_t flags; int ret; + *is_private = 0; /* We may be loading into a live environment. Try and join. */ flags = DB_USE_ENVIRON | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN; @@ -467,11 +534,16 @@ db_init(home) */ LF_CLR(DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN); LF_SET(DB_CREATE | DB_PRIVATE); + *is_private = 1; + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) { + dbenv->err(dbenv, ret, "set_cachesize"); + return (1); + } if ((ret = dbenv->open(dbenv, home, flags, 0)) == 0) return (0); /* An environment is required. */ - dbenv->err(dbenv, ret, "DBENV->open"); + dbenv->err(dbenv, ret, "DB_ENV->open"); return (1); } @@ -481,14 +553,14 @@ db_init(home) case '1': \ if ((ret = dbp->set_flags(dbp, flag)) != 0) { \ dbp->err(dbp, ret, "%s: set_flags: %s", \ - progname, name); \ + G(progname), name); \ return (1); \ } \ break; \ case '0': \ break; \ default: \ - badnum(); \ + badnum(dbenv); \ return (1); \ } \ continue; \ @@ -514,7 +586,8 @@ db_init(home) * Handle command-line configuration options. */ int -configure(dbp, clp, subdbp, keysp) +configure(dbenv, dbp, clp, subdbp, keysp) + DB_ENV *dbenv; DB *dbp; char **clp, **subdbp; int *keysp; @@ -534,6 +607,8 @@ configure(dbp, clp, subdbp, keysp) if (strcmp(name, "database") == 0 || strcmp(name, "subdatabase") == 0) { + if (*subdbp != NULL) + free(*subdbp); if ((*subdbp = strdup(value)) == NULL) { dbp->err(dbp, ENOMEM, NULL); return (1); @@ -546,7 +621,7 @@ configure(dbp, clp, subdbp, keysp) else if (strcmp(value, "0") == 0) *keysp = 0; else { - badnum(); + badnum(dbenv); return (1); } continue; @@ -558,6 +633,7 @@ configure(dbp, clp, subdbp, keysp) NUMBER(name, value, "bt_minkey", set_bt_minkey); NUMBER(name, value, "db_lorder", set_lorder); NUMBER(name, value, "db_pagesize", set_pagesize); + FLAG(name, value, "chksum", DB_CHKSUM_SHA1); FLAG(name, value, "duplicates", DB_DUP); FLAG(name, value, "dupsort", DB_DUPSORT); NUMBER(name, value, "h_ffactor", set_h_ffactor); @@ -568,13 +644,13 @@ configure(dbp, clp, subdbp, keysp) FLAG(name, value, "renumber", DB_RENUMBER); dbp->errx(dbp, - "unknown command-line configuration keyword"); + "unknown command-line configuration keyword \"%s\"", name); return (1); } return (0); nameerr: - dbp->err(dbp, ret, "%s: %s=%s", progname, name, value); + dbp->err(dbp, ret, "%s: %s=%s", G(progname), name, value); return (1); } @@ -583,35 +659,91 @@ nameerr: * Read the header message. */ int -rheader(dbp, dbtypep, subdbp, checkprintp, keysp) +rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp) + DB_ENV *dbenv; DB *dbp; DBTYPE *dbtypep; char **subdbp; int *checkprintp, *keysp; { long val; - int first, ret; - char *name, *value, *p, buf[128]; + int ch, first, hdr, linelen, buflen, ret, start; + char *buf, *name, *p, *value; *dbtypep = DB_UNKNOWN; *checkprintp = 0; + name = p = NULL; - for (first = 1;; first = 0) { - ++lineno; - - /* If we don't see the expected information, it's an error. */ - if (fgets(buf, sizeof(buf), stdin) == NULL) { - if (!first || ferror(stdin)) - goto badfmt; - endofile = 1; - break; + /* + * We start with a smallish buffer; most headers are small. + * We may need to realloc it for a large subdatabase name. + */ + buflen = 4096; + if (G(hdrbuf) == NULL) { + hdr = 0; + if ((buf = (char *)malloc(buflen)) == NULL) { +memerr: dbp->errx(dbp, "could not allocate buffer %d", buflen); + return (1); } - if ((p = strchr(name = buf, '=')) == NULL) + G(hdrbuf) = buf; + G(origline) = G(lineno); + } else { + hdr = 1; + buf = G(hdrbuf); + G(lineno) = G(origline); + } + + start = 0; + for (first = 1;; first = 0) { + ++G(lineno); + + /* Read a line, which may be of arbitrary length, into buf. */ + linelen = 0; + buf = &G(hdrbuf)[start]; + if (hdr == 0) { + for (;;) { + if ((ch = getchar()) == EOF) { + if (!first || ferror(stdin)) + goto badfmt; + G(endofile) = 1; + break; + } + + if (ch == '\n') + break; + + buf[linelen++] = ch; + + /* If the buffer is too small, double it. */ + if (linelen + start == buflen) { + G(hdrbuf) = (char *)realloc(G(hdrbuf), + buflen *= 2); + if (G(hdrbuf) == NULL) + goto memerr; + buf = &G(hdrbuf)[start]; + } + } + if (G(endofile) == 1) + break; + buf[linelen++] = '\0'; + } else + linelen = strlen(buf) + 1; + start += linelen; + + if (name != NULL) { + *p = '='; + free(name); + name = NULL; + } + /* If we don't see the expected information, it's an error. */ + if ((name = strdup(buf)) == NULL) + goto memerr; + if ((p = strchr(name, '=')) == NULL) goto badfmt; *p++ = '\0'; - if ((p = strchr(value = p, '\n')) == NULL) - goto badfmt; - *p = '\0'; + + value = p--; + if (name[0] == '\0' || value[0] == '\0') goto badfmt; @@ -622,13 +754,13 @@ rheader(dbp, dbtypep, subdbp, checkprintp, keysp) * Version 1 didn't have a "VERSION" header line. We * only support versions 1, 2, and 3 of the dump format. */ - version = atoi(value); + G(version) = atoi(value); - if (version > 3) { + if (G(version) > 3) { dbp->errx(dbp, "line %lu: VERSION %d is unsupported", - lineno, version); - return (1); + G(lineno), G(version)); + goto err; } continue; } @@ -660,14 +792,14 @@ rheader(dbp, dbtypep, subdbp, checkprintp, keysp) *dbtypep = DB_QUEUE; continue; } - dbp->errx(dbp, "line %lu: unknown type", lineno); - return (1); + dbp->errx(dbp, "line %lu: unknown type", G(lineno)); + goto err; } if (strcmp(name, "database") == 0 || strcmp(name, "subdatabase") == 0) { - if ((*subdbp = strdup(value)) == NULL) { - dbp->err(dbp, ENOMEM, NULL); - return (1); + if ((ret = convprintable(dbenv, value, subdbp)) != 0) { + dbp->err(dbp, ret, "error reading db name"); + goto err; } continue; } @@ -677,8 +809,8 @@ rheader(dbp, dbtypep, subdbp, checkprintp, keysp) else if (strcmp(value, "0") == 0) *keysp = 0; else { - badnum(); - return (1); + badnum(dbenv); + goto err; } continue; } @@ -689,6 +821,8 @@ rheader(dbp, dbtypep, subdbp, checkprintp, keysp) NUMBER(name, value, "bt_minkey", set_bt_minkey); NUMBER(name, value, "db_lorder", set_lorder); NUMBER(name, value, "db_pagesize", set_pagesize); + NUMBER(name, value, "extentsize", set_q_extentsize); + FLAG(name, value, "chksum", DB_CHKSUM_SHA1); FLAG(name, value, "duplicates", DB_DUP); FLAG(name, value, "dupsort", DB_DUPSORT); NUMBER(name, value, "h_ffactor", set_h_ffactor); @@ -699,18 +833,81 @@ rheader(dbp, dbtypep, subdbp, checkprintp, keysp) FLAG(name, value, "renumber", DB_RENUMBER); dbp->errx(dbp, - "unknown input-file header configuration keyword"); - return (1); + "unknown input-file header configuration keyword \"%s\"", + name); + goto err; } - return (0); - + ret = 0; + if (0) { nameerr: - dbp->err(dbp, ret, "%s: %s=%s", progname, name, value); - return (1); - + dbp->err(dbp, ret, "%s: %s=%s", G(progname), name, value); + ret = 1; + } + if (0) +err: ret = 1; + if (0) { badfmt: - dbp->errx(dbp, "line %lu: unexpected format", lineno); - return (1); + dbp->errx(dbp, "line %lu: unexpected format", G(lineno)); + ret = 1; + } + if (name != NULL) { + *p = '='; + free(name); + } + return (ret); +} + +/* + * convprintable -- + * Convert a printable-encoded string into a newly allocated string. + * + * In an ideal world, this would probably share code with dbt_rprint, but + * that's set up to read character-by-character (to avoid large memory + * allocations that aren't likely to be a problem here), and this has fewer + * special cases to deal with. + * + * Note that despite the printable encoding, the char * interface to this + * function (which is, not coincidentally, also used for database naming) + * means that outstr cannot contain any nuls. + */ +int +convprintable(dbenv, instr, outstrp) + DB_ENV *dbenv; + char *instr, **outstrp; +{ + char c, *outstr; + int e1, e2; + + /* + * Just malloc a string big enough for the whole input string; + * the output string will be smaller (or of equal length). + */ + if ((outstr = (char *)malloc(strlen(instr))) == NULL) + return (ENOMEM); + + *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; + } else + *outstr++ = *instr; + + *outstr = '\0'; + + return (0); } /* @@ -718,7 +915,8 @@ badfmt: * Read a printable line into a DBT structure. */ int -dbt_rprint(dbtp) +dbt_rprint(dbenv, dbtp) + DB_ENV *dbenv; DBT *dbtp; { u_int32_t len; @@ -726,31 +924,31 @@ dbt_rprint(dbtp) int c1, c2, e, escape, first; char buf[32]; - ++lineno; + ++G(lineno); first = 1; e = escape = 0; for (p = dbtp->data, len = 0; (c1 = getchar()) != '\n';) { if (c1 == EOF) { if (len == 0) { - endofile = endodata = 1; + G(endofile) = G(endodata) = 1; return (0); } - badend(); + badend(dbenv); return (1); } if (first) { first = 0; - if (version > 1) { + if (G(version) > 1) { if (c1 != ' ') { buf[0] = c1; if (fgets(buf + 1, sizeof(buf) - 1, stdin) == NULL || strcmp(buf, "DATA=END\n") != 0) { - badend(); + badend(dbenv); return (1); } - endodata = 1; + G(endodata) = 1; return (0); } continue; @@ -759,10 +957,11 @@ dbt_rprint(dbtp) if (escape) { if (c1 != '\\') { if ((c2 = getchar()) == EOF) { - badend(); + badend(dbenv); return (1); } - c1 = digitize(c1, &e) << 4 | digitize(c2, &e); + c1 = digitize(dbenv, + c1, &e) << 4 | digitize(dbenv, c2, &e); if (e) return (1); } @@ -794,7 +993,8 @@ dbt_rprint(dbtp) * Read a byte dump line into a DBT structure. */ int -dbt_rdump(dbtp) +dbt_rdump(dbenv, dbtp) + DB_ENV *dbenv; DBT *dbtp; { u_int32_t len; @@ -802,38 +1002,38 @@ dbt_rdump(dbtp) int c1, c2, e, first; char buf[32]; - ++lineno; + ++G(lineno); first = 1; e = 0; for (p = dbtp->data, len = 0; (c1 = getchar()) != '\n';) { if (c1 == EOF) { if (len == 0) { - endofile = endodata = 1; + G(endofile) = G(endodata) = 1; return (0); } - badend(); + badend(dbenv); return (1); } if (first) { first = 0; - if (version > 1) { + if (G(version) > 1) { if (c1 != ' ') { buf[0] = c1; if (fgets(buf + 1, sizeof(buf) - 1, stdin) == NULL || strcmp(buf, "DATA=END\n") != 0) { - badend(); + badend(dbenv); return (1); } - endodata = 1; + G(endodata) = 1; return (0); } continue; } } if ((c2 = getchar()) == EOF) { - badend(); + badend(dbenv); return (1); } if (len >= dbtp->ulen - 10) { @@ -846,7 +1046,7 @@ dbt_rdump(dbtp) p = (u_int8_t *)dbtp->data + len; } ++len; - *p++ = digitize(c1, &e) << 4 | digitize(c2, &e); + *p++ = digitize(dbenv, c1, &e) << 4 | digitize(dbenv, c2, &e); if (e) return (1); } @@ -860,21 +1060,22 @@ dbt_rdump(dbtp) * Read a record number dump line into a DBT structure. */ int -dbt_rrecno(dbtp, ishex) +dbt_rrecno(dbenv, dbtp, ishex) + DB_ENV *dbenv; DBT *dbtp; int ishex; { char buf[32], *p, *q; - ++lineno; + ++G(lineno); if (fgets(buf, sizeof(buf), stdin) == NULL) { - endofile = endodata = 1; + G(endofile) = G(endodata) = 1; return (0); } if (strcmp(buf, "DATA=END\n") == 0) { - endodata = 1; + G(endodata) = 1; return (0); } @@ -904,8 +1105,8 @@ dbt_rrecno(dbtp, ishex) } if (__db_getulong(NULL, - progname, buf + 1, 0, 0, (u_long *)dbtp->data)) { -bad: badend(); + G(progname), buf + 1, 0, 0, (u_long *)dbtp->data)) { +bad: badend(dbenv); return (1); } @@ -918,7 +1119,8 @@ bad: badend(); * Convert a character to an integer. */ int -digitize(c, errorp) +digitize(dbenv, c, errorp) + DB_ENV *dbenv; int c, *errorp; { switch (c) { /* Don't depend on ASCII ordering. */ @@ -951,7 +1153,8 @@ digitize(c, errorp) * Display the bad number message. */ void -badnum() +badnum(dbenv) + DB_ENV *dbenv; { dbenv->errx(dbenv, "boolean name=value pairs require a value of 0 or 1"); @@ -962,7 +1165,8 @@ badnum() * Display the bad end to input message. */ void -badend() +badend(dbenv) + DB_ENV *dbenv; { dbenv->errx(dbenv, "unexpected end of input data or key/data pair"); } @@ -971,17 +1175,18 @@ badend() * usage -- * Display the usage message. */ -void +int usage() { (void)fprintf(stderr, "%s\n\t%s\n", - "usage: db_load [-nTV]", - "[-c name=value] [-f file] [-h home] [-t btree | hash | recno] db_file"); - exit(1); + "usage: db_load [-nTV] [-c name=value] [-f file]", + "[-h home] [-P password] [-t btree | hash | recno | queue] db_file"); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -993,6 +1198,35 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); +} + +int +env_create(dbenvp, ldg) + DB_ENV **dbenvp; + LDG *ldg; +{ + DB_ENV *dbenv; + int ret; + + if ((ret = db_env_create(dbenvp, 0)) != 0) { + fprintf(stderr, + "%s: db_env_create: %s\n", ldg->progname, db_strerror(ret)); + return (ret); + } + dbenv = *dbenvp; + dbenv->set_errfile(dbenv, stderr); + dbenv->set_errpfx(dbenv, ldg->progname); + if (ldg->passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + ldg->passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + return (ret); + } + if ((ret = db_init(dbenv, ldg->home, ldg->cache, &ldg->private)) != 0) + return (ret); + dbenv->app_private = ldg; + + return (0); } diff --git a/bdb/db_printlog/README b/bdb/db_printlog/README index 7d8da505e49..d59f4c77f55 100644 --- a/bdb/db_printlog/README +++ b/bdb/db_printlog/README @@ -1,4 +1,4 @@ -# $Id: README,v 10.5 1999/11/21 23:08:01 bostic Exp $ +# $Id: README,v 10.6 2002/06/20 14:52:54 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 @@ -10,14 +10,23 @@ commit.awk Output transaction ID of committed transactions. count.awk Print out the number of log records for transactions that we encountered. +dbname.awk Take a comma-separated list of database names and spit + out all the log records that affect those databases. + fileid.awk Take a comma-separated list of file numbers and spit out all the log records that affect those file numbers. +logstat.awk Display log record count/size statistics. + pgno.awk Take a comma-separated list of page numbers and spit out all the log records that affect those page numbers. range.awk Print out a range of the log. +rectype.awk Print out a range of the log -- command line should + set RECTYPE to the a comma separated list of the + rectypes (or partial strings of rectypes) sought. + status.awk Read through db_printlog output and list the transactions encountered, and whether they commited or aborted. diff --git a/bdb/db_printlog/db_printlog.c b/bdb/db_printlog/db_printlog.c index 8b9fb74a6a9..af6d00d593a 100644 --- a/bdb/db_printlog/db_printlog.c +++ b/bdb/db_printlog/db_printlog.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,14 +9,15 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_printlog.c,v 11.23 2001/01/18 18:36:58 bostic Exp $"; + "$Id: db_printlog.c,v 11.52 2002/08/08 03:50:38 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES #include +#include #include #include #include @@ -24,21 +25,20 @@ static const char revid[] = #endif #include "db_int.h" -#include "db_page.h" -#include "btree.h" -#include "db_am.h" -#include "hash.h" -#include "log.h" -#include "qam.h" -#include "txn.h" +#include "dbinc/db_page.h" +#include "dbinc/btree.h" +#include "dbinc/fop.h" +#include "dbinc/hash.h" +#include "dbinc/log.h" +#include "dbinc/qam.h" +#include "dbinc/rep.h" +#include "dbinc/txn.h" -int main __P((int, char *[])); -void usage __P((void)); -void version_check __P((void)); - -DB_ENV *dbenv; -const char - *progname = "db_printlog"; /* Program name. */ +int main __P((int, char *[])); +int usage __P((void)); +int version_check __P((const char *)); +int print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops)); +int open_rep_db __P((DB_ENV *, DB **, DBC **)); int main(argc, argv) @@ -47,42 +47,63 @@ main(argc, argv) { extern char *optarg; extern int optind; - DBT data; + const char *progname = "db_printlog"; + DB *dbp; + DBC *dbc; + DB_ENV *dbenv; + DB_LOGC *logc; + int (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + size_t dtabsize; + DBT data, keydbt; DB_LSN key; - int ch, e_close, exitval, nflag, ret; - char *home; + int ch, e_close, exitval, nflag, rflag, ret, repflag; + char *home, *passwd; - version_check(); + if ((ret = version_check(progname)) != 0) + return (ret); - e_close = exitval = 0; - nflag = 0; - home = NULL; - while ((ch = getopt(argc, argv, "h:NV")) != EOF) + dbp = NULL; + dbc = NULL; + logc = NULL; + e_close = exitval = nflag = rflag = repflag = 0; + home = passwd = NULL; + dtabsize = 0; + dtab = NULL; + while ((ch = getopt(argc, argv, "h:NP:rRV")) != EOF) switch (ch) { case 'h': home = optarg; break; case 'N': nflag = 1; - if ((ret = db_env_set_panicstate(0)) != 0) { - fprintf(stderr, - "%s: db_env_set_panicstate: %s\n", - progname, db_strerror(ret)); - return (1); + 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 'r': + rflag = 1; + break; + case 'R': + repflag = 1; + break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); case '?': default: - usage(); + return (usage()); } argc -= optind; argv += optind; if (argc > 0) - usage(); + return (usage()); /* Handle possible interruptions. */ __db_util_siginit(); @@ -101,8 +122,29 @@ main(argc, argv) dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); - if (nflag && (ret = dbenv->set_mutexlocks(dbenv, 0)) != 0) { - dbenv->err(dbenv, ret, "set_mutexlocks"); + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto shutdown; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto shutdown; + } + } + + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); + goto shutdown; + } + + /* + * Set up an app-specific dispatch function so that we can gracefully + * handle app-specific log records. + */ + if ((ret = dbenv->set_app_dispatch(dbenv, print_app_record)) != 0) { + dbenv->err(dbenv, ret, "app_dispatch"); goto shutdown; } @@ -110,8 +152,19 @@ main(argc, argv) * An environment is required, but as all we're doing is reading log * files, we create one if it doesn't already exist. If we create * it, create it private so it automatically goes away when we're done. + * If we are reading the replication database, do not open the env + * with logging, because we don't want to log the opens. */ - if ((ret = dbenv->open(dbenv, home, + if (repflag) { + if ((ret = dbenv->open(dbenv, home, + DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0 && + (ret = dbenv->open(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) + != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } + } else if ((ret = dbenv->open(dbenv, home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 && (ret = dbenv->open(dbenv, home, DB_CREATE | DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { @@ -120,33 +173,48 @@ main(argc, argv) } /* Initialize print callbacks. */ - if ((ret = __bam_init_print(dbenv)) != 0 || - (ret = __crdel_init_print(dbenv)) != 0 || - (ret = __db_init_print(dbenv)) != 0 || - (ret = __qam_init_print(dbenv)) != 0 || - (ret = __ham_init_print(dbenv)) != 0 || - (ret = __log_init_print(dbenv)) != 0 || - (ret = __txn_init_print(dbenv)) != 0) { + if ((ret = __bam_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __dbreg_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __crdel_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __db_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __fop_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __qam_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (ret = __ham_init_print(dbenv, &dtab, &dtabsize)) != 0 || + (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) + goto shutdown; + } else if ((ret = dbenv->log_cursor(dbenv, &logc, 0)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->log_cursor"); + goto shutdown; + } + memset(&data, 0, sizeof(data)); + memset(&keydbt, 0, sizeof(keydbt)); while (!__db_util_interrupted()) { - if ((ret = log_get(dbenv, &key, &data, DB_NEXT)) != 0) { + if (repflag) { + ret = dbc->c_get(dbc, + &keydbt, &data, rflag ? DB_PREV : DB_NEXT); + if (ret == 0) + key = ((REP_CONTROL *)keydbt.data)->lsn; + } else + ret = logc->get(logc, + &key, &data, rflag ? DB_PREV : DB_NEXT); + if (ret != 0) { if (ret == DB_NOTFOUND) break; - dbenv->err(dbenv, ret, "log_get"); + dbenv->err(dbenv, + ret, repflag ? "DB_LOGC->get" : "DBC->get"); goto shutdown; } - /* - * XXX - * We use DB_TXN_ABORT as our op because that's the only op - * that calls the underlying recovery function without any - * consideration as to the contents of the transaction list. - */ - ret = __db_dispatch(dbenv, &data, &key, DB_TXN_ABORT, NULL); + ret = __db_dispatch(dbenv, + dtab, dtabsize, &data, &key, DB_TXN_PRINT, NULL); /* * XXX @@ -163,6 +231,22 @@ main(argc, argv) if (0) { shutdown: exitval = 1; } + if (logc != NULL && (ret = logc->close(logc, 0)) != 0) + exitval = 1; + + if (dbc != NULL && (ret = dbc->c_close(dbc)) != 0) + exitval = 1; + + if (dbp != NULL && (ret = dbp->close(dbp, 0)) != 0) + exitval = 1; + + /* + * The dtab is allocated by __db_add_recovery (called by *_init_print) + * using the library malloc function (__os_malloc). It thus needs to be + * freed using the corresponding free (__os_free). + */ + if (dtab != NULL) + __os_free(dbenv, dtab); if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { exitval = 1; fprintf(stderr, @@ -172,18 +256,20 @@ shutdown: exitval = 1; /* Resend any caught signal. */ __db_util_sigresend(); - return (exitval); + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } -void +int usage() { - fprintf(stderr, "usage: db_printlog [-NV] [-h home]\n"); - exit (1); + fprintf(stderr, "%s\n", + "usage: db_printlog [-NrV] [-h home] [-P password]"); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -195,6 +281,80 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); +} + +/* Print an unknown, application-specific log record as best we can. */ +int +print_app_record(dbenv, dbt, lsnp, op) + DB_ENV *dbenv; + DBT *dbt; + DB_LSN *lsnp; + db_recops op; +{ + int ch; + u_int32_t i, rectype; + + DB_ASSERT(op == DB_TXN_PRINT); + COMPQUIET(dbenv, NULL); + + /* + * Fetch the rectype, which always must be at the beginning of the + * record (if dispatching is to work at all). + */ + memcpy(&rectype, dbt->data, sizeof(rectype)); + + /* + * Applications may wish to customize the output here based on the + * rectype. We just print the entire log record in the generic + * mixed-hex-and-printable format we use for binary data. + */ + printf("[%lu][%lu]application specific record: rec: %lu\n", + (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)rectype); + printf("\tdata: "); + for (i = 0; i < dbt->size; i++) { + ch = ((u_int8_t *)dbt->data)[i]; + printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch); + } + printf("\n\n"); + + return (0); +} + +int +open_rep_db(dbenv, dbpp, dbcp) + DB_ENV *dbenv; + DB **dbpp; + DBC **dbcp; +{ + int ret; + + DB *dbp; + *dbpp = NULL; + *dbcp = NULL; + + if ((ret = db_create(dbpp, dbenv, 0)) != 0) { + dbenv->err(dbenv, ret, "db_create"); + return (ret); + } + + dbp = *dbpp; + if ((ret = + dbp->open(dbp, NULL, "__db.rep.db", NULL, DB_BTREE, 0, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->open"); + goto err; + } + + if ((ret = dbp->cursor(dbp, NULL, dbcp, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->cursor"); + goto err; + } + + return (0); + +err: if (*dbpp != NULL) + (void)(*dbpp)->close(*dbpp, 0); + return (ret); } diff --git a/bdb/db_printlog/dbname.awk b/bdb/db_printlog/dbname.awk index d070335127c..47955994579 100644 --- a/bdb/db_printlog/dbname.awk +++ b/bdb/db_printlog/dbname.awk @@ -1,4 +1,4 @@ -# $Id: dbname.awk,v 1.2 2000/08/03 15:06:39 ubell Exp $ +# $Id: dbname.awk,v 1.5 2002/05/07 05:45:51 ubell Exp $ # # Take a comma-separated list of database names and spit out all the # log records that affect those databases. @@ -16,7 +16,7 @@ NR == 1 { myfile = -1; } -/^\[.*log_register/ { +/^\[.*dbreg_register/ { register = 1; } /opcode:/ { @@ -58,8 +58,6 @@ NR == 1 { } } - - /^\[/{ if (printme == 1) { printf("%s\n", rec); @@ -69,6 +67,8 @@ NR == 1 { rec = $0 } + +TXN == 1 && /txn_regop/ {printme = 1} /^ /{ rec = sprintf("%s\n%s", rec, $0); } diff --git a/bdb/db_printlog/logstat.awk b/bdb/db_printlog/logstat.awk new file mode 100644 index 00000000000..1009343eba4 --- /dev/null +++ b/bdb/db_printlog/logstat.awk @@ -0,0 +1,36 @@ +# $Id: logstat.awk,v 1.1 2002/05/10 15:19:13 bostic Exp $ +# +# Output accumulated log record count/size statistics. +BEGIN { + l_file = 0; + l_offset = 0; +} + +/^\[/{ + gsub("[][: ]", " ", $1) + split($1, a) + + if (a[1] == l_file) { + l[a[3]] += a[2] - l_offset + ++n[a[3]] + } else + ++s[a[3]] + + l_file = a[1] + l_offset = a[2] +} + +END { + # We can't figure out the size of the first record in each log file, + # use the average for other records we found as an estimate. + for (i in s) + if (s[i] != 0 && n[i] != 0) { + l[i] += s[i] * (l[i]/n[i]) + n[i] += s[i] + delete s[i] + } + for (i in l) + printf "%s: %d (n: %d, avg: %.2f)\n", i, l[i], n[i], l[i]/n[i] + for (i in s) + printf "%s: unknown (n: %d, unknown)\n", i, s[i] +} diff --git a/bdb/db_printlog/status.awk b/bdb/db_printlog/status.awk index 42e24b078b9..13df0b6194a 100644 --- a/bdb/db_printlog/status.awk +++ b/bdb/db_printlog/status.awk @@ -1,14 +1,17 @@ -# $Id: status.awk,v 10.2 1999/11/21 18:01:43 bostic Exp $ +# $Id: status.awk,v 10.3 2002/04/11 01:35:24 margo Exp $ # # Read through db_printlog output and list all the transactions encountered # and whether they commited or aborted. # # 1 = started # 2 = commited +# 3 = explicitly aborted +# 4 = other BEGIN { cur_txn = 0 } /^\[/{ + in_regop = 0 if (status[$5] == 0) { status[$5] = 1; txns[cur_txn] = $5; @@ -16,11 +19,28 @@ BEGIN { } } /txn_regop/ { - status[$5] = 2 + txnid = $5 + in_regop = 1 +} +/opcode:/ { + if (in_regop == 1) { + if ($2 == 1) + status[txnid] = 2 + else if ($2 == 3) + status[txnid] = 3 + else + status[txnid] = 4 + } } END { for (i = 0; i < cur_txn; i++) { - printf("%s\t%s\n", - txns[i], status[txns[i]] == 1 ? "ABORT" : "COMMIT"); + if (status[txns[i]] == 1) + printf("%s\tABORT\n", txns[i]); + if (status[txns[i]] == 2) + printf("%s\tCOMMIT\n", txns[i]); + if (status[txns[i]] == 3) + printf("%s\tABORT\n", txns[i]); + if (status[txns[i]] == 4) + printf("%s\tOTHER\n", txns[i]); } } diff --git a/bdb/db_recover/db_recover.c b/bdb/db_recover/db_recover.c index 59ab8bcef15..b6414267f93 100644 --- a/bdb/db_recover/db_recover.c +++ b/bdb/db_recover/db_recover.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,9 +9,9 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_recover.c,v 11.17 2001/01/18 18:36:58 bostic Exp $"; + "$Id: db_recover.c,v 11.33 2002/03/28 20:13:42 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES @@ -34,17 +34,12 @@ static const char revid[] = #endif #include "db_int.h" -#include "common_ext.h" -#include "txn.h" +#include "dbinc/txn.h" -int main __P((int, char *[])); -void read_timestamp __P((char *, time_t *)); -void usage __P((void)); -void version_check __P((void)); - -DB_ENV *dbenv; -const char - *progname = "db_recover"; /* Program name. */ +int main __P((int, char *[])); +int read_timestamp __P((const char *, char *, time_t *)); +int usage __P((void)); +int version_check __P((const char *)); int main(argc, argv) @@ -53,43 +48,60 @@ main(argc, argv) { extern char *optarg; extern int optind; + const char *progname = "db_recover"; + DB_ENV *dbenv; DB_TXNREGION *region; time_t now, timestamp; u_int32_t flags; - int ch, exitval, fatal_recover, ret, verbose; - char *home; + int ch, exitval, fatal_recover, ret, retain_env, verbose; + char *home, *passwd; - version_check(); + if ((ret = version_check(progname)) != 0) + return (ret); - home = NULL; + home = passwd = NULL; timestamp = 0; - exitval = fatal_recover = verbose = 0; - while ((ch = getopt(argc, argv, "ch:t:Vv")) != EOF) + exitval = fatal_recover = retain_env = verbose = 0; + while ((ch = getopt(argc, argv, "ceh:P:t:Vv")) != EOF) switch (ch) { case 'c': fatal_recover = 1; break; + case 'e': + retain_env = 1; + break; case 'h': home = 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': - read_timestamp(optarg, ×tamp); + if ((ret = + read_timestamp(progname, optarg, ×tamp)) != 0) + return (ret); break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); case 'v': verbose = 1; break; case '?': default: - usage(); + return (usage()); } argc -= optind; argv += optind; if (argc != 0) - usage(); + return (usage()); /* Handle possible interruptions. */ __db_util_siginit(); @@ -101,7 +113,7 @@ main(argc, argv) if ((ret = db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "%s: db_env_create: %s\n", progname, db_strerror(ret)); - exit (1); + return (EXIT_FAILURE); } dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); @@ -111,7 +123,13 @@ main(argc, argv) } if (timestamp && (ret = dbenv->set_tx_timestamp(dbenv, ×tamp)) != 0) { - dbenv->err(dbenv, ret, "DBENV->set_timestamp"); + dbenv->err(dbenv, ret, "DB_ENV->set_timestamp"); + goto shutdown; + } + + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); goto shutdown; } @@ -119,18 +137,21 @@ main(argc, argv) * Initialize the environment -- we don't actually do anything * else, that all that's needed to run recovery. * - * Note that we specify a private environment, as we're about to - * create a region, and we don't want to to leave it around. If - * we leave the region around, the application that should create - * it will simply join it instead, and will then be running with - * incorrectly sized (and probably terribly small) caches. + * Note that unless the caller specified the -e option, we use a + * private environment, as we're about to create a region, and we + * don't want to to leave it around. If we leave the region around, + * the application that should create it will simply join it instead, + * and will then be running with incorrectly sized (and probably + * terribly small) caches. Applications that use -e should almost + * certainly use DB_CONFIG files in the directory. */ flags = 0; LF_SET(DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | - DB_INIT_MPOOL | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON); + 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); if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0) { - dbenv->err(dbenv, ret, "DBENV->open"); + dbenv->err(dbenv, ret, "DB_ENV->open"); goto shutdown; } @@ -158,7 +179,7 @@ shutdown: exitval = 1; /* Resend any caught signal. */ __db_util_sigresend(); - return (exitval); + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } #define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; @@ -194,8 +215,9 @@ shutdown: exitval = 1; * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -void -read_timestamp(arg, timep) +int +read_timestamp(progname, arg, timep) + const char *progname; char *arg; time_t *timep; { @@ -208,7 +230,7 @@ read_timestamp(arg, timep) if ((t = localtime(&now)) == NULL) { fprintf(stderr, "%s: localtime: %s\n", progname, strerror(errno)); - exit (1); + return (EXIT_FAILURE); } /* [[CC]YY]MMDDhhmm[.SS] */ if ((p = strchr(arg, '.')) == NULL) @@ -226,7 +248,7 @@ read_timestamp(arg, timep) t->tm_year = ATOI2(arg); t->tm_year *= 100; yearset = 1; - /* FALLTHOUGH */ + /* FALLTHROUGH */ case 10: /* YYMMDDhhmm */ if (yearset) { yearset = ATOI2(arg); @@ -258,20 +280,22 @@ read_timestamp(arg, timep) terr: fprintf(stderr, "%s: out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]", progname); - exit (1); + return (EXIT_FAILURE); } + return (0); } -void +int usage() { - (void)fprintf(stderr, - "usage: db_recover [-cVv] [-h home] [-t [[CC]YY]MMDDhhmm[.SS]]\n"); - exit(1); + (void)fprintf(stderr, "%s\n", +"usage: db_recover [-ceVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]"); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -283,6 +307,7 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); } diff --git a/bdb/db_stat/db_stat.c b/bdb/db_stat/db_stat.c index 9d80caa4889..a2b01b71e0a 100644 --- a/bdb/db_stat/db_stat.c +++ b/bdb/db_stat/db_stat.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,9 +9,9 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_stat.c,v 11.42 2001/01/18 18:36:59 bostic Exp $"; + "$Id: db_stat.c,v 11.125 2002/08/08 15:26:15 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES @@ -35,41 +35,33 @@ static const char revid[] = #endif #include "db_int.h" -#include "db_page.h" -#include "db_shash.h" -#include "lock.h" -#include "mp.h" +#include "dbinc/db_page.h" #define PCT(f, t, pgsize) \ ((t) == 0 ? 0 : \ (((double)(((t) * (pgsize)) - (f)) / ((t) * (pgsize))) * 100)) -typedef enum { T_NOTSET, T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_TXN } test_t; +typedef enum { T_NOTSET, + T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_REP, T_TXN } test_t; int argcheck __P((char *, const char *)); -int btree_stats __P((DB_ENV *, DB *, DB_BTREE_STAT *)); -int db_init __P((char *, test_t)); +int btree_stats __P((DB_ENV *, DB *, DB_BTREE_STAT *, int)); +int db_init __P((DB_ENV *, char *, test_t, u_int32_t, int *)); void dl __P((const char *, u_long)); void dl_bytes __P((const char *, u_long, u_long, u_long)); -int env_stats __P((DB_ENV *)); -int hash_stats __P((DB_ENV *, DB *)); -int lock_ok __P((char *)); -int lock_stats __P((DB_ENV *)); -int log_stats __P((DB_ENV *)); +int env_stats __P((DB_ENV *, u_int32_t)); +int hash_stats __P((DB_ENV *, DB *, int)); +int lock_stats __P((DB_ENV *, char *, u_int32_t)); +int log_stats __P((DB_ENV *, u_int32_t)); int main __P((int, char *[])); -int mpool_ok __P((char *)); -int mpool_stats __P((DB_ENV *)); +int mpool_stats __P((DB_ENV *, char *, u_int32_t)); void prflags __P((u_int32_t, const FN *)); -int queue_stats __P((DB_ENV *, DB *)); +int queue_stats __P((DB_ENV *, DB *, int)); +int rep_stats __P((DB_ENV *, u_int32_t)); int txn_compare __P((const void *, const void *)); -int txn_stats __P((DB_ENV *)); -void usage __P((void)); -void version_check __P((void)); - -DB_ENV *dbenv; -char *internal; -const char - *progname = "db_stat"; /* Program name. */ +int txn_stats __P((DB_ENV *, u_int32_t)); +int usage __P((void)); +int version_check __P((const char *)); int main(argc, argv) @@ -78,72 +70,114 @@ 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; test_t ttype; - int ch, checked, d_close, e_close, exitval, nflag, ret; - char *db, *home, *subdb; + u_int32_t cache; + int ch, checked, d_close, e_close, exitval, fast, flags; + int nflag, private, resize, ret; + char *db, *home, *internal, *passwd, *subdb; - version_check(); + if ((ret = version_check(progname)) != 0) + return (ret); dbp = NULL; ttype = T_NOTSET; - nflag = 0; - d_close = e_close = exitval = 0; - db = home = subdb = NULL; - while ((ch = getopt(argc, argv, "C:cd:eh:lM:mNs:tV")) != EOF) + cache = MEGABYTE; + d_close = e_close = exitval = fast = flags = nflag = private = 0; + db = home = internal = passwd = subdb = NULL; + + while ((ch = getopt(argc, argv, "C:cd:efh:lM:mNP:rs:tVZ")) != EOF) switch (ch) { case 'C': + if (ttype != T_NOTSET) + goto argcombo; ttype = T_LOCK; - if (!argcheck(internal = optarg, "Acflmo")) - usage(); + if (!argcheck(internal = optarg, "Aclmop")) + return (usage()); break; case 'c': + if (ttype != T_NOTSET) + goto argcombo; ttype = T_LOCK; break; case 'd': - db = optarg; + if (ttype != T_DB && ttype != T_NOTSET) + goto argcombo; ttype = T_DB; + db = optarg; break; case 'e': + if (ttype != T_NOTSET) + goto argcombo; ttype = T_ENV; break; + case 'f': + fast = DB_FAST_STAT; + break; case 'h': home = optarg; break; case 'l': + if (ttype != T_NOTSET) + goto argcombo; ttype = T_LOG; break; case 'M': + if (ttype != T_NOTSET) + goto argcombo; ttype = T_MPOOL; - if (!argcheck(internal = optarg, "Ahlm")) - usage(); + if (!argcheck(internal = optarg, "Ahm")) + return (usage()); break; case 'm': + if (ttype != T_NOTSET) + goto argcombo; ttype = T_MPOOL; break; case 'N': nflag = 1; - if ((ret = db_env_set_panicstate(0)) != 0) { - fprintf(stderr, - "%s: db_env_set_panicstate: %s\n", - progname, db_strerror(ret)); - return (1); + 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 'r': + if (ttype != T_NOTSET) + goto argcombo; + ttype = T_REP; + break; case 's': - subdb = optarg; + if (ttype != T_DB && ttype != T_NOTSET) + goto argcombo; ttype = T_DB; + subdb = optarg; break; case 't': + if (ttype != T_NOTSET) { +argcombo: fprintf(stderr, + "%s: illegal option combination\n", + progname); + return (EXIT_FAILURE); + } ttype = T_TXN; break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); + case 'Z': + flags |= DB_STAT_CLEAR; + break; case '?': default: - usage(); + return (usage()); } argc -= optind; argv += optind; @@ -151,12 +185,14 @@ main(argc, argv) switch (ttype) { case T_DB: if (db == NULL) - usage(); + return (usage()); break; case T_NOTSET: - usage(); + return (usage()); /* NOTREACHED */ default: + if (fast != 0) + return (usage()); break; } @@ -167,7 +203,7 @@ main(argc, argv) * Create an environment object and initialize it for error * reporting. */ - if ((ret = db_env_create(&dbenv, 0)) != 0) { +retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "%s: db_env_create: %s\n", progname, db_strerror(ret)); goto shutdown; @@ -177,29 +213,59 @@ main(argc, argv) dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); - if (nflag && (ret = dbenv->set_mutexlocks(dbenv, 0)) != 0) { - dbenv->err(dbenv, ret, "set_mutexlocks"); + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto shutdown; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto shutdown; + } + } + + if (passwd != NULL && + (ret = dbenv->set_encrypt(dbenv, passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); goto shutdown; } /* Initialize the environment. */ - if (db_init(home, ttype) != 0) + if (db_init(dbenv, home, ttype, cache, &private) != 0) goto shutdown; switch (ttype) { case T_DB: /* Create the DB object and open the file. */ + if (flags != 0) + return (usage()); if ((ret = db_create(&dbp, dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "db_create"); goto shutdown; } + d_close = 1; - if ((ret = - dbp->open(dbp, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { - dbp->err(dbp, ret, "open: %s", db); + if ((ret = dbp->open(dbp, + NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbp->err(dbp, ret, "DB->open: %s", db); goto shutdown; } + /* Check if cache is too small for this DB's pagesize. */ + if (private) { + if ((ret = + __db_util_cache(dbenv, dbp, &cache, &resize)) != 0) + goto shutdown; + if (resize) { + (void)dbp->close(dbp, 0); + d_close = 0; + + (void)dbenv->close(dbenv, 0); + e_close = 0; + goto retry; + } + } + /* * See if we can open this db read/write to update counts. * If its a master-db then we cannot. So check to see, @@ -207,9 +273,9 @@ main(argc, argv) */ checked = 0; if (subdb == NULL && dbp->type == DB_BTREE) { - if ((ret = dbp->stat(dbp, &sp, NULL, 0)) != 0) { - dbp->err(dbp, ret, "dbp->stat"); - return (1); + if ((ret = dbp->stat(dbp, &sp, DB_FAST_STAT)) != 0) { + dbp->err(dbp, ret, "DB->stat"); + goto shutdown; } checked = 1; } @@ -221,58 +287,68 @@ main(argc, argv) dbenv->err(dbenv, ret, "db_create"); goto shutdown; } - if ((ret = dbp->open(alt_dbp, - db, subdb, DB_UNKNOWN, 0, 0)) == 0) { - (void)dbp->close(dbp, 0); - dbp = alt_dbp; + if ((ret = dbp->open(alt_dbp, NULL, + db, subdb, DB_UNKNOWN, 0, 0)) != 0) { + dbenv->err(dbenv, + ret, "DB->open: %s:%s", db, subdb); + (void)alt_dbp->close(alt_dbp, 0); + goto shutdown; } + + (void)dbp->close(dbp, 0); + dbp = alt_dbp; + /* Need to run again to update counts */ checked = 0; } - d_close = 1; switch (dbp->type) { case DB_BTREE: case DB_RECNO: - if (btree_stats(dbenv, dbp, checked == 1 ? sp : NULL)) + if (btree_stats( + dbenv, dbp, checked == 1 ? sp : NULL, fast)) goto shutdown; break; case DB_HASH: - if (hash_stats(dbenv, dbp)) + if (hash_stats(dbenv, dbp, fast)) goto shutdown; break; case DB_QUEUE: - if (queue_stats(dbenv, dbp)) + if (queue_stats(dbenv, dbp, fast)) goto shutdown; break; case DB_UNKNOWN: - abort(); /* Impossible. */ - /* NOTREACHED */ + dbenv->errx(dbenv, "Unknown database type."); + goto shutdown; } break; case T_ENV: - if (env_stats(dbenv)) - exitval = 1; + if (env_stats(dbenv, flags)) + goto shutdown; break; case T_LOCK: - if (lock_stats(dbenv)) - exitval = 1; + if (lock_stats(dbenv, internal, flags)) + goto shutdown; break; case T_LOG: - if (log_stats(dbenv)) - exitval = 1; + if (log_stats(dbenv, flags)) + goto shutdown; break; case T_MPOOL: - if (mpool_stats(dbenv)) - exitval = 1; + if (mpool_stats(dbenv, internal, flags)) + goto shutdown; + break; + case T_REP: + if (rep_stats(dbenv, flags)) + goto shutdown; break; case T_TXN: - if (txn_stats(dbenv)) - exitval = 1; + if (txn_stats(dbenv, flags)) + goto shutdown; break; case T_NOTSET: - abort(); /* Impossible. */ - /* NOTREACHED */ + dbenv->errx(dbenv, "Unknown statistics flag."); + goto shutdown; } if (0) { @@ -280,7 +356,7 @@ shutdown: exitval = 1; } if (d_close && (ret = dbp->close(dbp, 0)) != 0) { exitval = 1; - dbp->err(dbp, ret, "close"); + dbenv->err(dbenv, ret, "close"); } if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { exitval = 1; @@ -291,7 +367,7 @@ shutdown: exitval = 1; /* Resend any caught signal. */ __db_util_sigresend(); - return (exitval); + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } /* @@ -299,8 +375,9 @@ shutdown: exitval = 1; * Display environment statistics. */ int -env_stats(dbenvp) - DB_ENV *dbenvp; +env_stats(dbenv, flags) + DB_ENV *dbenv; + u_int32_t flags; { REGENV renv; REGION *rp, regs[1024]; @@ -308,15 +385,15 @@ env_stats(dbenvp) const char *lable; n = sizeof(regs) / sizeof(regs[0]); - if ((ret = __db_e_stat(dbenvp, &renv, regs, &n)) != 0) { - dbenvp->err(dbenvp, ret, "__db_e_stat"); + if ((ret = __db_e_stat(dbenv, &renv, regs, &n, flags)) != 0) { + dbenv->err(dbenv, ret, "__db_e_stat"); return (1); } printf("%d.%d.%d\tEnvironment version.\n", renv.majver, renv.minver, renv.patch); printf("%lx\tMagic number.\n", (u_long)renv.magic); - printf("%d\tPanic value.\n", renv.panic); + printf("%d\tPanic value.\n", renv.envpanic); /* Adjust the reference count for us... */ printf("%d\tReferences.\n", renv.refcnt - 1); @@ -370,10 +447,11 @@ env_stats(dbenvp) * Display btree/recno statistics. */ int -btree_stats(dbenvp, dbp, msp) - DB_ENV *dbenvp; +btree_stats(dbenv, dbp, msp, fast) + DB_ENV *dbenv; DB *dbp; DB_BTREE_STAT *msp; + int fast; { static const FN fn[] = { { BTM_DUP, "duplicates" }, @@ -387,12 +465,12 @@ btree_stats(dbenvp, dbp, msp) DB_BTREE_STAT *sp; int ret; - COMPQUIET(dbenvp, NULL); + COMPQUIET(dbenv, NULL); if (msp != NULL) sp = msp; - else if ((ret = dbp->stat(dbp, &sp, NULL, 0)) != 0) { - dbp->err(dbp, ret, "dbp->stat"); + else if ((ret = dbp->stat(dbp, &sp, fast)) != 0) { + dbp->err(dbp, ret, "DB->stat"); return (1); } @@ -447,6 +525,8 @@ btree_stats(dbenvp, dbp, msp) dl("Number of pages on the free list.\n", (u_long)sp->bt_free); + free(sp); + return (0); } @@ -455,9 +535,10 @@ btree_stats(dbenvp, dbp, msp) * Display hash statistics. */ int -hash_stats(dbenvp, dbp) - DB_ENV *dbenvp; +hash_stats(dbenv, dbp, fast) + DB_ENV *dbenv; DB *dbp; + int fast; { static const FN fn[] = { { DB_HASH_DUP, "duplicates" }, @@ -467,10 +548,10 @@ hash_stats(dbenvp, dbp) DB_HASH_STAT *sp; int ret; - COMPQUIET(dbenvp, NULL); + COMPQUIET(dbenv, NULL); - if ((ret = dbp->stat(dbp, &sp, NULL, 0)) != 0) { - dbp->err(dbp, ret, "dbp->stat"); + if ((ret = dbp->stat(dbp, &sp, fast)) != 0) { + dbp->err(dbp, ret, "DB->stat"); return (1); } @@ -478,6 +559,7 @@ hash_stats(dbenvp, dbp) printf("%lu\tHash version number.\n", (u_long)sp->hash_version); prflags(sp->hash_metaflags, fn); dl("Underlying database page size.\n", (u_long)sp->hash_pagesize); + dl("Specified fill factor.\n", (u_long)sp->hash_ffactor); dl("Number of keys in the database.\n", (u_long)sp->hash_nkeys); dl("Number of data items in the database.\n", (u_long)sp->hash_ndata); @@ -506,6 +588,8 @@ hash_stats(dbenvp, dbp) dl("Number of pages on the free list.\n", (u_long)sp->hash_free); + free(sp); + return (0); } @@ -514,17 +598,18 @@ hash_stats(dbenvp, dbp) * Display queue statistics. */ int -queue_stats(dbenvp, dbp) - DB_ENV *dbenvp; +queue_stats(dbenv, dbp, fast) + DB_ENV *dbenv; DB *dbp; + int fast; { DB_QUEUE_STAT *sp; int ret; - COMPQUIET(dbenvp, NULL); + COMPQUIET(dbenv, NULL); - if ((ret = dbp->stat(dbp, &sp, NULL, 0)) != 0) { - dbp->err(dbp, ret, "dbp->stat"); + if ((ret = dbp->stat(dbp, &sp, fast)) != 0) { + dbp->err(dbp, ret, "DB->stat"); return (1); } @@ -536,6 +621,9 @@ queue_stats(dbenvp, dbp) else printf("0x%x\tFixed-length record pad.\n", (int)sp->qs_re_pad); dl("Underlying database page size.\n", (u_long)sp->qs_pagesize); + if (sp->qs_extentsize != 0) + dl("Underlying database extent size.\n", + (u_long)sp->qs_extentsize); dl("Number of records in the database.\n", (u_long)sp->qs_nkeys); dl("Number of database pages.\n", (u_long)sp->qs_pages); dl("Number of bytes free in database pages", (u_long)sp->qs_pgfree); @@ -543,7 +631,9 @@ queue_stats(dbenvp, dbp) PCT(sp->qs_pgfree, sp->qs_pages, sp->qs_pagesize)); printf("%lu\tFirst undeleted record.\n", (u_long)sp->qs_first_recno); printf( - "%lu\tLast allocated record number.\n", (u_long)sp->qs_cur_recno); + "%lu\tNext available record number.\n", (u_long)sp->qs_cur_recno); + + free(sp); return (0); } @@ -553,46 +643,68 @@ queue_stats(dbenvp, dbp) * Display lock statistics. */ int -lock_stats(dbenvp) - DB_ENV *dbenvp; +lock_stats(dbenv, internal, flags) + DB_ENV *dbenv; + char *internal; + u_int32_t flags; { DB_LOCK_STAT *sp; int ret; if (internal != NULL) { - __lock_dump_region(dbenvp, internal, stdout); + if ((ret = + dbenv->lock_dump_region(dbenv, internal, stdout)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } return (0); } - if ((ret = lock_stat(dbenvp, &sp, NULL)) != 0) { - dbenvp->err(dbenvp, ret, NULL); + if ((ret = dbenv->lock_stat(dbenv, &sp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); return (1); } - dl("Last allocated locker ID.\n", (u_long)sp->st_lastid); + dl("Last allocated locker ID.\n", (u_long)sp->st_id); + dl("Current maximum unused locker ID.\n", (u_long)sp->st_cur_maxid); dl("Number of lock modes.\n", (u_long)sp->st_nmodes); dl("Maximum number of locks possible.\n", (u_long)sp->st_maxlocks); dl("Maximum number of lockers possible.\n", (u_long)sp->st_maxlockers); - dl("Maximum number of objects possible.\n", (u_long)sp->st_maxobjects); - dl("Current locks.\n", (u_long)sp->st_nlocks); - dl("Maximum number of locks so far.\n", (u_long)sp->st_maxnlocks); - dl("Current number of lockers.\n", (u_long)sp->st_nlockers); - dl("Maximum number lockers so far.\n", (u_long)sp->st_maxnlockers); - dl("Current number lock objects.\n", (u_long)sp->st_nobjects); - dl("Maximum number of lock objects so far.\n", + dl("Maximum number of lock objects possible.\n", + (u_long)sp->st_maxobjects); + dl("Number of current locks.\n", (u_long)sp->st_nlocks); + dl("Maximum number of locks at any one time.\n", + (u_long)sp->st_maxnlocks); + dl("Number of current lockers.\n", (u_long)sp->st_nlockers); + dl("Maximum number of lockers at any one time.\n", + (u_long)sp->st_maxnlockers); + dl("Number of current lock objects.\n", (u_long)sp->st_nobjects); + dl("Maximum number of lock objects at any one time.\n", (u_long)sp->st_maxnobjects); - dl("Number of lock requests.\n", (u_long)sp->st_nrequests); - dl("Number of lock releases.\n", (u_long)sp->st_nreleases); - dl("Number of lock requests that would have waited.\n", + dl("Total number of locks requested.\n", (u_long)sp->st_nrequests); + dl("Total number of locks released.\n", (u_long)sp->st_nreleases); + dl( + "Total number of lock requests failing because DB_LOCK_NOWAIT was set.\n", (u_long)sp->st_nnowaits); - dl("Number of lock conflicts.\n", (u_long)sp->st_nconflicts); + dl( + "Total number of locks not immediately available due to conflicts.\n", + (u_long)sp->st_nconflicts); dl("Number of deadlocks.\n", (u_long)sp->st_ndeadlocks); - dl_bytes("Lock region size", + dl("Lock timeout value.\n", (u_long)sp->st_locktimeout); + dl("Number of locks that have timed out.\n", + (u_long)sp->st_nlocktimeouts); + dl("Transaction timeout value.\n", (u_long)sp->st_txntimeout); + dl("Number of transactions that have timed out.\n", + (u_long)sp->st_ntxntimeouts); + + dl_bytes("The size of the lock region.", (u_long)0, (u_long)0, (u_long)sp->st_regsize); - dl("The number of region locks granted without waiting.\n", - (u_long)sp->st_region_nowait); dl("The number of region locks granted after waiting.\n", (u_long)sp->st_region_wait); + dl("The number of region locks granted without waiting.\n", + (u_long)sp->st_region_nowait); + + free(sp); return (0); } @@ -602,31 +714,32 @@ lock_stats(dbenvp) * Display log statistics. */ int -log_stats(dbenvp) - DB_ENV *dbenvp; +log_stats(dbenv, flags) + DB_ENV *dbenv; + u_int32_t flags; { DB_LOG_STAT *sp; int ret; - if ((ret = log_stat(dbenvp, &sp, NULL)) != 0) { - dbenvp->err(dbenvp, ret, NULL); + if ((ret = dbenv->log_stat(dbenv, &sp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); return (1); } printf("%lx\tLog magic number.\n", (u_long)sp->st_magic); printf("%lu\tLog version number.\n", (u_long)sp->st_version); - dl_bytes("Log region size", - (u_long)0, (u_long)0, (u_long)sp->st_regsize); dl_bytes("Log record cache size", (u_long)0, (u_long)0, (u_long)sp->st_lg_bsize); printf("%#o\tLog file mode.\n", sp->st_mode); - if (sp->st_lg_max % MEGABYTE == 0) - printf("%luMb\tLog file size.\n", - (u_long)sp->st_lg_max / MEGABYTE); - else if (sp->st_lg_max % 1024 == 0) - printf("%luKb\tLog file size.\n", (u_long)sp->st_lg_max / 1024); + if (sp->st_lg_size % MEGABYTE == 0) + printf("%luMb\tCurrent log file size.\n", + (u_long)sp->st_lg_size / MEGABYTE); + else if (sp->st_lg_size % 1024 == 0) + printf("%luKb\tCurrent log file size.\n", + (u_long)sp->st_lg_size / 1024); else - printf("%lu\tLog file size.\n", (u_long)sp->st_lg_max); + printf("%lu\tCurrent log file size.\n", + (u_long)sp->st_lg_size); dl_bytes("Log bytes written", (u_long)0, (u_long)sp->st_w_mbytes, (u_long)sp->st_w_bytes); dl_bytes("Log bytes written since last checkpoint", @@ -637,10 +750,20 @@ log_stats(dbenvp) dl("Total log file flushes.\n", (u_long)sp->st_scount); printf("%lu\tCurrent log file number.\n", (u_long)sp->st_cur_file); printf("%lu\tCurrent log file offset.\n", (u_long)sp->st_cur_offset); - dl("The number of region locks granted without waiting.\n", - (u_long)sp->st_region_nowait); + printf("%lu\tOn-disk log file number.\n", (u_long)sp->st_disk_file); + printf("%lu\tOn-disk log file offset.\n", (u_long)sp->st_disk_offset); + + dl("Max commits in a log flush.\n", (u_long)sp->st_maxcommitperflush); + dl("Min commits in a log flush.\n", (u_long)sp->st_mincommitperflush); + + dl_bytes("Log region size", + (u_long)0, (u_long)0, (u_long)sp->st_regsize); dl("The number of region locks granted after waiting.\n", (u_long)sp->st_region_wait); + dl("The number of region locks granted without waiting.\n", + (u_long)sp->st_region_nowait); + + free(sp); return (0); } @@ -650,34 +773,41 @@ log_stats(dbenvp) * Display mpool statistics. */ int -mpool_stats(dbenvp) - DB_ENV *dbenvp; +mpool_stats(dbenv, internal, flags) + DB_ENV *dbenv; + char *internal; + u_int32_t flags; { DB_MPOOL_FSTAT **fsp; DB_MPOOL_STAT *gsp; int ret; if (internal != NULL) { - __memp_dump_region(dbenvp, internal, stdout); - return (1); + if ((ret = + dbenv->memp_dump_region(dbenv, internal, stdout)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } + return (0); } - if ((ret = memp_stat(dbenvp, &gsp, &fsp, NULL)) != 0) { - dbenvp->err(dbenvp, ret, NULL); + if ((ret = dbenv->memp_stat(dbenv, &gsp, &fsp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); return (1); } dl_bytes("Total cache size", (u_long)gsp->st_gbytes, (u_long)0, (u_long)gsp->st_bytes); dl("Number of caches.\n", (u_long)gsp->st_ncache); - dl("Pool individual cache size.\n", (u_long)gsp->st_regsize); + dl_bytes("Pool individual cache size", + (u_long)0, (u_long)0, (u_long)gsp->st_regsize); + dl("Requested pages mapped into the process' address space.\n", + (u_long)gsp->st_map); dl("Requested pages found in the cache", (u_long)gsp->st_cache_hit); if (gsp->st_cache_hit + gsp->st_cache_miss != 0) printf(" (%.0f%%)", ((double)gsp->st_cache_hit / (gsp->st_cache_hit + gsp->st_cache_miss)) * 100); printf(".\n"); - dl("Requested pages mapped into the process' address space.\n", - (u_long)gsp->st_map); dl("Requested pages not found in the cache.\n", (u_long)gsp->st_cache_miss); dl("Pages created in the cache.\n", (u_long)gsp->st_page_create); @@ -688,11 +818,13 @@ mpool_stats(dbenvp) (u_long)gsp->st_ro_evict); dl("Dirty pages forced from the cache.\n", (u_long)gsp->st_rw_evict); - dl("Dirty buffers written by trickle-sync thread.\n", + dl("Dirty pages written by trickle-sync thread.\n", (u_long)gsp->st_page_trickle); - dl("Current clean buffer count.\n", + dl("Current total page count.\n", + (u_long)gsp->st_pages); + dl("Current clean page count.\n", (u_long)gsp->st_page_clean); - dl("Current dirty buffer count.\n", + dl("Current dirty page count.\n", (u_long)gsp->st_page_dirty); dl("Number of hash buckets used for page location.\n", (u_long)gsp->st_hash_buckets); @@ -702,15 +834,33 @@ mpool_stats(dbenvp) (u_long)gsp->st_hash_longest); dl("Total number of hash buckets examined for page location.\n", (u_long)gsp->st_hash_examined); + dl("The number of hash bucket locks granted without waiting.\n", + (u_long)gsp->st_hash_nowait); + dl("The number of hash bucket locks granted after waiting.\n", + (u_long)gsp->st_hash_wait); + dl("The maximum number of times any hash bucket lock was waited for.\n", + (u_long)gsp->st_hash_max_wait); dl("The number of region locks granted without waiting.\n", (u_long)gsp->st_region_nowait); dl("The number of region locks granted after waiting.\n", (u_long)gsp->st_region_wait); + dl("The number of page allocations.\n", + (u_long)gsp->st_alloc); + dl("The number of hash buckets examined during allocations\n", + (u_long)gsp->st_alloc_buckets); + dl("The max number of hash buckets examined for an allocation\n", + (u_long)gsp->st_alloc_max_buckets); + dl("The number of pages examined during allocations\n", + (u_long)gsp->st_alloc_pages); + dl("The max number of pages examined for an allocation\n", + (u_long)gsp->st_alloc_max_pages); for (; fsp != NULL && *fsp != NULL; ++fsp) { printf("%s\n", DB_LINE); printf("Pool File: %s\n", (*fsp)->file_name); dl("Page size.\n", (u_long)(*fsp)->st_pagesize); + dl("Requested pages mapped into the process' address space.\n", + (u_long)(*fsp)->st_map); dl("Requested pages found in the cache", (u_long)(*fsp)->st_cache_hit); if ((*fsp)->st_cache_hit + (*fsp)->st_cache_miss != 0) @@ -718,8 +868,6 @@ mpool_stats(dbenvp) ((*fsp)->st_cache_hit + (*fsp)->st_cache_miss)) * 100); printf(".\n"); - dl("Requested pages mapped into the process' address space.\n", - (u_long)(*fsp)->st_map); dl("Requested pages not found in the cache.\n", (u_long)(*fsp)->st_cache_miss); dl("Pages created in the cache.\n", @@ -730,6 +878,123 @@ mpool_stats(dbenvp) (u_long)(*fsp)->st_page_out); } + free(gsp); + + return (0); +} + +/* + * rep_stats -- + * Display replication statistics. + */ +int +rep_stats(dbenv, flags) + DB_ENV *dbenv; + u_int32_t flags; +{ + DB_REP_STAT *sp; + int is_client, ret; + const char *p; + + if ((ret = dbenv->rep_stat(dbenv, &sp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); + return (1); + } + + is_client = 0; + switch (sp->st_status) { + case DB_REP_MASTER: + printf("Environment configured as a replication master.\n"); + break; + case DB_REP_CLIENT: + printf("Environment configured as a replication client.\n"); + is_client = 1; + break; + case DB_REP_LOGSONLY: + printf("Environment configured as a logs-only replica.\n"); + is_client = 1; + break; + default: + printf("Environment not configured for replication.\n"); + break; + } + + printf("%lu/%lu\t%s\n", + (u_long)sp->st_next_lsn.file, (u_long)sp->st_next_lsn.offset, + is_client ? "Next LSN expected." : "Next LSN to be used."); + p = sp->st_waiting_lsn.file == 0 ? + "Not waiting for any missed log records." : + "LSN of first missed log record being waited for."; + printf("%lu/%lu\t%s\n", + (u_long)sp->st_waiting_lsn.file, (u_long)sp->st_waiting_lsn.offset, + p); + + dl("Number of duplicate master conditions detected.\n", + (u_long)sp->st_dupmasters); + if (sp->st_env_id != DB_EID_INVALID) + dl("Current environment ID.\n", (u_long)sp->st_env_id); + else + printf("No current environment ID.\n"); + dl("Current environment priority.\n", (u_long)sp->st_env_priority); + dl("Current generation number.\n", (u_long)sp->st_gen); + dl("Number of duplicate log records received.\n", + (u_long)sp->st_log_duplicated); + dl("Number of log records currently queued.\n", + (u_long)sp->st_log_queued); + dl("Maximum number of log records ever queued at once.\n", + (u_long)sp->st_log_queued_max); + dl("Total number of log records queued.\n", + (u_long)sp->st_log_queued_total); + dl("Number of log records received and appended to the log.\n", + (u_long)sp->st_log_records); + dl("Number of log records missed and requested.\n", + (u_long)sp->st_log_requested); + if (sp->st_master != DB_EID_INVALID) + dl("Current master ID.\n", (u_long)sp->st_master); + else + printf("No current master ID.\n"); + dl("Number of times the master has changed.\n", + (u_long)sp->st_master_changes); + dl("Number of messages received with a bad generation number.\n", + (u_long)sp->st_msgs_badgen); + dl("Number of messages received and processed.\n", + (u_long)sp->st_msgs_processed); + dl("Number of messages ignored due to pending recovery.\n", + (u_long)sp->st_msgs_recover); + dl("Number of failed message sends.\n", + (u_long)sp->st_msgs_send_failures); + dl("Number of messages sent.\n", (u_long)sp->st_msgs_sent); + dl("Number of new site messages received.\n", (u_long)sp->st_newsites); + dl("Transmission limited.\n", (u_long)sp->st_nthrottles); + dl("Number of outdated conditions detected.\n", + (u_long)sp->st_outdated); + dl("Number of transactions applied.\n", (u_long)sp->st_txns_applied); + + dl("Number of elections held.\n", (u_long)sp->st_elections); + dl("Number of elections won.\n", (u_long)sp->st_elections_won); + + if (sp->st_election_status == 0) + printf("No election in progress.\n"); + else { + dl("Current election phase.\n", (u_long)sp->st_election_status); + dl("Election winner.\n", + (u_long)sp->st_election_cur_winner); + dl("Election generation number.\n", + (u_long)sp->st_election_gen); + printf("%lu/%lu\tMaximum LSN of election winner.\n", + (u_long)sp->st_election_lsn.file, + (u_long)sp->st_election_lsn.offset); + dl("Number of sites expected to participate in elections.\n", + (u_long)sp->st_election_nsites); + dl("Election priority.\n", (u_long)sp->st_election_priority); + dl("Election tiebreaker value.\n", + (u_long)sp->st_election_tiebreaker); + dl("Votes received this election round.\n", + (u_long)sp->st_election_votes); + } + + free(sp); + return (0); } @@ -738,16 +1003,17 @@ mpool_stats(dbenvp) * Display transaction statistics. */ int -txn_stats(dbenvp) - DB_ENV *dbenvp; +txn_stats(dbenv, flags) + DB_ENV *dbenv; + u_int32_t flags; { DB_TXN_STAT *sp; u_int32_t i; int ret; const char *p; - if ((ret = txn_stat(dbenvp, &sp, NULL)) != 0) { - dbenvp->err(dbenvp, ret, NULL); + if ((ret = dbenv->txn_stat(dbenv, &sp, flags)) != 0) { + dbenv->err(dbenv, ret, NULL); return (1); } @@ -755,12 +1021,6 @@ txn_stats(dbenvp) "No checkpoint LSN." : "File/offset for last checkpoint LSN."; printf("%lu/%lu\t%s\n", (u_long)sp->st_last_ckp.file, (u_long)sp->st_last_ckp.offset, p); - p = sp->st_pending_ckp.file == 0 ? - "No pending checkpoint LSN." : - "File/offset for last pending checkpoint LSN."; - printf("%lu/%lu\t%s\n", - (u_long)sp->st_pending_ckp.file, - (u_long)sp->st_pending_ckp.offset, p); if (sp->st_time_ckp == 0) printf("0\tNo checkpoint timestamp.\n"); else @@ -775,19 +1035,30 @@ txn_stats(dbenvp) dl("Number of transactions begun.\n", (u_long)sp->st_nbegins); dl("Number of transactions aborted.\n", (u_long)sp->st_naborts); dl("Number of transactions committed.\n", (u_long)sp->st_ncommits); + dl("Number of transactions restored.\n", (u_long)sp->st_nrestores); + dl_bytes("Transaction region size", (u_long)0, (u_long)0, (u_long)sp->st_regsize); - dl("The number of region locks granted without waiting.\n", - (u_long)sp->st_region_nowait); dl("The number of region locks granted after waiting.\n", (u_long)sp->st_region_wait); + dl("The number of region locks granted without waiting.\n", + (u_long)sp->st_region_nowait); + qsort(sp->st_txnarray, sp->st_nactive, sizeof(sp->st_txnarray[0]), txn_compare); - for (i = 0; i < sp->st_nactive; ++i) - printf("\tid: %lx; initial LSN file/offest %lu/%lu\n", + for (i = 0; i < sp->st_nactive; ++i) { + printf("\tid: %lx; begin LSN: file/offset %lu/%lu", (u_long)sp->st_txnarray[i].txnid, (u_long)sp->st_txnarray[i].lsn.file, (u_long)sp->st_txnarray[i].lsn.offset); + if (sp->st_txnarray[i].parentid == 0) + printf("\n"); + else + printf(" parent: %lx\n", + (u_long)sp->st_txnarray[i].parentid); + } + + free(sp); return (0); } @@ -837,43 +1108,35 @@ dl_bytes(msg, gbytes, mbytes, bytes) u_long gbytes, mbytes, bytes; { const char *sep; - u_long sbytes; - int showbytes; - sbytes = bytes; - while (bytes > MEGABYTE) { + /* Normalize the values. */ + while (bytes >= MEGABYTE) { ++mbytes; bytes -= MEGABYTE; } - while (mbytes > GIGABYTE / MEGABYTE) { + while (mbytes >= GIGABYTE / MEGABYTE) { ++gbytes; - --mbytes; + mbytes -= GIGABYTE / MEGABYTE; } sep = ""; - showbytes = 0; if (gbytes > 0) { printf("%luGB", gbytes); sep = " "; - showbytes = 1; } if (mbytes > 0) { printf("%s%luMB", sep, mbytes); sep = " "; - showbytes = 1; } - if (bytes > 1024) { + if (bytes >= 1024) { printf("%s%luKB", sep, bytes / 1024); bytes %= 1024; sep = " "; - showbytes = 1; } if (bytes > 0) printf("%s%luB", sep, bytes); - printf("\t%s", msg); - if (showbytes) - printf(" (%lu bytes)", sbytes); - printf(".\n"); + + printf("\t%s.\n", msg); } /* @@ -902,45 +1165,57 @@ prflags(flags, fnp) * Initialize the environment. */ int -db_init(home, ttype) +db_init(dbenv, home, ttype, cache, is_private) + DB_ENV *dbenv; char *home; test_t ttype; + u_int32_t cache; + int *is_private; { + u_int32_t oflags; int ret; /* * If our environment open fails, and we're trying to look at a * shared region, it's a hard failure. + * + * We will probably just drop core if the environment we join does + * not include a memory pool. This is probably acceptable; trying + * to use an existing environment that does not contain a memory + * pool to look at a database can be safely construed as operator + * error, I think. */ - if ((ret = dbenv->open(dbenv, - home, DB_JOINENV | DB_USE_ENVIRON, 0)) == 0) + *is_private = 0; + if ((ret = + dbenv->open(dbenv, home, DB_JOINENV | DB_USE_ENVIRON, 0)) == 0) return (0); - if (ttype != T_DB) { - dbenv->err(dbenv, ret, "DBENV->open%s%s", + if (ttype != T_DB && ttype != T_LOG) { + dbenv->err(dbenv, ret, "DB_ENV->open%s%s", home == NULL ? "" : ": ", home == NULL ? "" : home); return (1); } /* - * We're trying to look at a database. + * We're looking at a database or set of log files and no environment + * exists. Create one, but make it private so no files are actually + * created. Declare a reasonably large cache so that we don't fail + * when reporting statistics on large databases. * - * An environment is required because we may be trying to look at - * databases in directories other than the current one. We could - * avoid using an environment iff the -h option wasn't specified, - * but that seems like more work than it's worth. - * - * - * No environment exists. Create one, but make it private so that - * no files are actually created. - * - * Note that we will probably just drop core if the environment - * we joined above does not include a memory pool. This is probably - * acceptable; trying to use an existing shared environment that - * does not contain a memory pool to look at a database can - * be safely construed as operator error, I think. + * An environment is required to look at databases because we may be + * trying to look at databases in directories other than the current + * one. */ - if ((ret = dbenv->open(dbenv, home, - DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) == 0) + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) { + dbenv->err(dbenv, ret, "set_cachesize"); + return (1); + } + *is_private = 1; + oflags = DB_CREATE | DB_PRIVATE | DB_USE_ENVIRON; + if (ttype == T_DB) + oflags |= DB_INIT_MPOOL; + if (ttype == T_LOG) + oflags |= DB_INIT_LOG; + if ((ret = dbenv->open(dbenv, home, oflags, 0)) == 0) return (0); /* An environment is required. */ @@ -963,16 +1238,18 @@ argcheck(arg, ok_args) return (1); } -void +int usage() { - fprintf(stderr, "usage: db_stat %s\n", - "[-celmNtV] [-C Acflmo] [-d file [-s file]] [-h home] [-M Ahlm]"); - exit (1); + fprintf(stderr, "%s\n\t%s\n", + "usage: db_stat [-celmNrtVZ] [-C Aclmop]", + "[-d file [-f] [-s database]] [-h home] [-M Ahlm] [-P password]"); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -984,6 +1261,7 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); } diff --git a/bdb/db_upgrade/db_upgrade.c b/bdb/db_upgrade/db_upgrade.c index dc29b6c7e0c..f46b5eabc4e 100644 --- a/bdb/db_upgrade/db_upgrade.c +++ b/bdb/db_upgrade/db_upgrade.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,9 +9,9 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_upgrade.c,v 1.13 2001/01/18 18:36:59 bostic Exp $"; + "$Id: db_upgrade.c,v 1.31 2002/03/28 20:13:47 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES @@ -25,12 +25,9 @@ static const char revid[] = #include "db_int.h" -int main __P((int, char *[])); -void usage __P((void)); -void version_check __P((void)); - -const char - *progname = "db_upgrade"; /* Program name. */ +int main __P((int, char *[])); +int usage __P((void)); +int version_check __P((const char *)); int main(argc, argv) @@ -39,30 +36,35 @@ 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, e_close, exitval, nflag, ret, t_ret; - char *home; + char *home, *passwd; - version_check(); + if ((ret = version_check(progname)) != 0) + return (ret); dbenv = NULL; flags = nflag = 0; e_close = exitval = 0; - home = NULL; - while ((ch = getopt(argc, argv, "h:NsV")) != EOF) + home = passwd = NULL; + while ((ch = getopt(argc, argv, "h:NP:sV")) != EOF) switch (ch) { case 'h': home = optarg; break; case 'N': nflag = 1; - if ((ret = db_env_set_panicstate(0)) != 0) { - fprintf(stderr, - "%s: db_env_set_panicstate: %s\n", - progname, db_strerror(ret)); - exit (1); + 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 's': @@ -70,16 +72,16 @@ main(argc, argv) break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); case '?': default: - usage(); + return (usage()); } argc -= optind; argv += optind; if (argc <= 0) - usage(); + return (usage()); /* Handle possible interruptions. */ __db_util_siginit(); @@ -98,8 +100,20 @@ main(argc, argv) dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); - if (nflag && (ret = dbenv->set_mutexlocks(dbenv, 0)) != 0) { - dbenv->err(dbenv, ret, "set_mutexlocks"); + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto shutdown; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto shutdown; + } + } + + if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv, + passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); goto shutdown; } @@ -126,7 +140,7 @@ main(argc, argv) if ((ret = dbp->upgrade(dbp, argv[0], flags)) != 0) dbp->err(dbp, ret, "DB->upgrade: %s", argv[0]); if ((t_ret = dbp->close(dbp, 0)) != 0 && ret == 0) { - dbp->err(dbp, ret, "DB->close: %s", argv[0]); + dbenv->err(dbenv, ret, "DB->close: %s", argv[0]); ret = t_ret; } if (ret != 0) @@ -145,18 +159,20 @@ shutdown: exitval = 1; /* Resend any caught signal. */ __db_util_sigresend(); - return (exitval); + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } -void +int usage() { - fprintf(stderr, "usage: db_upgrade [-NsV] [-h home] db_file ...\n"); - exit (1); + fprintf(stderr, "%s\n", + "usage: db_upgrade [-NsV] [-h home] [-P password] db_file ..."); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -168,6 +184,7 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); } diff --git a/bdb/db_verify/db_verify.c b/bdb/db_verify/db_verify.c index 3bbf14caac6..8d63a20e7bc 100644 --- a/bdb/db_verify/db_verify.c +++ b/bdb/db_verify/db_verify.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ @@ -9,9 +9,9 @@ #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2000\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n"; static const char revid[] = - "$Id: db_verify.c,v 1.15 2001/01/18 18:36:59 bostic Exp $"; + "$Id: db_verify.c,v 1.38 2002/08/08 03:51:38 bostic Exp $"; #endif #ifndef NO_SYSTEM_INCLUDES @@ -25,12 +25,9 @@ static const char revid[] = #include "db_int.h" -int main __P((int, char *[])); -void usage __P((void)); -void version_check __P((void)); - -const char - *progname = "db_verify"; /* Program name. */ +int main __P((int, char *[])); +int usage __P((void)); +int version_check __P((const char *)); int main(argc, argv) @@ -39,46 +36,56 @@ main(argc, argv) { extern char *optarg; extern int optind; - DB *dbp; + const char *progname = "db_verify"; + DB *dbp, *dbp1; DB_ENV *dbenv; - int ch, e_close, exitval, nflag, quiet, ret, t_ret; - char *home; + u_int32_t cache; + int ch, d_close, e_close, exitval, nflag, oflag, private; + int quiet, resize, ret, t_ret; + char *home, *passwd; - version_check(); + if ((ret = version_check(progname)) != 0) + return (ret); dbenv = NULL; - e_close = exitval = nflag = quiet = 0; - home = NULL; - while ((ch = getopt(argc, argv, "h:NqV")) != EOF) + cache = MEGABYTE; + d_close = e_close = exitval = nflag = oflag = quiet = 0; + home = passwd = NULL; + while ((ch = getopt(argc, argv, "h:NoP:qV")) != EOF) switch (ch) { case 'h': home = optarg; break; case 'N': nflag = 1; - if ((ret = db_env_set_panicstate(0)) != 0) { - fprintf(stderr, - "%s: db_env_set_panicstate: %s\n", - progname, db_strerror(ret)); - exit (1); + 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 'o': + oflag = 1; break; case 'q': quiet = 1; break; case 'V': printf("%s\n", db_version(NULL, NULL, NULL)); - exit(0); + return (EXIT_SUCCESS); case '?': default: - usage(); + return (usage()); } argc -= optind; argv += optind; if (argc <= 0) - usage(); + return (usage()); /* Handle possible interruptions. */ __db_util_siginit(); @@ -87,57 +94,108 @@ main(argc, argv) * 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)); +retry: if ((ret = db_env_create(&dbenv, 0)) != 0) { + fprintf(stderr, + "%s: db_env_create: %s\n", progname, db_strerror(ret)); goto shutdown; } e_close = 1; - /* - * XXX - * We'd prefer to have error output configured while calling - * db_env_create, but there's no way to turn it off once it's - * turned on. - */ if (!quiet) { dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); } - if (nflag && (ret = dbenv->set_mutexlocks(dbenv, 0)) != 0) { - dbenv->err(dbenv, ret, "set_mutexlocks"); - goto shutdown; + if (nflag) { + if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING"); + goto shutdown; + } + if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) { + dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC"); + goto shutdown; + } } - /* - * Attach to an mpool if it exists, but if that fails, attach - * to a private region. - */ - if ((ret = dbenv->open(dbenv, - home, DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0 && - (ret = dbenv->open(dbenv, home, - DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { - dbenv->err(dbenv, ret, "open"); + if (passwd != NULL && + (ret = dbenv->set_encrypt(dbenv, passwd, DB_ENCRYPT_AES)) != 0) { + dbenv->err(dbenv, ret, "set_passwd"); goto shutdown; } + /* + * Attach to an mpool if it exists, but if that fails, attach to a + * private region. In the latter case, declare a reasonably large + * cache so that we don't fail when verifying large databases. + */ + private = 0; + if ((ret = + dbenv->open(dbenv, home, DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0) { + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) { + dbenv->err(dbenv, ret, "set_cachesize"); + goto shutdown; + } + private = 1; + if ((ret = dbenv->open(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } + } for (; !__db_util_interrupted() && argv[0] != NULL; ++argv) { if ((ret = db_create(&dbp, dbenv, 0)) != 0) { - fprintf(stderr, - "%s: db_create: %s\n", progname, db_strerror(ret)); + dbenv->err(dbenv, ret, "%s: db_create", progname); goto shutdown; } - if (!quiet) { - dbp->set_errfile(dbp, stderr); - dbp->set_errpfx(dbp, progname); + d_close = 1; + + /* + * We create a 2nd dbp to this database to get its pagesize + * because the dbp we're using for verify cannot be opened. + */ + if (private) { + if ((ret = db_create(&dbp1, dbenv, 0)) != 0) { + dbenv->err( + dbenv, ret, "%s: db_create", progname); + goto shutdown; + } + + if ((ret = dbp1->open(dbp1, NULL, + argv[0], NULL, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->open: %s", argv[0]); + (void)dbp1->close(dbp1, 0); + goto shutdown; + } + /* + * If we get here, we can check the cache/page. + * !!! + * If we have to retry with an env with a larger + * cache, we jump out of this loop. However, we + * will still be working on the same argv when we + * get back into the for-loop. + */ + ret = __db_util_cache(dbenv, dbp1, &cache, &resize); + (void)dbp1->close(dbp1, 0); + if (ret != 0) + goto shutdown; + + if (resize) { + (void)dbp->close(dbp, 0); + d_close = 0; + + (void)dbenv->close(dbenv, 0); + e_close = 0; + goto retry; + } } - if ((ret = dbp->verify(dbp, argv[0], NULL, NULL, 0)) != 0) + if ((ret = dbp->verify(dbp, + argv[0], NULL, NULL, oflag ? DB_NOORDERCHK : 0)) != 0) dbp->err(dbp, ret, "DB->verify: %s", argv[0]); if ((t_ret = dbp->close(dbp, 0)) != 0 && ret == 0) { - dbp->err(dbp, ret, "DB->close: %s", argv[0]); + dbenv->err(dbenv, ret, "DB->close: %s", argv[0]); ret = t_ret; } + d_close = 0; if (ret != 0) goto shutdown; } @@ -145,6 +203,11 @@ main(argc, argv) if (0) { shutdown: exitval = 1; } + + if (d_close && (ret = dbp->close(dbp, 0)) != 0) { + exitval = 1; + dbenv->err(dbenv, ret, "close"); + } if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { exitval = 1; fprintf(stderr, @@ -154,18 +217,20 @@ shutdown: exitval = 1; /* Resend any caught signal. */ __db_util_sigresend(); - return (exitval); + return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } -void +int usage() { - fprintf(stderr, "usage: db_verify [-NqV] [-h home] db_file ...\n"); - exit (1); + fprintf(stderr, "%s\n", + "usage: db_verify [-NoqV] [-h home] [-P password] db_file ..."); + return (EXIT_FAILURE); } -void -version_check() +int +version_check(progname) + const char *progname; { int v_major, v_minor, v_patch; @@ -177,6 +242,7 @@ version_check() "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n", progname, DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, v_major, v_minor, v_patch); - exit (1); + return (EXIT_FAILURE); } + return (0); } diff --git a/bdb/include/btree.h b/bdb/dbinc/btree.h similarity index 95% rename from bdb/include/btree.h rename to bdb/dbinc/btree.h index 395f645f03f..54da9c5b208 100644 --- a/bdb/include/btree.h +++ b/bdb/dbinc/btree.h @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -39,8 +39,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: btree.h,v 11.37 2001/01/17 17:09:52 bostic Exp $ + * $Id: btree.h,v 11.45 2002/08/06 06:11:21 bostic Exp $ */ +#ifndef _DB_BTREE_H_ +#define _DB_BTREE_H_ /* Forward structure declarations. */ struct __btree; typedef struct __btree BTREE; @@ -144,7 +146,7 @@ struct __epg { #define BT_STK_CLR(c) do { \ (c)->csp = (c)->sp; \ (c)->csp->page = NULL; \ - (c)->csp->lock.off = LOCK_INVALID; \ + LOCK_INIT((c)->csp->lock); \ } while (0) #define BT_STK_ENTER(dbenv, c, pagep, page_indx, l, mode, ret) do { \ @@ -159,7 +161,7 @@ struct __epg { } while (0) #define BT_STK_PUSH(dbenv, c, pagep, page_indx, lock, mode, ret) do { \ - BT_STK_ENTER(dbenv, c, pagep, page_indx, lock, mode, ret); \ + BT_STK_ENTER(dbenv, c, pagep, page_indx, lock, mode, ret); \ ++(c)->csp; \ } while (0) @@ -169,12 +171,12 @@ struct __epg { (c)->csp->page = NULL; \ (c)->csp->indx = page_indx; \ (c)->csp->entries = NUM_ENT(pagep); \ - (c)->csp->lock.off = LOCK_INVALID; \ + LOCK_INIT((c)->csp->lock); \ (c)->csp->lock_mode = DB_LOCK_NG; \ } \ } while (0) -#define BT_STK_NUMPUSH(dbenv, c, pagep, page_indx,ret) do { \ +#define BT_STK_NUMPUSH(dbenv, c, pagep, page_indx, ret) do { \ BT_STK_NUM(dbenv, cp, pagep, page_indx, ret); \ ++(c)->csp; \ } while (0) @@ -233,8 +235,8 @@ struct __cursor { * page. Assume every item requires the maximum alignment for * padding, out of sheer paranoia. */ -#define B_MINKEY_TO_OVFLSIZE(minkey, pgsize) \ - ((u_int16_t)(((pgsize) - P_OVERHEAD) / ((minkey) * P_INDX) - \ +#define B_MINKEY_TO_OVFLSIZE(dbp, minkey, pgsize) \ + ((u_int16_t)(((pgsize) - P_OVERHEAD(dbp)) / ((minkey) * P_INDX) -\ (BKEYDATA_PSIZE(0) + ALIGN(1, sizeof(int32_t))))) /* @@ -312,6 +314,7 @@ typedef enum { DB_CA_SPLIT = 4 } db_ca_mode; -#include "btree_auto.h" -#include "btree_ext.h" -#include "db_am.h" +#include "dbinc_auto/btree_auto.h" +#include "dbinc_auto/btree_ext.h" +#include "dbinc/db_am.h" +#endif /* !_DB_BTREE_H_ */ diff --git a/bdb/dbinc/crypto.h b/bdb/dbinc/crypto.h new file mode 100644 index 00000000000..92fad098a4a --- /dev/null +++ b/bdb/dbinc/crypto.h @@ -0,0 +1,78 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: crypto.h,v 1.9 2002/08/06 06:37:07 bostic Exp $ + */ + +#ifndef _DB_CRYPTO_H_ +#define _DB_CRYPTO_H_ + +/* + * !!! + * These are the internal representations of the algorithm flags. + * They are used in both the DB_CIPHER structure and the CIPHER + * structure so we can tell if users specified both passwd and alg + * correctly. + * + * CIPHER_ANY is used when an app joins an existing env but doesn't + * know the algorithm originally used. This is only valid in the + * DB_CIPHER structure until we open and can set the alg. + */ +/* + * We store the algorithm in an 8-bit field on the meta-page. So we + * use a numeric value, not bit fields. + * now we are limited to 8 algorithms before we cannot use bits and + * need numeric values. That should be plenty. It is okay for the + * CIPHER_ANY flag to go beyond that since that is never stored on disk. + */ + +/* + * This structure is per-process, not in shared memory. + */ +struct __db_cipher { + int (*adj_size) __P((size_t)); + int (*close) __P((DB_ENV *, void *)); + int (*decrypt) __P((DB_ENV *, void *, void *, u_int8_t *, size_t)); + int (*encrypt) __P((DB_ENV *, void *, void *, u_int8_t *, size_t)); + int (*init) __P((DB_ENV *, DB_CIPHER *)); + + u_int8_t mac_key[DB_MAC_KEY]; /* MAC key. */ + void *data; /* Algorithm-specific information */ + +#define CIPHER_AES 1 /* AES algorithm */ + u_int8_t alg; /* Algorithm used - See above */ + u_int8_t spare[3]; /* Spares */ + +#define CIPHER_ANY 0x00000001 /* Only for DB_CIPHER */ + u_int32_t flags; /* Other flags */ +}; + +#ifdef HAVE_CRYPTO + +#include "crypto/rijndael/rijndael-api-fst.h" + +/* + * Shared ciphering structure + * No DB_MUTEX needed because all information is read-only after creation. + */ +typedef struct __cipher { + roff_t passwd; /* Offset to shared passwd */ + size_t passwd_len; /* Length of passwd */ + u_int32_t flags; /* Algorithm used - see above */ +} CIPHER; + +#define DB_AES_KEYLEN 128 /* AES key length */ +#define DB_AES_CHUNK 16 /* AES byte unit size */ + +typedef struct __aes_cipher { + keyInstance decrypt_ki; /* Decryption key instance */ + keyInstance encrypt_ki; /* Encryption key instance */ + u_int32_t flags; /* AES-specific flags */ +} AES_CIPHER; + +#include "dbinc_auto/crypto_ext.h" +#endif /* HAVE_CRYPTO */ +#endif /* !_DB_CRYPTO_H_ */ diff --git a/bdb/dbinc/cxx_common.h b/bdb/dbinc/cxx_common.h new file mode 100644 index 00000000000..e5cb3a9aef4 --- /dev/null +++ b/bdb/dbinc/cxx_common.h @@ -0,0 +1,45 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: cxx_common.h,v 11.2 2002/01/11 15:52:23 bostic Exp $ + */ + +#ifndef _CXX_COMMON_H_ +#define _CXX_COMMON_H_ + +// +// Common definitions used by all of Berkeley DB's C++ include files. +// + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// 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 */ +#endif /* !_CXX_COMMON_H_ */ diff --git a/bdb/dbinc/cxx_except.h b/bdb/dbinc/cxx_except.h new file mode 100644 index 00000000000..f9bf4f859f8 --- /dev/null +++ b/bdb/dbinc/cxx_except.h @@ -0,0 +1,141 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: cxx_except.h,v 11.5 2002/08/01 23:32:34 mjc Exp $ + */ + +#ifndef _CXX_EXCEPT_H_ +#define _CXX_EXCEPT_H_ + +#include "cxx_common.h" + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Forward declarations +// + +class DbDeadlockException; // forward +class DbException; // forward +class DbLockNotGrantedException; // forward +class DbLock; // forward +class DbMemoryException; // forward +class DbRunRecoveryException; // forward +class Dbt; // forward + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// 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). +// +// NOTE: We would like to inherit from class exception and +// let it handle what(), but there are +// MSVC++ problems when is included. +// +class _exported DbException +{ +public: + virtual ~DbException(); + DbException(int err); + DbException(const char *description); + DbException(const char *prefix, int err); + DbException(const char *prefix1, const char *prefix2, int err); + int get_errno() const; + virtual const char *what() const; + + DbException(const DbException &); + DbException &operator = (const DbException &); + +private: + char *what_; + int err_; // errno +}; + +// +// A specific sort of exception that occurs when +// an operation is aborted to resolve a deadlock. +// +class _exported DbDeadlockException : public DbException +{ +public: + virtual ~DbDeadlockException(); + 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(); + DbLockNotGrantedException(const char *prefix, db_lockop_t op, + db_lockmode_t mode, const Dbt *obj, const DbLock lock, int index); + 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(); + DbMemoryException(Dbt *dbt); + DbMemoryException(const char *description); + DbMemoryException(const char *prefix, Dbt *dbt); + DbMemoryException(const char *prefix1, const char *prefix2, Dbt *dbt); + Dbt *get_dbt() const; + + DbMemoryException(const DbMemoryException &); + DbMemoryException &operator = (const DbMemoryException &); + +private: + Dbt *dbt_; +}; + +// +// A specific sort of exception that occurs when +// recovery is required before continuing DB activity. +// +class _exported DbRunRecoveryException : public DbException +{ +public: + virtual ~DbRunRecoveryException(); + DbRunRecoveryException(const char *description); + + DbRunRecoveryException(const DbRunRecoveryException &); + DbRunRecoveryException &operator = (const DbRunRecoveryException &); +}; + +#endif /* !_CXX_EXCEPT_H_ */ diff --git a/bdb/include/cxx_int.h b/bdb/dbinc/cxx_int.h similarity index 76% rename from bdb/include/cxx_int.h rename to bdb/dbinc/cxx_int.h index 4a9a40ceba1..9af3979d9f1 100644 --- a/bdb/include/cxx_int.h +++ b/bdb/dbinc/cxx_int.h @@ -1,10 +1,10 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. * - * $Id: cxx_int.h,v 11.13 2000/11/21 22:56:36 dda Exp $ + * $Id: cxx_int.h,v 11.20 2002/01/11 15:52:23 bostic Exp $ */ #ifndef _CXX_INT_H_ @@ -69,26 +69,11 @@ WRAPPED_CLASS(DbTxn, DbTxnImp, DB_TXN*) #define DB_ERROR(caller, ecode, policy) \ DbEnv::runtime_error(caller, ecode, policy) -// These defines are for tedious field set/get access methods. -// +#define DB_ERROR_DBT(caller, dbt, policy) \ + DbEnv::runtime_error_dbt(caller, dbt, policy) -#define DB_RO_ACCESS(_class, _type, _cxx_name, _field) \ - \ -_type _class::get_##_cxx_name() const \ -{ \ - return (_field); \ -} - -#define DB_WO_ACCESS(_class, _type, _cxx_name, _field) \ - \ -void _class::set_##_cxx_name(_type value) \ -{ \ - _field = value; \ -} \ - -#define DB_RW_ACCESS(_class, _type, _cxx_name, _field) \ - DB_RO_ACCESS(_class, _type, _cxx_name, _field) \ - DB_WO_ACCESS(_class, _type, _cxx_name, _field) +#define DB_OVERFLOWED_DBT(dbt) \ + (F_ISSET(dbt, DB_DBT_USERMEM) && dbt->size > dbt->ulen) /* values for Db::flags_ */ #define DB_CXX_PRIVATE_ENV 0x00000001 diff --git a/bdb/dbinc/db.in b/bdb/dbinc/db.in new file mode 100644 index 00000000000..208de3bd622 --- /dev/null +++ b/bdb/dbinc/db.in @@ -0,0 +1,1883 @@ +/* + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: db.in,v 11.323 2002/09/03 17:27:16 bostic 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 +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * XXX + * Handle function prototypes and the keyword "const". This steps on name + * space that DB doesn't control, but all of the other solutions are worse. + * + * XXX + * While Microsoft's compiler is ANSI C compliant, it doesn't have _STDC_ + * defined by default, you specify a command line flag or #pragma to turn + * it on. Don't do that, however, because some of Microsoft's own header + * files won't compile. + */ +#undef __P +#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER) +#define __P(protos) protos /* ANSI C prototypes */ +#else +#define const +#define __P(protos) () /* K&R C preprocessor */ +#endif + +/* + * Berkeley DB version information. + */ +#define DB_VERSION_MAJOR @DB_VERSION_MAJOR@ +#define DB_VERSION_MINOR @DB_VERSION_MINOR@ +#define DB_VERSION_PATCH @DB_VERSION_PATCH@ +#define DB_VERSION_STRING @DB_VERSION_STRING@ + +/* + * !!! + * 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__ +@u_int8_decl@ +@int16_decl@ +@u_int16_decl@ +@int32_decl@ +@u_int32_decl@ +#endif + +@u_char_decl@ +@u_short_decl@ +@u_int_decl@ +@u_long_decl@ +@ssize_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. */ +#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 currently limited to 32-bits. I expect that's going + * to have to be fixed in the not-too-distant future, since we won't want to + * split 100Gb memory pools into that many different regions. + */ +typedef u_int32_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_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_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_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_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; +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 */ + + 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_private; /* Application-private handle. */ + +#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. */ + 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 0x000001 /* Create file as necessary. */ +#define DB_CXX_NO_EXCEPTIONS 0x000002 /* C++: return error values. */ +#define DB_FORCE 0x000004 /* Force (anything). */ +#define DB_NOMMAP 0x000008 /* Don't mmap underlying file. */ +#define DB_RDONLY 0x000010 /* Read-only (O_RDONLY). */ +#define DB_RECOVER 0x000020 /* Run normal recovery. */ +#define DB_THREAD 0x000040 /* Applications are threaded. */ +#define DB_TRUNCATE 0x000080 /* Discard existing DB (O_TRUNC). */ +#define DB_TXN_NOSYNC 0x000100 /* Do not sync log on commit. */ +#define DB_USE_ENVIRON 0x000200 /* Use the environment. */ +#define DB_USE_ENVIRON_ROOT 0x000400 /* 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->associate, DB->del, DB->put, DB->open, + * DB->remove, DB->rename, DB->truncate + * DB_DIRTY_READ: + * DB->cursor, DB->get, DB->join, DB->open, DBcursor->c_get, + * DB_ENV->txn_begin + * + * Shared flags up to 0x000400 */ +#define DB_AUTO_COMMIT 0x00800000 /* Implied transaction. */ +#define DB_DIRTY_READ 0x01000000 /* Dirty Read. */ + +/* + * Flags private to db_env_create. + */ +#define DB_CLIENT 0x000001 /* Open for a client environment. */ + +/* + * Flags private to db_create. + */ +#define DB_XA_CREATE 0x000001 /* Open in an XA environment. */ + +/* + * Flags private to DB_ENV->open. + * Shared flags up to 0x000400 */ +#define DB_INIT_CDB 0x000800 /* Concurrent Access Methods. */ +#define DB_INIT_LOCK 0x001000 /* Initialize locking. */ +#define DB_INIT_LOG 0x002000 /* Initialize logging. */ +#define DB_INIT_MPOOL 0x004000 /* Initialize mpool. */ +#define DB_INIT_TXN 0x008000 /* Initialize transactions. */ +#define DB_JOINENV 0x010000 /* Initialize all subsystems present. */ +#define DB_LOCKDOWN 0x020000 /* Lock memory into physical core. */ +#define DB_PRIVATE 0x040000 /* DB_ENV is process local. */ +#define DB_RECOVER_FATAL 0x080000 /* Run catastrophic recovery. */ +#define DB_SYSTEM_MEM 0x100000 /* Use system-backed memory. */ + +/* + * Flags private to DB->open. + * Shared flags up to 0x000400 */ +#define DB_EXCL 0x000800 /* Exclusive open (O_EXCL). */ +#define DB_FCNTL_LOCKING 0x001000 /* UNDOC: fcntl(2) locking. */ +#define DB_RDWRMASTER 0x002000 /* UNDOC: allow subdb master open R/W */ +#define DB_WRITEOPEN 0x004000 /* UNDOC: open with write lock. */ + +/* + * Flags private to DB_ENV->txn_begin. + * Shared flags up to 0x000400 */ +#define DB_TXN_NOWAIT 0x000800 /* Do not wait for locks in this TXN. */ +#define DB_TXN_SYNC 0x001000 /* Always sync log on commit. */ + +/* + * Flags private to DB_ENV->set_encrypt. + */ +#define DB_ENCRYPT_AES 0x000001 /* AES, assumes SHA1 checksum */ + +/* + * Flags private to DB_ENV->set_flags. + * Shared flags up to 0x000400 */ +#define DB_CDB_ALLDB 0x000800 /* Set CDB locking per environment. */ +#define DB_DIRECT_DB 0x001000 /* Don't buffer databases in the OS. */ +#define DB_DIRECT_LOG 0x002000 /* Don't buffer log files in the OS. */ +#define DB_NOLOCKING 0x004000 /* Set locking/mutex behavior. */ +#define DB_NOPANIC 0x008000 /* Set panic state per DB_ENV. */ +#define DB_OVERWRITE 0x010000 /* Overwrite unlinked region files. */ +#define DB_PANIC_ENVIRONMENT 0x020000 /* Set panic state per environment. */ +#define DB_REGION_INIT 0x040000 /* Page-fault regions on open. */ +#define DB_TXN_WRITE_NOSYNC 0x080000 /* Write, don't sync, on txn commit. */ +#define DB_YIELDCPU 0x100000 /* Yield the CPU (a lot). */ + +/* + * Flags private to DB->set_feedback's callback. + */ +#define DB_UPGRADE 0x000001 /* Upgrading. */ +#define DB_VERIFY 0x000002 /* Verifying. */ + +/* + * Flags private to DB_MPOOLFILE->open. + * Shared flags up to 0x000400 */ +#define DB_DIRECT 0x000800 /* Don't buffer the file in the OS. */ +#define DB_EXTENT 0x001000 /* UNDOC: dealing with an extent. */ +#define DB_ODDFILESIZE 0x002000 /* Truncate file to N * pgsize. */ + +/* + * Flags private to DB->set_flags. + */ +#define DB_CHKSUM_SHA1 0x000001 /* Use SHA1 checksumming */ +#define DB_DUP 0x000002 /* Btree, Hash: duplicate keys. */ +#define DB_DUPSORT 0x000004 /* Btree, Hash: duplicate keys. */ +#define DB_ENCRYPT 0x000008 /* Btree, Hash: duplicate keys. */ +#define DB_RECNUM 0x000010 /* Btree: record numbers. */ +#define DB_RENUMBER 0x000020 /* Recno: renumber on insert/delete. */ +#define DB_REVSPLITOFF 0x000040 /* Btree: turn off reverse splits. */ +#define DB_SNAPSHOT 0x000080 /* Recno: snapshot the input. */ + +/* + * Flags private to the DB->stat methods. + */ +#define DB_STAT_CLEAR 0x000001 /* Clear stat after returning values. */ + +/* + * Flags private to DB->join. + */ +#define DB_JOIN_NOSORT 0x000001 /* Don't try to optimize join. */ + +/* + * Flags private to DB->verify. + */ +#define DB_AGGRESSIVE 0x000001 /* Salvage whatever could be data.*/ +#define DB_NOORDERCHK 0x000002 /* Skip sort order/hashing check. */ +#define DB_ORDERCHKONLY 0x000004 /* Only perform the order check. */ +#define DB_PR_PAGE 0x000008 /* Show page contents (-da). */ +#define DB_PR_RECOVERYTEST 0x000010 /* Recovery test (-dr). */ +#define DB_PRINTABLE 0x000020 /* Use printable format for salvage. */ +#define DB_SALVAGE 0x000040 /* Salvage what looks like data. */ +/* + * !!! + * These must not go over 0x8000, or they will collide with the flags + * used by __bam_vrfy_subtree. + */ + +/* + * Flags private to DB->set_rep_transport's send callback. + */ +#define DB_REP_PERMANENT 0x0001 /* Important--app. may want to flush. */ + +/******************************************************* + * 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 /* Abort txn with maximum # of locks. */ +#define DB_LOCK_MINLOCKS 4 /* Abort txn with minimum # of locks. */ +#define DB_LOCK_MINWRITE 5 /* Abort txn with minimum writelocks. */ +#define DB_LOCK_OLDEST 6 /* Abort oldest transaction. */ +#define DB_LOCK_RANDOM 7 /* Abort random transaction. */ +#define DB_LOCK_YOUNGEST 8 /* Abort youngest transaction. */ + +/* Flag values for lock_vec(), lock_get(). */ +#define DB_LOCK_FREE_LOCKER 0x001 /* Internal: Free locker as well. */ +#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. */ + +/* + * 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_DIRTY=7, /* Dirty Read. */ + 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_ERR=2, /* Lock is bad. */ + DB_LSTAT_EXPIRED=3, /* Lock has expired. */ + DB_LSTAT_FREE=4, /* Lock is unallocated. */ + DB_LSTAT_HELD=5, /* Lock is currently held. */ + DB_LSTAT_NOTEXIST=6, /* Object on which lock was waiting + * was removed */ + DB_LSTAT_PENDING=7, /* Lock was waiting and has been + * promoted; waiting for the owner + * to run and upgrade it to held. */ + DB_LSTAT_WAITING=8 /* 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. */ + u_int32_t 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_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_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. */ + u_int32_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 +#define DB_TXN_LOCK 4 + 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 { + size_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 7 /* Current log version. */ +#define DB_LOGOLDVER 7 /* Oldest log version supported. */ +#define DB_LOGMAGIC 0x040988 + +/* Flag values for log_archive(). */ +#define DB_ARCH_ABS 0x001 /* Absolute pathnames. */ +#define DB_ARCH_DATA 0x002 /* Data files. */ +#define DB_ARCH_LOG 0x004 /* Log files. */ + +/* + * 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. */ +}; + +/* + * DB_LOGC -- + * Log cursor. + */ +struct __db_log_cursor { + DB_ENV *dbenv; /* Enclosing dbenv. */ + + DB_FH *c_fh; /* 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. */ + +#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. */ + DB_LSN bp_lsn; /* Read buffer first byte LSN. */ + + u_int32_t bp_maxrec; /* Max record length in the log file. */ + + /* Methods. */ + int (*close) __P((DB_LOGC *, u_int32_t)); + int (*get) __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t)); + +#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 mode. */ + u_int32_t st_lg_bsize; /* Log buffer size. */ + u_int32_t st_lg_size; /* Log file size. */ + 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_fill; /* Overflow writes to 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. */ + u_int32_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. */ +}; + +/******************************************************* + * 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. */ + +/* 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. */ + +/* 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 { + /* These fields need to be protected for multi-threaded support. */ + DB_MUTEX *mutexp; /* Structure thread lock. */ + + DB_FH *fhp; /* Underlying file handle. */ + + u_int32_t ref; /* Reference count. */ + + /* + * !!! + * The pinref and q fields are protected by the region lock, not the + * DB_MPOOLFILE structure mutex. We don't use the structure mutex + * because then I/O (which holds the structure lock held because of + * the race between the seek and write of the file descriptor) would + * block any other put/get calls using this DB_MPOOLFILE structure. + */ + 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. */ + + /* + * These fields are not thread-protected because they are initialized + * when the file is opened and never modified. + */ + int ftype; /* File type. */ + DBT *pgcookie; /* Byte-string passed to pgin/pgout. */ + u_int8_t *fileid; /* Unique file ID. */ + int32_t lsn_offset; /* LSN offset in page. */ + u_int32_t clear_len; /* Cleared length on created pages. */ + + DB_MPOOL *dbmp; /* Overlying DB_MPOOL. */ + MPOOLFILE *mfp; /* Underlying MPOOLFILE. */ + + void *addr; /* Address of mmap'd region. */ + size_t len; /* Length of mmap'd region. */ + + /* Methods. */ + int (*close) __P((DB_MPOOLFILE *, u_int32_t)); + int (*get) __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *)); + void (*get_fileid) __P((DB_MPOOLFILE *, u_int8_t *)); + void (*last_pgno) __P((DB_MPOOLFILE *, db_pgno_t *)); + int (*open)__P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t)); + int (*put) __P((DB_MPOOLFILE *, void *, u_int32_t)); + void (*refcnt) __P((DB_MPOOLFILE *, db_pgno_t *)); + int (*set) __P((DB_MPOOLFILE *, void *, u_int32_t)); + int (*set_clear_len) __P((DB_MPOOLFILE *, u_int32_t)); + int (*set_fileid) __P((DB_MPOOLFILE *, u_int8_t *)); + int (*set_ftype) __P((DB_MPOOLFILE *, int)); + int (*set_lsn_offset) __P((DB_MPOOLFILE *, int32_t)); + int (*set_pgcookie) __P((DB_MPOOLFILE *, DBT *)); + int (*set_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY)); + void (*set_unlink) __P((DB_MPOOLFILE *, int)); + int (*sync) __P((DB_MPOOLFILE *)); + + /* + * MP_OPEN_CALLED and MP_READONLY do not need to be thread protected + * because they are initialized when the file is opened, and never + * modified. + * + * MP_FLUSH, MP_UPGRADE and MP_UPGRADE_FAIL are thread protected + * becase they are potentially read by multiple threads of control. + */ +#define MP_FLUSH 0x001 /* Was opened to flush a buffer. */ +#define MP_OPEN_CALLED 0x002 /* File opened. */ +#define MP_READONLY 0x004 /* File is readonly. */ +#define MP_UPGRADE 0x008 /* File descriptor is readwrite. */ +#define MP_UPGRADE_FAIL 0x010 /* Upgrade wasn't possible. */ + 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. */ + u_int32_t st_regsize; /* Cache 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. */ + 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_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_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. */ +}; + +/* Mpool file statistics structure. */ +struct __db_mpool_fstat { + char *file_name; /* File name. */ + size_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_GETPGNOS=5, /* Internal. */ + DB_TXN_OPENFILES=6, /* Internal. */ + DB_TXN_POPENFILES=7, /* Internal. */ + DB_TXN_PRINT=8 /* 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. */ + DB_LSN last_lsn; /* Lsn of last log write. */ + u_int32_t txnid; /* Unique transaction id. */ + roff_t off; /* Detail structure within region. */ + db_timeout_t lock_timeout; /* Timeout for locks for this txn. */ + db_timeout_t expire; /* Time this txn expires. */ + void *txn_list; /* Undo information for parent. */ + + /* + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_ENTRY(__db_txn) links; + */ + struct { + struct __db_txn *tqe_next; + struct __db_txn **tqe_prev; + } links; /* Links transactions off manager. */ + + /* + * !!! + * 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. + * 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_ENTRY(__db_txn) klinks; + */ + struct { + struct __db_txn *tqe_next; + struct __db_txn **tqe_prev; + } klinks; + + /* API-private structure: used by C++ */ + void *api_internal; + + u_int32_t cursors; /* Number of cursors open for txn */ + + /* Methods. */ + int (*abort) __P((DB_TXN *)); + int (*commit) __P((DB_TXN *, u_int32_t)); + int (*discard) __P((DB_TXN *, u_int32_t)); + u_int32_t (*id) __P((DB_TXN *)); + int (*prepare) __P((DB_TXN *, u_int8_t *)); + int (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t)); + +#define TXN_CHILDCOMMIT 0x01 /* Transaction that has committed. */ +#define TXN_COMPENSATE 0x02 /* Compensating transaction. */ +#define TXN_DIRTY_READ 0x04 /* Transaction does dirty reads. */ +#define TXN_LOCKTIMEOUT 0x08 /* Transaction has a lock timeout. */ +#define TXN_MALLOC 0x10 /* Structure allocated by TXN system. */ +#define TXN_NOSYNC 0x20 /* Do not sync on prepare and commit. */ +#define TXN_NOWAIT 0x40 /* Do not wait on locks. */ +#define TXN_SYNC 0x80 /* Sync on prepare and commit. */ + u_int32_t flags; +}; + +/* Transaction statistics structure. */ +struct __db_txn_active { + u_int32_t txnid; /* Transaction ID */ + u_int32_t parentid; /* Transaction ID of parent */ + DB_LSN lsn; /* LSN when transaction began */ +}; + +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_nrestores; /* number of restored transactions + after recovery. */ + u_int32_t st_maxnactive; /* maximum active 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. */ + u_int32_t st_regsize; /* Region size. */ +}; + +/* + * 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 which must have the same value. + */ +#define DB_XIDDATASIZE 128 +struct __db_preplist { + DB_TXN *txn; + u_int8_t gid[DB_XIDDATASIZE]; +}; + +/******************************************************* + * Replication. + *******************************************************/ +/* Special, out-of-band environment IDs. */ +#define DB_EID_BROADCAST -1 +#define DB_EID_INVALID -2 + +/* rep_start flags values */ +#define DB_REP_CLIENT 0x001 +#define DB_REP_LOGSONLY 0x002 +#define DB_REP_MASTER 0x004 + +/* 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. */ + + 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_gen; /* Current generation 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_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_priority; /* Current election priority. */ + int st_election_status; /* Current election status. */ + int st_election_tiebreaker; /* Election tiebreaker value. */ + int st_election_votes; /* Votes received in this round. */ +}; + +/******************************************************* + * 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 + +/* + * 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_CACHED_COUNTS 4 /* stat() */ +#define DB_COMMIT 5 /* log_put() (internal) */ +#define DB_CONSUME 6 /* get() */ +#define DB_CONSUME_WAIT 7 /* get() */ +#define DB_CURRENT 8 /* c_get(), c_put(), DB_LOGC->get() */ +#define DB_FAST_STAT 9 /* stat() */ +#define DB_FIRST 10 /* c_get(), DB_LOGC->get() */ +#define DB_GET_BOTH 11 /* get(), c_get() */ +#define DB_GET_BOTHC 12 /* c_get() (internal) */ +#define DB_GET_BOTH_RANGE 13 /* get(), c_get() */ +#define DB_GET_RECNO 14 /* c_get() */ +#define DB_JOIN_ITEM 15 /* c_get(); do not do primary lookup */ +#define DB_KEYFIRST 16 /* c_put() */ +#define DB_KEYLAST 17 /* c_put() */ +#define DB_LAST 18 /* c_get(), DB_LOGC->get() */ +#define DB_NEXT 19 /* c_get(), DB_LOGC->get() */ +#define DB_NEXT_DUP 20 /* c_get() */ +#define DB_NEXT_NODUP 21 /* c_get() */ +#define DB_NODUPDATA 22 /* put(), c_put() */ +#define DB_NOOVERWRITE 23 /* put() */ +#define DB_NOSYNC 24 /* close() */ +#define DB_POSITION 25 /* c_dup() */ +#define DB_POSITIONI 26 /* c_dup() (internal) */ +#define DB_PREV 27 /* c_get(), DB_LOGC->get() */ +#define DB_PREV_NODUP 28 /* c_get(), DB_LOGC->get() */ +#define DB_RECORDCOUNT 29 /* stat() */ +#define DB_SET 30 /* c_get(), DB_LOGC->get() */ +#define DB_SET_LOCK_TIMEOUT 31 /* set_timout() */ +#define DB_SET_RANGE 32 /* c_get() */ +#define DB_SET_RECNO 33 /* get(), c_get() */ +#define DB_SET_TXN_NOW 34 /* set_timout() (internal) */ +#define DB_SET_TXN_TIMEOUT 35 /* set_timout() */ +#define DB_UPDATE_SECONDARY 36 /* c_get(), c_del() (internal) */ +#define DB_WRITECURSOR 37 /* cursor() */ +#define DB_WRITELOCK 38 /* cursor() (internal) */ + +/* This has to change when the max opcode hits 255. */ +#define DB_OPFLAGS_MASK 0x000000ff /* Mask for operations flags. */ +/* DB_DIRTY_READ 0x01000000 Dirty Read. */ +#define DB_FLUSH 0x02000000 /* Flush data to disk. */ +#define DB_MULTIPLE 0x04000000 /* Return multiple data values. */ +#define DB_MULTIPLE_KEY 0x08000000 /* Return multiple data/key pairs. */ +#define DB_NOCOPY 0x10000000 /* Don't copy data */ +#define DB_PERMANENT 0x20000000 /* Flag record with REP_PERMANENT. */ +#define DB_RMW 0x40000000 /* Acquire write flag immediately. */ +#define DB_WRNOSYNC 0x80000000 /* Private: write, don't sync log_put */ + +/* + * 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. + */ +/* DB (public) error return codes. */ +#define DB_DONOTINDEX (-30999)/* "Null" return from 2ndary callbk. */ +#define DB_KEYEMPTY (-30998)/* Key/data deleted or never created. */ +#define DB_KEYEXIST (-30997)/* The key/data pair already exists. */ +#define DB_LOCK_DEADLOCK (-30996)/* Deadlock. */ +#define DB_LOCK_NOTGRANTED (-30995)/* Lock unavailable. */ +#define DB_NOSERVER (-30994)/* Server panic return. */ +#define DB_NOSERVER_HOME (-30993)/* Bad home sent to server. */ +#define DB_NOSERVER_ID (-30992)/* Bad ID sent to server. */ +#define DB_NOTFOUND (-30991)/* Key/data pair not found (EOF). */ +#define DB_OLD_VERSION (-30990)/* Out-of-date version. */ +#define DB_PAGE_NOTFOUND (-30989)/* Requested page not found. */ +#define DB_REP_DUPMASTER (-30988)/* There are two masters. */ +#define DB_REP_HOLDELECTION (-30987)/* Time to hold an election. */ +#define DB_REP_NEWMASTER (-30986)/* We have learned of a new master. */ +#define DB_REP_NEWSITE (-30985)/* New site entered system. */ +#define DB_REP_OUTDATED (-30984)/* Site is too far behind master. */ +#define DB_REP_UNAVAIL (-30983)/* Site cannot currently be reached. */ +#define DB_RUNRECOVERY (-30982)/* Panic return. */ +#define DB_SECONDARY_BAD (-30981)/* Secondary index corrupt. */ +#define DB_VERIFY_BAD (-30980)/* Verify failed; bad format. */ + +/* DB (private) error return codes. */ +#define DB_ALREADY_ABORTED (-30899) +#define DB_DELETED (-30898)/* Recovery file marked deleted. */ +#define DB_JAVA_CALLBACK (-30897)/* Exception during a java callback. */ +#define DB_LOCK_NOTEXIST (-30896)/* Object to lock is gone. */ +#define DB_NEEDSPLIT (-30895)/* Page needs to be split. */ +#define DB_SURPRISE_KID (-30894)/* Child commit where parent + didn't know it was a parent. */ +#define DB_SWAPBYTES (-30893)/* Database needs byte swapping. */ +#define DB_TIMEOUT (-30892)/* Timed out waiting for election. */ +#define DB_TXN_CKP (-30891)/* Encountered ckp record in log. */ +#define DB_VERIFY_FATAL (-30890)/* 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_CACHE_PRIORITY priority; /* Priority in the buffer pool. */ + + DB_MUTEX *mutexp; /* Synchronization for free threading */ + + 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. */ + + long cl_id; /* RPC: remote client id. */ + + /* + * 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. + * LIST_ENTRY(__db) dblistlinks; + */ + struct { + struct __db *le_next; + struct __db **le_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; + + /* 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. */ + + /* Methods. */ + 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 (*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 (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)); + int (*get_byteswapped) __P((DB *, int *)); + 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 (*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))); + int (*set_alloc) __P((DB *, void *(*)(size_t), + void *(*)(void *, size_t), void (*)(void *))); + int (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int)); + int (*set_cache_priority) __P((DB *, DB_CACHE_PRIORITY)); + 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 char *, 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_lorder) __P((DB *, int)); + int (*set_pagesize) __P((DB *, u_int32_t)); + int (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int))); + int (*stat) __P((DB *, void *, 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 (*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 (*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_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 (*set_q_extentsize) __P((DB *, u_int32_t)); + + int (*db_am_remove) __P((DB *, + DB_TXN *, const char *, const char *, DB_LSN *)); + int (*db_am_rename) __P((DB *, DB_TXN *, + const char *, const char *, const char *)); + + /* + * 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. */ + +#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_IN_RENAME 0x00004000 /* File is being renamed. */ +#define DB_AM_OPEN_CALLED 0x00008000 /* DB->open called. */ +#define DB_AM_PAD 0x00010000 /* Fixed-length record pad. */ +#define DB_AM_PGDEF 0x00020000 /* Page size was defaulted. */ +#define DB_AM_RDONLY 0x00040000 /* Database is readonly. */ +#define DB_AM_RECNUM 0x00080000 /* DB_RECNUM. */ +#define DB_AM_RECOVER 0x00100000 /* DB opened by recovery routine. */ +#define DB_AM_RENUMBER 0x00200000 /* DB_RENUMBER. */ +#define DB_AM_REVSPLITOFF 0x00400000 /* DB_REVSPLITOFF. */ +#define DB_AM_SECONDARY 0x00800000 /* Database is a secondary index. */ +#define DB_AM_SNAPSHOT 0x01000000 /* DB_SNAPSHOT. */ +#define DB_AM_SUBDB 0x02000000 /* Subdatabases supported. */ +#define DB_AM_SWAP 0x04000000 /* Pages need to be byte-swapped. */ +#define DB_AM_TXN 0x08000000 /* Opened in a transaction. */ +#define DB_AM_VERIFYING 0x10000000 /* DB handle is in the verifier. */ + u_int32_t flags; +}; + +/* + * Macros for bulk get. Note that wherever we use a DBT *, we explicitly + * cast it; this allows the same macros to work with C++ Dbt *'s, as Dbt + * is a subclass of struct DBT in C++. + */ +#define DB_MULTIPLE_INIT(pointer, dbt) \ + (pointer = (u_int8_t *)((DBT *)(dbt))->data + \ + ((DBT *)(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 *)(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 *)(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 *)(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 *)(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 *)(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. */ + + u_int32_t lid; /* Default process' locker id. */ + 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; /* Lock held on this cursor. */ + + long cl_id; /* Remote client id. */ + + DBTYPE dbtype; /* Cursor type. */ + + DBC_INTERNAL *internal; /* Access method private. */ + + int (*c_close) __P((DBC *)); /* Methods: public. */ + 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)); + + /* Methods: private. */ + 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 *)); + + /* Private: for secondary indices. */ + int (*c_real_get) __P((DBC *, DBT *, DBT *, u_int32_t)); + +#define DBC_ACTIVE 0x0001 /* Cursor in use. */ +#define DBC_COMPENSATE 0x0002 /* Cursor compensating, don't lock. */ +#define DBC_DIRTY_READ 0x0004 /* Cursor supports dirty reads. */ +#define DBC_OPD 0x0008 /* Cursor references off-page dups. */ +#define DBC_RECOVER 0x0010 /* Recovery cursor; don't log/lock. */ +#define DBC_RMW 0x0020 /* Acquire write flag in read op. */ +#define DBC_TRANSIENT 0x0040 /* Cursor is transient. */ +#define DBC_WRITECURSOR 0x0080 /* Cursor may be used to write (CDB). */ +#define DBC_WRITEDUP 0x0100 /* idup'ed DBC_WRITECURSOR (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. */ + 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_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. */ + 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_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. */ +}; + +/* 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. */ + +typedef enum { + DB_NOTICE_LOGFILE_CHANGED +} db_notices; + +/* Database Environment handle. */ +struct __db_env { + /******************************************************* + * Public: owned by the application. + *******************************************************/ + FILE *db_errfile; /* Error message file stream. */ + const char *db_errpfx; /* Error message prefix. */ + /* Callbacks. */ + void (*db_errcall) __P((const char *, char *)); + void (*db_feedback) __P((DB_ENV *, int, int)); + void (*db_paniccall) __P((DB_ENV *, int)); + void (*db_noticecall) __P((DB_ENV *, db_notices)); + + /* App-specified alloc functions. */ + void *(*db_malloc) __P((size_t)); + void *(*db_realloc) __P((void *, size_t)); + void (*db_free) __P((void *)); + + /* + * 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_CHKPOINT 0x0001 /* List checkpoints. */ +#define DB_VERB_DEADLOCK 0x0002 /* Deadlock detection information. */ +#define DB_VERB_RECOVERY 0x0004 /* Recovery information. */ +#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)); + + /* Locking. */ + u_int8_t *lk_conflicts; /* Two dimensional conflict matrix. */ + u_int32_t 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. */ + + /* Memory pool. */ + u_int32_t mp_gbytes; /* Cachesize: GB. */ + u_int32_t mp_bytes; /* Cachesize: Bytes. */ + size_t mp_size; /* DEPRECATED: Cachesize: bytes. */ + int mp_ncache; /* Number of cache regions. */ + size_t mp_mmapsize; /* Maximum file size for mmap. */ + + int rep_eid; /* environment id. */ + + /* 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. */ + + /******************************************************* + * Private: owned by DB. + *******************************************************/ + int panic_errval; /* Panic causing errno. */ + + /* 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. */ + + void *reginfo; /* REGINFO structure reference. */ + DB_FH *lockfhp; /* fcntl(2) locking file handle. */ + + 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. */ + long cl_id; /* RPC: remote client env id. */ + + 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 + * 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. + * LIST_HEAD(dblist, __db); + */ + DB_MUTEX *dblist_mutexp; /* Mutex. */ + struct { + struct __db *lh_first; + } dblist; + + /* + * XA support. + * + * !!! + * Explicit representations of structures from queue.h. + * TAILQ_ENTRY(__db_env) links; + */ + struct { + struct __db_env *tqe_next; + struct __db_env **tqe_prev; + } links; + int xa_rmid; /* XA Resource Manager ID. */ + DB_TXN *xa_txn; /* XA Current transaction. */ + + /* 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. */ + int mti; /* Mersenne Twister index. */ + u_long *mt; /* Mersenne Twister state vector. */ + + /* DB_ENV Methods. */ + 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 (*open) __P((DB_ENV *, const char *, u_int32_t, int)); + int (*remove) __P((DB_ENV *, const char *, u_int32_t)); + int (*set_data_dir) __P((DB_ENV *, const char *)); + 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_encrypt) __P((DB_ENV *, const char *, u_int32_t)); + void (*set_errcall) __P((DB_ENV *, void (*)(const char *, char *))); + void (*set_errfile) __P((DB_ENV *, FILE *)); + void (*set_errpfx) __P((DB_ENV *, const char *)); + int (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int))); + int (*set_flags) __P((DB_ENV *, u_int32_t, int)); + void (*set_noticecall) __P((DB_ENV *, void (*)(DB_ENV *, db_notices))); + 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 (*set_shm_key) __P((DB_ENV *, long)); + int (*set_tas_spins) __P((DB_ENV *, u_int32_t)); + int (*set_tmp_dir) __P((DB_ENV *, const char *)); + int (*set_verbose) __P((DB_ENV *, u_int32_t, int)); + + void *lg_handle; /* Log handle and methods. */ + int (*set_lg_bsize) __P((DB_ENV *, u_int32_t)); + int (*set_lg_dir) __P((DB_ENV *, const char *)); + int (*set_lg_max) __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)); + + void *lk_handle; /* Lock handle and methods. */ + 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) __P((DB_ENV *, u_int32_t)); + int (*set_lk_max_locks) __P((DB_ENV *, u_int32_t)); + int (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t)); + int (*set_lk_max_objects) __P((DB_ENV *, u_int32_t)); + int (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, int *)); + int (*lock_dump_region) __P((DB_ENV *, char *, FILE *)); + 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_id_set) __P((DB_ENV *, u_int32_t, u_int32_t)); + int (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t)); + int (*lock_vec) __P((DB_ENV *, + u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **)); + int (*lock_downgrade) __P((DB_ENV *, + DB_LOCK *, db_lockmode_t, u_int32_t)); + + void *mp_handle; /* Mpool handle and methods. */ + int (*set_mp_mmapsize) __P((DB_ENV *, size_t)); + int (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int)); + int (*memp_dump_region) __P((DB_ENV *, char *, FILE *)); + int (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t)); + int (*memp_nameop) __P((DB_ENV *, + u_int8_t *, const char *, const char *, const char *)); + 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_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, u_int32_t, int *)); + int (*rep_flush) __P((DB_ENV *)); + int (*rep_process_message) __P((DB_ENV *, DBT *, DBT *, int *)); + int (*rep_start) __P((DB_ENV *, DBT *, u_int32_t)); + int (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t)); + int (*set_rep_election) __P((DB_ENV *, + u_int32_t, u_int32_t, u_int32_t, u_int32_t)); + int (*set_rep_limit) __P((DB_ENV *, u_int32_t, u_int32_t)); + int (*set_rep_request) __P((DB_ENV *, u_int32_t, u_int32_t)); + int (*set_rep_timeout) __P((DB_ENV *, u_int32_t, u_int32_t)); + int (*set_rep_transport) __P((DB_ENV *, int, + int (*) (DB_ENV *, const DBT *, const DBT *, int, u_int32_t))); + + void *tx_handle; /* Txn handle and methods. */ + int (*set_tx_max) __P((DB_ENV *, u_int32_t)); + int (*set_tx_timestamp) __P((DB_ENV *, time_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_id_set) __P((DB_ENV *, 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 (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t)); + +#define DB_TEST_ELECTINIT 1 /* after __rep_elect_init */ +#define DB_TEST_ELECTSEND 2 /* after REP_ELECT msgnit */ +#define DB_TEST_ELECTVOTE1 3 /* after __rep_send_vote 1 */ +#define DB_TEST_ELECTVOTE2 4 /* after __rep_wait */ +#define DB_TEST_ELECTWAIT1 5 /* after REP_VOTE2 */ +#define DB_TEST_ELECTWAIT2 6 /* after __rep_wait 2 */ +#define DB_TEST_PREDESTROY 7 /* before destroy op */ +#define DB_TEST_PREOPEN 8 /* before __os_open */ +#define DB_TEST_POSTDESTROY 9 /* after destroy op */ +#define DB_TEST_POSTLOG 10 /* after logging all pages */ +#define DB_TEST_POSTLOGMETA 11 /* after logging meta in btree */ +#define DB_TEST_POSTOPEN 12 /* after __os_open */ +#define DB_TEST_POSTSYNC 13 /* after syncing the log */ +#define DB_TEST_SUBDB_LOCKS 14 /* subdb locking tests */ + int test_abort; /* Abort 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_FATAL 0x0000080 /* Doing fatal recovery in env. */ +#define DB_ENV_LOCKDOWN 0x0000100 /* DB_LOCKDOWN set. */ +#define DB_ENV_NOLOCKING 0x0000200 /* DB_NOLOCKING set. */ +#define DB_ENV_NOMMAP 0x0000400 /* DB_NOMMAP set. */ +#define DB_ENV_NOPANIC 0x0000800 /* Okay if panic set. */ +#define DB_ENV_OPEN_CALLED 0x0001000 /* DB_ENV->open called. */ +#define DB_ENV_OVERWRITE 0x0002000 /* DB_OVERWRITE set. */ +#define DB_ENV_PRIVATE 0x0004000 /* DB_PRIVATE set. */ +#define DB_ENV_REGION_INIT 0x0008000 /* DB_REGION_INIT set. */ +#define DB_ENV_REP_CLIENT 0x0010000 /* Replication client. */ +#define DB_ENV_REP_LOGSONLY 0x0020000 /* Log files only replication site. */ +#define DB_ENV_REP_MASTER 0x0040000 /* Replication master. */ +#define DB_ENV_RPCCLIENT 0x0080000 /* DB_CLIENT 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_TXN_NOSYNC 0x0800000 /* DB_TXN_NOSYNC set. */ +#define DB_ENV_TXN_WRITE_NOSYNC 0x1000000 /* DB_TXN_WRITE_NOSYNC set. */ +#define DB_ENV_YIELDCPU 0x2000000 /* 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@DB_VERSION_UNIQUE_NAME@(a) +#define dbm_close(a) __db_ndbm_close@DB_VERSION_UNIQUE_NAME@(a) +#define dbm_delete(a, b) __db_ndbm_delete@DB_VERSION_UNIQUE_NAME@(a, b) +#define dbm_dirfno(a) __db_ndbm_dirfno@DB_VERSION_UNIQUE_NAME@(a) +#define dbm_error(a) __db_ndbm_error@DB_VERSION_UNIQUE_NAME@(a) +#define dbm_fetch(a, b) __db_ndbm_fetch@DB_VERSION_UNIQUE_NAME@(a, b) +#define dbm_firstkey(a) __db_ndbm_firstkey@DB_VERSION_UNIQUE_NAME@(a) +#define dbm_nextkey(a) __db_ndbm_nextkey@DB_VERSION_UNIQUE_NAME@(a) +#define dbm_open(a, b, c) __db_ndbm_open@DB_VERSION_UNIQUE_NAME@(a, b, c) +#define dbm_pagfno(a) __db_ndbm_pagfno@DB_VERSION_UNIQUE_NAME@(a) +#define dbm_rdonly(a) __db_ndbm_rdonly@DB_VERSION_UNIQUE_NAME@(a) +#define dbm_store(a, b, c, d) \ + __db_ndbm_store@DB_VERSION_UNIQUE_NAME@(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@DB_VERSION_UNIQUE_NAME@(a) +#define dbmclose __db_dbm_close@DB_VERSION_UNIQUE_NAME@ +#if !defined(__cplusplus) +#define delete(a) __db_dbm_delete@DB_VERSION_UNIQUE_NAME@(a) +#endif +#define fetch(a) __db_dbm_fetch@DB_VERSION_UNIQUE_NAME@(a) +#define firstkey __db_dbm_firstkey@DB_VERSION_UNIQUE_NAME@ +#define nextkey(a) __db_dbm_nextkey@DB_VERSION_UNIQUE_NAME@(a) +#define store(a, b) __db_dbm_store@DB_VERSION_UNIQUE_NAME@(a, b) + +/******************************************************* + * Hsearch historic interface. + *******************************************************/ +typedef enum { + FIND, ENTER +} ACTION; + +typedef struct entry { + char *key; + char *data; +} ENTRY; + +#define hcreate(a) __db_hcreate@DB_VERSION_UNIQUE_NAME@(a) +#define hdestroy __db_hdestroy@DB_VERSION_UNIQUE_NAME@ +#define hsearch(a, b) __db_hsearch@DB_VERSION_UNIQUE_NAME@(a, b) + +#endif /* DB_DBM_HSEARCH */ + +#if defined(__cplusplus) +} +#endif +#endif /* !_DB_H_ */ diff --git a/bdb/include/db_185.h b/bdb/dbinc/db_185.in similarity index 95% rename from bdb/include/db_185.h rename to bdb/dbinc/db_185.in index e50ebb0adb8..86e2290c304 100644 --- a/bdb/include/db_185.h +++ b/bdb/dbinc/db_185.in @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: db_185.h,v 11.4 2000/02/14 02:59:54 bostic Exp $ + * $Id: db_185.in,v 11.8 2002/01/11 15:52:24 bostic Exp $ */ #ifndef _DB_185_H_ @@ -163,13 +163,7 @@ typedef struct { char *bfname; /* btree file name */ } RECNOINFO; -#if defined(__cplusplus) -extern "C" { -#endif -#define dbopen __db185_open -DB *__db185_open __P((const char *, int, int, DBTYPE, const void *)); +/* 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/bdb/dbinc/db_am.h b/bdb/dbinc/db_am.h new file mode 100644 index 00000000000..c5aa424255d --- /dev/null +++ b/bdb/dbinc/db_am.h @@ -0,0 +1,127 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: db_am.h,v 11.61 2002/08/08 03:20:46 bostic Exp $ + */ +#ifndef _DB_AM_H_ +#define _DB_AM_H_ + +/* + * IS_AUTO_COMMIT -- + * Test for local auto-commit flag or global flag with no local DbTxn + * handle. + */ +#define IS_AUTO_COMMIT(dbenv, txn, flags) \ + (LF_ISSET(DB_AUTO_COMMIT) || \ + ((txn) == NULL && F_ISSET((dbenv), DB_ENV_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 5 +#define DB_REM_PAGE 6 + +/* + * Standard initialization and shutdown macros for all recovery functions. + */ +#define REC_INTRO(func, inc_count) { \ + argp = NULL; \ + dbc = NULL; \ + file_dbp = NULL; \ + mpf = NULL; \ + if ((ret = func(dbenv, dbtp->data, &argp)) != 0) \ + goto out; \ + if ((ret = __dbreg_id_to_db(dbenv, argp->txnid, \ + &file_dbp, argp->fileid, inc_count)) != 0) { \ + if (ret == DB_DELETED) { \ + ret = 0; \ + goto done; \ + } \ + goto out; \ + } \ + if ((ret = file_dbp->cursor(file_dbp, NULL, &dbc, 0)) != 0) \ + goto out; \ + F_SET(dbc, DBC_RECOVER); \ + mpf = file_dbp->mpf; \ +} + +#define REC_CLOSE { \ + int __t_ret; \ + if (argp != NULL) \ + __os_free(dbenv, argp); \ + if (dbc != NULL && \ + (__t_ret = dbc->c_close(dbc)) != 0 && ret == 0) \ + ret = __t_ret; \ + return (ret); \ +} + +/* + * No-op versions of the same macros. + */ +#define REC_NOOP_INTRO(func) { \ + argp = NULL; \ + if ((ret = func(dbenv, dbtp->data, &argp)) != 0) \ + return (ret); \ +} +#define REC_NOOP_CLOSE \ + if (argp != NULL) \ + __os_free(dbenv, argp); \ + return (ret); \ + +/* + * Standard debugging macro for all recovery functions. + */ +#ifdef DEBUG_RECOVER +#define REC_PRINT(func) \ + (void)func(dbenv, dbtp, lsnp, op, info); +#else +#define REC_PRINT(func) +#endif + +/* + * Actions to __db_lget + */ +#define LCK_ALWAYS 1 /* Lock even for off page dup cursors */ +#define LCK_COUPLE 2 /* Lock Couple */ +#define LCK_COUPLE_ALWAYS 3 /* Lock Couple even in txn. */ +#define LCK_DOWNGRADE 4 /* Downgrade the lock. (internal) */ +#define LCK_ROLLBACK 5 /* Lock even if in rollback */ + +/* + * If doing transactions we have to hold the locks associated with a data item + * from a page for the entire transaction. However, we don't have to hold the + * locks associated with walking the tree. Distinguish between the two so that + * we don't tie up the internal pages of the tree longer than necessary. + */ +#define __LPUT(dbc, lock) \ + (LOCK_ISSET(lock) ? \ + (dbc)->dbp->dbenv->lock_put((dbc)->dbp->dbenv, &(lock)) : 0) + +/* + * __TLPUT -- transactional lock put + * If the lock is valid then + * If we are not in a transaction put the lock. + * Else if the cursor is doing dirty reads and this was a read then + * put the lock. + * Else if the db is supporting dirty reads and this is a write then + * downgrade it. + * Else do nothing. + */ +#define __TLPUT(dbc, lock) \ + (LOCK_ISSET(lock) ? __db_lput(dbc, &(lock)) : 0) + +typedef struct { + DBC *dbc; + int count; +} db_trunc_param; + +#include "dbinc/db_dispatch.h" +#include "dbinc_auto/db_auto.h" +#include "dbinc_auto/crdel_auto.h" +#include "dbinc_auto/db_ext.h" +#endif /* !_DB_AM_H_ */ diff --git a/bdb/dbinc/db_cxx.in b/bdb/dbinc/db_cxx.in new file mode 100644 index 00000000000..6752b36ec42 --- /dev/null +++ b/bdb/dbinc/db_cxx.in @@ -0,0 +1,795 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: db_cxx.in,v 11.113 2002/08/23 13:02:27 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 + +@cxx_have_stdheaders@ +#ifdef HAVE_CXX_STDHEADERS +#include +#define __DB_OSTREAMCLASS std::ostream +#else +#include +#define __DB_OSTREAMCLASS ostream +#endif + +#include "db.h" +#include "cxx_common.h" +#include "cxx_except.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 Dbt; // forward +class DbTxn; // forward + +// These classes are not defined here and should be invisible +// to the user, but some compilers require forward references. +// There is one for each use of the DEFINE_DB_CLASS macro. + +class DbImp; +class DbEnvImp; +class DbMpoolFileImp; +class DbTxnImp; + +// DEFINE_DB_CLASS defines an imp_ data member and imp() accessor. +// The underlying type is a pointer to an opaque *Imp class, that +// gets converted to the correct implementation class by the implementation. +// +// Since these defines use "private/public" labels, and leave the access +// being "private", we always use these by convention before any data +// members in the private section of a class. Keeping them in the +// private section also emphasizes that they are off limits to user code. +// +#define DEFINE_DB_CLASS(name) \ + public: class name##Imp* imp() { return (imp_); } \ + public: const class name##Imp* constimp() const { return (imp_); } \ + private: class name##Imp* imp_ + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// 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(disable: 4201 4514) + +#endif + +// 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); +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Lock classes +// + +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 classes +// + +class _exported DbLsn : protected DB_LSN +{ + friend class DbEnv; // friendship needed to cast to base class + friend class DbLogc; // friendship needed to cast to base class +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Memory pool classes +// + +class _exported DbMpoolFile +{ + friend class DbEnv; + +private: + // Put this first to allow inlining with some C++ compilers (g++-2.95) + DEFINE_DB_CLASS(DbMpoolFile); + +public: + int close(u_int32_t flags); + int get(db_pgno_t *pgnoaddr, u_int32_t flags, void *pagep); + void last_pgno(db_pgno_t *pgnoaddr); + int open(const char *file, u_int32_t flags, int mode, size_t pagesize); + int put(void *pgaddr, u_int32_t flags); + void refcnt(db_pgno_t *pgnoaddr); + int set(void *pgaddr, u_int32_t flags); + int set_clear_len(u_int32_t len); + int set_fileid(u_int8_t *fileid); + int set_ftype(int ftype); + int set_lsn_offset(int32_t offset); + int set_pgcookie(DBT *dbt); + void set_unlink(int); + int sync(); + + virtual DB_MPOOLFILE *get_DB_MPOOLFILE() + { + return (DB_MPOOLFILE *)imp(); + } + + virtual const DB_MPOOLFILE *get_const_DB_MPOOLFILE() const + { + return (const DB_MPOOLFILE *)constimp(); + } + +private: + // 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]; +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Transaction classes +// + +class _exported DbTxn +{ + friend class DbEnv; + +private: + // Put this first to allow inlining with some C++ compilers (g++-2.95) + DEFINE_DB_CLASS(DbTxn); + +public: + int abort(); + int commit(u_int32_t flags); + int discard(u_int32_t flags); + u_int32_t id(); + int prepare(u_int8_t *gid); + int set_timeout(db_timeout_t timeout, u_int32_t flags); + + virtual DB_TXN *get_DB_TXN() + { + return (DB_TXN *)imp(); + } + + virtual const DB_TXN *get_const_DB_TXN() const + { + return (const DB_TXN *)constimp(); + } + + 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: + // 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 &); +}; + +// +// 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; + +private: + // Put this first to allow inlining with some C++ compilers (g++-2.95) + DEFINE_DB_CLASS(DbEnv); + +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 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 void *get_app_private() const; + virtual int open(const char *, u_int32_t, int); + virtual int remove(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_cachesize(u_int32_t, u_int32_t, int); + virtual int set_data_dir(const char *); + virtual int set_encrypt(const char *, int); + virtual void set_errcall(void (*)(const char *, char *)); + virtual void set_errfile(FILE *); + virtual void set_errpfx(const char *); + virtual int set_flags(u_int32_t, int); + virtual int set_feedback(void (*)(DbEnv *, int, int)); + virtual int set_lg_bsize(u_int32_t); + virtual int set_lg_dir(const char *); + virtual int set_lg_max(u_int32_t); + virtual int set_lg_regionmax(u_int32_t); + virtual int set_lk_conflicts(u_int8_t *, int); + virtual int set_lk_detect(u_int32_t); + virtual int set_lk_max(u_int32_t); + virtual int set_lk_max_lockers(u_int32_t); + virtual int set_lk_max_locks(u_int32_t); + virtual int set_lk_max_objects(u_int32_t); + virtual int set_mp_mmapsize(size_t); + virtual int set_paniccall(void (*)(DbEnv *, int)); + virtual int set_rpc_server(void *, char *, long, long, u_int32_t); + virtual int set_shm_key(long); + virtual int set_timeout(db_timeout_t timeout, u_int32_t flags); + virtual int set_tmp_dir(const char *); + virtual int set_tas_spins(u_int32_t); + virtual int set_tx_max(u_int32_t); + virtual int set_app_dispatch(int (*)(DbEnv *, + Dbt *, DbLsn *, db_recops)); + virtual int set_tx_timestamp(time_t *); + virtual int set_verbose(u_int32_t which, int onoff); + + // 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 void set_error_stream(__DB_OSTREAMCLASS *); + + // used internally + static void runtime_error(const char *caller, int err, + int error_policy); + static void runtime_error_dbt(const char *caller, Dbt *dbt, + int error_policy); + static void runtime_error_lock_get(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_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_stat(DB_LOG_STAT **spp, 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_sync(DbLsn *lsn); + virtual int memp_trickle(int pct, int *nwrotep); + + // 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); + + // Replication functions + // + virtual int rep_elect(int, int, u_int32_t, int *); + virtual int rep_process_message(Dbt *, Dbt *, int *); + virtual int rep_start(Dbt *, u_int32_t); + virtual int rep_stat(DB_REP_STAT **statp, u_int32_t flags); + virtual int set_rep_limit(u_int32_t, u_int32_t); + virtual int set_rep_transport(u_int32_t, + int (*)(DbEnv *, const Dbt *, const Dbt *, int, u_int32_t)); + + // Conversion functions + // + virtual DB_ENV *get_DB_ENV() + { + return (DB_ENV *)imp(); + } + + virtual const DB_ENV *get_const_DB_ENV() const + { + return (const DB_ENV *)constimp(); + } + + static DbEnv* get_DbEnv(DB_ENV *dbenv) + { + return (DbEnv *)dbenv->api1_internal; + } + + static const DbEnv* get_const_DbEnv(const DB_ENV *dbenv) + { + return (const DbEnv *)dbenv->api1_internal; + } + + // 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 void _stream_error_function(const char *, char *); + 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 int _rep_send_intercept(DB_ENV *env, + const DBT *cntrl, const DBT *data, + int id, u_int32_t flags); + +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 + int construct_error_; + u_int32_t construct_flags_; + int (*app_dispatch_callback_)(DbEnv *, Dbt *, DbLsn *, db_recops); + void (*feedback_callback_)(DbEnv *, int, int); + 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 *, int, u_int32_t); + + // class data + static __DB_OSTREAMCLASS *error_stream_; +}; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// Table access classes +// + +// +// Represents a database table = a set of keys with associated values. +// +class _exported Db +{ + friend class DbEnv; + +private: + // Put this first to allow inlining with some C++ compilers (g++-2.95) + DEFINE_DB_CLASS(Db); + +public: + Db(DbEnv*, u_int32_t); // create a Db object, then call open() + virtual ~Db(); // does *not* call close. + + // 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 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_type(DBTYPE *); + 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 set_bt_maxkey(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 set_cachesize(u_int32_t, u_int32_t, int); + virtual int set_cache_priority(DB_CACHE_PRIORITY); + virtual int set_dup_compare(dup_compare_fcn_type); /*deprecated*/ + virtual int set_dup_compare(int (*)(Db *, const Dbt *, const Dbt *)); + virtual int set_encrypt(const char *, int); + virtual void set_errcall(void (*)(const char *, char *)); + virtual void set_errfile(FILE *); + virtual void set_errpfx(const char *); + virtual int set_feedback(void (*)(Db *, int, int)); + virtual int set_flags(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 set_h_nelem(u_int32_t); + virtual int set_lorder(int); + virtual int set_pagesize(u_int32_t); + virtual int set_paniccall(void (*)(DbEnv *, int)); + virtual int set_re_delim(int); + virtual int set_re_len(u_int32_t); + virtual int set_re_pad(int); + virtual int set_re_source(char *); + virtual int set_q_extentsize(u_int32_t); + virtual int stat(void *sp, 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_OSTREAMCLASS *, u_int32_t); + + // These additional methods are not in the C interface, and + // are only available for C++. + // + virtual void set_error_stream(__DB_OSTREAMCLASS *); + + virtual DB *get_DB() + { + return (DB *)imp(); + } + + virtual const DB *get_const_DB() const + { + return (const DB *)constimp(); + } + + 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 + DbEnv *env_; + 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); +}; + +// +// A chunk of data, maybe a key or value. +// +class _exported Dbt : private DBT +{ + friend class Dbc; + friend class Db; + friend class DbEnv; + friend class DbLogc; + +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. +}; + +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 &); +}; + +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 &); +}; +#endif /* !_DB_CXX_H_ */ diff --git a/bdb/include/db_dispatch.h b/bdb/dbinc/db_dispatch.h similarity index 74% rename from bdb/include/db_dispatch.h rename to bdb/dbinc/db_dispatch.h index 003acee6f65..283eb1e95de 100644 --- a/bdb/include/db_dispatch.h +++ b/bdb/dbinc/db_dispatch.h @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: db_dispatch.h,v 11.17 2000/12/14 07:39:13 ubell Exp $ + * $Id: db_dispatch.h,v 11.30 2002/06/20 19:34:03 margo Exp $ */ #ifndef _DB_DISPATCH_H_ @@ -43,13 +43,31 @@ * recovery. This is a generic list used to pass along whatever information * we need during recovery. */ +typedef enum { + TXNLIST_DELETE, + TXNLIST_LSN, + TXNLIST_PGNO, + TXNLIST_TXNID +} db_txnlist_type; + +#define DB_TXNLIST_MASK(hp, n) (n % hp->nslots) struct __db_txnhead { - LIST_HEAD(__db_headlink, __db_txnlist) head; - u_int32_t maxid; - int32_t generation; + u_int32_t maxid; /* Maximum transaction id. */ + DB_LSN maxlsn; /* Maximum commit lsn. */ + DB_LSN ckplsn; /* LSN of last retained checkpoint. */ + DB_LSN trunc_lsn; /* Lsn to which we are going to truncate; + * make sure we abort anyone after this. */ + int32_t generation; /* Current generation number. */ + int32_t gen_alloc; /* Number of generations allocated. */ + struct { + int32_t generation; + u_int32_t txn_min; + u_int32_t txn_max; + } *gen_array; /* Array of txnids associted with a gen. */ + int nslots; + LIST_HEAD(__db_headlink, __db_txnlist) head[1]; }; -#define TXNLIST_INVALID_ID 0xffffffff struct __db_txnlist { db_txnlist_type type; LIST_ENTRY(__db_txnlist) links; @@ -57,17 +75,9 @@ struct __db_txnlist { struct { u_int32_t txnid; int32_t generation; - int32_t aborted; + int32_t status; } t; struct { -#define TXNLIST_FLAG_DELETED 0x1 -#define TXNLIST_FLAG_CLOSED 0x2 - u_int32_t flags; - int32_t fileid; - u_int32_t count; - char *fname; - } d; - struct { int32_t ntxns; int32_t maxn; DB_LSN *lsn_array; @@ -75,6 +85,7 @@ struct __db_txnlist { struct { int32_t nentries; int32_t maxentry; + int32_t locked; char *fname; int32_t fileid; db_pgno_t *pgno_array; @@ -87,9 +98,8 @@ struct __db_txnlist { * 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 #define DB_user_BEGIN 10000 -#endif +#endif /* !_DB_DISPATCH_H_ */ diff --git a/bdb/include/db_int.src b/bdb/dbinc/db_int.in similarity index 55% rename from bdb/include/db_int.src rename to bdb/dbinc/db_int.in index 347169ab5cd..2f46293a65d 100644 --- a/bdb/include/db_int.src +++ b/bdb/dbinc/db_int.in @@ -1,20 +1,19 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: db_int.src,v 11.42 2001/01/11 17:49:17 krinsky Exp $ + * $Id: db_int.in,v 11.106 2002/09/10 02:48:08 bostic Exp $ */ #ifndef _DB_INTERNAL_H_ #define _DB_INTERNAL_H_ /******************************************************* - * General includes. + * 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. *******************************************************/ -#include "db.h" - #ifndef NO_SYSTEM_INCLUDES #if defined(__STDC__) || defined(__cplusplus) #include @@ -24,8 +23,10 @@ #include #endif -#include "queue.h" -#include "shqueue.h" +#include "db.h" + +#include "dbinc/queue.h" +#include "dbinc/shqueue.h" #if defined(__cplusplus) extern "C" { @@ -43,10 +44,19 @@ extern "C" { #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)) -#define RECNO_OOB 0 /* Illegal record number. */ +/* Minimum number of pages cached, by default. */ +#define DB_MINPAGECACHE 16 /* * If we are unable to determine the underlying filesystem block size, use @@ -79,12 +89,25 @@ extern "C" { /* Align an integer to a specific boundary. */ #undef ALIGN -#define ALIGN(value, bound) \ - (((value) + (bound) - 1) & ~(((u_int)bound) - 1)) +#define ALIGN(v, bound) (((v) + (bound) - 1) & ~(((db_align_t)bound) - 1)) -/* Align a pointer to a specific boundary. */ -#undef ALIGNP -#define ALIGNP(value, bound) ALIGN((db_alignp_t)value, bound) +/* + * 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)(db_alignp_t)(p)) + +/* + * Convert a pointer to a small integral value. + * + * The (u_int16_t)(db_alignp_t) cast avoids warnings: the (db_alignp_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 db_alignp_t. + */ +#define P_TO_UINT32(p) ((u_int32_t)(db_alignp_t)(p)) +#define P_TO_UINT16(p) ((u_int16_t)(db_alignp_t)(p)) /* * There are several on-page structures that are declared to have a number of @@ -100,17 +123,10 @@ extern "C" { * an array. */ #undef SSZ -#define SSZ(name, field) ((int)&(((name *)0)->field)) +#define SSZ(name, field) P_TO_UINT16(&(((name *)0)->field)) #undef SSZA -#define SSZA(name, field) ((int)&(((name *)0)->field[0])) - -/* - * 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)(db_alignp_t)(p)) +#define SSZA(name, field) P_TO_UINT16(&(((name *)0)->field[0])) /* Structure used to print flag values. */ typedef struct __fn { @@ -125,9 +141,9 @@ typedef struct __fn { #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)) +#define LF_CLR(f) ((flags) &= ~(f)) +#define LF_ISSET(f) ((flags) & (f)) +#define LF_SET(f) ((flags) |= (f)) /* Display separator string. */ #undef DB_LINE @@ -136,6 +152,29 @@ typedef struct __fn { /* Unused, or not-used-yet variable. "Shut that bloody compiler up!" */ #define COMPQUIET(n, v) (n) = (v) +/******************************************************* + * 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) DB_RETOK_DBGET(ret) +#define DB_RETOK_DBCPUT(ret) ((ret) == 0 || (ret) == DB_KEYEXIST || \ + (ret) == DB_NOTFOUND) +#define DB_RETOK_DBDEL(ret) ((ret) == 0 || (ret) == DB_NOTFOUND) +#define DB_RETOK_DBGET(ret) ((ret) == 0 || (ret) == DB_KEYEMPTY || \ + (ret) == DB_NOTFOUND) +#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_NEWMASTER || \ + (ret) == DB_REP_NEWSITE) + /******************************************************* * Files. *******************************************************/ @@ -148,19 +187,20 @@ typedef struct __fn { #define MAXPATHLEN 1024 #define PATH_DOT "." /* Current working directory. */ -#define PATH_SEPARATOR "/" /* Path separator character. */ +#define PATH_SEPARATOR "/" /* Path separator character(s). */ /* * Flags understood by __os_open. */ -#define DB_OSO_CREATE 0x001 /* POSIX: O_CREAT */ -#define DB_OSO_EXCL 0x002 /* POSIX: O_EXCL */ -#define DB_OSO_LOG 0x004 /* Opening a log file. */ -#define DB_OSO_RDONLY 0x008 /* POSIX: O_RDONLY */ -#define DB_OSO_REGION 0x010 /* Opening a region file. */ -#define DB_OSO_SEQ 0x020 /* Expected sequential access. */ -#define DB_OSO_TEMP 0x040 /* Remove after last close. */ -#define DB_OSO_TRUNC 0x080 /* POSIX: O_TRUNC */ +#define DB_OSO_CREATE 0x0001 /* POSIX: O_CREAT */ +#define DB_OSO_DIRECT 0x0002 /* Don't buffer the file in the OS. */ +#define DB_OSO_EXCL 0x0004 /* POSIX: O_EXCL */ +#define DB_OSO_LOG 0x0008 /* Opening a log file. */ +#define DB_OSO_RDONLY 0x0010 /* POSIX: O_RDONLY */ +#define DB_OSO_REGION 0x0020 /* Opening a region file. */ +#define DB_OSO_SEQ 0x0040 /* Expected sequential access. */ +#define DB_OSO_TEMP 0x0080 /* Remove after last close. */ +#define DB_OSO_TRUNC 0x0100 /* POSIX: O_TRUNC */ /* * Seek options understood by __os_seek. @@ -184,15 +224,19 @@ typedef enum { /* * CDB_LOCKING CDB product locking. + * CRYPTO_ON Security has been configured. * LOCKING_ON Locking has been configured. * LOGGING_ON Logging has been configured. * MPOOL_ON Memory pool has been configured. + * RPC_ON RPC has been configured. * TXN_ON Transactions have been configured. */ #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 RPC_ON(dbenv) ((dbenv)->cl_handle != NULL) #define TXN_ON(dbenv) ((dbenv)->tx_handle != NULL) /* @@ -205,21 +249,24 @@ typedef enum { !CDB_LOCKING((dbc)->dbp->dbenv) && LOCKING_ON((dbc)->dbp->dbenv)) /* - * IS_RECOVERING The system is running recovery. + * IS_RECOVERING: The system is running recovery. */ #define IS_RECOVERING(dbenv) \ (LOGGING_ON(dbenv) && \ F_ISSET((DB_LOG *)(dbenv)->lg_handle, DBLOG_RECOVER)) -/* Most initialization methods cannot be called after open is called. */ +/* 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, subsystem) \ +#define ENV_REQUIRES_CONFIG(dbenv, handle, i, flags) \ if (handle == NULL) \ - return (__db_env_config(dbenv, subsystem)); + return (__db_env_config(dbenv, i, flags)); /******************************************************* * Database Access Methods. @@ -233,15 +280,15 @@ typedef enum { /* Initialization methods are often illegal before/after open is called. */ #define DB_ILLEGAL_AFTER_OPEN(dbp, name) \ - if (F_ISSET((dbp), DB_OPEN_CALLED)) \ - return (__db_mi_open(dbp->dbenv, name, 1)); + 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_OPEN_CALLED)) \ - return (__db_mi_open(dbp->dbenv, name, 0)); + 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)); + 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) \ @@ -267,12 +314,49 @@ 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(sdbp, dbt) \ + if (F_ISSET((dbt), DB_DBT_APPMALLOC)) { \ + __os_ufree((sdbp)->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. *******************************************************/ @@ -285,7 +369,8 @@ struct __dbc_internal { /* Structure used as the DB pgin/pgout pgcookie. */ typedef struct __dbpginfo { size_t db_pagesize; /* Underlying page size. */ - int needswap; /* If swapping required. */ + u_int32_t flags; /* Some DB_AM flags needed. */ + DBTYPE type; /* DB type */ } DB_PGINFO; /******************************************************* @@ -296,102 +381,93 @@ typedef struct __dbpginfo { (LSN).file = 0; \ (LSN).offset = 0; \ } while (0) - -/* Return 1 if LSN is a 'zero' lsn, otherwise return 0. */ #define IS_ZERO_LSN(LSN) ((LSN).file == 0) -/* Test if we need to log a change. */ -#define DB_LOGGING(dbc) \ - (LOGGING_ON((dbc)->dbp->dbenv) && !F_ISSET(dbc, DBC_RECOVER)) +#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_T_MAX; \ + (LSN).offset = UINT32_T_MAX; \ +} while (0) +#define IS_MAX_LSN(LSN) \ + ((LSN).file == UINT32_T_MAX && (LSN).offset == UINT32_T_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) + +/* + * 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) && !F_ISSET((dbenv), DB_ENV_REP_CLIENT) && \ + (!IS_RECOVERING(dbenv))) + +/* + * Test if we need to log a change. Note that 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/DB_ENV_REP_CLIENT here because we don't + * want to have 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. + */ +#define DBC_LOGGING(dbc) \ + (LOGGING_ON((dbc)->dbp->dbenv) && !F_ISSET((dbc), DBC_RECOVER) && \ + !F_ISSET((dbc)->dbp->dbenv, DB_ENV_REP_CLIENT)) -/* Internal flag for use with internal __log_unregister. */ -#define DB_LOGONLY 0x01 /******************************************************* * Txn. *******************************************************/ #define DB_NONBLOCK(C) ((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT)) -#define IS_SUBTRANSACTION(txn) \ +#define IS_SUBTRANSACTION(txn) \ ((txn) != NULL && (txn)->parent != NULL) /******************************************************* - * Global variables. + * Crypto. *******************************************************/ -#ifdef HAVE_VXWORKS -#include "semLib.h" -#endif +#define DB_IV_BYTES 16 /* Bytes per IV */ +#define DB_MAC_KEY 20 /* Bytes per MAC checksum */ -/* - * DB global variables. Done in a single structure to minimize the name-space - * pollution. - */ -typedef struct __db_globals { - u_int32_t db_pageyield; /* db_set_pageyield */ - u_int32_t db_panic; /* db_set_panic */ - u_int32_t db_region_init; /* db_set_region_init */ - u_int32_t db_tas_spins; /* db_set_tas_spins */ -#ifdef HAVE_VXWORKS - u_int32_t db_global_init; /* VxWorks: inited */ - SEM_ID db_global_lock; /* VxWorks: global semaphore */ -#endif - /* XA: list of opened environments. */ - TAILQ_HEAD(__db_envq, __db_env) db_envq; -} DB_GLOBALS; - -#ifdef DB_INITIALIZE_DB_GLOBALS -DB_GLOBALS __db_global_values = { - 0, /* db_set_pageyield */ - 1, /* db_set_panic */ - 0, /* db_set_region_init */ - 0, /* db_set_tas_spins */ -#ifdef HAVE_VXWORKS - 0, /* db_global_init */ - NULL, /* db_global_lock */ -#endif - /* XA environment queue */ - {NULL, &__db_global_values.db_envq.tqh_first} -}; -#else -extern DB_GLOBALS __db_global_values; -#endif -#define DB_GLOBAL(v) __db_global_values.v - -/* Forward structure declarations. */ +/******************************************************* + * Forward structure declarations. + *******************************************************/ struct __db_reginfo_t; typedef struct __db_reginfo_t REGINFO; -struct __mutex_t; typedef struct __mutex_t MUTEX; +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; -struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST; -struct __db_txnhead; typedef struct __db_txnhead DB_TXNHEAD; -typedef enum { - TXNLIST_DELETE, - TXNLIST_LSN, - TXNLIST_TXNID, - TXNLIST_PGNO -} db_txnlist_type; - -/* - * Currently, region offsets are limited to 32-bits. I expect that's going - * to have to be fixed in the not-too-distant future, since we won't want to - * split 100Gb memory pools into that many different regions. It's typedef'd - * so it won't be too painful to upgrade. - */ -typedef u_int32_t roff_t; #if defined(__cplusplus) } #endif /******************************************************* - * More general includes. + * Remaining general DB includes. *******************************************************/ -#include "debug.h" -#include "mutex.h" -#include "region.h" -#include "mutex_ext.h" -#include "env_ext.h" -#include "os.h" -#include "os_ext.h" -#include "common_ext.h" +@db_int_def@ + +#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/os.h" +#include "dbinc_auto/clib_ext.h" +#include "dbinc_auto/common_ext.h" #endif /* !_DB_INTERNAL_H_ */ diff --git a/bdb/include/db_join.h b/bdb/dbinc/db_join.h similarity index 89% rename from bdb/include/db_join.h rename to bdb/dbinc/db_join.h index d92887bb589..487ce3eebbb 100644 --- a/bdb/include/db_join.h +++ b/bdb/dbinc/db_join.h @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1998, 1999, 2000 + * Copyright (c) 1998-2002 * Sleepycat Software. All rights reserved. * * @(#)db_join.h 11.1 (Sleepycat) 7/25/99 @@ -22,9 +22,10 @@ typedef struct __join_cursor { DBC **j_workcurs; /* Scratch cursor copies to muck with. */ DB *j_primary; /* Primary dbp. */ DBT j_key; /* Used to do lookups. */ + DBT j_rdata; /* Memory used for data return. */ u_int32_t j_ncurs; /* How many cursors do we have? */ #define JOIN_RETRY 0x01 /* Error on primary get; re-return same key. */ u_int32_t flags; } JOIN_CURSOR; -#endif +#endif /* !_DB_JOIN_H_ */ diff --git a/bdb/include/db_page.h b/bdb/dbinc/db_page.h similarity index 77% rename from bdb/include/db_page.h rename to bdb/dbinc/db_page.h index 8066424143b..97497556fd9 100644 --- a/bdb/include/db_page.h +++ b/bdb/dbinc/db_page.h @@ -1,10 +1,10 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: db_page.h,v 11.28 2000/12/06 19:55:45 ubell Exp $ + * $Id: db_page.h,v 11.52 2002/09/13 21:24:04 bostic Exp $ */ #ifndef _DB_PAGE_H_ @@ -65,28 +65,31 @@ extern "C" { * The magic and version numbers have to be in the same place in all versions * of the metadata page as the application may not have upgraded the database. ************************************************************************/ -typedef struct _dbmeta31 { +typedef struct _dbmeta33 { DB_LSN lsn; /* 00-07: LSN. */ db_pgno_t pgno; /* 08-11: Current page number. */ u_int32_t magic; /* 12-15: Magic number. */ u_int32_t version; /* 16-19: Version. */ u_int32_t pagesize; /* 20-23: Pagesize. */ - u_int8_t unused1[1]; /* 24: Unused. */ + u_int8_t encrypt_alg; /* 24: Encryption algorithm. */ u_int8_t type; /* 25: Page type. */ - u_int8_t unused2[2]; /* 26-27: Unused. */ +#define DBMETA_CHKSUM 0x01 + u_int8_t metaflags; /* 26: Meta-only flags */ + u_int8_t unused1; /* 27: Unused. */ u_int32_t free; /* 28-31: Free list page number. */ - DB_LSN unused3; /* 32-39: former Lsn for allocation */ + db_pgno_t last_pgno; /* 32-35: Page number of last page in db. */ + u_int32_t unused3; /* 36-39: Unused. */ u_int32_t key_count; /* 40-43: Cached key count. */ u_int32_t record_count; /* 44-47: Cached record count. */ u_int32_t flags; /* 48-51: Flags: unique to each AM. */ /* 52-71: Unique file ID. */ u_int8_t uid[DB_FILE_ID_LEN]; -} DBMETA31, DBMETA; +} DBMETA33, DBMETA; /************************************************************************ BTREE METADATA PAGE LAYOUT ************************************************************************/ -typedef struct _btmeta31 { +typedef struct _btmeta33 { #define BTM_DUP 0x001 /* Duplicates. */ #define BTM_RECNO 0x002 /* Recno tree. */ #define BTM_RECNUM 0x004 /* Btree: maintain record count. */ @@ -101,17 +104,22 @@ typedef struct _btmeta31 { 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-92: Root page. */ + u_int32_t root; /* 88-91: Root page. */ + u_int32_t unused[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 */ + u_int8_t chksum[DB_MAC_KEY]; /* 496-511: Page chksum */ /* - * Minimum page size is 128. + * Minimum page size is 512. */ -} BTMETA31, BTMETA; +} BTMETA33, BTMETA; /************************************************************************ HASH METADATA PAGE LAYOUT ************************************************************************/ -typedef struct _hashmeta31 { +typedef struct _hashmeta33 { #define DB_HASH_DUP 0x01 /* Duplicates. */ #define DB_HASH_SUBDB 0x02 /* Subdatabases. */ #define DB_HASH_DUPSORT 0x04 /* Duplicates are sorted. */ @@ -126,11 +134,16 @@ typedef struct _hashmeta31 { #define NCACHED 32 /* number of spare points */ /* 96-223: Spare pages for overflow */ u_int32_t spares[NCACHED]; + u_int32_t unused[59]; /* 224-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 */ + u_int8_t chksum[DB_MAC_KEY]; /* 496-511: Page chksum */ /* - * Minimum page size is 256. + * Minimum page size is 512. */ -} HMETA31, HMETA; +} HMETA33, HMETA; /************************************************************************ QUEUE METADATA PAGE LAYOUT @@ -139,27 +152,32 @@ typedef struct _hashmeta31 { * QAM Meta data page structure * */ -typedef struct _qmeta32 { +typedef struct _qmeta33 { DBMETA dbmeta; /* 00-71: Generic meta-data header. */ u_int32_t first_recno; /* 72-75: First not deleted record. */ - u_int32_t cur_recno; /* 76-79: Last recno allocated. */ + u_int32_t cur_recno; /* 76-79: Next recno to be allocated. */ u_int32_t re_len; /* 80-83: Fixed-length record length. */ u_int32_t re_pad; /* 84-87: Fixed-length record pad. */ u_int32_t rec_page; /* 88-91: Records Per Page. */ u_int32_t page_ext; /* 92-95: Pages per extent */ + u_int32_t unused[91]; /* 96-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 */ + u_int8_t chksum[DB_MAC_KEY]; /* 496-511: Page chksum */ /* - * Minimum page size is 128. + * Minimum page size is 512. */ -} QMETA32, QMETA; +} QMETA33, QMETA; /* * DBMETASIZE is a constant used by __db_file_setup and DB->verify * as a buffer which is guaranteed to be larger than any possible * metadata page size and smaller than any disk sector. */ -#define DBMETASIZE 256 +#define DBMETASIZE 512 /************************************************************************ BTREE/HASH MAIN PAGE LAYOUT @@ -170,9 +188,9 @@ typedef struct _qmeta32 { * +-----------------------------------+ * | next pgno | entries | hf offset | * +-----------------------------------+ - * | level | type | index | + * | level | type | chksum | * +-----------------------------------+ - * | index | free --> | + * | iv | index | free --> | * +-----------+-----------------------+ * | F R E E A R E A | * +-----------------------------------+ @@ -181,12 +199,28 @@ typedef struct _qmeta32 { * | item | item | item | * +-----------------------------------+ * - * sizeof(PAGE) == 26 bytes, and the following indices are guaranteed to be - * two-byte aligned. + * sizeof(PAGE) == 26 bytes + possibly 20 bytes of checksum and possibly + * 16 bytes of IV (+ 2 bytes for alignment), and the following indices + * are guaranteed to be two-byte aligned. If we aren't doing crypto or + * checksumming the bytes are reclaimed for data storage. * * For hash and btree leaf pages, index items are paired, e.g., inp[0] is the * key for inp[1]'s data. All other types of pages only contain single items. */ +typedef struct __pg_chksum { + u_int8_t unused[2]; /* 26-27: For alignment */ + u_int8_t chksum[4]; /* 28-31: Checksum */ +} PG_CHKSUM; + +typedef struct __pg_crypto { + u_int8_t unused[2]; /* 26-27: For alignment */ + u_int8_t chksum[DB_MAC_KEY]; /* 28-47: Checksum */ + u_int8_t iv[DB_IV_BYTES]; /* 48-63: IV */ + /* !!! + * Must be 16-byte aligned for crypto + */ +} PG_CRYPTO; + typedef struct _db_page { DB_LSN lsn; /* 00-07: Log sequence number. */ db_pgno_t pgno; /* 08-11: Current page number. */ @@ -207,9 +241,30 @@ typedef struct _db_page { #define MAXBTREELEVEL 255 u_int8_t level; /* 24: Btree tree level. */ u_int8_t type; /* 25: Page type. */ - db_indx_t inp[1]; /* Variable length index of items. */ } PAGE; +#define SIZEOF_PAGE 26 +/* + * !!! + * DB_AM_ENCRYPT always implies DB_AM_CHKSUM so that must come first. + */ +#define P_INP(dbp, pg) \ + ((db_indx_t *)((u_int8_t *)(pg) + SIZEOF_PAGE + \ + (F_ISSET((dbp), DB_AM_ENCRYPT) ? sizeof(PG_CRYPTO) : \ + (F_ISSET((dbp), DB_AM_CHKSUM) ? sizeof(PG_CHKSUM) : 0)))) + +#define P_IV(dbp, pg) \ + (F_ISSET((dbp), DB_AM_ENCRYPT) ? ((u_int8_t *)(pg) + \ + SIZEOF_PAGE + SSZA(PG_CRYPTO, iv)) \ + : NULL) + +#define P_CHKSUM(dbp, pg) \ + (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)) \ + : NULL)) + /* PAGE element macros. */ #define LSN(p) (((PAGE *)p)->lsn) #define PGNO(p) (((PAGE *)p)->pgno) @@ -223,6 +278,15 @@ typedef struct _db_page { /************************************************************************ QUEUE MAIN PAGE LAYOUT ************************************************************************/ +/* + * Sizes of page below. Used to reclaim space if not doing + * crypto or checksumming. If you change the QPAGE below you + * MUST adjust this too. + */ +#define QPAGE_NORMAL 28 +#define QPAGE_CHKSUM 48 +#define QPAGE_SEC 64 + typedef struct _qpage { DB_LSN lsn; /* 00-07: Log sequence number. */ db_pgno_t pgno; /* 08-11: Current page number. */ @@ -230,8 +294,13 @@ typedef struct _qpage { u_int8_t unused1[1]; /* 24: Unused. */ u_int8_t type; /* 25: Page type. */ u_int8_t unused2[2]; /* 26-27: Unused. */ + u_int8_t chksum[DB_MAC_KEY]; /* 28-47: Checksum */ + u_int8_t iv[DB_IV_BYTES]; /* 48-63: IV */ } QPAGE; +#define QPAGE_SZ(dbp) \ + (F_ISSET((dbp), DB_AM_ENCRYPT) ? QPAGE_SEC : \ + F_ISSET((dbp), DB_AM_CHKSUM) ? QPAGE_CHKSUM : QPAGE_NORMAL) /* * !!! * The next_pgno and prev_pgno fields are not maintained for btree and recno @@ -248,8 +317,8 @@ typedef struct _qpage { * the BINTERNAL fields on each access.) Overload the PREV_PGNO field. */ #define RE_NREC(p) \ - ((TYPE(p) == P_IBTREE || TYPE(p) == P_IRECNO) ? \ - PREV_PGNO(p) : (TYPE(p) == P_LBTREE ? NUM_ENT(p) / 2 : NUM_ENT(p))) + ((TYPE(p) == P_IBTREE || TYPE(p) == P_IRECNO) ? PREV_PGNO(p) : \ + (db_pgno_t)(TYPE(p) == P_LBTREE ? NUM_ENT(p) / 2 : NUM_ENT(p))) #define RE_NREC_ADJ(p, adj) \ PREV_PGNO(p) += adj; #define RE_NREC_SET(p, num) \ @@ -273,16 +342,17 @@ typedef struct _qpage { } while (0) /* Page header length (offset to first index). */ -#define P_OVERHEAD (SSZA(PAGE, inp)) +#define P_OVERHEAD(dbp) P_TO_UINT16(P_INP(dbp, 0)) /* First free byte. */ -#define LOFFSET(pg) (P_OVERHEAD + NUM_ENT(pg) * sizeof(db_indx_t)) +#define LOFFSET(dbp, pg) \ + (P_OVERHEAD(dbp) + NUM_ENT(pg) * sizeof(db_indx_t)) /* Free space on a regular page. */ -#define P_FREESPACE(pg) (HOFFSET(pg) - LOFFSET(pg)) +#define P_FREESPACE(dbp, pg) (HOFFSET(pg) - LOFFSET(dbp, pg)) /* Get a pointer to the bytes at a specific index. */ -#define P_ENTRY(pg, indx) ((u_int8_t *)pg + ((PAGE *)pg)->inp[indx]) +#define P_ENTRY(dbp, pg, indx) ((u_int8_t *)pg + P_INP(dbp, pg)[indx]) /************************************************************************ OVERFLOW PAGE LAYOUT @@ -307,10 +377,10 @@ typedef struct _qpage { #define OV_REF(p) (((PAGE *)p)->entries) /* Maximum number of bytes that you can put on an overflow page. */ -#define P_MAXSPACE(psize) ((psize) - P_OVERHEAD) +#define P_MAXSPACE(dbp, psize) ((psize) - P_OVERHEAD(dbp)) /* Free space on an overflow page. */ -#define P_OVFLSPACE(psize, pg) (P_MAXSPACE(psize) - HOFFSET(pg)) +#define P_OVFLSPACE(dbp, psize, pg) (P_MAXSPACE(dbp, psize) - HOFFSET(pg)) /************************************************************************ HASH PAGE LAYOUT @@ -331,7 +401,7 @@ typedef struct _qpage { * structures, there's a pair of macros. */ #define HPAGE_PTYPE(p) (*(u_int8_t *)p) -#define HPAGE_TYPE(pg, indx) (*P_ENTRY(pg, indx)) +#define HPAGE_TYPE(dbp, pg, indx) (*P_ENTRY(dbp, pg, indx)) /* * The first and second types are H_KEYDATA and H_DUPLICATE, represented @@ -361,12 +431,12 @@ typedef struct _hkeydata { * The length of any HKEYDATA item. Note that indx is an element index, * not a PAIR index. */ -#define LEN_HITEM(pg, pgsize, indx) \ +#define LEN_HITEM(dbp, pg, pgsize, indx) \ (((indx) == 0 ? pgsize : \ - ((PAGE *)(pg))->inp[indx - 1]) - ((PAGE *)(pg))->inp[indx]) + (P_INP(dbp, pg)[indx - 1])) - (P_INP(dbp, pg)[indx])) -#define LEN_HKEYDATA(pg, psize, indx) \ - (LEN_HITEM(pg, psize, indx) - HKEYDATA_SIZE(0)) +#define LEN_HKEYDATA(dbp, pg, psize, indx) \ + (db_indx_t)(LEN_HITEM(dbp, pg, psize, indx) - HKEYDATA_SIZE(0)) /* * Page space required to add a new HKEYDATA item to the page, with and @@ -389,13 +459,15 @@ typedef struct _hkeydata { #define H_NUMPAIRS(pg) (NUM_ENT(pg) / 2) #define H_KEYINDEX(indx) (indx) #define H_DATAINDEX(indx) ((indx) + 1) -#define H_PAIRKEY(pg, indx) P_ENTRY(pg, H_KEYINDEX(indx)) -#define H_PAIRDATA(pg, indx) P_ENTRY(pg, H_DATAINDEX(indx)) -#define H_PAIRSIZE(pg, psize, indx) \ - (LEN_HITEM(pg, psize, H_KEYINDEX(indx)) + \ - LEN_HITEM(pg, psize, H_DATAINDEX(indx))) -#define LEN_HDATA(p, psize, indx) LEN_HKEYDATA(p, psize, H_DATAINDEX(indx)) -#define LEN_HKEY(p, psize, indx) LEN_HKEYDATA(p, psize, H_KEYINDEX(indx)) +#define H_PAIRKEY(dbp, pg, indx) P_ENTRY(dbp, pg, H_KEYINDEX(indx)) +#define H_PAIRDATA(dbp, pg, indx) P_ENTRY(dbp, pg, H_DATAINDEX(indx)) +#define H_PAIRSIZE(dbp, pg, psize, indx) \ + (LEN_HITEM(dbp, pg, psize, H_KEYINDEX(indx)) + \ + LEN_HITEM(dbp, pg, psize, H_DATAINDEX(indx))) +#define LEN_HDATA(dbp, p, psize, indx) \ + LEN_HKEYDATA(dbp, p, psize, H_DATAINDEX(indx)) +#define LEN_HKEY(dbp, p, psize, indx) \ + LEN_HKEYDATA(dbp, p, psize, H_KEYINDEX(indx)) /* * The third type is the H_OFFPAGE, represented by the HOFFPAGE structure: @@ -470,8 +542,8 @@ typedef struct _bkeydata { } BKEYDATA; /* Get a BKEYDATA item for a specific index. */ -#define GET_BKEYDATA(pg, indx) \ - ((BKEYDATA *)P_ENTRY(pg, indx)) +#define GET_BKEYDATA(dbp, pg, indx) \ + ((BKEYDATA *)P_ENTRY(dbp, pg, indx)) /* * Page space required to add a new BKEYDATA item to the page, with and @@ -495,15 +567,18 @@ typedef struct _boverflow { } BOVERFLOW; /* Get a BOVERFLOW item for a specific index. */ -#define GET_BOVERFLOW(pg, indx) \ - ((BOVERFLOW *)P_ENTRY(pg, indx)) +#define GET_BOVERFLOW(dbp, pg, indx) \ + ((BOVERFLOW *)P_ENTRY(dbp, pg, indx)) /* * Page space required to add a new BOVERFLOW item to the page, with and - * without the index value. + * without the index value. The (u_int16_t) cast avoids warnings: ALIGN + * casts to db_align_t, the 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 db_align_t. */ #define BOVERFLOW_SIZE \ - ALIGN(sizeof(BOVERFLOW), sizeof(u_int32_t)) + ((u_int16_t)ALIGN(sizeof(BOVERFLOW), sizeof(u_int32_t))) #define BOVERFLOW_PSIZE \ (BOVERFLOW_SIZE + sizeof(db_indx_t)) @@ -532,8 +607,8 @@ typedef struct _binternal { } BINTERNAL; /* Get a BINTERNAL item for a specific index. */ -#define GET_BINTERNAL(pg, indx) \ - ((BINTERNAL *)P_ENTRY(pg, indx)) +#define GET_BINTERNAL(dbp, pg, indx) \ + ((BINTERNAL *)P_ENTRY(dbp, pg, indx)) /* * Page space required to add a new BINTERNAL item to the page, with and @@ -557,8 +632,8 @@ typedef struct _rinternal { } RINTERNAL; /* Get a RINTERNAL item for a specific index. */ -#define GET_RINTERNAL(pg, indx) \ - ((RINTERNAL *)P_ENTRY(pg, indx)) +#define GET_RINTERNAL(dbp, pg, indx) \ + ((RINTERNAL *)P_ENTRY(dbp, pg, indx)) /* * Page space required to add a new RINTERNAL item to the page, with and @@ -573,4 +648,4 @@ typedef struct _rinternal { } #endif -#endif /* _DB_PAGE_H_ */ +#endif /* !_DB_PAGE_H_ */ diff --git a/bdb/include/db_server_int.h b/bdb/dbinc/db_server_int.h similarity index 56% rename from bdb/include/db_server_int.h rename to bdb/dbinc/db_server_int.h index 69e88ea5aec..efec539b2f8 100644 --- a/bdb/include/db_server_int.h +++ b/bdb/dbinc/db_server_int.h @@ -1,10 +1,10 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2000 + * Copyright (c) 2000-2002 * Sleepycat Software. All rights reserved. * - * $Id: db_server_int.h,v 1.13 2001/01/11 18:19:52 bostic Exp $ + * $Id: db_server_int.h,v 1.23 2002/02/12 15:01:24 sue Exp $ */ #ifndef _DB_SERVER_INT_H_ @@ -14,6 +14,21 @@ #define DB_SERVER_MAXTIMEOUT 1200 /* 20 minutes */ #define DB_SERVER_IDLETIMEOUT 86400 /* 1 day */ +/* + * Ignore/mask off the following env->open flags: + * Most are illegal for a client to specify as they would control + * server resource usage. We will just ignore them. + * DB_LOCKDOWN + * DB_PRIVATE + * DB_RECOVER + * DB_RECOVER_FATAL + * DB_SYSTEM_MEM + * DB_USE_ENVIRON, DB_USE_ENVIRON_ROOT - handled on client + */ +#define DB_SERVER_FLAGMASK ( \ +DB_LOCKDOWN | DB_PRIVATE | DB_RECOVER | DB_RECOVER_FATAL | \ +DB_SYSTEM_MEM | DB_USE_ENVIRON | DB_USE_ENVIRON_ROOT) + #define CT_CURSOR 0x001 /* Cursor */ #define CT_DB 0x002 /* Database */ #define CT_ENV 0x004 /* Env */ @@ -28,6 +43,39 @@ struct home_entry { char *home; char *dir; char *name; + char *passwd; +}; + +/* + * Data needed for sharing handles. + * To share an env handle, on the open call, they must have matching + * env flags, and matching set_flags. + * + * To share a db handle on the open call, the db, subdb and flags must + * all be the same. + */ +#define DB_SERVER_ENVFLAGS ( \ +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_DBNOSHARE (DB_EXCL | DB_TRUNCATE) + +typedef struct ct_envdata ct_envdata; +typedef struct ct_dbdata ct_dbdata; +struct ct_envdata { + u_int32_t envflags; + u_int32_t onflags; + u_int32_t offflags; + home_entry *home; +}; + +struct ct_dbdata { + u_int32_t dbflags; + u_int32_t setflags; + char *db; + char *subdb; + DBTYPE type; }; /* @@ -42,18 +90,30 @@ typedef struct ct_entry ct_entry; struct ct_entry { LIST_ENTRY(ct_entry) entries; /* List of entries */ union { +#ifdef __cplusplus + DbEnv *envp; /* H_ENV */ + DbTxn *txnp; /* H_TXN */ + Db *dbp; /* H_DB */ + Dbc *dbc; /* H_CURSOR */ +#else DB_ENV *envp; /* H_ENV */ DB_TXN *txnp; /* H_TXN */ DB *dbp; /* H_DB */ DBC *dbc; /* H_CURSOR */ +#endif void *anyp; } handle_u; + union { /* Private data per type */ + ct_envdata envdp; /* Env info */ + ct_dbdata dbdp; /* Db info */ + } private_u; long ct_id; /* Client ID */ long *ct_activep; /* Activity timestamp pointer*/ long *ct_origp; /* Original timestamp pointer*/ long ct_active; /* Activity timestamp */ long ct_timeout; /* Resource timeout */ long ct_idle; /* Idle timeout */ + u_int32_t ct_refcount; /* Ref count for sharing */ u_int32_t ct_type; /* This entry's type */ struct ct_entry *ct_parent; /* Its parent */ struct ct_entry *ct_envparent; /* Its environment */ @@ -65,6 +125,9 @@ struct ct_entry { #define ct_dbc handle_u.dbc #define ct_anyp handle_u.anyp +#define ct_envdp private_u.envdp +#define ct_dbdp private_u.dbdp + extern int __dbsrv_verbose; /* @@ -82,4 +145,4 @@ extern int __dbsrv_verbose; __dbsrv_active(ctp); \ } -#endif /* _DB_SERVER_INT_H_ */ +#endif /* !_DB_SERVER_INT_H_ */ diff --git a/bdb/include/db_shash.h b/bdb/dbinc/db_shash.h similarity index 94% rename from bdb/include/db_shash.h rename to bdb/dbinc/db_shash.h index 0b9aac98f53..2c54d6145c5 100644 --- a/bdb/include/db_shash.h +++ b/bdb/dbinc/db_shash.h @@ -1,12 +1,15 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: db_shash.h,v 11.7 2000/12/12 17:43:56 bostic Exp $ + * $Id: db_shash.h,v 11.11 2002/01/11 15:52:26 bostic Exp $ */ +#ifndef _DB_SHASH_H_ +#define _DB_SHASH_H_ + /* Hash Headers */ typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB; @@ -75,3 +78,4 @@ typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB; __bucket = &begin[ndx]; \ SH_TAILQ_REMOVE(__bucket, obj, field, type); \ } +#endif /* !_DB_SHASH_H_ */ diff --git a/bdb/include/db_swap.h b/bdb/dbinc/db_swap.h similarity index 88% rename from bdb/include/db_swap.h rename to bdb/dbinc/db_swap.h index bc96afb7a10..d5aad65385e 100644 --- a/bdb/include/db_swap.h +++ b/bdb/dbinc/db_swap.h @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: db_swap.h,v 11.5 2000/03/28 16:14:36 bostic Exp $ + * $Id: db_swap.h,v 11.8 2002/01/11 15:52:26 bostic Exp $ */ #ifndef _DB_SWAP_H_ @@ -100,16 +100,17 @@ } /* - * DB has local versions of htonl() and ntohl() that only operate on pointers - * to the right size memory locations, the portability magic for finding the - * real ones isn't worth the effort. + * Berkeley DB has local versions of htonl() and ntohl() that operate on + * pointers to the right size memory locations; the portability magic for + * finding the real system functions isn't worth the effort. */ -#if defined(WORDS_BIGENDIAN) -#define DB_HTONL(p) -#define DB_NTOHL(p) -#else -#define DB_HTONL(p) P_32_SWAP(p) -#define DB_NTOHL(p) P_32_SWAP(p) -#endif +#define DB_HTONL(p) do { \ + if (!__db_isbigendian()) \ + P_32_SWAP(p); \ +} while (0) +#define DB_NTOHL(p) do { \ + if (!__db_isbigendian()) \ + P_32_SWAP(p); \ +} while (0) #endif /* !_DB_SWAP_H_ */ diff --git a/bdb/include/db_upgrade.h b/bdb/dbinc/db_upgrade.h similarity index 68% rename from bdb/include/db_upgrade.h rename to bdb/dbinc/db_upgrade.h index d8d99645231..3ccba810889 100644 --- a/bdb/include/db_upgrade.h +++ b/bdb/dbinc/db_upgrade.h @@ -1,10 +1,10 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: db_upgrade.h,v 1.5 2000/11/16 23:40:56 ubell Exp $ + * $Id: db_upgrade.h,v 1.10 2002/01/11 15:52:26 bostic Exp $ */ #ifndef _DB_UPGRADE_H_ @@ -16,12 +16,65 @@ */ /* Structures from the 3.1 release */ +typedef struct _dbmeta31 { + DB_LSN lsn; /* 00-07: LSN. */ + db_pgno_t pgno; /* 08-11: Current page number. */ + u_int32_t magic; /* 12-15: Magic number. */ + u_int32_t version; /* 16-19: Version. */ + u_int32_t pagesize; /* 20-23: Pagesize. */ + u_int8_t unused1[1]; /* 24: Unused. */ + u_int8_t type; /* 25: Page type. */ + u_int8_t unused2[2]; /* 26-27: Unused. */ + u_int32_t free; /* 28-31: Free list page number. */ + DB_LSN unused3; /* 36-39: Unused. */ + u_int32_t key_count; /* 40-43: Cached key count. */ + u_int32_t record_count; /* 44-47: Cached record count. */ + u_int32_t flags; /* 48-51: Flags: unique to each AM. */ + /* 52-71: Unique file ID. */ + u_int8_t uid[DB_FILE_ID_LEN]; +} DBMETA31; + +typedef struct _btmeta31 { + DBMETA31 dbmeta; /* 00-71: Generic meta-data header. */ + + u_int32_t maxkey; /* 72-75: Btree: Maxkey. */ + 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-92: Root page. */ + + /* + * Minimum page size is 128. + */ +} BTMETA31; + +/************************************************************************ + HASH METADATA PAGE LAYOUT + ************************************************************************/ +typedef struct _hashmeta31 { + DBMETA31 dbmeta; /* 00-71: Generic meta-data page header. */ + + u_int32_t max_bucket; /* 72-75: ID of Maximum bucket in use */ + u_int32_t high_mask; /* 76-79: Modulo mask into table */ + u_int32_t low_mask; /* 80-83: Modulo mask into table lower half */ + u_int32_t ffactor; /* 84-87: Fill factor */ + u_int32_t nelem; /* 88-91: Number of keys in hash table */ + u_int32_t h_charkey; /* 92-95: Value of hash(CHARKEY) */ +#define NCACHED 32 /* number of spare points */ + /* 96-223: Spare pages for overflow */ + u_int32_t spares[NCACHED]; + + /* + * Minimum page size is 256. + */ +} HMETA31; + /* * QAM Meta data page structure * */ typedef struct _qmeta31 { - DBMETA dbmeta; /* 00-71: Generic meta-data header. */ + DBMETA31 dbmeta; /* 00-71: Generic meta-data header. */ u_int32_t start; /* 72-75: Start offset. */ u_int32_t first_recno; /* 76-79: First not deleted record. */ @@ -34,6 +87,21 @@ typedef struct _qmeta31 { * Minimum page size is 128. */ } QMETA31; +/* Structures from the 3.2 release */ +typedef struct _qmeta32 { + DBMETA31 dbmeta; /* 00-71: Generic meta-data header. */ + + u_int32_t first_recno; /* 72-75: First not deleted record. */ + u_int32_t cur_recno; /* 76-79: Last recno allocated. */ + u_int32_t re_len; /* 80-83: Fixed-length record length. */ + u_int32_t re_pad; /* 84-87: Fixed-length record pad. */ + u_int32_t rec_page; /* 88-91: Records Per Page. */ + u_int32_t page_ext; /* 92-95: Pages per extent */ + + /* + * Minimum page size is 128. + */ +} QMETA32; /* Structures from the 3.0 release */ @@ -171,4 +239,4 @@ typedef struct hashhdr { /* Disk resident portion */ */ } HASHHDR; -#endif +#endif /* !_DB_UPGRADE_H_ */ diff --git a/bdb/include/db_verify.h b/bdb/dbinc/db_verify.h similarity index 82% rename from bdb/include/db_verify.h rename to bdb/dbinc/db_verify.h index 2507f1f1082..949c9a2a6a1 100644 --- a/bdb/include/db_verify.h +++ b/bdb/dbinc/db_verify.h @@ -1,10 +1,10 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1999, 2000 + * Copyright (c) 1999-2002 * Sleepycat Software. All rights reserved. * - * $Id: db_verify.h,v 1.18 2000/12/31 17:51:52 bostic Exp $ + * $Id: db_verify.h,v 1.26 2002/08/06 06:37:08 bostic Exp $ */ #ifndef _DB_VERIFY_H_ @@ -27,14 +27,17 @@ /* For fatal type errors--i.e., verifier bugs. */ #define TYPE_ERR_PRINT(dbenv, func, pgno, ptype) \ - EPRINT(((dbenv), "%s called on nonsensical page %lu of type %lu", \ - (func), (u_long)(pgno), (u_long)(ptype))); + EPRINT(((dbenv), "Page %lu: %s called on nonsensical page of type %lu", \ + (u_long)(pgno), (func), (u_long)(ptype))); -/* Is x a power of two? (Tests true for zero, which doesn't matter here.) */ -#define POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0) - -#define IS_VALID_PAGESIZE(x) \ - (POWER_OF_TWO(x) && (x) >= DB_MIN_PGSIZE && ((x) <= DB_MAX_PGSIZE)) +/* 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", \ + (u_long)(pgno), str, (u_long)P_INVALID)); \ + EPRINT(((dbenv), "Page %lu: totally zeroed page", \ + (u_long)(pgno))); \ + } while (0) /* * Note that 0 is, in general, a valid pgno, despite equalling PGNO_INVALID; @@ -111,12 +114,23 @@ struct __vrfy_dbinfo { db_pgno_t last_pgno; db_pgno_t pgs_remaining; /* For dbp->db_feedback(). */ + /* + * These are used during __bam_vrfy_subtree to keep track, while + * walking up and down the Btree structure, of the prev- and next-page + * chain of leaf pages and verify that it's intact. Also, make sure + * that this chain contains pages of only one type. + */ + db_pgno_t prev_pgno; + db_pgno_t next_pgno; + u_int8_t leaf_type; + /* Queue needs these to verify data pages in the first pass. */ u_int32_t re_len; u_int32_t rec_page; -#define SALVAGE_PRINTHEADER 0x01 -#define SALVAGE_PRINTFOOTER 0x02 +#define SALVAGE_PRINTABLE 0x01 /* Output printable chars literally. */ +#define SALVAGE_PRINTHEADER 0x02 /* Print the unknown-key header. */ +#define SALVAGE_PRINTFOOTER 0x04 /* Print the unknown-key footer. */ u_int32_t flags; }; /* VRFY_DBINFO */ @@ -188,4 +202,4 @@ struct __vrfy_childinfo { LIST_ENTRY(__vrfy_childinfo) links; }; /* VRFY_CHILDINFO */ -#endif /* _DB_VERIFY_H_ */ +#endif /* !_DB_VERIFY_H_ */ diff --git a/bdb/dbinc/debug.h b/bdb/dbinc/debug.h new file mode 100644 index 00000000000..21f80387ccc --- /dev/null +++ b/bdb/dbinc/debug.h @@ -0,0 +1,198 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1998-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: debug.h,v 11.31 2002/08/06 06:37:08 bostic Exp $ + */ + +#ifndef _DB_DEBUG_H_ +#define _DB_DEBUG_H_ + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * When running with #DIAGNOSTIC defined, we smash memory and do memory + * guarding with a special byte value. + */ +#define CLEAR_BYTE 0xdb +#define GUARD_BYTE 0xdc + +/* + * DB assertions. + */ +#if defined(DIAGNOSTIC) && defined(__STDC__) +#define DB_ASSERT(e) ((e) ? (void)0 : __db_assert(#e, __FILE__, __LINE__)) +#else +#define DB_ASSERT(e) +#endif + +/* + * Purify and other run-time tools complain about uninitialized reads/writes + * of structure fields whose only purpose is padding, as well as when heap + * memory that was never initialized is written to disk. + */ +#ifdef UMRW +#define UMRW_SET(v) (v) = 0 +#else +#define UMRW_SET(v) +#endif + +/* + * Error message handling. Use a macro instead of a function because va_list + * references to variadic arguments cannot be reset to the beginning of the + * variadic argument list (and then rescanned), by functions other than the + * original routine that took the variadic list of arguments. + */ +#if defined(__STDC__) || defined(__cplusplus) +#define DB_REAL_ERR(env, error, error_set, stderr_default, fmt) { \ + va_list ap; \ + \ + /* Call the user's callback function, if specified. */ \ + va_start(ap, fmt); \ + if ((env) != NULL && (env)->db_errcall != NULL) \ + __db_errcall(env, error, error_set, fmt, ap); \ + va_end(ap); \ + \ + /* Write to the user's file descriptor, if specified. */ \ + va_start(ap, fmt); \ + if ((env) != NULL && (env)->db_errfile != NULL) \ + __db_errfile(env, error, error_set, fmt, ap); \ + va_end(ap); \ + \ + /* \ + * If we have a default and we didn't do either of the above, \ + * write to the default. \ + */ \ + va_start(ap, fmt); \ + if ((stderr_default) && ((env) == NULL || \ + ((env)->db_errcall == NULL && (env)->db_errfile == NULL))) \ + __db_errfile(env, error, error_set, fmt, ap); \ + va_end(ap); \ +} +#else +#define DB_REAL_ERR(env, error, error_set, stderr_default, fmt) { \ + va_list ap; \ + \ + /* Call the user's callback function, if specified. */ \ + va_start(ap); \ + if ((env) != NULL && (env)->db_errcall != NULL) \ + __db_errcall(env, error, error_set, fmt, ap); \ + va_end(ap); \ + \ + /* Write to the user's file descriptor, if specified. */ \ + va_start(ap); \ + if ((env) != NULL && (env)->db_errfile != NULL) \ + __db_errfile(env, error, error_set, fmt, ap); \ + va_end(ap); \ + \ + /* \ + * If we have a default and we didn't do either of the above, \ + * write to the default. \ + */ \ + va_start(ap); \ + if ((stderr_default) && ((env) == NULL || \ + ((env)->db_errcall == NULL && (env)->db_errfile == NULL))) \ + __db_errfile(env, error, error_set, fmt, ap); \ + va_end(ap); \ +} +#endif + +/* + * Debugging macro to log operations. + * If DEBUG_WOP is defined, log operations that modify the database. + * If DEBUG_ROP is defined, log operations that read the database. + * + * D dbp + * T txn + * O operation (string) + * K key + * A data + * F flags + */ +#define LOG_OP(C, T, O, K, A, F) { \ + DB_LSN __lsn; \ + DBT __op; \ + if (DBC_LOGGING((C))) { \ + memset(&__op, 0, sizeof(__op)); \ + __op.data = O; \ + __op.size = strlen(O) + 1; \ + (void)__db_debug_log((C)->dbp->dbenv, T, &__lsn, 0, \ + &__op, (C)->dbp->log_filename->id, K, A, F); \ + } \ +} +#ifdef DEBUG_ROP +#define DEBUG_LREAD(C, T, O, K, A, F) LOG_OP(C, T, O, K, A, F) +#else +#define DEBUG_LREAD(C, T, O, K, A, F) +#endif +#ifdef DEBUG_WOP +#define DEBUG_LWRITE(C, T, O, K, A, F) LOG_OP(C, T, O, K, A, F) +#else +#define DEBUG_LWRITE(C, T, O, K, A, F) +#endif + +/* + * Hook for testing recovery at various places in the create/delete paths. + * Hook for testing subdb locks. + */ +#if CONFIG_TEST +#define DB_TEST_SUBLOCKS(env, flags) \ +do { \ + if ((env)->test_abort == DB_TEST_SUBDB_LOCKS) \ + (flags) |= DB_LOCK_NOWAIT; \ +} while (0) + +#define DB_ENV_TEST_RECOVERY(env, val, ret, name) \ +do { \ + int __ret; \ + PANIC_CHECK((env)); \ + if ((env)->test_copy == (val)) { \ + /* COPY the FILE */ \ + if ((__ret = __db_testcopy((env), NULL, (name))) != 0) \ + (ret) = __db_panic((env), __ret); \ + } \ + if ((env)->test_abort == (val)) { \ + /* ABORT the TXN */ \ + (env)->test_abort = 0; \ + (ret) = EINVAL; \ + goto db_tr_err; \ + } \ +} while (0) + +#define DB_TEST_RECOVERY(dbp, val, ret, name) \ +do { \ + int __ret; \ + PANIC_CHECK((dbp)->dbenv); \ + if ((dbp)->dbenv->test_copy == (val)) { \ + /* Copy the file. */ \ + if (F_ISSET((dbp), \ + DB_AM_OPEN_CALLED) && (dbp)->mpf != NULL) \ + (void)(dbp)->sync((dbp), 0); \ + if ((__ret = \ + __db_testcopy((dbp)->dbenv, (dbp), (name))) != 0) \ + (ret) = __db_panic((dbp)->dbenv, __ret); \ + } \ + if ((dbp)->dbenv->test_abort == (val)) { \ + /* Abort the transaction. */ \ + (dbp)->dbenv->test_abort = 0; \ + (ret) = EINVAL; \ + goto db_tr_err; \ + } \ +} while (0) + +#define DB_TEST_RECOVERY_LABEL db_tr_err: +#else +#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 +#endif + +#if defined(__cplusplus) +} +#endif +#endif /* !_DB_DEBUG_H_ */ diff --git a/bdb/dbinc/fop.h b/bdb/dbinc/fop.h new file mode 100644 index 00000000000..c438ef7ef40 --- /dev/null +++ b/bdb/dbinc/fop.h @@ -0,0 +1,16 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2001-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: fop.h,v 11.3 2002/03/27 04:34:54 bostic Exp $ + */ + +#ifndef _FOP_H_ +#define _FOP_H_ + +#include "dbinc_auto/fileops_auto.h" +#include "dbinc_auto/fileops_ext.h" + +#endif /* !_FOP_H_ */ diff --git a/bdb/dbinc/globals.h b/bdb/dbinc/globals.h new file mode 100644 index 00000000000..3441ade2ea9 --- /dev/null +++ b/bdb/dbinc/globals.h @@ -0,0 +1,83 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: globals.h,v 11.1 2002/07/12 18:56:41 bostic Exp $ + */ + +/******************************************************* + * Global variables. + * + * Held in a single structure to minimize the name-space pollution. + *******************************************************/ +#ifdef HAVE_VXWORKS +#include "semLib.h" +#endif + +typedef struct __db_globals { + u_int32_t no_write_errors; /* write error testing disallowed */ +#ifdef HAVE_VXWORKS + u_int32_t db_global_init; /* VxWorks: inited */ + SEM_ID db_global_lock; /* VxWorks: global semaphore */ +#endif + /* XA: list of opened environments. */ + TAILQ_HEAD(__db_envq, __db_env) db_envq; + + int (*j_close) __P((int)); /* Underlying OS interface jump table.*/ + void (*j_dirfree) __P((char **, int)); + int (*j_dirlist) __P((const char *, char ***, int *)); + int (*j_exists) __P((const char *, int *)); + void (*j_free) __P((void *)); + int (*j_fsync) __P((int)); + int (*j_ioinfo) __P((const char *, + int, u_int32_t *, u_int32_t *, u_int32_t *)); + void *(*j_malloc) __P((size_t)); + int (*j_map) __P((char *, size_t, int, int, void **)); + int (*j_open) __P((const char *, int, ...)); + ssize_t (*j_read) __P((int, void *, size_t)); + void *(*j_realloc) __P((void *, size_t)); + int (*j_rename) __P((const char *, const char *)); + int (*j_seek) __P((int, size_t, db_pgno_t, u_int32_t, int, int)); + int (*j_sleep) __P((u_long, u_long)); + int (*j_unlink) __P((const char *)); + int (*j_unmap) __P((void *, size_t)); + ssize_t (*j_write) __P((int, const void *, size_t)); + int (*j_yield) __P((void)); +} DB_GLOBALS; + +#ifdef DB_INITIALIZE_DB_GLOBALS +DB_GLOBALS __db_global_values = { + 0, /* write error testing disallowed */ +#ifdef HAVE_VXWORKS + 0, /* VxWorks: initialized */ + NULL, /* VxWorks: global semaphore */ +#endif + /* XA: list of opened environments. */ + {NULL, &__db_global_values.db_envq.tqh_first}, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL +}; +#else +extern DB_GLOBALS __db_global_values; +#endif + +#define DB_GLOBAL(v) __db_global_values.v diff --git a/bdb/include/hash.h b/bdb/dbinc/hash.h similarity index 93% rename from bdb/include/hash.h rename to bdb/dbinc/hash.h index 14a88c80b9c..98289735fc4 100644 --- a/bdb/include/hash.h +++ b/bdb/dbinc/hash.h @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -39,9 +39,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: hash.h,v 11.19 2000/12/21 23:05:16 krinsky Exp $ + * $Id: hash.h,v 11.26 2002/03/27 04:34:54 bostic Exp $ */ +#ifndef _DB_HASH_H_ +#define _DB_HASH_H_ + /* Hash internal structure. */ typedef struct hash_t { db_pgno_t meta_pgno; /* Page number of the meta data page. */ @@ -131,10 +134,14 @@ typedef struct cursor_t { typedef enum { DB_HAM_CHGPG = 1, - DB_HAM_SPLIT = 2, - DB_HAM_DUP = 3 + DB_HAM_DELFIRSTPG = 2, + DB_HAM_DELMIDPG = 3, + DB_HAM_DELLASTPG = 4, + DB_HAM_DUP = 5, + DB_HAM_SPLIT = 6 } db_ham_mode; -#include "hash_auto.h" -#include "hash_ext.h" -#include "db_am.h" +#include "dbinc_auto/hash_auto.h" +#include "dbinc_auto/hash_ext.h" +#include "dbinc/db_am.h" +#endif /* !_DB_HASH_H_ */ diff --git a/bdb/dbinc/hmac.h b/bdb/dbinc/hmac.h new file mode 100644 index 00000000000..16f61fb58ad --- /dev/null +++ b/bdb/dbinc/hmac.h @@ -0,0 +1,32 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: hmac.h,v 1.3 2002/08/06 06:37:08 bostic Exp $ + */ + +#ifndef _DB_HMAC_H_ +#define _DB_HMAC_H_ + +/* + * Algorithm specific information. + */ +/* + * SHA1 checksumming + */ +typedef struct { + u_int32_t state[5]; + u_int32_t count[2]; + unsigned char buffer[64]; +} SHA1_CTX; + +/* + * AES assumes the SHA1 checksumming (also called MAC) + */ +#define DB_MAC_MAGIC "mac derivation key magic value" +#define DB_ENC_MAGIC "encryption and decryption key value magic" + +#include "dbinc_auto/hmac_ext.h" +#endif /* !_DB_HMAC_H_ */ diff --git a/bdb/include/lock.h b/bdb/dbinc/lock.h similarity index 70% rename from bdb/include/lock.h rename to bdb/dbinc/lock.h index e4a01ddf9c7..7ddc9ce9988 100644 --- a/bdb/include/lock.h +++ b/bdb/dbinc/lock.h @@ -1,33 +1,58 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: lock.h,v 11.20 2000/12/12 17:43:56 bostic Exp $ + * $Id: lock.h,v 11.42 2002/05/18 01:34:13 bostic Exp $ */ +#ifndef _DB_LOCK_H_ +#define _DB_LOCK_H_ + #define DB_LOCK_DEFAULT_N 1000 /* Default # of locks in region. */ +/* + * The locker id space is divided between the transaction manager and the lock + * manager. Lock IDs start at 1 and go to DB_LOCK_MAXID. Txn IDs start at + * DB_LOCK_MAXID + 1 and go up to TXN_MAXIMUM. + */ +#define DB_LOCK_INVALIDID 0 +#define DB_LOCK_MAXID 0x7fffffff + /* * Out of band value for a lock. Locks contain an offset into a lock region, * so we use an invalid region offset to indicate an invalid or unset lock. */ -#define LOCK_INVALID INVALID_ROFF +#define LOCK_INVALID INVALID_ROFF +#define LOCK_ISSET(lock) ((lock).off != LOCK_INVALID) +#define LOCK_INIT(lock) ((lock).off = LOCK_INVALID) /* - * The locker id space is divided between the transaction manager and the lock - * manager. Lock IDs start at 0 and go to DB_LOCK_MAXID. Txn IDs start at - * DB_LOCK_MAXID + 1 and go up to TXN_INVALID. + * Macro to identify a write lock for the purpose of counting locks + * for the NUMWRITES option to deadlock detection. */ -#define DB_LOCK_MAXID 0x7fffffff +#define IS_WRITELOCK(m) \ + ((m) == DB_LOCK_WRITE || (m) == DB_LOCK_IWRITE || (m) == DB_LOCK_IWR) + +/* + * Lock timers. + */ +typedef struct { + u_int32_t tv_sec; /* Seconds. */ + u_int32_t tv_usec; /* Microseconds. */ +} db_timeval_t; + +#define LOCK_TIME_ISVALID(time) ((time)->tv_sec != 0) +#define LOCK_SET_TIME_INVALID(time) ((time)->tv_sec = 0) +#define LOCK_TIME_EQUAL(t1, t2) \ + ((t1)->tv_sec == (t2)->tv_sec && (t1)->tv_usec == (t2)->tv_usec) /* * DB_LOCKREGION -- * The lock shared region. */ typedef struct __db_lockregion { - u_int32_t id; /* unique id generator */ u_int32_t need_dd; /* flag for deadlock detector */ u_int32_t detect; /* run dd on every conflict */ /* free lock header */ @@ -37,30 +62,23 @@ typedef struct __db_lockregion { /* free locker header */ SH_TAILQ_HEAD(__flocker) free_lockers; SH_TAILQ_HEAD(__dobj) dd_objs; /* objects with waiters */ - u_int32_t maxlocks; /* maximum number of locks in table */ - u_int32_t maxlockers; /* maximum number of lockers in table */ - u_int32_t maxobjects; /* maximum number of objects in table */ + SH_TAILQ_HEAD(__lkrs) lockers; /* list of lockers */ + + db_timeout_t lk_timeout; /* timeout for locks. */ + db_timeout_t tx_timeout; /* timeout for txns. */ + u_int32_t locker_t_size; /* size of locker hash table */ u_int32_t object_t_size; /* size of object hash table */ - u_int32_t nmodes; /* number of lock modes */ - u_int32_t nlocks; /* current number of locks */ - u_int32_t maxnlocks; /* maximum number of locks so far*/ - u_int32_t nlockers; /* current number of lockers */ - u_int32_t maxnlockers; /* maximum number of lockers so far */ - u_int32_t nobjects; /* current number of objects */ - u_int32_t maxnobjects; /* maximum number of objects so far */ + 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 */ - u_int32_t nconflicts; /* number of lock conflicts */ - u_int32_t nrequests; /* number of lock gets */ - u_int32_t nreleases; /* number of lock puts */ - u_int32_t nnowaits; /* number of lock requests that would - have waited without nowait */ - u_int32_t ndeadlocks; /* number of deadlocks */ -#ifdef MUTEX_SYSTEM_RESOURCES + + DB_LOCK_STAT stat; /* stats about locking. */ + +#ifdef HAVE_MUTEX_SYSTEM_RESOURCES roff_t maint_off; /* offset of region maintenance info */ #endif } DB_LOCKREGION; @@ -98,6 +116,8 @@ typedef struct __db_lockobj { typedef struct __db_locker { u_int32_t id; /* 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. */ size_t master_locker; /* Locker of master transaction. */ size_t parent_locker; /* Parent of this child. */ SH_LIST_HEAD(_child) child_locker; /* List of descendant txns; @@ -106,22 +126,20 @@ typedef struct __db_locker { SH_LIST_ENTRY child_link; /* Links transactions in the family; elements of the child_locker list. */ - SH_TAILQ_ENTRY links; /* Links for free list. */ + SH_TAILQ_ENTRY links; /* Links for free and hash list. */ + SH_TAILQ_ENTRY ulinks; /* Links in-use list. */ SH_LIST_HEAD(_held) heldby; /* Locks held by this locker. */ + db_timeval_t lk_expire; /* When current lock expires. */ + db_timeval_t tx_expire; /* When this txn expires. */ + db_timeout_t lk_timeout; /* How long do we let locks live. */ #define DB_LOCKER_DELETED 0x0001 +#define DB_LOCKER_DIRTY 0x0002 +#define DB_LOCKER_INABORT 0x0004 +#define DB_LOCKER_TIMEOUT 0x0008 u_int32_t flags; } DB_LOCKER; -/* - * Lockers can be freed if they are not part of a transaction family. - * Members of a family either point at the master transaction or are - * the master transaction and have children lockers. - */ -#define LOCKER_FREEABLE(lp) \ - ((lp)->master_locker == TXN_INVALID_ID && \ - SH_LIST_FIRST(&(lp)->child_locker, __db_locker) == NULL) - /* * DB_LOCKTAB -- * The primary library lock data structure (i.e., the one referenced @@ -137,7 +155,7 @@ typedef struct __db_locktab { /* Test for conflicts. */ #define CONFLICTS(T, R, HELD, WANTED) \ - (T)->conflicts[(HELD) * (R)->nmodes + (WANTED)] + (T)->conflicts[(HELD) * (R)->stat.st_nmodes + (WANTED)] #define OBJ_LINKS_VALID(L) ((L)->links.stqe_prev != -1) @@ -146,7 +164,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. */ - MUTEX mutex; + DB_MUTEX mutex; u_int32_t holder; /* Who holds this lock. */ u_int32_t gen; /* Generation count. */ @@ -167,13 +185,15 @@ struct __db_lock { * DB_LOCK_NOPROMOTE: Don't bother running promotion when releasing locks * (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). */ -#define DB_LOCK_DOALL 0x001 -#define DB_LOCK_FREE 0x002 -#define DB_LOCK_IGNOREDEL 0x004 -#define DB_LOCK_NOPROMOTE 0x008 -#define DB_LOCK_UNLINK 0x010 -#define DB_LOCK_NOWAITERS 0x020 +#define DB_LOCK_DOALL 0x010000 +#define DB_LOCK_FREE 0x020000 +#define DB_LOCK_IGNOREDEL 0x040000 +#define DB_LOCK_NOPROMOTE 0x080000 +#define DB_LOCK_UNLINK 0x100000 +#define DB_LOCK_NOWAITERS 0x200000 /* * Macros to get/release different types of mutexes. @@ -187,4 +207,6 @@ struct __db_lock { #define LOCKREGION(dbenv, lt) R_LOCK((dbenv), &(lt)->reginfo) #define UNLOCKREGION(dbenv, lt) R_UNLOCK((dbenv), &(lt)->reginfo) -#include "lock_ext.h" + +#include "dbinc_auto/lock_ext.h" +#endif /* !_DB_LOCK_H_ */ diff --git a/bdb/dbinc/log.h b/bdb/dbinc/log.h new file mode 100644 index 00000000000..434994528ea --- /dev/null +++ b/bdb/dbinc/log.h @@ -0,0 +1,273 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: log.h,v 11.60 2002/08/06 06:37:08 bostic Exp $ + */ + +#ifndef _LOG_H_ +#define _LOG_H_ + +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; + +#define LFPREFIX "log." /* Log file name prefix. */ +#define LFNAME "log.%010d" /* Log file name template. */ +#define LFNAME_V1 "log.%05d" /* Log file name template, rev 1. */ + +#define LG_MAX_DEFAULT (10 * MEGABYTE) /* 10 MB. */ +#define LG_BSIZE_DEFAULT (32 * 1024) /* 32 KB. */ +#define LG_BASE_REGION_SIZE (60 * 1024) /* 60 KB. */ + +/* + * The per-process table that maps log file-id's to DB structures. + */ +typedef struct __db_entry { + DB *dbp; /* Open dbp for this file id. */ + int deleted; /* File was not found during open. */ +} DB_ENTRY; + +/* + * 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. */ + + DB_ENTRY *dbentry; /* Recovery file-id mapping. */ +#define DB_GROW_SIZE 64 + 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, OR, they are only used + * when threads are not being used, i.e. most cursor operations are disallowed + * on threaded logs. + */ + u_int32_t lfname; /* Log file "name". */ + DB_FH lfh; /* Log file handle. */ + + u_int8_t *bufp; /* Region buffer. */ + +/* These fields are not protected. */ + DB_ENV *dbenv; /* Reference to error information. */ + REGINFO reginfo; /* Region information. */ + +#define DBLOG_RECOVER 0x01 /* We are in recovery. */ +#define DBLOG_FORCE_OPEN 0x02 /* Force the DB open even if it appears + * to be deleted. + */ + u_int32_t flags; +}; + +/* + * HDR -- + * Log record header. + */ +struct __hdr { + u_int32_t prev; /* Previous offset. */ + u_int32_t len; /* Current length. */ + u_int8_t chksum[DB_MAC_KEY]; /* Current checksum. */ + u_int8_t iv[DB_IV_BYTES]; /* IV */ + u_int32_t orig_size; /* Original size of log record */ + /* !!! - 'size' is not written to log, must be last in hdr */ + size_t size; /* Size of header to use */ +}; + +/* + * 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 + * a crypto-checksum and IV and original size if running in crypto + * mode. We must store the original size in case we pad. Set the + * size when we set up the header. We compute a DB_MAC_KEY size + * checksum regardless, but we can safely just use the first 4 bytes. + */ +#define HDR_NORMAL_SZ 12 +#define HDR_CRYPTO_SZ 12 + DB_MAC_KEY + DB_IV_BYTES + +struct __log_persist { + u_int32_t magic; /* DB_LOGMAGIC */ + u_int32_t version; /* DB_LOGVERSION */ + + u_int32_t log_size; /* Log file size. */ + u_int32_t mode; /* Log file mode. */ +}; + +/* + * 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. */ + + LOGP persist; /* Persistent information. */ + + SH_TAILQ_HEAD(__fq1) fq; /* List of file names. */ + int32_t fid_max; /* Max fid allocated. */ + roff_t free_fid_stack; /* Stack of free file ids. */ + int free_fids; /* Height of free fid stack. */ + int free_fids_alloced; /* Number of free fid slots alloc'ed. */ + + /* + * The lsn LSN is the file offset that we're about to write and which + * we will return to the user. + */ + DB_LSN lsn; /* LSN at current file offset. */ + + /* + * The f_lsn LSN is the LSN (returned to the user) that "owns" the + * first byte of the buffer. If the record associated with the LSN + * spans buffers, it may not reflect the physical file location of + * the first byte of the buffer. + */ + DB_LSN f_lsn; /* LSN of first byte in the buffer. */ + size_t b_off; /* Current offset in the buffer. */ + u_int32_t w_off; /* Current write offset in the file. */ + u_int32_t len; /* Length of the last record. */ + + /* + * 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_LOG_STAT stat; /* Log statistics. */ + + /* + * The waiting_lsn is used by the replication system. It is the + * first LSN that we are holding without putting in the log, because + * we received one or more log records out of order. Associated with + * the waiting_lsn is the number of log records that we still have to + * receive before we decide that we should request it again. + */ + DB_LSN waiting_lsn; /* First log record after a gap. */ + DB_LSN verify_lsn; /* LSN we are waiting to verify. */ + u_int32_t wait_recs; /* Records to wait before requesting. */ + u_int32_t rcvd_recs; /* Records received while waiting. */ + + /* + * The ready_lsn is also used by the replication system. It is the + * next LSN we expect to receive. It's normally equal to "lsn", + * except at the beginning of a log file, at which point it's set + * to the LSN of the first record of the new file (after the + * header), rather than to 0. + */ + DB_LSN ready_lsn; + + /* + * During initialization, the log system walks forward through the + * last log file to find its end. If it runs into a checkpoint + * while it's doing so, it caches it here so that the transaction + * system doesn't need to walk through the file again on its + * initialization. + */ + DB_LSN cached_ckp_lsn; + + roff_t buffer_off; /* Log buffer offset in the region. */ + u_int32_t buffer_size; /* Log buffer size. */ + + u_int32_t log_size; /* Log file's size. */ + u_int32_t log_nsize; /* Next log file's size. */ + + u_int32_t ncommit; /* Number of txns waiting to commit. */ + + DB_LSN t_lsn; /* LSN of first commit */ + SH_TAILQ_HEAD(__commit) commits;/* list of txns waiting to commit. */ + SH_TAILQ_HEAD(__free) free_commits;/* free list of commit structs. */ + +#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 +}; + +/* + * __db_commit structure -- + * One of these is allocated for each transaction waiting + * to commit. + */ +struct __db_commit { + DB_MUTEX mutex; /* Mutex for txn to wait on. */ + DB_LSN lsn; /* LSN of commit record. */ + SH_TAILQ_ENTRY links; /* Either on free or waiting list. */ + +#define DB_COMMIT_FLUSH 0x0001 /* Flush the log when you wake up. */ + u_int32_t flags; +}; + +/* + * FNAME -- + * File name and id. + */ +struct __fname { + SH_TAILQ_ENTRY q; /* File name queue. */ + + int32_t id; /* Logging file id. */ + DBTYPE s_type; /* Saved DB type. */ + + roff_t name_off; /* Name offset. */ + db_pgno_t meta_pgno; /* Page number of the meta page. */ + u_int8_t ufid[DB_FILE_ID_LEN]; /* Unique file id. */ + + u_int32_t create_txnid; /* + * Txn ID of the DB create, stored so + * we can log it at register time. + */ +}; + +/* File open/close register log record opcodes. */ +#define LOG_CHECKPOINT 1 /* Checkpoint: file name/id dump. */ +#define LOG_CLOSE 2 /* File close. */ +#define LOG_OPEN 3 /* File open. */ +#define LOG_RCLOSE 4 /* File close after recovery. */ + +#define CHECK_LSN(redo, cmp, lsn, prev) \ + DB_ASSERT(!DB_REDO(redo) || \ + (cmp) >= 0 || IS_NOT_LOGGED_LSN(*lsn)); \ + if (DB_REDO(redo) && (cmp) < 0 && !IS_NOT_LOGGED_LSN(*(lsn))) { \ + __db_err(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); \ + goto out; \ + } + +/* + * Status codes indicating the validity of a log file examined by + * __log_valid(). + */ +typedef enum { + DB_LV_INCOMPLETE, + DB_LV_NONEXISTENT, + DB_LV_NORMAL, + DB_LV_OLD_READABLE, + DB_LV_OLD_UNREADABLE +} logfile_validity; + +#include "dbinc_auto/dbreg_auto.h" +#include "dbinc_auto/dbreg_ext.h" +#include "dbinc_auto/log_ext.h" +#endif /* !_LOG_H_ */ diff --git a/bdb/dbinc/mp.h b/bdb/dbinc/mp.h new file mode 100644 index 00000000000..5c805b92364 --- /dev/null +++ b/bdb/dbinc/mp.h @@ -0,0 +1,293 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: mp.h,v 11.44 2002/08/06 06:11:21 bostic Exp $ + */ + +#ifndef _DB_MP_H_ +#define _DB_MP_H_ + +struct __bh; typedef struct __bh BH; +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; + + /* We require at least 20KB of cache. */ +#define DB_CACHESIZE_MIN (20 * 1024) + +typedef enum { + DB_SYNC_ALLOC, /* Flush for allocation. */ + DB_SYNC_CACHE, /* Checkpoint or flush entire cache. */ + DB_SYNC_FILE, /* Flush file. */ + DB_SYNC_TRICKLE /* Trickle sync. */ +} db_sync_op; + +/* + * DB_MPOOL -- + * Per-process memory pool structure. + */ +struct __db_mpool { + /* These fields need to be protected for multi-threaded support. */ + DB_MUTEX *mutexp; /* Structure thread lock. */ + + /* List of pgin/pgout routines. */ + LIST_HEAD(__db_mpregh, __db_mpreg) dbregq; + + /* List of DB_MPOOLFILE's. */ + TAILQ_HEAD(__db_mpoolfileh, __db_mpoolfile) dbmfq; + + /* + * The dbenv, nreg and reginfo fields are not thread protected, + * as they are initialized during mpool creation, and not modified + * again. + */ + DB_ENV *dbenv; /* Enclosing environment. */ + + u_int32_t nreg; /* N underlying cache regions. */ + REGINFO *reginfo; /* Underlying cache regions. */ +}; + +/* + * DB_MPREG -- + * DB_MPOOL registry of pgin/pgout functions. + */ +struct __db_mpreg { + LIST_ENTRY(__db_mpreg) q; /* Linked list. */ + + int32_t ftype; /* File type. */ + /* Pgin, pgout routines. */ + int (*pgin) __P((DB_ENV *, db_pgno_t, void *, DBT *)); + int (*pgout) __P((DB_ENV *, db_pgno_t, void *, DBT *)); +}; + +/* + * NCACHE -- + * Select a cache based on the file and the page number. Assumes accesses + * are uniform across pages, which is probably OK. What we really want to + * avoid is anything that puts all pages from any single file in the same + * cache, as we expect that file access will be bursty, and to avoid + * putting all page number N pages in the same cache as we expect access + * to the metapages (page 0) and the root of a btree (page 1) to be much + * more frequent than a random data page. + */ +#define NCACHE(mp, mf_offset, pgno) \ + (((pgno) ^ ((mf_offset) >> 3)) % ((MPOOL *)mp)->nreg) + +/* + * NBUCKET -- + * We make the assumption that early pages of the file are more likely + * to be retrieved than the later pages, which means the top bits will + * be more interesting for hashing as they're less likely to collide. + * That said, as 512 8K pages represents a 4MB file, so only reasonably + * large files will have page numbers with any other than the bottom 9 + * bits set. We XOR in the MPOOL offset of the MPOOLFILE that backs the + * page, since that should also be unique for the page. We don't want + * to do anything very fancy -- speed is more important to us than using + * good hashing. + */ +#define NBUCKET(mc, mf_offset, pgno) \ + (((pgno) ^ ((mf_offset) << 9)) % (mc)->htab_buckets) + +/* + * MPOOL -- + * Shared memory pool region. + */ +struct __mpool { + /* + * The memory pool can be broken up into individual pieces/files. + * Not what we would have liked, but on Solaris you can allocate + * only a little more than 2GB of memory in a contiguous chunk, + * and I expect to see more systems with similar issues. + * + * While this structure is duplicated in each piece of the cache, + * the first of these pieces/files describes the entire pool, the + * second only describe a piece of the cache. + */ + + /* + * The lsn field and list of underlying MPOOLFILEs are thread protected + * by the region lock. + */ + DB_LSN lsn; /* Maximum checkpoint LSN. */ + + SH_TAILQ_HEAD(__mpfq) mpfq; /* List of MPOOLFILEs. */ + + /* + * The nreg, regids and maint_off fields are not thread protected, + * as they are initialized during mpool creation, and not modified + * again. + */ + 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. + * + * The htab and htab_buckets fields are not thread protected as they + * are initialized during mpool creation, and not modified again. + * + * The last_checked and lru_count fields are thread protected by + * the region lock. + */ + int 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 */ + + /* + * The stat fields are generally not thread protected, and cannot be + * trusted. Note that st_pages is an exception, and is always updated + * inside a region lock (although it is sometimes read outside of the + * region lock). + */ + DB_MPOOL_STAT stat; /* Per-cache mpool statistics. */ +}; + +struct __db_mpool_hash { + DB_MUTEX hash_mutex; /* Per-bucket 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. */ +}; + +/* + * The base mpool priority is 1/4th of the name space, or just under 2^30. + * When the LRU counter wraps, we shift everybody down to a base-relative + * value. + */ +#define MPOOL_BASE_DECREMENT (UINT32_T_MAX - (UINT32_T_MAX / 4)) + +/* + * Mpool priorities from low to high. Defined in terms of fractions of the + * buffers in the pool. + */ +#define MPOOL_PRI_VERY_LOW -1 /* Dead duck. Check and set to 0. */ +#define MPOOL_PRI_LOW -2 /* Low. */ +#define MPOOL_PRI_DEFAULT 0 /* No adjustment -- special case.*/ +#define MPOOL_PRI_HIGH 10 /* With the dirty buffers. */ +#define MPOOL_PRI_DIRTY 10 /* Dirty gets a 10% boost. */ +#define MPOOL_PRI_VERY_HIGH 1 /* Add number of buffers in pool. */ + +/* + * MPOOLFILE_IGNORE -- + * Discard an MPOOLFILE and any buffers it references: update the flags + * so we never try to write buffers associated with the file, nor can we + * find it when looking for files to join. In addition, clear the ftype + * field, there's no reason to post-process pages, they can be discarded + * by any thread. + * + * Expects the MPOOLFILE mutex to be held. + */ +#define MPOOLFILE_IGNORE(mfp) { \ + (mfp)->ftype = 0; \ + F_SET(mfp, MP_DEADFILE); \ +} + +/* + * MPOOLFILE -- + * Shared DB_MPOOLFILE information. + */ +struct __mpoolfile { + DB_MUTEX mutex; + + /* Protected by MPOOLFILE mutex. */ + u_int32_t mpf_cnt; /* Ref count: DB_MPOOLFILEs. */ + u_int32_t block_cnt; /* Ref count: blocks in cache. */ + + roff_t path_off; /* File name location. */ + + /* 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. */ + + /* + * None of the following fields are thread protected. + * + * There are potential races with the ftype field because it's read + * without holding a lock. However, it has to be set before adding + * any buffers to the cache that depend on it being set, so there + * would need to be incorrect operation ordering to have a problem. + * + * There are potential races with the priority field because it's read + * without holding a lock. However, a collision is unlikely and if it + * happens is of little consequence. + * + * We do not protect the statistics in "stat" because of the cost of + * the mutex in the get/put routines. There is a chance that a count + * will get lost. + * + * The remaining fields are initialized at open and never subsequently + * modified, except for the MP_DEADFILE, which is only set and never + * unset. (If there was more than one flag that was subsequently set, + * there might be a race, but with a single flag there can't be.) + */ + int32_t ftype; /* File type. */ + + int32_t priority; /* Priority when unpinning buffer. */ + + DB_MPOOL_FSTAT stat; /* Per-file mpool statistics. */ + + int32_t lsn_off; /* Page's LSN offset. */ + u_int32_t clear_len; /* Bytes to clear on page create. */ + + roff_t fileid_off; /* File ID string location. */ + + roff_t pgcookie_len; /* Pgin/pgout cookie length. */ + roff_t pgcookie_off; /* Pgin/pgout cookie location. */ + +#define MP_CAN_MMAP 0x01 /* If the file can be mmap'd. */ +#define MP_DEADFILE 0x02 /* Dirty pages can simply be trashed. */ +#define MP_DIRECT 0x04 /* No OS buffering. */ +#define MP_EXTENT 0x08 /* Extent file. */ +#define MP_TEMP 0x10 /* Backing file is a temporary. */ +#define MP_UNLINK 0x20 /* Unlink file on last close. */ + u_int32_t flags; +}; + +/* + * 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_DISCARD 0x008 /* Page is useless. */ +#define BH_LOCKED 0x010 /* Page is locked (I/O in progress). */ +#define BH_TRASH 0x020 /* 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. */ + + /* + * !!! + * This array must be at least size_t aligned -- the DB access methods + * put PAGE and other structures into it, and then access them directly. + * (We guarantee size_t alignment to applications in the documentation, + * too.) + */ + u_int8_t buf[1]; /* Variable length data. */ +}; + +#include "dbinc_auto/mp_ext.h" +#endif /* !_DB_MP_H_ */ diff --git a/bdb/include/mutex.h b/bdb/dbinc/mutex.h similarity index 76% rename from bdb/include/mutex.h rename to bdb/dbinc/mutex.h index 4c1b265355d..41bb1b4bb59 100644 --- a/bdb/include/mutex.h +++ b/bdb/dbinc/mutex.h @@ -1,12 +1,15 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: mutex.h,v 11.41 2000/12/22 19:28:15 bostic Exp $ + * $Id: mutex.h,v 11.71 2002/09/10 01:36:48 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. @@ -14,16 +17,6 @@ #define DB_BEGIN_SINGLE_THREAD #define DB_END_SINGLE_THREAD -/* - * When the underlying system mutexes require system resources, we have - * to clean up after application failure. This violates the rule that - * we never look at a shared region after a failure, but there's no other - * choice. In those cases, this #define is set. - */ -#ifdef HAVE_QNX -#define MUTEX_SYSTEM_RESOURCES -#endif - /********************************************************************* * POSIX.1 pthreads interface. *********************************************************************/ @@ -239,15 +232,13 @@ typedef unsigned char tsl_t; * when we're first looking for a DB environment. *********************************************************************/ #ifdef HAVE_MUTEX_VXWORKS -#define MUTEX_SYSTEM_RESOURCES - -#include "semLib.h" +#include "taskLib.h" typedef SEM_ID tsl_t; #define MUTEX_ALIGN sizeof(unsigned int) #ifdef LOAD_ACTUAL_MUTEX_CODE #define MUTEX_SET(tsl) (semTake((*tsl), WAIT_FOREVER) == OK) -#define MUTEX_UNSET(tsl) (semGive((*tsl)) == 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) @@ -305,13 +296,18 @@ typedef unsigned int tsl_t; * Win32 *********************************************************************/ #ifdef HAVE_MUTEX_WIN32 -typedef unsigned int tsl_t; -#define MUTEX_ALIGN sizeof(unsigned int) +#define MUTEX_FIELDS \ + LONG tas; \ + LONG nwaiters; \ + union { \ + HANDLE event; /* Windows event HANDLE for wakeups */ \ + u_int32_t id; /* ID used for shared mutexes */ \ + } /* anonymous */; -#ifdef LOAD_ACTUAL_MUTEX_CODE -#define MUTEX_INIT(x) 0 +#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) #endif #endif @@ -393,6 +389,31 @@ MUTEX_UNSET(tsl_t *tsl) { #endif #endif +/********************************************************************* + * ARM/gcc assembly. + *********************************************************************/ +#ifdef HAVE_MUTEX_ARM_GCC_ASSEMBLY +typedef unsigned char tsl_t; + +#ifdef LOAD_ACTUAL_MUTEX_CODE +/* + * For arm/gcc, 0 is clear, 1 is set. + */ +#define MUTEX_SET(tsl) ({ \ + int __r; \ + asm volatile("swpb %0, %1, [%2]" \ + : "=r" (__r) \ + : "0" (1), "r" (tsl) \ + : "memory" \ + ); \ + __r & 1; \ +}) + +#define MUTEX_UNSET(tsl) (*(volatile tsl_t *)(tsl) = 0) +#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) +#endif +#endif + /********************************************************************* * HPPA/gcc assembly. *********************************************************************/ @@ -414,7 +435,7 @@ typedef u_int32_t tsl_t; }) #define MUTEX_UNSET(tsl) (*(tsl) = -1) -#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) +#define MUTEX_INIT(tsl) (MUTEX_UNSET(tsl), 0) #endif #endif @@ -447,7 +468,8 @@ typedef unsigned char tsl_t; /********************************************************************* * PowerPC/gcc assembly. *********************************************************************/ -#ifdef HAVE_MUTEX_PPC_GCC_ASSEMBLY +#if defined(HAVE_MUTEX_PPC_GENERIC_GCC_ASSEMBLY) || \ + (HAVE_MUTEX_PPC_APPLE_GCC_ASSEMBLY) typedef u_int32_t tsl_t; #ifdef LOAD_ACTUAL_MUTEX_CODE @@ -480,8 +502,38 @@ typedef u_int32_t tsl_t; * 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 set, 0 otherwise. + * MUTEX_SET() is 1 if the mutex previously had its low bit clear, 0 otherwise. + * + * Mutexes on Mac OS X work the same way as the standard PowerPC version, but + * the assembler syntax is subtly different -- the standard PowerPC version + * assembles but doesn't work correctly. This version makes (unnecessary?) + * use of a stupid linker trick: __db_mutex_tas_dummy is never called, but the + * ___db_mutex_set label is used as a function name. */ +#ifdef HAVE_MUTEX_PPC_APPLE_GCC_ASSEMBLY +extern int __db_mutex_set __P((volatile tsl_t *)); +void +__db_mutex_tas_dummy() +{ + __asm__ __volatile__(" \n\ + .globl ___db_mutex_set \n\ +___db_mutex_set: \n\ + lwarx r5,0,r3 \n\ + cmpwi r5,0 \n\ + bne fail \n\ + addi r5,r5,1 \n\ + stwcx. r5,0,r3 \n\ + beq success \n\ +fail: \n\ + li r3,0 \n\ + blr \n\ +success: \n\ + li r3,1 \n\ + blr"); +} +#define MUTEX_SET(tsl) __db_mutex_set(tsl) +#endif +#ifdef HAVE_MUTEX_PPC_GENERIC_GCC_ASSEMBLY #define MUTEX_SET(tsl) ({ \ int __one = 1; \ int __r; \ @@ -496,8 +548,38 @@ typedef u_int32_t tsl_t; 1:" \ : "=&r" (__r) \ : "r" (__l), "r" (__one)); \ - __r & 1; \ + !(__r & 1); \ }) +#endif +#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 +/* + * For 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) @@ -552,9 +634,9 @@ typedef unsigned char tsl_t; * 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. + * 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. * * For gcc/sparc, 0 is clear, 1 is set. */ @@ -611,28 +693,6 @@ typedef unsigned char tsl_t; #endif #endif -#ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY -typedef unsigned char tsl_t; - -#ifdef LOAD_ACTUAL_MUTEX_CODE -/* - * For gcc/x86, 0 is clear, 1 is set. - */ -#define MUTEX_SET(tsl) ({ \ - register tsl_t *__l = (tsl); \ - int __r; \ - asm volatile("mov $1,%%rax; lock; xchgb %1,%%al; xor $1,%%rax"\ - : "=&a" (__r), "=m" (*__l) \ - : "1" (*__l) \ - ); \ - __r & 1; \ -}) - -#define MUTEX_UNSET(tsl) (*(tsl) = 0) -#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) -#endif -#endif - /* * Mutex alignment defaults to one byte. * @@ -655,10 +715,35 @@ typedef unsigned char tsl_t; #endif #endif +/* + * !!! + * These defines are separated into the u_int8_t flags stored in the + * mutex below, and the 32 bit flags passed to __db_mutex_setup. + * But they must co-exist and not overlap. Flags to __db_mutex_setup are: + * + * 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_IGNORE 0x001 /* Ignore, no lock required. */ #define MUTEX_INITED 0x002 /* Mutex is successfully initialized */ -#define MUTEX_SELF_BLOCK 0x004 /* Must block self. */ -#define MUTEX_THREAD 0x008 /* Thread-only mutex. */ +#define MUTEX_MPOOL 0x004 /* Allocated from mpool. */ +#define MUTEX_SELF_BLOCK 0x008 /* Must block self. */ +/* Flags only, may be larger than 0xff. */ +#define MUTEX_ALLOC 0x00000100 /* Allocate and init a mutex */ +#define MUTEX_NO_RECORD 0x00000200 /* Do not record lock */ +#define MUTEX_NO_RLOCK 0x00000400 /* Do not acquire region lock */ +#define MUTEX_THREAD 0x00000800 /* Thread-only mutex. */ /* Mutex. */ struct __mutex_t { @@ -676,7 +761,9 @@ struct __mutex_t { #endif u_int32_t mutex_set_wait; /* Granted after wait. */ u_int32_t mutex_set_nowait; /* Granted without waiting. */ -#ifdef MUTEX_SYSTEM_RESOURCES + 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. */ #endif @@ -685,36 +772,43 @@ struct __mutex_t { /* 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(a, b, c, d) __db_pthread_mutex_init(a, b, d) -#define __db_mutex_lock(a, b, c) __db_pthread_mutex_lock(a, b) +#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) +#elif defined(HAVE_MUTEX_WIN32) +#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(a, b, c, d) __db_tas_mutex_init(a, b, d) -#define __db_mutex_lock(a, b, c) __db_tas_mutex_lock(a, b) +#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 #else -#define __db_mutex_init(a, b, c, d) __db_fcntl_mutex_init(a, b, c) -#define __db_mutex_lock(a, b, c) __db_fcntl_mutex_lock(a, b, c) +#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 MUTEX_SYSTEM_RESOURCES +#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_shmutex_init(a, b, c, d, e, f) \ +#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_shmutex_init(a, b, c, d, e, f) __db_mutex_init(a, b, c, d) +#define __db_mutex_init(a, b, c, d, e, f) __db_mutex_init_int(a, b, c, d) #endif /* @@ -731,22 +825,22 @@ struct __mutex_t { * We want to switch threads as often as possible. Yield every time * we get a mutex to ensure contention. */ -#define MUTEX_LOCK(dbenv, mp, fh) \ - if (!F_ISSET((MUTEX *)(mp), MUTEX_IGNORE)) \ - (void)__db_mutex_lock(dbenv, mp, fh); \ - if (DB_GLOBAL(db_pageyield)) \ +#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, fh) \ - if (!F_ISSET((MUTEX *)(mp), MUTEX_IGNORE)) \ - (void)__db_mutex_lock(dbenv, mp, fh); +#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((MUTEX *)(mp), MUTEX_IGNORE)) \ + 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, NULL) + MUTEX_LOCK(dbenv, mp) #define MUTEX_THREAD_UNLOCK(dbenv, mp) \ if (mp != NULL) \ MUTEX_UNLOCK(dbenv, mp) @@ -764,3 +858,22 @@ struct __mutex_t { #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 +#endif /* !_DB_MUTEX_H_ */ diff --git a/bdb/include/os.h b/bdb/dbinc/os.h similarity index 67% rename from bdb/include/os.h rename to bdb/dbinc/os.h index b5d469e88fa..01ca0ac470d 100644 --- a/bdb/include/os.h +++ b/bdb/dbinc/os.h @@ -1,28 +1,33 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. * - * $Id: os.h,v 11.5 2000/10/27 20:32:01 dda Exp $ + * $Id: os.h,v 11.14 2002/03/27 04:34:55 bostic Exp $ */ +#ifndef _DB_OS_H_ +#define _DB_OS_H_ + #if defined(__cplusplus) extern "C" { #endif -/* - * Filehandle. - */ + +/* DB filehandle. */ struct __fh_t { #if defined(DB_WIN32) HANDLE handle; /* Windows/32 file handle. */ #endif int fd; /* POSIX file descriptor. */ + char *name; /* File name. */ u_int32_t log_size; /* XXX: Log file size. */ + u_int32_t pagesize; /* XXX: Page size. */ #define DB_FH_NOSYNC 0x01 /* Handle doesn't need to be sync'd. */ -#define DB_FH_VALID 0x02 /* Handle is valid. */ +#define DB_FH_UNLINK 0x02 /* Unlink on close */ +#define DB_FH_VALID 0x04 /* Handle is valid. */ u_int8_t flags; }; @@ -34,7 +39,7 @@ struct __fh_t { #define DB_IO_WRITE 2 typedef struct __io_t { DB_FH *fhp; /* I/O file handle. */ - MUTEX *mutexp; /* Mutex to lock. */ + DB_MUTEX *mutexp; /* Mutex to lock. */ size_t pagesize; /* Page size. */ db_pgno_t pgno; /* Page number. */ u_int8_t *buf; /* Buffer. */ @@ -44,3 +49,6 @@ typedef struct __io_t { #if defined(__cplusplus) } #endif + +#include "dbinc_auto/os_ext.h" +#endif /* !_DB_OS_H_ */ diff --git a/bdb/include/qam.h b/bdb/dbinc/qam.h similarity index 88% rename from bdb/include/qam.h rename to bdb/dbinc/qam.h index 88cd68776a8..0306ed07d2a 100644 --- a/bdb/include/qam.h +++ b/bdb/dbinc/qam.h @@ -1,12 +1,15 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1999, 2000 + * Copyright (c) 1999-2002 * Sleepycat Software. All rights reserved. * - * $Id: qam.h,v 11.26 2001/01/11 18:19:52 bostic Exp $ + * $Id: qam.h,v 11.38 2002/08/06 06:11:21 bostic Exp $ */ +#ifndef _DB_QAM_H_ +#define _DB_QAM_H_ + /* * QAM data elements: a status field and the data. */ @@ -32,10 +35,6 @@ struct __qcursor { u_int32_t flags; }; -/* - * The in-memory, per-tree queue data structure. - */ - typedef struct __mpfarray { u_int32_t n_extent; /* Number of extents in table. */ u_int32_t low_extent; /* First extent open. */ @@ -46,6 +45,9 @@ typedef struct __mpfarray { } *mpfarray; /* Array of open extents. */ } MPFARRAY; +/* + * The in-memory, per-tree queue data structure. + */ struct __queue { db_pgno_t q_meta; /* Database meta-data page. */ db_pgno_t q_root; /* Database root page. */ @@ -55,9 +57,11 @@ struct __queue { u_int32_t rec_page; /* records per page */ u_int32_t page_ext; /* Pages per extent */ MPFARRAY array1, array2; /* File arrays. */ - DB_MPOOL_FINFO finfo; /* Initialized info struct. */ - DB_PGINFO pginfo; /* Initialized pginfo struct. */ + + /* Extent file configuration: */ DBT pgcookie; /* Initialized pgcookie. */ + DB_PGINFO pginfo; /* Initialized pginfo struct. */ + char *path; /* Space allocated to file pathname. */ char *name; /* The name of the file. */ char *dir; /* The dir of the file. */ @@ -65,7 +69,7 @@ struct __queue { }; /* Format for queue extent names. */ -#define QUEUE_EXTENT "%s/__dbq.%s.%d" +#define QUEUE_EXTENT "%s%c__dbq.%s.%d" typedef struct __qam_filelist { DB_MPOOLFILE *mpf; @@ -81,14 +85,14 @@ typedef struct __qam_filelist { * Page number for record = * divide the physical record number by the records per page * add the root page number - * For now the root page will always be 1, but we might want to change + * For now the root page will always be 1, but we might want to change * in the future (e.g. multiple fixed len queues per file). * * Index of record on page = * physical record number, less the logical pno times records/page */ #define CALC_QAM_RECNO_PER_PAGE(dbp) \ - (((dbp)->pgsize - sizeof(QPAGE)) / \ + (((dbp)->pgsize - QPAGE_SZ(dbp)) / \ ALIGN(((QUEUE *)(dbp)->q_internal)->re_len + \ sizeof(QAMDATA) - SSZA(QAMDATA, data), sizeof(u_int32_t))) @@ -104,7 +108,7 @@ typedef struct __qam_filelist { #define QAM_GET_RECORD(dbp, page, index) \ ((QAMDATA *)((u_int8_t *)(page) + \ - sizeof(QPAGE) + (ALIGN(sizeof(QAMDATA) - SSZA(QAMDATA, data) + \ + QPAGE_SZ(dbp) + (ALIGN(sizeof(QAMDATA) - SSZA(QAMDATA, data) + \ ((QUEUE *)(dbp)->q_internal)->re_len, sizeof(u_int32_t)) * index))) #define QAM_AFTER_CURRENT(meta, recno) \ @@ -124,6 +128,7 @@ typedef struct __qam_filelist { */ #define QAM_SETFIRST 0x01 #define QAM_SETCUR 0x02 +#define QAM_TRUNCATE 0x04 /* * Parameter to __qam_position. @@ -146,5 +151,6 @@ typedef enum { #define __qam_fput(dbp, pageno, addrp, flags) \ __qam_fprobe(dbp, pageno, addrp, QAM_PROBE_PUT, flags) -#include "qam_auto.h" -#include "qam_ext.h" +#include "dbinc_auto/qam_auto.h" +#include "dbinc_auto/qam_ext.h" +#endif /* !_DB_QAM_H_ */ diff --git a/bdb/include/queue.h b/bdb/dbinc/queue.h similarity index 100% rename from bdb/include/queue.h rename to bdb/dbinc/queue.h diff --git a/bdb/include/region.h b/bdb/dbinc/region.h similarity index 89% rename from bdb/include/region.h rename to bdb/dbinc/region.h index c5882d09aad..9ee6c81062f 100644 --- a/bdb/include/region.h +++ b/bdb/dbinc/region.h @@ -1,12 +1,15 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1998, 1999, 2000 + * Copyright (c) 1998-2002 * Sleepycat Software. All rights reserved. * - * $Id: region.h,v 11.13 2000/11/15 19:25:37 sue Exp $ + * $Id: region.h,v 11.33 2002/08/06 06:11:22 bostic Exp $ */ +#ifndef _DB_REGION_H_ +#define _DB_REGION_H_ + /* * The DB environment consists of some number of "regions", which are described * by the following four structures: @@ -87,7 +90,7 @@ * 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: * - * The address of an msemaphore structure may be significant. If the + * 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. */ @@ -129,7 +132,7 @@ typedef enum { /* Reference describing system memory version of REGENV. */ typedef struct __db_reg_env_ref { roff_t size; /* Region size. */ - long segid; /* UNIX shmget(2) ID. */ + long segid; /* UNIX shmget ID, VxWorks ID. */ } REGENV_REF; /* Per-environment region information. */ @@ -139,7 +142,7 @@ typedef struct __db_reg_env { * The mutex must be the first entry in the structure to guarantee * correct alignment. */ - MUTEX mutex; /* Environment mutex. */ + DB_MUTEX mutex; /* Environment mutex. */ /* * !!! @@ -154,19 +157,22 @@ typedef struct __db_reg_env { */ u_int32_t magic; /* Valid region magic number. */ - int panic; /* Environment is dead. */ + int envpanic; /* Environment is dead. */ int majver; /* Major DB version number. */ int minver; /* Minor DB version number. */ int patch; /* Patch DB version number. */ u_int32_t init_flags; /* Flags the env was initialized with.*/ + roff_t cipher_off; /* Offset of cipher area */ /* List of regions. */ SH_LIST_HEAD(__db_regionh) regionq; u_int32_t refcnt; /* References to the environment. */ + roff_t rep_off; /* Offset of the replication area. */ + size_t pad; /* Guarantee that following memory is * size_t aligned. This is necessary * because we're going to store the @@ -181,7 +187,7 @@ typedef struct __db_region { * The mutex must be the first entry in the structure to guarantee * correct alignment. */ - MUTEX mutex; /* Region mutex. */ + DB_MUTEX mutex; /* Region mutex. */ /* * !!! @@ -265,28 +271,34 @@ typedef struct __db_regmaint_t { * R_UNLOCK */ #define R_LOCK(dbenv, reginfo) \ - MUTEX_LOCK(dbenv, &(reginfo)->rp->mutex, (dbenv)->lockfhp) + 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 (DB_GLOBAL(db_panic) && \ + if (!F_ISSET((dbenv), DB_ENV_NOPANIC) && \ (dbenv)->reginfo != NULL && ((REGENV *) \ - ((REGINFO *)(dbenv)->reginfo)->primary)->panic != 0) \ - return (DB_RUNRECOVERY); + ((REGINFO *)(dbenv)->reginfo)->primary)->envpanic != 0) \ + return (__db_panic_msg(dbenv)); + +#define PANIC_SET(dbenv, onoff) \ + ((REGENV *)((REGINFO *)(dbenv)->reginfo)->primary)->envpanic = (onoff); /* - * All regions are created on 8K boundaries out of sheer paranoia, so that - * we don't make some underlying VM unhappy. + * 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_ROUNDOFF(i, s) { \ - (i) += (s) - 1; \ - (i) -= (i) % (s); \ -} #define OS_VMPAGESIZE (8 * 1024) -#define OS_VMROUNDOFF(i) OS_ROUNDOFF(i, OS_VMPAGESIZE) +#define OS_VMROUNDOFF(i) { \ + if ((i) < \ + (UINT32_T_MAX - OS_VMPAGESIZE) + 1 || (i) < OS_VMPAGESIZE) \ + (i) += OS_VMPAGESIZE - 1; \ + (i) -= (i) % OS_VMPAGESIZE; \ +} #if defined(__cplusplus) } #endif +#endif /* !_DB_REGION_H_ */ diff --git a/bdb/dbinc/rep.h b/bdb/dbinc/rep.h new file mode 100644 index 00000000000..1e315494c87 --- /dev/null +++ b/bdb/dbinc/rep.h @@ -0,0 +1,184 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2001-2002 + * Sleepycat Software. All rights reserved. + */ + +#ifndef _REP_H_ +#define _REP_H_ + +#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_ELECT 4 /* Indicates that all listeners should */ + /* begin master election */ +#define REP_FILE 6 /* Page of a database file. */ +#define REP_FILE_REQ 7 /* Request for a database file. */ +#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 + * 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_REQ 17 /* Request for a database page. */ +#define REP_PLIST 18 /* Database page list. */ +#define REP_PLIST_REQ 19 /* Request for a page list. */ +#define REP_VERIFY 20 /* A log record for verification. */ +#define REP_VERIFY_FAIL 21 /* The client is outdated. */ +#define REP_VERIFY_REQ 22 /* Request for a log record to verify. */ +#define REP_VOTE1 23 /* Send out your information for an election. */ +#define REP_VOTE2 24 /* Send a "you are master" vote. */ + +/* Used to consistently designate which messages ought to be received where. */ +#define MASTER_ONLY(dbenv) \ + if (!F_ISSET(dbenv, DB_ENV_REP_MASTER)) return (EINVAL) + +#define CLIENT_ONLY(dbenv) \ + if (!F_ISSET(dbenv, DB_ENV_REP_CLIENT)) return (EINVAL) + +#define ANYSITE(dbenv) + +/* 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. */ + u_int32_t tally_off; /* Offset of the tally region. */ + int eid; /* Environment id. */ + int master_id; /* ID of the master site. */ + u_int32_t gen; /* Replication generation number */ + int asites; /* Space allocated for sites. */ + int nsites; /* Number of sites in group. */ + int priority; /* My priority in an election. */ + u_int32_t gbytes; /* Limit on data sent in single... */ + u_int32_t bytes; /* __rep_process_message call. */ +#define DB_REP_REQUEST_GAP 4 +#define DB_REP_MAX_GAP 128 + 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. */ + + /* Vote tallying information. */ + int sites; /* Sites heard from. */ + int winner; /* Current winner. */ + int w_priority; /* Winner priority. */ + u_int32_t w_gen; /* Winner generation. */ + DB_LSN w_lsn; /* Winner LSN. */ + int w_tiebreaker; /* Winner tiebreaking value. */ + int votes; /* Number of votes for this site. */ + + /* Statistics. */ + DB_REP_STAT stat; + +#define REP_F_EPHASE1 0x01 /* In phase 1 of election. */ +#define REP_F_EPHASE2 0x02 /* In phase 2 of election. */ +#define REP_F_LOGSONLY 0x04 /* Log-site only; cannot be upgraded. */ +#define REP_F_MASTER 0x08 /* Master replica. */ +#define REP_F_RECOVER 0x10 +#define REP_F_UPGRADE 0x20 /* Upgradeable replica. */ +#define REP_ISCLIENT (REP_F_UPGRADE | REP_F_LOGSONLY) + u_int32_t flags; +} REP; + +#define IN_ELECTION(R) F_ISSET((R), REP_F_EPHASE1 | REP_F_EPHASE2) +#define ELECTION_DONE(R) F_CLR((R), REP_F_EPHASE1 | REP_F_EPHASE2) + +/* + * Per-process replication structure. + */ +struct __db_rep { + DB_MUTEX *mutexp; + + DB_MUTEX *db_mutexp; /* Mutex for bookkeeping database. */ + DB *rep_db; /* Bookkeeping database. */ + + REP *region; /* In memory structure. */ + int (*rep_send) /* Send function. */ + __P((DB_ENV *, + const DBT *, const DBT *, int, u_int32_t)); +}; + +/* + * 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. + */ +typedef struct __rep_control { +#define DB_REPVERSION 1 + 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. */ + u_int32_t flags; /* log_put flag value. */ +} REP_CONTROL; + +/* Election vote information. */ +typedef struct __rep_vote { + int priority; /* My site's priority. */ + int nsites; /* Number of sites I've been in + * communication with. */ + int tiebreaker; /* Tie-breaking quasi-random int. */ +} REP_VOTE_INFO; + +/* + * 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_page { + DB_LSN lsn; + u_int32_t fid; + DB_LOCK_ILOCK pgdesc; +#define LSN_PAGE_NOLOCK 0x0001 /* No lock necessary for log rec. */ + u_int32_t flags; +} LSN_PAGE; + +typedef struct __txn_recs { + int npages; + int nalloc; + LSN_PAGE *array; + u_int32_t txnid; + u_int32_t lockid; +} TXN_RECS; + +typedef struct __lsn_collection { + int nlsns; + int nalloc; + DB_LSN *array; +} LSN_COLLECTION; + +/* + * This is used by the page-prep routines to do the lock_vec call to + * apply the updates for a single transaction or a collection of + * transactions. + */ +typedef struct _linfo { + int n; + DB_LOCKREQ *reqs; + DBT *objs; +} linfo_t; + +#include "dbinc_auto/rep_ext.h" +#endif /* !_REP_H_ */ diff --git a/bdb/include/shqueue.h b/bdb/dbinc/shqueue.h similarity index 99% rename from bdb/include/shqueue.h rename to bdb/dbinc/shqueue.h index 115c5d39e88..47fdf12ac92 100644 --- a/bdb/include/shqueue.h +++ b/bdb/dbinc/shqueue.h @@ -1,11 +1,12 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: shqueue.h,v 11.6 2000/11/14 20:20:28 bostic Exp $ + * $Id: shqueue.h,v 11.9 2002/01/11 15:52:30 bostic Exp $ */ + #ifndef _SYS_SHQUEUE_H_ #define _SYS_SHQUEUE_H_ @@ -333,5 +334,4 @@ struct { \ #if defined(__cplusplus) } #endif - #endif /* !_SYS_SHQUEUE_H_ */ diff --git a/bdb/include/tcl_db.h b/bdb/dbinc/tcl_db.h similarity index 76% rename from bdb/include/tcl_db.h rename to bdb/dbinc/tcl_db.h index 254006c2f6d..8c04d545295 100644 --- a/bdb/include/tcl_db.h +++ b/bdb/dbinc/tcl_db.h @@ -1,18 +1,22 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1999, 2000 + * Copyright (c) 1999-2002 * Sleepycat Software. All rights reserved. * - * $Id: tcl_db.h,v 11.9 2000/12/12 17:43:56 bostic Exp $ + * $Id: tcl_db.h,v 11.30 2002/08/06 06:11:22 bostic Exp $ */ +#ifndef _DB_TCL_DB_H_ +#define _DB_TCL_DB_H_ + #define MSG_SIZE 100 /* Message size */ enum INFOTYPE { - I_ENV, I_DB, I_DBC, I_TXN, I_MP, I_PG, I_LOCK, I_NDBM, I_MUTEX }; + I_ENV, I_DB, I_DBC, I_TXN, I_MP, I_PG, I_LOCK, I_LOGC, I_NDBM, I_MUTEX }; #define MAX_ID 8 /* Maximum number of sub-id's we need */ +#define DBTCL_PREP 64 /* Size of txn_recover preplist */ #define DBTCL_DBM 1 #define DBTCL_NDBM 2 @@ -20,7 +24,7 @@ enum INFOTYPE { typedef struct _mutex_entry { union { struct { - MUTEX real_m; + DB_MUTEX real_m; u_int32_t real_val; } r; /* @@ -87,9 +91,7 @@ typedef struct dbtcl_info { DB_MPOOLFILE *mp; DB_LOCK *lock; _MUTEX_DATA *mutex; -#if 0 - DBM *ndbmp; /* Compatibility */ -#endif + DB_LOGC *logc; } un; union data { int anydata; @@ -103,13 +105,21 @@ typedef struct dbtcl_info { DBT i_lockobj; FILE *i_err; char *i_errpfx; + + /* Callbacks--Tcl_Objs containing proc names */ + Tcl_Obj *i_btcompare; + Tcl_Obj *i_dupcompare; + Tcl_Obj *i_hashproc; + Tcl_Obj *i_rep_send; + Tcl_Obj *i_second_call; + + /* Environment ID for the i_rep_send callback. */ + Tcl_Obj *i_rep_eid; + struct dbtcl_info *i_parent; int i_otherid[MAX_ID]; } DBTCL_INFO; -extern int __debug_on, __debug_print, __debug_stop, __debug_test; -LIST_HEAD(infohead, dbtcl_info) __db_infohead; - #define i_anyp un.anyp #define i_pagep un.anyp #define i_envp un.envp @@ -119,9 +129,7 @@ LIST_HEAD(infohead, dbtcl_info) __db_infohead; #define i_mp un.mp #define i_lock un.lock #define i_mutex un.mutex -#if 0 -#define i_ndbm un.ndbmp -#endif +#define i_logc un.logc #define i_data und.anydata #define i_pgno und.pgno @@ -133,11 +141,21 @@ LIST_HEAD(infohead, dbtcl_info) __db_infohead; #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_mppgid i_otherid[0] #define i_dbdbcid i_otherid[0] +extern int __debug_on, __debug_print, __debug_stop, __debug_test; + +typedef struct dbtcl_global { + LIST_HEAD(infohead, dbtcl_info) g_infohead; +} DBTCL_GLOBAL; +#define __db_infohead __dbtcl_global.g_infohead + +extern DBTCL_GLOBAL __dbtcl_global; + #define NAME_TO_ENV(name) (DB_ENV *)_NameToPtr((name)) #define NAME_TO_DB(name) (DB *)_NameToPtr((name)) #define NAME_TO_DBC(name) (DBC *)_NameToPtr((name)) @@ -160,6 +178,29 @@ do { \ goto error; \ } while (0) +/* + * MAKE_STAT_LSN appends a {name {LSNfile LSNoffset}} pair to a result list + * that MUST be called 'res' that is a Tcl_Obj * in the local + * function. This macro also assumes a label "error" to go to + * in the even of a Tcl error. For stat functions this will + * typically go before the "free" function to free the stat structure + * returned by DB. + */ +#define MAKE_STAT_LSN(s, lsn) \ +do { \ + myobjc = 2; \ + myobjv[0] = Tcl_NewLongObj((long)(lsn)->file); \ + myobjv[1] = Tcl_NewLongObj((long)(lsn)->offset); \ + lsnlist = Tcl_NewListObj(myobjc, myobjv); \ + myobjc = 2; \ + myobjv[0] = Tcl_NewStringObj((s), strlen(s)); \ + myobjv[1] = lsnlist; \ + thislist = Tcl_NewListObj(myobjc, myobjv); \ + result = Tcl_ListObjAppendElement(interp, res, thislist); \ + if (result != TCL_OK) \ + goto error; \ +} while (0) + /* * MAKE_STAT_STRLIST appends a {name string} pair to a result list * that MUST be called 'res' that is a Tcl_Obj * in the local @@ -170,7 +211,7 @@ do { \ */ #define MAKE_STAT_STRLIST(s,s1) \ do { \ - result = _SetListElem(interp, res, (s), strlen(s), \ + result = _SetListElem(interp, res, (s), strlen(s), \ (s1), strlen(s1)); \ if (result != TCL_OK) \ goto error; \ @@ -198,7 +239,7 @@ do { \ */ #define FLAG_CHECK2(flag,val) \ do { \ - if ((flag) != 0 && (flag) != (val)) { \ + if (((flag) & ~(val)) != 0) { \ Tcl_SetResult(interp, \ " Only 1 policy can be specified.\n", \ TCL_STATIC); \ @@ -216,4 +257,5 @@ do { \ #define IS_HELP(s) \ (strcmp(Tcl_GetStringFromObj(s,NULL), "-?") == 0) ? TCL_OK : TCL_ERROR -#include "tcl_ext.h" +#include "dbinc_auto/tcl_ext.h" +#endif /* !_DB_TCL_DB_H_ */ diff --git a/bdb/include/txn.h b/bdb/dbinc/txn.h similarity index 57% rename from bdb/include/txn.h rename to bdb/dbinc/txn.h index 009a1ca1589..31b00a6ba74 100644 --- a/bdb/include/txn.h +++ b/bdb/dbinc/txn.h @@ -1,18 +1,24 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * - * $Id: txn.h,v 11.12 2001/01/02 17:23:39 margo Exp $ + * $Id: txn.h,v 11.43 2002/08/29 14:22:19 margo Exp $ */ #ifndef _TXN_H_ #define _TXN_H_ -#include "xa.h" +#include "dbinc/xa.h" + +/* Operation parameters to the delayed commit processing code. */ +typedef enum { + TXN_REMOVE, /* Remove a file. */ + TXN_TRADE, /* Trade lockers. */ + TXN_TRADED /* Already traded; downgrade lock. */ +} TXN_EVENT_T; -struct __db_txnmgr; typedef struct __db_txnmgr DB_TXNMGR; struct __db_txnregion; typedef struct __db_txnregion DB_TXNREGION; /* @@ -20,36 +26,14 @@ struct __db_txnregion; typedef struct __db_txnregion DB_TXNREGION; * TXN_MINIMUM = (DB_LOCK_MAXID + 1) but this makes compilers complain. */ #define TXN_MINIMUM 0x80000000 -#define TXN_INVALID 0xffffffff /* Maximum number of txn ids. */ -#define TXN_INVALID_ID 0 /* Invalid transaction ID. */ +#define TXN_MAXIMUM 0xffffffff /* Maximum number of txn ids. */ +#define TXN_INVALID 0 /* Invalid transaction ID. */ #define DEF_MAX_TXNS 20 /* Default max transactions. */ -/* The structure allocated for every transaction. */ -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. */ - roff_t off; /* Detail structure within region. */ - TAILQ_ENTRY(__db_txn) links; /* Links transactions off manager. */ - TAILQ_HEAD(__kids, __db_txn) kids; /* Child transactions. */ - TAILQ_ENTRY(__db_txn) klinks; /* Links child transactions. */ - u_int32_t cursors; /* Number of cursors open for txn */ - -#define TXN_CHILDCOMMIT 0x01 /* Transaction that has committed. */ -#define TXN_MALLOC 0x02 /* Structure allocated by TXN system. */ -#define TXN_NOSYNC 0x04 /* Do not sync on prepare and commit. */ -#define TXN_NOWAIT 0x08 /* Do not wait on locks. */ -#define TXN_SYNC 0x10 /* Sync on prepare and commit. */ - u_int32_t flags; -}; - /* * Internal data maintained in shared memory for each transaction. */ -typedef char DB_XID[XIDDATASIZE]; - typedef struct __txn_detail { u_int32_t txnid; /* current transaction id used to link free list also */ @@ -62,6 +46,9 @@ typedef struct __txn_detail { #define TXN_PREPARED 3 #define TXN_COMMITTED 4 u_int32_t status; /* status of the transaction */ +#define TXN_COLLECTED 0x1 +#define TXN_RESTORED 0x2 + u_int32_t flags; /* collected during txn_recover */ SH_TAILQ_ENTRY links; /* free/active list */ @@ -77,7 +64,7 @@ typedef struct __txn_detail { * XID (xid_t) structure: because these fields are logged, the * sizes have to be explicit. */ - DB_XID xid; /* XA global transaction id */ + u_int8_t xid[XIDDATASIZE]; /* XA global transaction id */ u_int32_t bqual; /* bqual_length from XID */ u_int32_t gtrid; /* gtrid_length from XID */ int32_t format; /* XA format */ @@ -96,12 +83,13 @@ struct __db_txnmgr { * to be stored elsewhere on architectures unable to support mutexes in heap * memory, e.g., HP/UX 9. */ - MUTEX *mutexp; /* Lock list of active transactions + DB_MUTEX *mutexp; /* Lock list of active transactions * (including the content of each * TXN_DETAIL structure on the list). */ /* 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. */ @@ -115,36 +103,41 @@ struct __db_txnmgr { struct __db_txnregion { u_int32_t maxtxns; /* maximum number of active TXNs */ u_int32_t last_txnid; /* last transaction id given out */ - DB_LSN pending_ckp; /* last checkpoint did not finish */ + u_int32_t cur_maxid; /* current max unused id. */ DB_LSN last_ckp; /* lsn of the last checkpoint */ time_t time_ckp; /* time of last checkpoint */ u_int32_t logtype; /* type of logging */ u_int32_t locktype; /* lock type */ - u_int32_t naborts; /* number of aborted TXNs */ - u_int32_t ncommits; /* number of committed TXNs */ - u_int32_t nbegins; /* number of begun TXNs */ - u_int32_t nactive; /* number of active TXNs */ - u_int32_t maxnactive; /* maximum number of active TXNs */ + DB_TXN_STAT stat; /* Statistics for txns. */ + +#define TXN_IN_RECOVERY 0x01 /* environment is being recovered */ + 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 }; /* - * Make the region large enough to hold N transaction detail structures - * plus some space to hold thread handles and the beginning of the shalloc - * region. - */ -#define TXN_REGION_SIZE(N) \ - (sizeof(DB_TXNREGION) + N * sizeof(TXN_DETAIL) + 1000) - -/* - * Log record types. + * Log record types. Note that these are *not* alphabetical. This is + * intentional so that we don't change the meaning of values between + * software upgrades. EXPECTED, UNEXPECTED, IGNORE, NOTFOUND and OK + * are used in the + * txnlist functions. */ +#define TXN_OK 0 #define TXN_COMMIT 1 #define TXN_PREPARE 2 +#define TXN_ABORT 3 +#define TXN_NOTFOUND 4 +#define TXN_IGNORE 5 +#define TXN_EXPECTED 6 +#define TXN_UNEXPECTED 7 -#include "txn_auto.h" -#include "txn_ext.h" - -#include "xa_ext.h" +#include "dbinc_auto/txn_auto.h" +#include "dbinc_auto/txn_ext.h" +#include "dbinc_auto/xa_ext.h" #endif /* !_TXN_H_ */ diff --git a/bdb/include/xa.h b/bdb/dbinc/xa.h similarity index 98% rename from bdb/include/xa.h rename to bdb/dbinc/xa.h index ce46179263a..64bdac8c914 100644 --- a/bdb/include/xa.h +++ b/bdb/dbinc/xa.h @@ -1,10 +1,10 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1998, 1999, 2000 + * Copyright (c) 1998-2002 * Sleepycat Software. All rights reserved. * - * $Id: xa.h,v 11.3 2000/02/14 02:59:55 bostic Exp $ + * $Id: xa.h,v 11.5 2002/01/11 15:52:30 bostic Exp $ */ /* * Start of xa.h header diff --git a/bdb/dbinc_auto/btree_auto.h b/bdb/dbinc_auto/btree_auto.h new file mode 100644 index 00000000000..4feb07ad94c --- /dev/null +++ b/bdb/dbinc_auto/btree_auto.h @@ -0,0 +1,128 @@ +/* Do not edit: automatically built by gen_rec.awk. */ + +#ifndef __bam_AUTO_H +#define __bam_AUTO_H +#define DB___bam_split 62 +typedef struct ___bam_split_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t left; + DB_LSN llsn; + db_pgno_t right; + DB_LSN rlsn; + u_int32_t indx; + db_pgno_t npgno; + DB_LSN nlsn; + db_pgno_t root_pgno; + DBT pg; + u_int32_t opflags; +} __bam_split_args; + +#define DB___bam_rsplit 63 +typedef struct ___bam_rsplit_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + DBT pgdbt; + db_pgno_t root_pgno; + db_pgno_t nrec; + DBT rootent; + DB_LSN rootlsn; +} __bam_rsplit_args; + +#define DB___bam_adj 55 +typedef struct ___bam_adj_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + DB_LSN lsn; + u_int32_t indx; + u_int32_t indx_copy; + u_int32_t is_insert; +} __bam_adj_args; + +#define DB___bam_cadjust 56 +typedef struct ___bam_cadjust_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + DB_LSN lsn; + u_int32_t indx; + int32_t adjust; + u_int32_t opflags; +} __bam_cadjust_args; + +#define DB___bam_cdel 57 +typedef struct ___bam_cdel_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + DB_LSN lsn; + u_int32_t indx; +} __bam_cdel_args; + +#define DB___bam_repl 58 +typedef struct ___bam_repl_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + DB_LSN lsn; + u_int32_t indx; + u_int32_t isdeleted; + DBT orig; + DBT repl; + u_int32_t prefix; + u_int32_t suffix; +} __bam_repl_args; + +#define DB___bam_root 59 +typedef struct ___bam_root_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t meta_pgno; + db_pgno_t root_pgno; + DB_LSN meta_lsn; +} __bam_root_args; + +#define DB___bam_curadj 64 +typedef struct ___bam_curadj_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_ca_mode mode; + db_pgno_t from_pgno; + db_pgno_t to_pgno; + db_pgno_t left_pgno; + u_int32_t first_indx; + u_int32_t from_indx; + u_int32_t to_indx; +} __bam_curadj_args; + +#define DB___bam_rcuradj 65 +typedef struct ___bam_rcuradj_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + ca_recno_arg mode; + db_pgno_t root; + db_recno_t recno; + u_int32_t order; +} __bam_rcuradj_args; + +#endif diff --git a/bdb/dbinc_auto/btree_ext.h b/bdb/dbinc_auto/btree_ext.h new file mode 100644 index 00000000000..ec5468acf1c --- /dev/null +++ b/bdb/dbinc_auto/btree_ext.h @@ -0,0 +1,132 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _btree_ext_h_ +#define _btree_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __bam_cmp __P((DB *, 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 *)); +void __bam_cprint __P((DBC *)); +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_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_c_init __P((DBC *, DBTYPE)); +int __bam_c_refresh __P((DBC *)); +int __bam_c_count __P((DBC *, db_recno_t *)); +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_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_db_create __P((DB *)); +int __bam_db_close __P((DB *)); +int __bam_set_flags __P((DB *, u_int32_t *flagsp)); +int __ram_set_flags __P((DB *, u_int32_t *flagsp)); +int __bam_open __P((DB *, DB_TXN *, const char *, db_pgno_t, u_int32_t)); +int __bam_metachk __P((DB *, const char *, BTMETA *)); +int __bam_read_root __P((DB *, DB_TXN *, db_pgno_t, u_int32_t)); +int __bam_new_file __P((DB *, DB_TXN *, DB_FH *, const char *)); +int __bam_new_subdb __P((DB *, DB *, DB_TXN *)); +int __bam_iitem __P((DBC *, DBT *, DBT *, u_int32_t, u_int32_t)); +int __bam_ritem __P((DBC *, PAGE *, u_int32_t, DBT *)); +int __bam_split_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_rsplit_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_adj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_cadjust_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_cdel_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_repl_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +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_reclaim __P((DB *, DB_TXN *)); +int __bam_truncate __P((DB *, DB_TXN *, u_int32_t *)); +int __ram_open __P((DB *, DB_TXN *, const char *, db_pgno_t, u_int32_t)); +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_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_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_copy __P((DB *, PAGE *, PAGE *, u_int32_t, u_int32_t)); +int __bam_stat __P((DB *, void *, u_int32_t)); +int __bam_traverse __P((DBC *, db_lockmode_t, db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *)); +int __bam_stat_callback __P((DB *, PAGE *, void *, int *)); +int __bam_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)); +int __bam_30_btreemeta __P((DB *, char *, u_int8_t *)); +int __bam_31_btreemeta __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *)); +int __bam_31_lbtree __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *)); +int __bam_vrfy_meta __P((DB *, VRFY_DBINFO *, BTMETA *, db_pgno_t, u_int32_t)); +int __ram_vrfy_leaf __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t)); +int __bam_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t)); +int __bam_vrfy_itemorder __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t, int, int, u_int32_t)); +int __bam_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t)); +int __bam_vrfy_subtree __P((DB *, VRFY_DBINFO *, db_pgno_t, void *, void *, u_int32_t, u_int32_t *, u_int32_t *, u_int32_t *)); +int __bam_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, PAGE *, void *, int (*)(void *, const void *), DBT *, u_int32_t)); +int __bam_salvage_walkdupint __P((DB *, VRFY_DBINFO *, PAGE *, DBT *, void *, int (*)(void *, const void *), u_int32_t)); +int __bam_meta2pgset __P((DB *, VRFY_DBINFO *, BTMETA *, u_int32_t, DB *)); +int __bam_split_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, u_int32_t)); +int __bam_split_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_split_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_split_read __P((DB_ENV *, void *, __bam_split_args **)); +int __bam_rsplit_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, const DBT *, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *)); +int __bam_rsplit_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_rsplit_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_rsplit_read __P((DB_ENV *, void *, __bam_rsplit_args **)); +int __bam_adj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, u_int32_t)); +int __bam_adj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_adj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_adj_read __P((DB_ENV *, void *, __bam_adj_args **)); +int __bam_cadjust_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, int32_t, u_int32_t)); +int __bam_cadjust_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_cadjust_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_cadjust_read __P((DB_ENV *, void *, __bam_cadjust_args **)); +int __bam_cdel_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t)); +int __bam_cdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_cdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_cdel_read __P((DB_ENV *, void *, __bam_cdel_args **)); +int __bam_repl_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, u_int32_t, u_int32_t)); +int __bam_repl_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_repl_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_repl_read __P((DB_ENV *, void *, __bam_repl_args **)); +int __bam_root_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, db_pgno_t, DB_LSN *)); +int __bam_root_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_root_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_root_read __P((DB_ENV *, void *, __bam_root_args **)); +int __bam_curadj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_ca_mode, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t)); +int __bam_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +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_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_rcuradj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __bam_rcuradj_read __P((DB_ENV *, void *, __bam_rcuradj_args **)); +int __bam_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __bam_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __bam_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_btree_ext_h_ */ diff --git a/bdb/dbinc_auto/clib_ext.h b/bdb/dbinc_auto/clib_ext.h new file mode 100644 index 00000000000..7e2817d620e --- /dev/null +++ b/bdb/dbinc_auto/clib_ext.h @@ -0,0 +1,49 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _clib_ext_h_ +#define _clib_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#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_MEMCMP +int memcmp __P((const void *, const void *, size_t)); +#endif +#ifndef HAVE_MEMCPY +void *memcpy __P((void *, const void *, size_t)); +#endif +#ifndef HAVE_MEMMOVE +void *memmove __P((void *, const void *, size_t)); +#endif +#ifndef HAVE_RAISE +int raise __P((int)); +#endif +#ifndef HAVE_SNPRINTF +int snprintf __P((char *, size_t, const char *, ...)); +#endif +#ifndef HAVE_STRCASECMP +int strcasecmp __P((const char *, const char *)); +#endif +#ifndef HAVE_STRCASECMP +int strncasecmp __P((const char *, const char *, size_t)); +#endif +#ifndef HAVE_STRDUP +char *strdup __P((const char *)); +#endif +#ifndef HAVE_STRERROR +char *strerror __P((int)); +#endif +#ifndef HAVE_VSNPRINTF +int vsnprintf __P((char *, size_t, const char *, va_list)); +#endif + +#if defined(__cplusplus) +} +#endif +#endif /* !_clib_ext_h_ */ diff --git a/bdb/dbinc_auto/common_ext.h b/bdb/dbinc_auto/common_ext.h new file mode 100644 index 00000000000..7744982fe41 --- /dev/null +++ b/bdb/dbinc_auto/common_ext.h @@ -0,0 +1,44 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _common_ext_h_ +#define _common_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __db_isbigendian __P((void)); +int __db_byteorder __P((DB_ENV *, int)); +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)); +void __db_pgerr __P((DB *, db_pgno_t, int)); +int __db_pgfmt __P((DB_ENV *, db_pgno_t)); +int __db_eopnotsup __P((const DB_ENV *)); +#ifdef DIAGNOSTIC +void __db_assert __P((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 *, ...)); +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_logmsg __P((const DB_ENV *, DB_TXN *, const char *, u_int32_t, const char *, ...)); +int __db_unknown_flag __P((DB_ENV *, char *, u_int32_t)); +int __db_unknown_type __P((DB_ENV *, char *, DBTYPE)); +int __db_check_txn __P((DB *, DB_TXN *, u_int32_t, int)); +int __db_not_txn_env __P((DB_ENV *)); +int __db_getlong __P((DB *, const char *, char *, long, long, long *)); +int __db_getulong __P((DB *, 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_util_arg __P((char *, char *, int *, char ***)); +int __db_util_cache __P((DB_ENV *, DB *, u_int32_t *, int *)); +int __db_util_logset __P((const char *, char *)); +void __db_util_siginit __P((void)); +int __db_util_interrupted __P((void)); +void __db_util_sigresend __P((void)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_common_ext_h_ */ diff --git a/bdb/dbinc_auto/crdel_auto.h b/bdb/dbinc_auto/crdel_auto.h new file mode 100644 index 00000000000..bdae193fac8 --- /dev/null +++ b/bdb/dbinc_auto/crdel_auto.h @@ -0,0 +1,16 @@ +/* Do not edit: automatically built by gen_rec.awk. */ + +#ifndef __crdel_AUTO_H +#define __crdel_AUTO_H +#define DB___crdel_metasub 142 +typedef struct ___crdel_metasub_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + DBT page; + DB_LSN lsn; +} __crdel_metasub_args; + +#endif diff --git a/bdb/dbinc_auto/crypto_ext.h b/bdb/dbinc_auto/crypto_ext.h new file mode 100644 index 00000000000..e37a895d91a --- /dev/null +++ b/bdb/dbinc_auto/crypto_ext.h @@ -0,0 +1,37 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _crypto_ext_h_ +#define _crypto_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __aes_setup __P((DB_ENV *, DB_CIPHER *)); +int __aes_adj_size __P((size_t)); +int __aes_close __P((DB_ENV *, void *)); +int __aes_decrypt __P((DB_ENV *, void *, void *, u_int8_t *, size_t)); +int __aes_encrypt __P((DB_ENV *, void *, void *, u_int8_t *, size_t)); +int __aes_init __P((DB_ENV *, DB_CIPHER *)); +int __crypto_region_init __P((DB_ENV *)); +int __crypto_dbenv_close __P((DB_ENV *)); +int __crypto_algsetup __P((DB_ENV *, DB_CIPHER *, u_int32_t, int)); +int __crypto_decrypt_meta __P((DB_ENV *, DB *, u_int8_t *, int)); +int __db_generate_iv __P((DB_ENV *, u_int32_t *)); +int __db_rijndaelKeySetupEnc __P((u32 *, const u8 *, int)); +int __db_rijndaelKeySetupDec __P((u32 *, const u8 *, int)); +void __db_rijndaelEncrypt __P((u32 *, int, const u8 *, u8 *)); +void __db_rijndaelDecrypt __P((u32 *, int, const u8 *, u8 *)); +void __db_rijndaelEncryptRound __P((const u32 *, int, u8 *, int)); +void __db_rijndaelDecryptRound __P((const u32 *, int, u8 *, int)); +int __db_makeKey __P((keyInstance *, int, int, char *)); +int __db_cipherInit __P((cipherInstance *, int, char *)); +int __db_blockEncrypt __P((cipherInstance *, keyInstance *, BYTE *, size_t, BYTE *)); +int __db_padEncrypt __P((cipherInstance *, keyInstance *, BYTE *, int, BYTE *)); +int __db_blockDecrypt __P((cipherInstance *, keyInstance *, BYTE *, size_t, BYTE *)); +int __db_padDecrypt __P((cipherInstance *, keyInstance *, BYTE *, int, BYTE *)); +int __db_cipherUpdateRounds __P((cipherInstance *, keyInstance *, BYTE *, int, BYTE *, int)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_crypto_ext_h_ */ diff --git a/bdb/dbinc_auto/db_auto.h b/bdb/dbinc_auto/db_auto.h new file mode 100644 index 00000000000..e56f38b384b --- /dev/null +++ b/bdb/dbinc_auto/db_auto.h @@ -0,0 +1,118 @@ +/* Do not edit: automatically built by gen_rec.awk. */ + +#ifndef __db_AUTO_H +#define __db_AUTO_H +#define DB___db_addrem 41 +typedef struct ___db_addrem_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t opcode; + int32_t fileid; + db_pgno_t pgno; + u_int32_t indx; + u_int32_t nbytes; + DBT hdr; + DBT dbt; + DB_LSN pagelsn; +} __db_addrem_args; + +#define DB___db_big 43 +typedef struct ___db_big_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t opcode; + int32_t fileid; + db_pgno_t pgno; + db_pgno_t prev_pgno; + db_pgno_t next_pgno; + DBT dbt; + DB_LSN pagelsn; + DB_LSN prevlsn; + DB_LSN nextlsn; +} __db_big_args; + +#define DB___db_ovref 44 +typedef struct ___db_ovref_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + int32_t adjust; + DB_LSN lsn; +} __db_ovref_args; + +#define DB___db_relink 45 +typedef struct ___db_relink_args { + u_int32_t type; + DB_TXN *txnid; + 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_args; + +#define DB___db_debug 47 +typedef struct ___db_debug_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + DBT op; + int32_t fileid; + DBT key; + DBT data; + u_int32_t arg_flags; +} __db_debug_args; + +#define DB___db_noop 48 +typedef struct ___db_noop_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + DB_LSN prevlsn; +} __db_noop_args; + +#define DB___db_pg_alloc 49 +typedef struct ___db_pg_alloc_args { + u_int32_t type; + DB_TXN *txnid; + 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_args; + +#define DB___db_pg_free 50 +typedef struct ___db_pg_free_args { + u_int32_t type; + DB_TXN *txnid; + 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_args; + +#define DB___db_cksum 51 +typedef struct ___db_cksum_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; +} __db_cksum_args; + +#endif diff --git a/bdb/dbinc_auto/db_ext.h b/bdb/dbinc_auto/db_ext.h new file mode 100644 index 00000000000..24a13975c89 --- /dev/null +++ b/bdb/dbinc_auto/db_ext.h @@ -0,0 +1,224 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _db_ext_h_ +#define _db_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __crdel_metasub_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, const DBT *, DB_LSN *)); +int __crdel_metasub_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __crdel_metasub_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __crdel_metasub_read __P((DB_ENV *, void *, __crdel_metasub_args **)); +int __crdel_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __crdel_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __crdel_init_recover __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 __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_close __P((DB *, u_int32_t)); +int __db_close_i __P((DB *, DB_TXN *, u_int32_t)); +int __db_refresh __P((DB *, DB_TXN *, u_int32_t)); +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)); +#if CONFIG_TEST +int __db_testcopy __P((DB_ENV *, DB *, const char *)); +#endif +int __db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t)); +int __db_icursor __P((DB *, DB_TXN *, DBTYPE, db_pgno_t, int, u_int32_t, DBC **)); +int __db_cprint __P((DB *)); +int __db_fd __P((DB *, int *)); +int __db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); +int __db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); +int __db_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); +int __db_sync __P((DB *, u_int32_t)); +int __db_associate __P((DB *, DB_TXN *, DB *, int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t)); +int __db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)); +int __db_addrem_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, u_int32_t, u_int32_t, const DBT *, const DBT *, DB_LSN *)); +int __db_addrem_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_addrem_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_addrem_read __P((DB_ENV *, void *, __db_addrem_args **)); +int __db_big_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *, DB_LSN *, DB_LSN *)); +int __db_big_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_big_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +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_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_ovref_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_ovref_read __P((DB_ENV *, void *, __db_ovref_args **)); +int __db_relink_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 *)); +int __db_relink_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_relink_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_relink_read __P((DB_ENV *, void *, __db_relink_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_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_debug_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +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_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_noop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_noop_read __P((DB_ENV *, void *, __db_noop_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)); +int __db_pg_alloc_getpgnos __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_alloc_read __P((DB_ENV *, void *, __db_pg_alloc_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)); +int __db_pg_free_getpgnos __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_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_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_cksum_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_cksum_read __P((DB_ENV *, void *, __db_cksum_args **)); +int __db_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __db_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __db_init_recover __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 *)); +int __db_c_count __P((DBC *, db_recno_t *, u_int32_t)); +int __db_c_del __P((DBC *, u_int32_t)); +int __db_c_dup __P((DBC *, DBC **, u_int32_t)); +int __db_c_idup __P((DBC *, DBC **, u_int32_t)); +int __db_c_newopd __P((DBC *, db_pgno_t, DBC *, DBC **)); +int __db_c_get __P((DBC *, DBT *, DBT *, u_int32_t)); +int __db_c_put __P((DBC *, DBT *, DBT *, u_int32_t)); +int __db_duperr __P((DB *, u_int32_t)); +int __db_c_secondary_get __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_next __P((DB **)); +int __db_s_done __P((DB *)); +u_int32_t __db_partsize __P((u_int32_t, DBT *)); +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_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, 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)); +int __db_txnlist_update __P((DB_ENV *, void *, u_int32_t, u_int32_t, DB_LSN *)); +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_lsninit __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *)); +int __db_add_limbo __P((DB_ENV *, void *, int32_t, db_pgno_t, int32_t)); +int __db_do_the_limbo __P((DB_ENV *, DB_TXN *, DB_TXN *, DB_TXNHEAD *)); +void __db_txnlist_print __P((void *)); +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_relink __P((DBC *, u_int32_t, PAGE *, PAGE **, int)); +int __db_cursorchk __P((const DB *, u_int32_t)); +int __db_ccountchk __P((const DB *, u_int32_t, int)); +int __db_cdelchk __P((const DB *, u_int32_t, int)); +int __db_cgetchk __P((const DB *, DBT *, DBT *, u_int32_t, int)); +int __db_cputchk __P((const DB *, const DBT *, DBT *, u_int32_t, int)); +int __db_pgetchk __P((const DB *, const DBT *, DBT *, DBT *, u_int32_t)); +int __db_cpgetchk __P((const DB *, DBT *, DBT *, DBT *, u_int32_t, int)); +int __db_delchk __P((const DB *, DBT *, u_int32_t)); +int __db_getchk __P((const DB *, const DBT *, DBT *, u_int32_t)); +int __db_joinchk __P((const DB *, DBC * const *, u_int32_t)); +int __db_joingetchk __P((const DB *, DBT *, u_int32_t)); +int __db_putchk __P((const DB *, DBT *, const DBT *, u_int32_t, int)); +int __db_statchk __P((const DB *, u_int32_t)); +int __db_syncchk __P((const DB *, u_int32_t)); +int __db_secondary_corrupt __P((DB *)); +int __db_associatechk __P((DB *, DB *, int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t)); +int __db_txn_auto __P((DB *, DB_TXN **)); +int __db_join __P((DB *, DBC **, DBC **, u_int32_t)); +int __db_new __P((DBC *, u_int32_t, PAGE **)); +int __db_free __P((DBC *, PAGE *)); +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 *)); +int __dbh_am_chk __P((DB *, u_int32_t)); +int __db_set_lorder __P((DB *, int)); +int __db_open __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)); +int __db_dbopen __P((DB *, DB_TXN *, const char *, const char *, u_int32_t, int, db_pgno_t)); +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_poff __P((DBC *, const DBT *, db_pgno_t *)); +int __db_ovref __P((DBC *, db_pgno_t, int32_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_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_dump __P((DB *, char *, char *)); +void __db_inmemdbflags __P((u_int32_t, void *, void (*)(u_int32_t, const FN *, void *))); +int __db_prnpage __P((DB *, db_pgno_t, FILE *)); +int __db_prpage __P((DB *, PAGE *, FILE *, u_int32_t)); +void __db_pr __P((u_int8_t *, u_int32_t, FILE *)); +int __db_prdbt __P((DBT *, int, const char *, void *, int (*)(void *, const void *), int, VRFY_DBINFO *)); +void __db_prflags __P((u_int32_t, const FN *, void *)); +const char * __db_dbtype_to_string __P((DBTYPE)); +int __db_prheader __P((DB *, char *, int, int, void *, int (*)(void *, const void *), VRFY_DBINFO *, db_pgno_t)); +int __db_prfooter __P((void *, int (*)(void *, const void *))); +int __db_addrem_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_big_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_ovref_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_relink_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_debug_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_noop_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_pg_alloc_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __db_pg_free_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_traverse_big __P((DB *, db_pgno_t, 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 __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)); +int __db_remove __P((DB *, const char *, const char *, u_int32_t)); +int __db_remove_i __P((DB *, DB_TXN *, const char *, const char *)); +int __dbenv_dbrename __P((DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)); +int __db_rename __P((DB *, const char *, const char *, const char *, u_int32_t)); +int __db_rename_i __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_retcopy __P((DB_ENV *, DBT *, void *, u_int32_t, void **, u_int32_t *)); +int __db_truncate __P((DB *, DB_TXN *, u_int32_t *, u_int32_t)); +int __db_upgrade __P((DB *, const char *, u_int32_t)); +int __db_lastpgno __P((DB *, char *, DB_FH *, db_pgno_t *)); +int __db_31_offdup __P((DB *, char *, DB_FH *, int, db_pgno_t *)); +int __db_verify __P((DB *, const char *, const char *, FILE *, u_int32_t)); +int __db_verify_callback __P((void *, const void *)); +int __db_verify_internal __P((DB *, const char *, const char *, void *, int (*)(void *, const void *), u_int32_t)); +int __db_vrfy_datapage __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t)); +int __db_vrfy_meta __P((DB *, VRFY_DBINFO *, DBMETA *, db_pgno_t, u_int32_t)); +void __db_vrfy_struct_feedback __P((DB *, VRFY_DBINFO *)); +int __db_vrfy_inpitem __P((DB *, PAGE *, db_pgno_t, u_int32_t, int, u_int32_t, u_int32_t *, u_int32_t *)); +int __db_vrfy_duptype __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t)); +int __db_salvage_duptree __P((DB *, VRFY_DBINFO *, db_pgno_t, DBT *, void *, int (*)(void *, const void *), u_int32_t)); +int __db_vrfy_dbinfo_create __P((DB_ENV *, u_int32_t, VRFY_DBINFO **)); +int __db_vrfy_dbinfo_destroy __P((DB_ENV *, VRFY_DBINFO *)); +int __db_vrfy_getpageinfo __P((VRFY_DBINFO *, db_pgno_t, VRFY_PAGEINFO **)); +int __db_vrfy_putpageinfo __P((DB_ENV *, VRFY_DBINFO *, VRFY_PAGEINFO *)); +int __db_vrfy_pgset __P((DB_ENV *, u_int32_t, DB **)); +int __db_vrfy_pgset_get __P((DB *, db_pgno_t, int *)); +int __db_vrfy_pgset_inc __P((DB *, db_pgno_t)); +int __db_vrfy_pgset_dec __P((DB *, db_pgno_t)); +int __db_vrfy_pgset_next __P((DBC *, db_pgno_t *)); +int __db_vrfy_childcursor __P((VRFY_DBINFO *, DBC **)); +int __db_vrfy_childput __P((VRFY_DBINFO *, db_pgno_t, VRFY_CHILDINFO *)); +int __db_vrfy_ccset __P((DBC *, db_pgno_t, VRFY_CHILDINFO **)); +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_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)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_db_ext_h_ */ diff --git a/bdb/dbinc_auto/db_server.h b/bdb/dbinc_auto/db_server.h new file mode 100644 index 00000000000..3409eed1a9f --- /dev/null +++ b/bdb/dbinc_auto/db_server.h @@ -0,0 +1,1006 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _DB_SERVER_H_RPCGEN +#define _DB_SERVER_H_RPCGEN + + +struct __env_cachesize_msg { + u_int dbenvcl_id; + u_int gbytes; + u_int bytes; + u_int ncache; +}; +typedef struct __env_cachesize_msg __env_cachesize_msg; + +struct __env_cachesize_reply { + int status; +}; +typedef struct __env_cachesize_reply __env_cachesize_reply; + +struct __env_close_msg { + u_int dbenvcl_id; + u_int flags; +}; +typedef struct __env_close_msg __env_close_msg; + +struct __env_close_reply { + int status; +}; +typedef struct __env_close_reply __env_close_reply; + +struct __env_create_msg { + u_int timeout; +}; +typedef struct __env_create_msg __env_create_msg; + +struct __env_create_reply { + int status; + u_int envcl_id; +}; +typedef struct __env_create_reply __env_create_reply; + +struct __env_dbremove_msg { + u_int dbenvcl_id; + u_int txnpcl_id; + char *name; + char *subdb; + u_int flags; +}; +typedef struct __env_dbremove_msg __env_dbremove_msg; + +struct __env_dbremove_reply { + int status; +}; +typedef struct __env_dbremove_reply __env_dbremove_reply; + +struct __env_dbrename_msg { + u_int dbenvcl_id; + u_int txnpcl_id; + char *name; + char *subdb; + char *newname; + u_int flags; +}; +typedef struct __env_dbrename_msg __env_dbrename_msg; + +struct __env_dbrename_reply { + int status; +}; +typedef struct __env_dbrename_reply __env_dbrename_reply; + +struct __env_encrypt_msg { + u_int dbenvcl_id; + char *passwd; + u_int flags; +}; +typedef struct __env_encrypt_msg __env_encrypt_msg; + +struct __env_encrypt_reply { + int status; +}; +typedef struct __env_encrypt_reply __env_encrypt_reply; + +struct __env_flags_msg { + u_int dbenvcl_id; + u_int flags; + u_int onoff; +}; +typedef struct __env_flags_msg __env_flags_msg; + +struct __env_flags_reply { + int status; +}; +typedef struct __env_flags_reply __env_flags_reply; + +struct __env_open_msg { + u_int dbenvcl_id; + char *home; + u_int flags; + u_int mode; +}; +typedef struct __env_open_msg __env_open_msg; + +struct __env_open_reply { + int status; + u_int envcl_id; +}; +typedef struct __env_open_reply __env_open_reply; + +struct __env_remove_msg { + u_int dbenvcl_id; + char *home; + u_int flags; +}; +typedef struct __env_remove_msg __env_remove_msg; + +struct __env_remove_reply { + int status; +}; +typedef struct __env_remove_reply __env_remove_reply; + +struct __txn_abort_msg { + u_int txnpcl_id; +}; +typedef struct __txn_abort_msg __txn_abort_msg; + +struct __txn_abort_reply { + int status; +}; +typedef struct __txn_abort_reply __txn_abort_reply; + +struct __txn_begin_msg { + u_int dbenvcl_id; + u_int parentcl_id; + u_int flags; +}; +typedef struct __txn_begin_msg __txn_begin_msg; + +struct __txn_begin_reply { + int status; + u_int txnidcl_id; +}; +typedef struct __txn_begin_reply __txn_begin_reply; + +struct __txn_commit_msg { + u_int txnpcl_id; + u_int flags; +}; +typedef struct __txn_commit_msg __txn_commit_msg; + +struct __txn_commit_reply { + int status; +}; +typedef struct __txn_commit_reply __txn_commit_reply; + +struct __txn_discard_msg { + u_int txnpcl_id; + u_int flags; +}; +typedef struct __txn_discard_msg __txn_discard_msg; + +struct __txn_discard_reply { + int status; +}; +typedef struct __txn_discard_reply __txn_discard_reply; + +struct __txn_prepare_msg { + u_int txnpcl_id; + char gid[128]; +}; +typedef struct __txn_prepare_msg __txn_prepare_msg; + +struct __txn_prepare_reply { + int status; +}; +typedef struct __txn_prepare_reply __txn_prepare_reply; + +struct __txn_recover_msg { + u_int dbenvcl_id; + u_int count; + u_int flags; +}; +typedef struct __txn_recover_msg __txn_recover_msg; + +struct __txn_recover_reply { + int status; + struct { + u_int txn_len; + u_int *txn_val; + } txn; + struct { + u_int gid_len; + char *gid_val; + } gid; + u_int retcount; +}; +typedef struct __txn_recover_reply __txn_recover_reply; + +struct __db_associate_msg { + u_int dbpcl_id; + u_int txnpcl_id; + u_int sdbpcl_id; + u_int flags; +}; +typedef struct __db_associate_msg __db_associate_msg; + +struct __db_associate_reply { + int status; +}; +typedef struct __db_associate_reply __db_associate_reply; + +struct __db_bt_maxkey_msg { + u_int dbpcl_id; + u_int maxkey; +}; +typedef struct __db_bt_maxkey_msg __db_bt_maxkey_msg; + +struct __db_bt_maxkey_reply { + int status; +}; +typedef struct __db_bt_maxkey_reply __db_bt_maxkey_reply; + +struct __db_bt_minkey_msg { + u_int dbpcl_id; + u_int minkey; +}; +typedef struct __db_bt_minkey_msg __db_bt_minkey_msg; + +struct __db_bt_minkey_reply { + int status; +}; +typedef struct __db_bt_minkey_reply __db_bt_minkey_reply; + +struct __db_close_msg { + u_int dbpcl_id; + u_int flags; +}; +typedef struct __db_close_msg __db_close_msg; + +struct __db_close_reply { + int status; +}; +typedef struct __db_close_reply __db_close_reply; + +struct __db_create_msg { + u_int dbenvcl_id; + u_int flags; +}; +typedef struct __db_create_msg __db_create_msg; + +struct __db_create_reply { + int status; + u_int dbcl_id; +}; +typedef struct __db_create_reply __db_create_reply; + +struct __db_del_msg { + u_int dbpcl_id; + u_int txnpcl_id; + u_int keydlen; + u_int keydoff; + u_int keyulen; + u_int keyflags; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; + u_int flags; +}; +typedef struct __db_del_msg __db_del_msg; + +struct __db_del_reply { + int status; +}; +typedef struct __db_del_reply __db_del_reply; + +struct __db_encrypt_msg { + u_int dbpcl_id; + char *passwd; + u_int flags; +}; +typedef struct __db_encrypt_msg __db_encrypt_msg; + +struct __db_encrypt_reply { + int status; +}; +typedef struct __db_encrypt_reply __db_encrypt_reply; + +struct __db_extentsize_msg { + u_int dbpcl_id; + u_int extentsize; +}; +typedef struct __db_extentsize_msg __db_extentsize_msg; + +struct __db_extentsize_reply { + int status; +}; +typedef struct __db_extentsize_reply __db_extentsize_reply; + +struct __db_flags_msg { + u_int dbpcl_id; + u_int flags; +}; +typedef struct __db_flags_msg __db_flags_msg; + +struct __db_flags_reply { + int status; +}; +typedef struct __db_flags_reply __db_flags_reply; + +struct __db_get_msg { + u_int dbpcl_id; + u_int txnpcl_id; + u_int keydlen; + u_int keydoff; + u_int keyulen; + u_int keyflags; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; + u_int datadlen; + u_int datadoff; + u_int dataulen; + u_int dataflags; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; + u_int flags; +}; +typedef struct __db_get_msg __db_get_msg; + +struct __db_get_reply { + int status; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; +}; +typedef struct __db_get_reply __db_get_reply; + +struct __db_h_ffactor_msg { + u_int dbpcl_id; + u_int ffactor; +}; +typedef struct __db_h_ffactor_msg __db_h_ffactor_msg; + +struct __db_h_ffactor_reply { + int status; +}; +typedef struct __db_h_ffactor_reply __db_h_ffactor_reply; + +struct __db_h_nelem_msg { + u_int dbpcl_id; + u_int nelem; +}; +typedef struct __db_h_nelem_msg __db_h_nelem_msg; + +struct __db_h_nelem_reply { + int status; +}; +typedef struct __db_h_nelem_reply __db_h_nelem_reply; + +struct __db_key_range_msg { + u_int dbpcl_id; + u_int txnpcl_id; + u_int keydlen; + u_int keydoff; + u_int keyulen; + u_int keyflags; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; + u_int flags; +}; +typedef struct __db_key_range_msg __db_key_range_msg; + +struct __db_key_range_reply { + int status; + double less; + double equal; + double greater; +}; +typedef struct __db_key_range_reply __db_key_range_reply; + +struct __db_lorder_msg { + u_int dbpcl_id; + u_int lorder; +}; +typedef struct __db_lorder_msg __db_lorder_msg; + +struct __db_lorder_reply { + int status; +}; +typedef struct __db_lorder_reply __db_lorder_reply; + +struct __db_open_msg { + u_int dbpcl_id; + u_int txnpcl_id; + char *name; + char *subdb; + u_int type; + u_int flags; + u_int mode; +}; +typedef struct __db_open_msg __db_open_msg; + +struct __db_open_reply { + int status; + u_int dbcl_id; + u_int type; + u_int dbflags; + u_int lorder; +}; +typedef struct __db_open_reply __db_open_reply; + +struct __db_pagesize_msg { + u_int dbpcl_id; + u_int pagesize; +}; +typedef struct __db_pagesize_msg __db_pagesize_msg; + +struct __db_pagesize_reply { + int status; +}; +typedef struct __db_pagesize_reply __db_pagesize_reply; + +struct __db_pget_msg { + u_int dbpcl_id; + u_int txnpcl_id; + u_int skeydlen; + u_int skeydoff; + u_int skeyulen; + u_int skeyflags; + struct { + u_int skeydata_len; + char *skeydata_val; + } skeydata; + u_int pkeydlen; + u_int pkeydoff; + u_int pkeyulen; + u_int pkeyflags; + struct { + u_int pkeydata_len; + char *pkeydata_val; + } pkeydata; + u_int datadlen; + u_int datadoff; + u_int dataulen; + u_int dataflags; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; + u_int flags; +}; +typedef struct __db_pget_msg __db_pget_msg; + +struct __db_pget_reply { + int status; + struct { + u_int skeydata_len; + char *skeydata_val; + } skeydata; + struct { + u_int pkeydata_len; + char *pkeydata_val; + } pkeydata; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; +}; +typedef struct __db_pget_reply __db_pget_reply; + +struct __db_put_msg { + u_int dbpcl_id; + u_int txnpcl_id; + u_int keydlen; + u_int keydoff; + u_int keyulen; + u_int keyflags; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; + u_int datadlen; + u_int datadoff; + u_int dataulen; + u_int dataflags; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; + u_int flags; +}; +typedef struct __db_put_msg __db_put_msg; + +struct __db_put_reply { + int status; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; +}; +typedef struct __db_put_reply __db_put_reply; + +struct __db_re_delim_msg { + u_int dbpcl_id; + u_int delim; +}; +typedef struct __db_re_delim_msg __db_re_delim_msg; + +struct __db_re_delim_reply { + int status; +}; +typedef struct __db_re_delim_reply __db_re_delim_reply; + +struct __db_re_len_msg { + u_int dbpcl_id; + u_int len; +}; +typedef struct __db_re_len_msg __db_re_len_msg; + +struct __db_re_len_reply { + int status; +}; +typedef struct __db_re_len_reply __db_re_len_reply; + +struct __db_re_pad_msg { + u_int dbpcl_id; + u_int pad; +}; +typedef struct __db_re_pad_msg __db_re_pad_msg; + +struct __db_re_pad_reply { + int status; +}; +typedef struct __db_re_pad_reply __db_re_pad_reply; + +struct __db_remove_msg { + u_int dbpcl_id; + char *name; + char *subdb; + u_int flags; +}; +typedef struct __db_remove_msg __db_remove_msg; + +struct __db_remove_reply { + int status; +}; +typedef struct __db_remove_reply __db_remove_reply; + +struct __db_rename_msg { + u_int dbpcl_id; + char *name; + char *subdb; + char *newname; + u_int flags; +}; +typedef struct __db_rename_msg __db_rename_msg; + +struct __db_rename_reply { + int status; +}; +typedef struct __db_rename_reply __db_rename_reply; + +struct __db_stat_msg { + u_int dbpcl_id; + u_int flags; +}; +typedef struct __db_stat_msg __db_stat_msg; + +struct __db_stat_reply { + int status; + struct { + u_int stats_len; + u_int *stats_val; + } stats; +}; +typedef struct __db_stat_reply __db_stat_reply; + +struct __db_sync_msg { + u_int dbpcl_id; + u_int flags; +}; +typedef struct __db_sync_msg __db_sync_msg; + +struct __db_sync_reply { + int status; +}; +typedef struct __db_sync_reply __db_sync_reply; + +struct __db_truncate_msg { + u_int dbpcl_id; + u_int txnpcl_id; + u_int flags; +}; +typedef struct __db_truncate_msg __db_truncate_msg; + +struct __db_truncate_reply { + int status; + u_int count; +}; +typedef struct __db_truncate_reply __db_truncate_reply; + +struct __db_cursor_msg { + u_int dbpcl_id; + u_int txnpcl_id; + u_int flags; +}; +typedef struct __db_cursor_msg __db_cursor_msg; + +struct __db_cursor_reply { + int status; + u_int dbcidcl_id; +}; +typedef struct __db_cursor_reply __db_cursor_reply; + +struct __db_join_msg { + u_int dbpcl_id; + struct { + u_int curs_len; + u_int *curs_val; + } curs; + u_int flags; +}; +typedef struct __db_join_msg __db_join_msg; + +struct __db_join_reply { + int status; + u_int dbcidcl_id; +}; +typedef struct __db_join_reply __db_join_reply; + +struct __dbc_close_msg { + u_int dbccl_id; +}; +typedef struct __dbc_close_msg __dbc_close_msg; + +struct __dbc_close_reply { + int status; +}; +typedef struct __dbc_close_reply __dbc_close_reply; + +struct __dbc_count_msg { + u_int dbccl_id; + u_int flags; +}; +typedef struct __dbc_count_msg __dbc_count_msg; + +struct __dbc_count_reply { + int status; + u_int dupcount; +}; +typedef struct __dbc_count_reply __dbc_count_reply; + +struct __dbc_del_msg { + u_int dbccl_id; + u_int flags; +}; +typedef struct __dbc_del_msg __dbc_del_msg; + +struct __dbc_del_reply { + int status; +}; +typedef struct __dbc_del_reply __dbc_del_reply; + +struct __dbc_dup_msg { + u_int dbccl_id; + u_int flags; +}; +typedef struct __dbc_dup_msg __dbc_dup_msg; + +struct __dbc_dup_reply { + int status; + u_int dbcidcl_id; +}; +typedef struct __dbc_dup_reply __dbc_dup_reply; + +struct __dbc_get_msg { + u_int dbccl_id; + u_int keydlen; + u_int keydoff; + u_int keyulen; + u_int keyflags; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; + u_int datadlen; + u_int datadoff; + u_int dataulen; + u_int dataflags; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; + u_int flags; +}; +typedef struct __dbc_get_msg __dbc_get_msg; + +struct __dbc_get_reply { + int status; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; +}; +typedef struct __dbc_get_reply __dbc_get_reply; + +struct __dbc_pget_msg { + u_int dbccl_id; + u_int skeydlen; + u_int skeydoff; + u_int skeyulen; + u_int skeyflags; + struct { + u_int skeydata_len; + char *skeydata_val; + } skeydata; + u_int pkeydlen; + u_int pkeydoff; + u_int pkeyulen; + u_int pkeyflags; + struct { + u_int pkeydata_len; + char *pkeydata_val; + } pkeydata; + u_int datadlen; + u_int datadoff; + u_int dataulen; + u_int dataflags; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; + u_int flags; +}; +typedef struct __dbc_pget_msg __dbc_pget_msg; + +struct __dbc_pget_reply { + int status; + struct { + u_int skeydata_len; + char *skeydata_val; + } skeydata; + struct { + u_int pkeydata_len; + char *pkeydata_val; + } pkeydata; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; +}; +typedef struct __dbc_pget_reply __dbc_pget_reply; + +struct __dbc_put_msg { + u_int dbccl_id; + u_int keydlen; + u_int keydoff; + u_int keyulen; + u_int keyflags; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; + u_int datadlen; + u_int datadoff; + u_int dataulen; + u_int dataflags; + struct { + u_int datadata_len; + char *datadata_val; + } datadata; + u_int flags; +}; +typedef struct __dbc_put_msg __dbc_put_msg; + +struct __dbc_put_reply { + int status; + struct { + u_int keydata_len; + char *keydata_val; + } keydata; +}; +typedef struct __dbc_put_reply __dbc_put_reply; + +#define __DB_env_cachesize ((unsigned long)(1)) +extern __env_cachesize_reply * __db_env_cachesize_4001(); +#define __DB_env_close ((unsigned long)(2)) +extern __env_close_reply * __db_env_close_4001(); +#define __DB_env_create ((unsigned long)(3)) +extern __env_create_reply * __db_env_create_4001(); +#define __DB_env_dbremove ((unsigned long)(4)) +extern __env_dbremove_reply * __db_env_dbremove_4001(); +#define __DB_env_dbrename ((unsigned long)(5)) +extern __env_dbrename_reply * __db_env_dbrename_4001(); +#define __DB_env_encrypt ((unsigned long)(6)) +extern __env_encrypt_reply * __db_env_encrypt_4001(); +#define __DB_env_flags ((unsigned long)(7)) +extern __env_flags_reply * __db_env_flags_4001(); +#define __DB_env_open ((unsigned long)(8)) +extern __env_open_reply * __db_env_open_4001(); +#define __DB_env_remove ((unsigned long)(9)) +extern __env_remove_reply * __db_env_remove_4001(); +#define __DB_txn_abort ((unsigned long)(10)) +extern __txn_abort_reply * __db_txn_abort_4001(); +#define __DB_txn_begin ((unsigned long)(11)) +extern __txn_begin_reply * __db_txn_begin_4001(); +#define __DB_txn_commit ((unsigned long)(12)) +extern __txn_commit_reply * __db_txn_commit_4001(); +#define __DB_txn_discard ((unsigned long)(13)) +extern __txn_discard_reply * __db_txn_discard_4001(); +#define __DB_txn_prepare ((unsigned long)(14)) +extern __txn_prepare_reply * __db_txn_prepare_4001(); +#define __DB_txn_recover ((unsigned long)(15)) +extern __txn_recover_reply * __db_txn_recover_4001(); +#define __DB_db_associate ((unsigned long)(16)) +extern __db_associate_reply * __db_db_associate_4001(); +#define __DB_db_bt_maxkey ((unsigned long)(17)) +extern __db_bt_maxkey_reply * __db_db_bt_maxkey_4001(); +#define __DB_db_bt_minkey ((unsigned long)(18)) +extern __db_bt_minkey_reply * __db_db_bt_minkey_4001(); +#define __DB_db_close ((unsigned long)(19)) +extern __db_close_reply * __db_db_close_4001(); +#define __DB_db_create ((unsigned long)(20)) +extern __db_create_reply * __db_db_create_4001(); +#define __DB_db_del ((unsigned long)(21)) +extern __db_del_reply * __db_db_del_4001(); +#define __DB_db_encrypt ((unsigned long)(22)) +extern __db_encrypt_reply * __db_db_encrypt_4001(); +#define __DB_db_extentsize ((unsigned long)(23)) +extern __db_extentsize_reply * __db_db_extentsize_4001(); +#define __DB_db_flags ((unsigned long)(24)) +extern __db_flags_reply * __db_db_flags_4001(); +#define __DB_db_get ((unsigned long)(25)) +extern __db_get_reply * __db_db_get_4001(); +#define __DB_db_h_ffactor ((unsigned long)(26)) +extern __db_h_ffactor_reply * __db_db_h_ffactor_4001(); +#define __DB_db_h_nelem ((unsigned long)(27)) +extern __db_h_nelem_reply * __db_db_h_nelem_4001(); +#define __DB_db_key_range ((unsigned long)(28)) +extern __db_key_range_reply * __db_db_key_range_4001(); +#define __DB_db_lorder ((unsigned long)(29)) +extern __db_lorder_reply * __db_db_lorder_4001(); +#define __DB_db_open ((unsigned long)(30)) +extern __db_open_reply * __db_db_open_4001(); +#define __DB_db_pagesize ((unsigned long)(31)) +extern __db_pagesize_reply * __db_db_pagesize_4001(); +#define __DB_db_pget ((unsigned long)(32)) +extern __db_pget_reply * __db_db_pget_4001(); +#define __DB_db_put ((unsigned long)(33)) +extern __db_put_reply * __db_db_put_4001(); +#define __DB_db_re_delim ((unsigned long)(34)) +extern __db_re_delim_reply * __db_db_re_delim_4001(); +#define __DB_db_re_len ((unsigned long)(35)) +extern __db_re_len_reply * __db_db_re_len_4001(); +#define __DB_db_re_pad ((unsigned long)(36)) +extern __db_re_pad_reply * __db_db_re_pad_4001(); +#define __DB_db_remove ((unsigned long)(37)) +extern __db_remove_reply * __db_db_remove_4001(); +#define __DB_db_rename ((unsigned long)(38)) +extern __db_rename_reply * __db_db_rename_4001(); +#define __DB_db_stat ((unsigned long)(39)) +extern __db_stat_reply * __db_db_stat_4001(); +#define __DB_db_sync ((unsigned long)(40)) +extern __db_sync_reply * __db_db_sync_4001(); +#define __DB_db_truncate ((unsigned long)(41)) +extern __db_truncate_reply * __db_db_truncate_4001(); +#define __DB_db_cursor ((unsigned long)(42)) +extern __db_cursor_reply * __db_db_cursor_4001(); +#define __DB_db_join ((unsigned long)(43)) +extern __db_join_reply * __db_db_join_4001(); +#define __DB_dbc_close ((unsigned long)(44)) +extern __dbc_close_reply * __db_dbc_close_4001(); +#define __DB_dbc_count ((unsigned long)(45)) +extern __dbc_count_reply * __db_dbc_count_4001(); +#define __DB_dbc_del ((unsigned long)(46)) +extern __dbc_del_reply * __db_dbc_del_4001(); +#define __DB_dbc_dup ((unsigned long)(47)) +extern __dbc_dup_reply * __db_dbc_dup_4001(); +#define __DB_dbc_get ((unsigned long)(48)) +extern __dbc_get_reply * __db_dbc_get_4001(); +#define __DB_dbc_pget ((unsigned long)(49)) +extern __dbc_pget_reply * __db_dbc_pget_4001(); +#define __DB_dbc_put ((unsigned long)(50)) +extern __dbc_put_reply * __db_dbc_put_4001(); +extern int db_rpc_serverprog_4001_freeresult(); + +/* the xdr functions */ +extern bool_t xdr___env_cachesize_msg(); +extern bool_t xdr___env_cachesize_reply(); +extern bool_t xdr___env_close_msg(); +extern bool_t xdr___env_close_reply(); +extern bool_t xdr___env_create_msg(); +extern bool_t xdr___env_create_reply(); +extern bool_t xdr___env_dbremove_msg(); +extern bool_t xdr___env_dbremove_reply(); +extern bool_t xdr___env_dbrename_msg(); +extern bool_t xdr___env_dbrename_reply(); +extern bool_t xdr___env_encrypt_msg(); +extern bool_t xdr___env_encrypt_reply(); +extern bool_t xdr___env_flags_msg(); +extern bool_t xdr___env_flags_reply(); +extern bool_t xdr___env_open_msg(); +extern bool_t xdr___env_open_reply(); +extern bool_t xdr___env_remove_msg(); +extern bool_t xdr___env_remove_reply(); +extern bool_t xdr___txn_abort_msg(); +extern bool_t xdr___txn_abort_reply(); +extern bool_t xdr___txn_begin_msg(); +extern bool_t xdr___txn_begin_reply(); +extern bool_t xdr___txn_commit_msg(); +extern bool_t xdr___txn_commit_reply(); +extern bool_t xdr___txn_discard_msg(); +extern bool_t xdr___txn_discard_reply(); +extern bool_t xdr___txn_prepare_msg(); +extern bool_t xdr___txn_prepare_reply(); +extern bool_t xdr___txn_recover_msg(); +extern bool_t xdr___txn_recover_reply(); +extern bool_t xdr___db_associate_msg(); +extern bool_t xdr___db_associate_reply(); +extern bool_t xdr___db_bt_maxkey_msg(); +extern bool_t xdr___db_bt_maxkey_reply(); +extern bool_t xdr___db_bt_minkey_msg(); +extern bool_t xdr___db_bt_minkey_reply(); +extern bool_t xdr___db_close_msg(); +extern bool_t xdr___db_close_reply(); +extern bool_t xdr___db_create_msg(); +extern bool_t xdr___db_create_reply(); +extern bool_t xdr___db_del_msg(); +extern bool_t xdr___db_del_reply(); +extern bool_t xdr___db_encrypt_msg(); +extern bool_t xdr___db_encrypt_reply(); +extern bool_t xdr___db_extentsize_msg(); +extern bool_t xdr___db_extentsize_reply(); +extern bool_t xdr___db_flags_msg(); +extern bool_t xdr___db_flags_reply(); +extern bool_t xdr___db_get_msg(); +extern bool_t xdr___db_get_reply(); +extern bool_t xdr___db_h_ffactor_msg(); +extern bool_t xdr___db_h_ffactor_reply(); +extern bool_t xdr___db_h_nelem_msg(); +extern bool_t xdr___db_h_nelem_reply(); +extern bool_t xdr___db_key_range_msg(); +extern bool_t xdr___db_key_range_reply(); +extern bool_t xdr___db_lorder_msg(); +extern bool_t xdr___db_lorder_reply(); +extern bool_t xdr___db_open_msg(); +extern bool_t xdr___db_open_reply(); +extern bool_t xdr___db_pagesize_msg(); +extern bool_t xdr___db_pagesize_reply(); +extern bool_t xdr___db_pget_msg(); +extern bool_t xdr___db_pget_reply(); +extern bool_t xdr___db_put_msg(); +extern bool_t xdr___db_put_reply(); +extern bool_t xdr___db_re_delim_msg(); +extern bool_t xdr___db_re_delim_reply(); +extern bool_t xdr___db_re_len_msg(); +extern bool_t xdr___db_re_len_reply(); +extern bool_t xdr___db_re_pad_msg(); +extern bool_t xdr___db_re_pad_reply(); +extern bool_t xdr___db_remove_msg(); +extern bool_t xdr___db_remove_reply(); +extern bool_t xdr___db_rename_msg(); +extern bool_t xdr___db_rename_reply(); +extern bool_t xdr___db_stat_msg(); +extern bool_t xdr___db_stat_reply(); +extern bool_t xdr___db_sync_msg(); +extern bool_t xdr___db_sync_reply(); +extern bool_t xdr___db_truncate_msg(); +extern bool_t xdr___db_truncate_reply(); +extern bool_t xdr___db_cursor_msg(); +extern bool_t xdr___db_cursor_reply(); +extern bool_t xdr___db_join_msg(); +extern bool_t xdr___db_join_reply(); +extern bool_t xdr___dbc_close_msg(); +extern bool_t xdr___dbc_close_reply(); +extern bool_t xdr___dbc_count_msg(); +extern bool_t xdr___dbc_count_reply(); +extern bool_t xdr___dbc_del_msg(); +extern bool_t xdr___dbc_del_reply(); +extern bool_t xdr___dbc_dup_msg(); +extern bool_t xdr___dbc_dup_reply(); +extern bool_t xdr___dbc_get_msg(); +extern bool_t xdr___dbc_get_reply(); +extern bool_t xdr___dbc_pget_msg(); +extern bool_t xdr___dbc_pget_reply(); +extern bool_t xdr___dbc_put_msg(); +extern bool_t xdr___dbc_put_reply(); + +#endif /* !_DB_SERVER_H_RPCGEN */ diff --git a/bdb/dbinc_auto/dbreg_auto.h b/bdb/dbinc_auto/dbreg_auto.h new file mode 100644 index 00000000000..4d7d4a91b45 --- /dev/null +++ b/bdb/dbinc_auto/dbreg_auto.h @@ -0,0 +1,19 @@ +/* Do not edit: automatically built by gen_rec.awk. */ + +#ifndef __dbreg_AUTO_H +#define __dbreg_AUTO_H +#define DB___dbreg_register 2 +typedef struct ___dbreg_register_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t opcode; + DBT name; + DBT uid; + int32_t fileid; + DBTYPE ftype; + db_pgno_t meta_pgno; + u_int32_t id; +} __dbreg_register_args; + +#endif diff --git a/bdb/dbinc_auto/dbreg_ext.h b/bdb/dbinc_auto/dbreg_ext.h new file mode 100644 index 00000000000..eda26206d86 --- /dev/null +++ b/bdb/dbinc_auto/dbreg_ext.h @@ -0,0 +1,43 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _dbreg_ext_h_ +#define _dbreg_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __dbreg_setup __P((DB *, const char *, u_int32_t)); +int __dbreg_teardown __P((DB *)); +int __dbreg_new_id __P((DB *, DB_TXN *)); +int __dbreg_assign_id __P((DB *, int32_t)); +int __dbreg_revoke_id __P((DB *, int)); +int __dbreg_close_id __P((DB *, DB_TXN *)); +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_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __dbreg_register_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __dbreg_register_read __P((DB_ENV *, void *, __dbreg_register_args **)); +int __dbreg_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __dbreg_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __dbreg_init_recover __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_add_dbentry __P((DB_ENV *, DB_LOG *, DB *, int32_t)); +void __dbreg_rem_dbentry __P((DB_LOG *, int32_t)); +int __dbreg_open_files __P((DB_ENV *)); +int __dbreg_close_files __P((DB_ENV *)); +int __dbreg_nofiles __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_lazy_id __P((DB *)); +int __dbreg_push_id __P((DB_ENV *, int32_t)); +int __dbreg_pop_id __P((DB_ENV *, int32_t *)); +int __dbreg_pluck_id __P((DB_ENV *, int32_t)); +void __dbreg_print_dblist __P((DB_ENV *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_dbreg_ext_h_ */ diff --git a/bdb/dbinc_auto/env_ext.h b/bdb/dbinc_auto/env_ext.h new file mode 100644 index 00000000000..4bd0eee4a83 --- /dev/null +++ b/bdb/dbinc_auto/env_ext.h @@ -0,0 +1,39 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _env_ext_h_ +#define _env_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +void __db_shalloc_init __P((void *, size_t)); +int __db_shalloc_size __P((size_t, size_t)); +int __db_shalloc __P((void *, size_t, size_t, void *)); +void __db_shalloc_free __P((void *, void *)); +size_t __db_shsizeof __P((void *)); +void __db_shalloc_dump __P((void *, FILE *)); +int __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 __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 __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 *, u_int32_t)); +int __env_openfiles __P((DB_ENV *, DB_LOGC *, void *, DBT *, DB_LSN *, DB_LSN *, double, int)); +int __db_e_attach __P((DB_ENV *, u_int32_t *)); +int __db_e_detach __P((DB_ENV *, int)); +int __db_e_remove __P((DB_ENV *, u_int32_t)); +int __db_e_stat __P((DB_ENV *, REGENV *, REGION *, int *, u_int32_t)); +int __db_r_attach __P((DB_ENV *, REGINFO *, size_t)); +int __db_r_detach __P((DB_ENV *, REGINFO *, int)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_env_ext_h_ */ diff --git a/bdb/dbinc_auto/ext_185_def.in b/bdb/dbinc_auto/ext_185_def.in new file mode 100644 index 00000000000..8da68a8df9d --- /dev/null +++ b/bdb/dbinc_auto/ext_185_def.in @@ -0,0 +1,12 @@ + +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _DB_EXT_185_DEF_IN_ +#define _DB_EXT_185_DEF_IN_ + +#ifdef _DB185_INT_H_ +#define __db185_open __db185_open@DB_VERSION_UNIQUE_NAME@ +#else +#define __db185_open __db185_open@DB_VERSION_UNIQUE_NAME@ +#endif + +#endif /* !_DB_EXT_185_DEF_IN_ */ diff --git a/bdb/dbinc_auto/ext_185_prot.in b/bdb/dbinc_auto/ext_185_prot.in new file mode 100644 index 00000000000..dfd8d3d476e --- /dev/null +++ b/bdb/dbinc_auto/ext_185_prot.in @@ -0,0 +1,19 @@ + +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _DB_EXT_185_PROT_IN_ +#define _DB_EXT_185_PROT_IN_ + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifdef _DB185_INT_H_ +DB185 *__db185_open __P((const char *, int, int, DBTYPE, const void *)); +#else +DB *__db185_open __P((const char *, int, int, DBTYPE, const void *)); +#endif + +#if defined(__cplusplus) +} +#endif +#endif /* !_DB_EXT_185_PROT_IN_ */ diff --git a/bdb/dbinc_auto/ext_def.in b/bdb/dbinc_auto/ext_def.in new file mode 100644 index 00000000000..7bef2465645 --- /dev/null +++ b/bdb/dbinc_auto/ext_def.in @@ -0,0 +1,61 @@ + +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _DB_EXT_DEF_IN_ +#define _DB_EXT_DEF_IN_ + +#define db_create db_create@DB_VERSION_UNIQUE_NAME@ +#define db_strerror db_strerror@DB_VERSION_UNIQUE_NAME@ +#define db_env_create db_env_create@DB_VERSION_UNIQUE_NAME@ +#define db_version db_version@DB_VERSION_UNIQUE_NAME@ +#define log_compare log_compare@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_close db_env_set_func_close@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_dirfree db_env_set_func_dirfree@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_dirlist db_env_set_func_dirlist@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_exists db_env_set_func_exists@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_free db_env_set_func_free@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_fsync db_env_set_func_fsync@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_ioinfo db_env_set_func_ioinfo@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_malloc db_env_set_func_malloc@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_map db_env_set_func_map@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_open db_env_set_func_open@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_read db_env_set_func_read@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_realloc db_env_set_func_realloc@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_rename db_env_set_func_rename@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_seek db_env_set_func_seek@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_sleep db_env_set_func_sleep@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_unlink db_env_set_func_unlink@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_unmap db_env_set_func_unmap@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_write db_env_set_func_write@DB_VERSION_UNIQUE_NAME@ +#define db_env_set_func_yield db_env_set_func_yield@DB_VERSION_UNIQUE_NAME@ +#if DB_DBM_HSEARCH != 0 +#define __db_ndbm_clearerr __db_ndbm_clearerr@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_close __db_ndbm_close@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_delete __db_ndbm_delete@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_dirfno __db_ndbm_dirfno@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_error __db_ndbm_error@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_fetch __db_ndbm_fetch@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_firstkey __db_ndbm_firstkey@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_nextkey __db_ndbm_nextkey@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_open __db_ndbm_open@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_pagfno __db_ndbm_pagfno@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_rdonly __db_ndbm_rdonly@DB_VERSION_UNIQUE_NAME@ +#define __db_ndbm_store __db_ndbm_store@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_close __db_dbm_close@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_dbrdonly __db_dbm_dbrdonly@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_delete __db_dbm_delete@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_dirf __db_dbm_dirf@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_fetch __db_dbm_fetch@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_firstkey __db_dbm_firstkey@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_init __db_dbm_init@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_nextkey __db_dbm_nextkey@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_pagf __db_dbm_pagf@DB_VERSION_UNIQUE_NAME@ +#define __db_dbm_store __db_dbm_store@DB_VERSION_UNIQUE_NAME@ +#endif +#if DB_DBM_HSEARCH != 0 +#define __db_hcreate __db_hcreate@DB_VERSION_UNIQUE_NAME@ +#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@ + +#endif /* !_DB_EXT_DEF_IN_ */ diff --git a/bdb/dbinc_auto/ext_prot.in b/bdb/dbinc_auto/ext_prot.in new file mode 100644 index 00000000000..42c77a1f763 --- /dev/null +++ b/bdb/dbinc_auto/ext_prot.in @@ -0,0 +1,70 @@ + +/* 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_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_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, size_t, db_pgno_t, u_int32_t, int, 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 txn_abort __P((DB_TXN *)); +int txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)); +int txn_commit __P((DB_TXN *, 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_dbrdonly __P((void)); +int __db_dbm_delete __P((datum)); +int __db_dbm_dirf __P((void)); +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_pagf __P((void)); +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/bdb/dbinc_auto/fileops_auto.h b/bdb/dbinc_auto/fileops_auto.h new file mode 100644 index 00000000000..ee1f58616ce --- /dev/null +++ b/bdb/dbinc_auto/fileops_auto.h @@ -0,0 +1,60 @@ +/* Do not edit: automatically built by gen_rec.awk. */ + +#ifndef __fop_AUTO_H +#define __fop_AUTO_H +#define DB___fop_create 143 +typedef struct ___fop_create_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + DBT name; + u_int32_t appname; + u_int32_t mode; +} __fop_create_args; + +#define DB___fop_remove 144 +typedef struct ___fop_remove_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + DBT name; + DBT fid; + u_int32_t appname; +} __fop_remove_args; + +#define DB___fop_write 145 +typedef struct ___fop_write_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + DBT name; + u_int32_t appname; + u_int32_t offset; + DBT page; + u_int32_t flag; +} __fop_write_args; + +#define DB___fop_rename 146 +typedef struct ___fop_rename_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + DBT oldname; + DBT newname; + DBT fileid; + u_int32_t appname; +} __fop_rename_args; + +#define DB___fop_file_remove 141 +typedef struct ___fop_file_remove_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + DBT real_fid; + DBT tmp_fid; + DBT name; + u_int32_t appname; + u_int32_t child; +} __fop_file_remove_args; + +#endif diff --git a/bdb/dbinc_auto/fileops_ext.h b/bdb/dbinc_auto/fileops_ext.h new file mode 100644 index 00000000000..66d80e60ad9 --- /dev/null +++ b/bdb/dbinc_auto/fileops_ext.h @@ -0,0 +1,52 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _fileops_ext_h_ +#define _fileops_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __fop_create_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, u_int32_t, u_int32_t)); +int __fop_create_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_create_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_create_read __P((DB_ENV *, void *, __fop_create_args **)); +int __fop_remove_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, u_int32_t)); +int __fop_remove_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_remove_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_remove_read __P((DB_ENV *, void *, __fop_remove_args **)); +int __fop_write_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, u_int32_t, u_int32_t, const DBT *, u_int32_t)); +int __fop_write_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_write_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_write_read __P((DB_ENV *, void *, __fop_write_args **)); +int __fop_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *, u_int32_t)); +int __fop_rename_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_rename_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_rename_read __P((DB_ENV *, void *, __fop_rename_args **)); +int __fop_file_remove_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *, u_int32_t, u_int32_t)); +int __fop_file_remove_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_file_remove_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_file_remove_read __P((DB_ENV *, void *, __fop_file_remove_args **)); +int __fop_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __fop_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __fop_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __fop_create __P((DB_ENV *, DB_TXN *, DB_FH *, const char *, APPNAME, int)); +int __fop_remove __P((DB_ENV *, DB_TXN *, u_int8_t *, const char *, APPNAME)); +int __fop_write __P((DB_ENV *, DB_TXN *, const char *, APPNAME, DB_FH *, u_int32_t, u_int8_t *, u_int32_t, u_int32_t)); +int __fop_rename __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int8_t *, APPNAME)); +int __fop_create_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_remove_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_write_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_rename_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_file_remove_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __fop_lock_handle __P((DB_ENV *, DB *, u_int32_t, db_lockmode_t, DB_LOCK *, u_int32_t)); +int __fop_file_setup __P((DB *, DB_TXN *, const char *, int, u_int32_t, u_int32_t *)); +int __fop_subdb_setup __P((DB *, DB_TXN *, const char *, const char *, int, u_int32_t)); +int __fop_remove_setup __P((DB *, DB_TXN *, const char *, u_int32_t)); +int __fop_read_meta __P((DB_ENV *, const char *, u_int8_t *, size_t, DB_FH *, int, u_int32_t)); +int __fop_dummy __P((DB *, DB_TXN *, const char *, const char *, u_int32_t)); +int __fop_dbrename __P((DB *, const char *, const char *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_fileops_ext_h_ */ diff --git a/bdb/dbinc_auto/hash_auto.h b/bdb/dbinc_auto/hash_auto.h new file mode 100644 index 00000000000..7ec3fb7ef08 --- /dev/null +++ b/bdb/dbinc_auto/hash_auto.h @@ -0,0 +1,132 @@ +/* Do not edit: automatically built by gen_rec.awk. */ + +#ifndef __ham_AUTO_H +#define __ham_AUTO_H +#define DB___ham_insdel 21 +typedef struct ___ham_insdel_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t opcode; + int32_t fileid; + db_pgno_t pgno; + u_int32_t ndx; + DB_LSN pagelsn; + DBT key; + DBT data; +} __ham_insdel_args; + +#define DB___ham_newpage 22 +typedef struct ___ham_newpage_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t opcode; + int32_t fileid; + db_pgno_t prev_pgno; + DB_LSN prevlsn; + db_pgno_t new_pgno; + DB_LSN pagelsn; + db_pgno_t next_pgno; + DB_LSN nextlsn; +} __ham_newpage_args; + +#define DB___ham_splitdata 24 +typedef struct ___ham_splitdata_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + u_int32_t opcode; + db_pgno_t pgno; + DBT pageimage; + DB_LSN pagelsn; +} __ham_splitdata_args; + +#define DB___ham_replace 25 +typedef struct ___ham_replace_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + u_int32_t ndx; + DB_LSN pagelsn; + int32_t off; + DBT olditem; + DBT newitem; + u_int32_t makedup; +} __ham_replace_args; + +#define DB___ham_copypage 28 +typedef struct ___ham_copypage_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + DB_LSN pagelsn; + db_pgno_t next_pgno; + DB_LSN nextlsn; + db_pgno_t nnext_pgno; + DB_LSN nnextlsn; + DBT page; +} __ham_copypage_args; + +#define DB___ham_metagroup 29 +typedef struct ___ham_metagroup_args { + u_int32_t type; + DB_TXN *txnid; + 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_args; + +#define DB___ham_groupalloc 32 +typedef struct ___ham_groupalloc_args { + u_int32_t type; + DB_TXN *txnid; + 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_args; + +#define DB___ham_curadj 33 +typedef struct ___ham_curadj_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_pgno_t pgno; + u_int32_t indx; + u_int32_t len; + u_int32_t dup_off; + int add; + int is_dup; + u_int32_t order; +} __ham_curadj_args; + +#define DB___ham_chgpg 34 +typedef struct ___ham_chgpg_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_ham_mode mode; + db_pgno_t old_pgno; + db_pgno_t new_pgno; + u_int32_t old_indx; + u_int32_t new_indx; +} __ham_chgpg_args; + +#endif diff --git a/bdb/dbinc_auto/hash_ext.h b/bdb/dbinc_auto/hash_ext.h new file mode 100644 index 00000000000..1ee2398706f --- /dev/null +++ b/bdb/dbinc_auto/hash_ext.h @@ -0,0 +1,125 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _hash_ext_h_ +#define _hash_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __ham_quick_delete __P((DBC *)); +int __ham_c_init __P((DBC *)); +int __ham_c_count __P((DBC *, db_recno_t *)); +int __ham_c_dup __P((DBC *, DBC *)); +u_int32_t __ham_call_hash __P((DBC *, u_int8_t *, int32_t)); +int __ham_init_dbt __P((DB_ENV *, DBT *, u_int32_t, void **, u_int32_t *)); +int __ham_c_update __P((DBC *, u_int32_t, int, int)); +int __ham_get_clist __P((DB *, db_pgno_t, u_int32_t, DBC ***)); +int __ham_insdel_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, u_int32_t, DB_LSN *, const DBT *, const DBT *)); +int __ham_insdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_insdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_insdel_read __P((DB_ENV *, void *, __ham_insdel_args **)); +int __ham_newpage_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 *)); +int __ham_newpage_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_newpage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_newpage_read __P((DB_ENV *, void *, __ham_newpage_args **)); +int __ham_splitdata_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, const DBT *, DB_LSN *)); +int __ham_splitdata_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_splitdata_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_splitdata_read __P((DB_ENV *, void *, __ham_splitdata_args **)); +int __ham_replace_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, u_int32_t, DB_LSN *, int32_t, const DBT *, const DBT *, u_int32_t)); +int __ham_replace_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_replace_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +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_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_copypage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_copypage_read __P((DB_ENV *, void *, __ham_copypage_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)); +int __ham_metagroup_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_metagroup_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_metagroup_read __P((DB_ENV *, void *, __ham_metagroup_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)); +int __ham_groupalloc_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_groupalloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +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)); +int __ham_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_curadj_read __P((DB_ENV *, void *, __ham_curadj_args **)); +int __ham_chgpg_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_ham_mode, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t)); +int __ham_chgpg_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_chgpg_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_chgpg_read __P((DB_ENV *, void *, __ham_chgpg_args **)); +int __ham_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __ham_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __ham_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __ham_pgin __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *)); +int __ham_pgout __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *)); +int __ham_mswap __P((void *)); +int __ham_add_dup __P((DBC *, DBT *, u_int32_t, db_pgno_t *)); +int __ham_dup_convert __P((DBC *)); +int __ham_make_dup __P((DB_ENV *, const DBT *, DBT *d, void **, u_int32_t *)); +void __ham_dsearch __P((DBC *, DBT *, u_int32_t *, int *, u_int32_t)); +void __ham_cprint __P((DBC *)); +u_int32_t __ham_func2 __P((DB *, const void *, u_int32_t)); +u_int32_t __ham_func3 __P((DB *, const void *, u_int32_t)); +u_int32_t __ham_func4 __P((DB *, const void *, u_int32_t)); +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_db_create __P((DB *)); +int __ham_db_close __P((DB *)); +int __ham_open __P((DB *, DB_TXN *, const char * name, db_pgno_t, u_int32_t)); +int __ham_metachk __P((DB *, const char *, HMETA *)); +int __ham_new_file __P((DB *, DB_TXN *, DB_FH *, const char *)); +int __ham_new_subdb __P((DB *, DB *, DB_TXN *)); +int __ham_item __P((DBC *, db_lockmode_t, db_pgno_t *)); +int __ham_item_reset __P((DBC *)); +void __ham_item_init __P((DBC *)); +int __ham_item_last __P((DBC *, db_lockmode_t, db_pgno_t *)); +int __ham_item_first __P((DBC *, db_lockmode_t, db_pgno_t *)); +int __ham_item_prev __P((DBC *, db_lockmode_t, db_pgno_t *)); +int __ham_item_next __P((DBC *, db_lockmode_t, db_pgno_t *)); +void __ham_putitem __P((DB *, PAGE *p, const DBT *, int)); +void __ham_reputpair __P((DB *, PAGE *, u_int32_t, const DBT *, const DBT *)); +int __ham_del_pair __P((DBC *, int)); +int __ham_replpair __P((DBC *, DBT *, u_int32_t)); +void __ham_onpage_replace __P((DB *, PAGE *, u_int32_t, int32_t, int32_t, DBT *)); +int __ham_split_page __P((DBC *, u_int32_t, u_int32_t)); +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_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 *)); +int __ham_newpage_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_replace_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_splitdata_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __ham_copypage_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +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_reclaim __P((DB *, DB_TXN *txn)); +int __ham_truncate __P((DB *, DB_TXN *txn, u_int32_t *)); +int __ham_stat __P((DB *, void *, u_int32_t)); +int __ham_traverse __P((DBC *, db_lockmode_t, int (*)(DB *, PAGE *, void *, int *), void *, int)); +int __ham_30_hashmeta __P((DB *, char *, u_int8_t *)); +int __ham_30_sizefix __P((DB *, DB_FH *, char *, u_int8_t *)); +int __ham_31_hashmeta __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *)); +int __ham_31_hash __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *)); +int __ham_vrfy_meta __P((DB *, VRFY_DBINFO *, HMETA *, db_pgno_t, u_int32_t)); +int __ham_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t)); +int __ham_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t)); +int __ham_vrfy_hashing __P((DB *, u_int32_t, HMETA *, u_int32_t, db_pgno_t, u_int32_t, u_int32_t (*) __P((DB *, const void *, u_int32_t)))); +int __ham_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, PAGE *, void *, int (*)(void *, const void *), u_int32_t)); +int __ham_meta2pgset __P((DB *, VRFY_DBINFO *, HMETA *, u_int32_t, DB *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_hash_ext_h_ */ diff --git a/bdb/dbinc_auto/hmac_ext.h b/bdb/dbinc_auto/hmac_ext.h new file mode 100644 index 00000000000..d161a7291f4 --- /dev/null +++ b/bdb/dbinc_auto/hmac_ext.h @@ -0,0 +1,20 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _hmac_ext_h_ +#define _hmac_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +void __db_chksum __P((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)); +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)); +void __db_SHA1Final __P((unsigned char *, SHA1_CTX *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_hmac_ext_h_ */ diff --git a/bdb/dbinc_auto/int_def.in b/bdb/dbinc_auto/int_def.in new file mode 100644 index 00000000000..003a861f4f5 --- /dev/null +++ b/bdb/dbinc_auto/int_def.in @@ -0,0 +1,1328 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _DB_INT_DEF_IN_ +#define _DB_INT_DEF_IN_ + +#define __crdel_metasub_log __crdel_metasub_log@DB_VERSION_UNIQUE_NAME@ +#define __crdel_metasub_getpgnos __crdel_metasub_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __crdel_metasub_print __crdel_metasub_print@DB_VERSION_UNIQUE_NAME@ +#define __crdel_metasub_read __crdel_metasub_read@DB_VERSION_UNIQUE_NAME@ +#define __crdel_init_print __crdel_init_print@DB_VERSION_UNIQUE_NAME@ +#define __crdel_init_getpgnos __crdel_init_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __crdel_init_recover __crdel_init_recover@DB_VERSION_UNIQUE_NAME@ +#define __crdel_metasub_recover __crdel_metasub_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@ +#define __db_close __db_close@DB_VERSION_UNIQUE_NAME@ +#define __db_close_i __db_close_i@DB_VERSION_UNIQUE_NAME@ +#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@ +#if CONFIG_TEST +#define __db_testcopy __db_testcopy@DB_VERSION_UNIQUE_NAME@ +#endif +#define __db_cursor __db_cursor@DB_VERSION_UNIQUE_NAME@ +#define __db_icursor __db_icursor@DB_VERSION_UNIQUE_NAME@ +#define __db_cprint __db_cprint@DB_VERSION_UNIQUE_NAME@ +#define __db_fd __db_fd@DB_VERSION_UNIQUE_NAME@ +#define __db_get __db_get@DB_VERSION_UNIQUE_NAME@ +#define __db_put __db_put@DB_VERSION_UNIQUE_NAME@ +#define __db_delete __db_delete@DB_VERSION_UNIQUE_NAME@ +#define __db_sync __db_sync@DB_VERSION_UNIQUE_NAME@ +#define __db_associate __db_associate@DB_VERSION_UNIQUE_NAME@ +#define __db_pget __db_pget@DB_VERSION_UNIQUE_NAME@ +#define __db_addrem_log __db_addrem_log@DB_VERSION_UNIQUE_NAME@ +#define __db_addrem_getpgnos __db_addrem_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_addrem_print __db_addrem_print@DB_VERSION_UNIQUE_NAME@ +#define __db_addrem_read __db_addrem_read@DB_VERSION_UNIQUE_NAME@ +#define __db_big_log __db_big_log@DB_VERSION_UNIQUE_NAME@ +#define __db_big_getpgnos __db_big_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_big_print __db_big_print@DB_VERSION_UNIQUE_NAME@ +#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_getpgnos __db_ovref_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_ovref_print __db_ovref_print@DB_VERSION_UNIQUE_NAME@ +#define __db_ovref_read __db_ovref_read@DB_VERSION_UNIQUE_NAME@ +#define __db_relink_log __db_relink_log@DB_VERSION_UNIQUE_NAME@ +#define __db_relink_getpgnos __db_relink_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_relink_print __db_relink_print@DB_VERSION_UNIQUE_NAME@ +#define __db_relink_read __db_relink_read@DB_VERSION_UNIQUE_NAME@ +#define __db_debug_log __db_debug_log@DB_VERSION_UNIQUE_NAME@ +#define __db_debug_getpgnos __db_debug_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_debug_print __db_debug_print@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_getpgnos __db_noop_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_noop_print __db_noop_print@DB_VERSION_UNIQUE_NAME@ +#define __db_noop_read __db_noop_read@DB_VERSION_UNIQUE_NAME@ +#define __db_pg_alloc_log __db_pg_alloc_log@DB_VERSION_UNIQUE_NAME@ +#define __db_pg_alloc_getpgnos __db_pg_alloc_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_pg_alloc_print __db_pg_alloc_print@DB_VERSION_UNIQUE_NAME@ +#define __db_pg_alloc_read __db_pg_alloc_read@DB_VERSION_UNIQUE_NAME@ +#define __db_pg_free_log __db_pg_free_log@DB_VERSION_UNIQUE_NAME@ +#define __db_pg_free_getpgnos __db_pg_free_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_pg_free_print __db_pg_free_print@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_getpgnos __db_cksum_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_cksum_print __db_cksum_print@DB_VERSION_UNIQUE_NAME@ +#define __db_cksum_read __db_cksum_read@DB_VERSION_UNIQUE_NAME@ +#define __db_init_print __db_init_print@DB_VERSION_UNIQUE_NAME@ +#define __db_init_getpgnos __db_init_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __db_init_recover __db_init_recover@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@ +#define __db_c_count __db_c_count@DB_VERSION_UNIQUE_NAME@ +#define __db_c_del __db_c_del@DB_VERSION_UNIQUE_NAME@ +#define __db_c_dup __db_c_dup@DB_VERSION_UNIQUE_NAME@ +#define __db_c_idup __db_c_idup@DB_VERSION_UNIQUE_NAME@ +#define __db_c_newopd __db_c_newopd@DB_VERSION_UNIQUE_NAME@ +#define __db_c_get __db_c_get@DB_VERSION_UNIQUE_NAME@ +#define __db_c_put __db_c_put@DB_VERSION_UNIQUE_NAME@ +#define __db_duperr __db_duperr@DB_VERSION_UNIQUE_NAME@ +#define __db_c_secondary_get __db_c_secondary_get@DB_VERSION_UNIQUE_NAME@ +#define __db_c_pget __db_c_pget@DB_VERSION_UNIQUE_NAME@ +#define __db_c_del_primary __db_c_del_primary@DB_VERSION_UNIQUE_NAME@ +#define __db_s_first __db_s_first@DB_VERSION_UNIQUE_NAME@ +#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 __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@ +#define __db_byteswap __db_byteswap@DB_VERSION_UNIQUE_NAME@ +#define __db_dispatch __db_dispatch@DB_VERSION_UNIQUE_NAME@ +#define __db_add_recovery __db_add_recovery@DB_VERSION_UNIQUE_NAME@ +#define __db_txnlist_init __db_txnlist_init@DB_VERSION_UNIQUE_NAME@ +#define __db_txnlist_add __db_txnlist_add@DB_VERSION_UNIQUE_NAME@ +#define __db_txnlist_remove __db_txnlist_remove@DB_VERSION_UNIQUE_NAME@ +#define __db_txnlist_ckp __db_txnlist_ckp@DB_VERSION_UNIQUE_NAME@ +#define __db_txnlist_end __db_txnlist_end@DB_VERSION_UNIQUE_NAME@ +#define __db_txnlist_find __db_txnlist_find@DB_VERSION_UNIQUE_NAME@ +#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_lsninit __db_txnlist_lsninit@DB_VERSION_UNIQUE_NAME@ +#define __db_add_limbo __db_add_limbo@DB_VERSION_UNIQUE_NAME@ +#define __db_do_the_limbo __db_do_the_limbo@DB_VERSION_UNIQUE_NAME@ +#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@ +#define __db_relink __db_relink@DB_VERSION_UNIQUE_NAME@ +#define __db_cursorchk __db_cursorchk@DB_VERSION_UNIQUE_NAME@ +#define __db_ccountchk __db_ccountchk@DB_VERSION_UNIQUE_NAME@ +#define __db_cdelchk __db_cdelchk@DB_VERSION_UNIQUE_NAME@ +#define __db_cgetchk __db_cgetchk@DB_VERSION_UNIQUE_NAME@ +#define __db_cputchk __db_cputchk@DB_VERSION_UNIQUE_NAME@ +#define __db_pgetchk __db_pgetchk@DB_VERSION_UNIQUE_NAME@ +#define __db_cpgetchk __db_cpgetchk@DB_VERSION_UNIQUE_NAME@ +#define __db_delchk __db_delchk@DB_VERSION_UNIQUE_NAME@ +#define __db_getchk __db_getchk@DB_VERSION_UNIQUE_NAME@ +#define __db_joinchk __db_joinchk@DB_VERSION_UNIQUE_NAME@ +#define __db_joingetchk __db_joingetchk@DB_VERSION_UNIQUE_NAME@ +#define __db_putchk __db_putchk@DB_VERSION_UNIQUE_NAME@ +#define __db_statchk __db_statchk@DB_VERSION_UNIQUE_NAME@ +#define __db_syncchk __db_syncchk@DB_VERSION_UNIQUE_NAME@ +#define __db_secondary_corrupt __db_secondary_corrupt@DB_VERSION_UNIQUE_NAME@ +#define __db_associatechk __db_associatechk@DB_VERSION_UNIQUE_NAME@ +#define __db_txn_auto __db_txn_auto@DB_VERSION_UNIQUE_NAME@ +#define __db_join __db_join@DB_VERSION_UNIQUE_NAME@ +#define __db_new __db_new@DB_VERSION_UNIQUE_NAME@ +#define __db_free __db_free@DB_VERSION_UNIQUE_NAME@ +#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@ +#define __dbh_am_chk __dbh_am_chk@DB_VERSION_UNIQUE_NAME@ +#define __db_set_lorder __db_set_lorder@DB_VERSION_UNIQUE_NAME@ +#define __db_open __db_open@DB_VERSION_UNIQUE_NAME@ +#define __db_dbopen __db_dbopen@DB_VERSION_UNIQUE_NAME@ +#define __db_new_file __db_new_file@DB_VERSION_UNIQUE_NAME@ +#define __db_init_subdb __db_init_subdb@DB_VERSION_UNIQUE_NAME@ +#define __db_chk_meta __db_chk_meta@DB_VERSION_UNIQUE_NAME@ +#define __db_meta_setup __db_meta_setup@DB_VERSION_UNIQUE_NAME@ +#define __db_goff __db_goff@DB_VERSION_UNIQUE_NAME@ +#define __db_poff __db_poff@DB_VERSION_UNIQUE_NAME@ +#define __db_ovref __db_ovref@DB_VERSION_UNIQUE_NAME@ +#define __db_doff __db_doff@DB_VERSION_UNIQUE_NAME@ +#define __db_moff __db_moff@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_overflow __db_vrfy_overflow@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_ovfl_structure __db_vrfy_ovfl_structure@DB_VERSION_UNIQUE_NAME@ +#define __db_safe_goff __db_safe_goff@DB_VERSION_UNIQUE_NAME@ +#define __db_loadme __db_loadme@DB_VERSION_UNIQUE_NAME@ +#define __db_dump __db_dump@DB_VERSION_UNIQUE_NAME@ +#define __db_inmemdbflags __db_inmemdbflags@DB_VERSION_UNIQUE_NAME@ +#define __db_prnpage __db_prnpage@DB_VERSION_UNIQUE_NAME@ +#define __db_prpage __db_prpage@DB_VERSION_UNIQUE_NAME@ +#define __db_pr __db_pr@DB_VERSION_UNIQUE_NAME@ +#define __db_prdbt __db_prdbt@DB_VERSION_UNIQUE_NAME@ +#define __db_prflags __db_prflags@DB_VERSION_UNIQUE_NAME@ +#define __db_dbtype_to_string __db_dbtype_to_string@DB_VERSION_UNIQUE_NAME@ +#define __db_prheader __db_prheader@DB_VERSION_UNIQUE_NAME@ +#define __db_prfooter __db_prfooter@DB_VERSION_UNIQUE_NAME@ +#define __db_addrem_recover __db_addrem_recover@DB_VERSION_UNIQUE_NAME@ +#define __db_big_recover __db_big_recover@DB_VERSION_UNIQUE_NAME@ +#define __db_ovref_recover __db_ovref_recover@DB_VERSION_UNIQUE_NAME@ +#define __db_relink_recover __db_relink_recover@DB_VERSION_UNIQUE_NAME@ +#define __db_debug_recover __db_debug_recover@DB_VERSION_UNIQUE_NAME@ +#define __db_noop_recover __db_noop_recover@DB_VERSION_UNIQUE_NAME@ +#define __db_pg_alloc_recover __db_pg_alloc_recover@DB_VERSION_UNIQUE_NAME@ +#define __db_pg_free_recover __db_pg_free_recover@DB_VERSION_UNIQUE_NAME@ +#define __db_cksum_recover __db_cksum_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 __dbenv_dbremove@DB_VERSION_UNIQUE_NAME@ +#define __db_remove __db_remove@DB_VERSION_UNIQUE_NAME@ +#define __db_remove_i __db_remove_i@DB_VERSION_UNIQUE_NAME@ +#define __dbenv_dbrename __dbenv_dbrename@DB_VERSION_UNIQUE_NAME@ +#define __db_rename __db_rename@DB_VERSION_UNIQUE_NAME@ +#define __db_rename_i __db_rename_i@DB_VERSION_UNIQUE_NAME@ +#define __db_ret __db_ret@DB_VERSION_UNIQUE_NAME@ +#define __db_retcopy __db_retcopy@DB_VERSION_UNIQUE_NAME@ +#define __db_truncate __db_truncate@DB_VERSION_UNIQUE_NAME@ +#define __db_upgrade __db_upgrade@DB_VERSION_UNIQUE_NAME@ +#define __db_lastpgno __db_lastpgno@DB_VERSION_UNIQUE_NAME@ +#define __db_31_offdup __db_31_offdup@DB_VERSION_UNIQUE_NAME@ +#define __db_verify __db_verify@DB_VERSION_UNIQUE_NAME@ +#define __db_verify_callback __db_verify_callback@DB_VERSION_UNIQUE_NAME@ +#define __db_verify_internal __db_verify_internal@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_datapage __db_vrfy_datapage@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_meta __db_vrfy_meta@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_struct_feedback __db_vrfy_struct_feedback@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_inpitem __db_vrfy_inpitem@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_duptype __db_vrfy_duptype@DB_VERSION_UNIQUE_NAME@ +#define __db_salvage_duptree __db_salvage_duptree@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_dbinfo_create __db_vrfy_dbinfo_create@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_dbinfo_destroy __db_vrfy_dbinfo_destroy@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_getpageinfo __db_vrfy_getpageinfo@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_putpageinfo __db_vrfy_putpageinfo@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_pgset __db_vrfy_pgset@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_pgset_get __db_vrfy_pgset_get@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_pgset_inc __db_vrfy_pgset_inc@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_pgset_dec __db_vrfy_pgset_dec@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_pgset_next __db_vrfy_pgset_next@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_childcursor __db_vrfy_childcursor@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_childput __db_vrfy_childput@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_ccset __db_vrfy_ccset@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_ccnext __db_vrfy_ccnext@DB_VERSION_UNIQUE_NAME@ +#define __db_vrfy_ccclose __db_vrfy_ccclose@DB_VERSION_UNIQUE_NAME@ +#define __db_salvage_init __db_salvage_init@DB_VERSION_UNIQUE_NAME@ +#define __db_salvage_destroy __db_salvage_destroy@DB_VERSION_UNIQUE_NAME@ +#define __db_salvage_getnext __db_salvage_getnext@DB_VERSION_UNIQUE_NAME@ +#define __db_salvage_isdone __db_salvage_isdone@DB_VERSION_UNIQUE_NAME@ +#define __db_salvage_markdone __db_salvage_markdone@DB_VERSION_UNIQUE_NAME@ +#define __db_salvage_markneeded __db_salvage_markneeded@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@ +#define __bam_pgin __bam_pgin@DB_VERSION_UNIQUE_NAME@ +#define __bam_pgout __bam_pgout@DB_VERSION_UNIQUE_NAME@ +#define __bam_mswap __bam_mswap@DB_VERSION_UNIQUE_NAME@ +#define __bam_cprint __bam_cprint@DB_VERSION_UNIQUE_NAME@ +#define __bam_ca_delete __bam_ca_delete@DB_VERSION_UNIQUE_NAME@ +#define __ram_ca_delete __ram_ca_delete@DB_VERSION_UNIQUE_NAME@ +#define __bam_ca_di __bam_ca_di@DB_VERSION_UNIQUE_NAME@ +#define __bam_ca_dup __bam_ca_dup@DB_VERSION_UNIQUE_NAME@ +#define __bam_ca_undodup __bam_ca_undodup@DB_VERSION_UNIQUE_NAME@ +#define __bam_ca_rsplit __bam_ca_rsplit@DB_VERSION_UNIQUE_NAME@ +#define __bam_ca_split __bam_ca_split@DB_VERSION_UNIQUE_NAME@ +#define __bam_ca_undosplit __bam_ca_undosplit@DB_VERSION_UNIQUE_NAME@ +#define __bam_c_init __bam_c_init@DB_VERSION_UNIQUE_NAME@ +#define __bam_c_refresh __bam_c_refresh@DB_VERSION_UNIQUE_NAME@ +#define __bam_c_count __bam_c_count@DB_VERSION_UNIQUE_NAME@ +#define __bam_c_dup __bam_c_dup@DB_VERSION_UNIQUE_NAME@ +#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_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_db_create __bam_db_create@DB_VERSION_UNIQUE_NAME@ +#define __bam_db_close __bam_db_close@DB_VERSION_UNIQUE_NAME@ +#define __bam_set_flags __bam_set_flags@DB_VERSION_UNIQUE_NAME@ +#define __ram_set_flags __ram_set_flags@DB_VERSION_UNIQUE_NAME@ +#define __bam_open __bam_open@DB_VERSION_UNIQUE_NAME@ +#define __bam_metachk __bam_metachk@DB_VERSION_UNIQUE_NAME@ +#define __bam_read_root __bam_read_root@DB_VERSION_UNIQUE_NAME@ +#define __bam_new_file __bam_new_file@DB_VERSION_UNIQUE_NAME@ +#define __bam_new_subdb __bam_new_subdb@DB_VERSION_UNIQUE_NAME@ +#define __bam_iitem __bam_iitem@DB_VERSION_UNIQUE_NAME@ +#define __bam_ritem __bam_ritem@DB_VERSION_UNIQUE_NAME@ +#define __bam_split_recover __bam_split_recover@DB_VERSION_UNIQUE_NAME@ +#define __bam_rsplit_recover __bam_rsplit_recover@DB_VERSION_UNIQUE_NAME@ +#define __bam_adj_recover __bam_adj_recover@DB_VERSION_UNIQUE_NAME@ +#define __bam_cadjust_recover __bam_cadjust_recover@DB_VERSION_UNIQUE_NAME@ +#define __bam_cdel_recover __bam_cdel_recover@DB_VERSION_UNIQUE_NAME@ +#define __bam_repl_recover __bam_repl_recover@DB_VERSION_UNIQUE_NAME@ +#define __bam_root_recover __bam_root_recover@DB_VERSION_UNIQUE_NAME@ +#define __bam_curadj_recover __bam_curadj_recover@DB_VERSION_UNIQUE_NAME@ +#define __bam_rcuradj_recover __bam_rcuradj_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@ +#define __ram_append __ram_append@DB_VERSION_UNIQUE_NAME@ +#define __ram_c_del __ram_c_del@DB_VERSION_UNIQUE_NAME@ +#define __ram_c_get __ram_c_get@DB_VERSION_UNIQUE_NAME@ +#define __ram_c_put __ram_c_put@DB_VERSION_UNIQUE_NAME@ +#define __ram_ca __ram_ca@DB_VERSION_UNIQUE_NAME@ +#define __ram_getno __ram_getno@DB_VERSION_UNIQUE_NAME@ +#define __ram_writeback __ram_writeback@DB_VERSION_UNIQUE_NAME@ +#define __bam_rsearch __bam_rsearch@DB_VERSION_UNIQUE_NAME@ +#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_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_copy __bam_copy@DB_VERSION_UNIQUE_NAME@ +#define __bam_stat __bam_stat@DB_VERSION_UNIQUE_NAME@ +#define __bam_traverse __bam_traverse@DB_VERSION_UNIQUE_NAME@ +#define __bam_stat_callback __bam_stat_callback@DB_VERSION_UNIQUE_NAME@ +#define __bam_key_range __bam_key_range@DB_VERSION_UNIQUE_NAME@ +#define __bam_30_btreemeta __bam_30_btreemeta@DB_VERSION_UNIQUE_NAME@ +#define __bam_31_btreemeta __bam_31_btreemeta@DB_VERSION_UNIQUE_NAME@ +#define __bam_31_lbtree __bam_31_lbtree@DB_VERSION_UNIQUE_NAME@ +#define __bam_vrfy_meta __bam_vrfy_meta@DB_VERSION_UNIQUE_NAME@ +#define __ram_vrfy_leaf __ram_vrfy_leaf@DB_VERSION_UNIQUE_NAME@ +#define __bam_vrfy __bam_vrfy@DB_VERSION_UNIQUE_NAME@ +#define __bam_vrfy_itemorder __bam_vrfy_itemorder@DB_VERSION_UNIQUE_NAME@ +#define __bam_vrfy_structure __bam_vrfy_structure@DB_VERSION_UNIQUE_NAME@ +#define __bam_vrfy_subtree __bam_vrfy_subtree@DB_VERSION_UNIQUE_NAME@ +#define __bam_salvage __bam_salvage@DB_VERSION_UNIQUE_NAME@ +#define __bam_salvage_walkdupint __bam_salvage_walkdupint@DB_VERSION_UNIQUE_NAME@ +#define __bam_meta2pgset __bam_meta2pgset@DB_VERSION_UNIQUE_NAME@ +#define __bam_split_log __bam_split_log@DB_VERSION_UNIQUE_NAME@ +#define __bam_split_getpgnos __bam_split_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_split_print __bam_split_print@DB_VERSION_UNIQUE_NAME@ +#define __bam_split_read __bam_split_read@DB_VERSION_UNIQUE_NAME@ +#define __bam_rsplit_log __bam_rsplit_log@DB_VERSION_UNIQUE_NAME@ +#define __bam_rsplit_getpgnos __bam_rsplit_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_rsplit_print __bam_rsplit_print@DB_VERSION_UNIQUE_NAME@ +#define __bam_rsplit_read __bam_rsplit_read@DB_VERSION_UNIQUE_NAME@ +#define __bam_adj_log __bam_adj_log@DB_VERSION_UNIQUE_NAME@ +#define __bam_adj_getpgnos __bam_adj_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_adj_print __bam_adj_print@DB_VERSION_UNIQUE_NAME@ +#define __bam_adj_read __bam_adj_read@DB_VERSION_UNIQUE_NAME@ +#define __bam_cadjust_log __bam_cadjust_log@DB_VERSION_UNIQUE_NAME@ +#define __bam_cadjust_getpgnos __bam_cadjust_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_cadjust_print __bam_cadjust_print@DB_VERSION_UNIQUE_NAME@ +#define __bam_cadjust_read __bam_cadjust_read@DB_VERSION_UNIQUE_NAME@ +#define __bam_cdel_log __bam_cdel_log@DB_VERSION_UNIQUE_NAME@ +#define __bam_cdel_getpgnos __bam_cdel_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_cdel_print __bam_cdel_print@DB_VERSION_UNIQUE_NAME@ +#define __bam_cdel_read __bam_cdel_read@DB_VERSION_UNIQUE_NAME@ +#define __bam_repl_log __bam_repl_log@DB_VERSION_UNIQUE_NAME@ +#define __bam_repl_getpgnos __bam_repl_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_repl_print __bam_repl_print@DB_VERSION_UNIQUE_NAME@ +#define __bam_repl_read __bam_repl_read@DB_VERSION_UNIQUE_NAME@ +#define __bam_root_log __bam_root_log@DB_VERSION_UNIQUE_NAME@ +#define __bam_root_getpgnos __bam_root_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_root_print __bam_root_print@DB_VERSION_UNIQUE_NAME@ +#define __bam_root_read __bam_root_read@DB_VERSION_UNIQUE_NAME@ +#define __bam_curadj_log __bam_curadj_log@DB_VERSION_UNIQUE_NAME@ +#define __bam_curadj_getpgnos __bam_curadj_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_curadj_print __bam_curadj_print@DB_VERSION_UNIQUE_NAME@ +#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_getpgnos __bam_rcuradj_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_rcuradj_print __bam_rcuradj_print@DB_VERSION_UNIQUE_NAME@ +#define __bam_rcuradj_read __bam_rcuradj_read@DB_VERSION_UNIQUE_NAME@ +#define __bam_init_print __bam_init_print@DB_VERSION_UNIQUE_NAME@ +#define __bam_init_getpgnos __bam_init_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __bam_init_recover __bam_init_recover@DB_VERSION_UNIQUE_NAME@ +#ifndef HAVE_GETCWD +#define getcwd getcwd@DB_VERSION_UNIQUE_NAME@ +#endif +#ifndef HAVE_GETOPT +#define getopt getopt@DB_VERSION_UNIQUE_NAME@ +#endif +#ifndef HAVE_MEMCMP +#define memcmp memcmp@DB_VERSION_UNIQUE_NAME@ +#endif +#ifndef HAVE_MEMCPY +#define memcpy memcpy@DB_VERSION_UNIQUE_NAME@ +#endif +#ifndef HAVE_MEMMOVE +#define memmove memmove@DB_VERSION_UNIQUE_NAME@ +#endif +#ifndef HAVE_RAISE +#define raise raise@DB_VERSION_UNIQUE_NAME@ +#endif +#ifndef HAVE_SNPRINTF +#define snprintf snprintf@DB_VERSION_UNIQUE_NAME@ +#endif +#ifndef HAVE_STRCASECMP +#define strcasecmp strcasecmp@DB_VERSION_UNIQUE_NAME@ +#endif +#ifndef HAVE_STRCASECMP +#define strncasecmp strncasecmp@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_VSNPRINTF +#define vsnprintf vsnprintf@DB_VERSION_UNIQUE_NAME@ +#endif +#define __db_isbigendian __db_isbigendian@DB_VERSION_UNIQUE_NAME@ +#define __db_byteorder __db_byteorder@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@ +#define __db_pgerr __db_pgerr@DB_VERSION_UNIQUE_NAME@ +#define __db_pgfmt __db_pgfmt@DB_VERSION_UNIQUE_NAME@ +#define __db_eopnotsup __db_eopnotsup@DB_VERSION_UNIQUE_NAME@ +#ifdef DIAGNOSTIC +#define __db_assert __db_assert@DB_VERSION_UNIQUE_NAME@ +#endif +#define __db_panic_msg __db_panic_msg@DB_VERSION_UNIQUE_NAME@ +#define __db_panic __db_panic@DB_VERSION_UNIQUE_NAME@ +#define __db_err __db_err@DB_VERSION_UNIQUE_NAME@ +#define __db_errcall __db_errcall@DB_VERSION_UNIQUE_NAME@ +#define __db_errfile __db_errfile@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_check_txn __db_check_txn@DB_VERSION_UNIQUE_NAME@ +#define __db_not_txn_env __db_not_txn_env@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_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@ +#define __db_util_siginit __db_util_siginit@DB_VERSION_UNIQUE_NAME@ +#define __db_util_interrupted __db_util_interrupted@DB_VERSION_UNIQUE_NAME@ +#define __db_util_sigresend __db_util_sigresend@DB_VERSION_UNIQUE_NAME@ +#define __aes_setup __aes_setup@DB_VERSION_UNIQUE_NAME@ +#define __aes_adj_size __aes_adj_size@DB_VERSION_UNIQUE_NAME@ +#define __aes_close __aes_close@DB_VERSION_UNIQUE_NAME@ +#define __aes_decrypt __aes_decrypt@DB_VERSION_UNIQUE_NAME@ +#define __aes_encrypt __aes_encrypt@DB_VERSION_UNIQUE_NAME@ +#define __aes_init __aes_init@DB_VERSION_UNIQUE_NAME@ +#define __crypto_region_init __crypto_region_init@DB_VERSION_UNIQUE_NAME@ +#define __crypto_dbenv_close __crypto_dbenv_close@DB_VERSION_UNIQUE_NAME@ +#define __crypto_algsetup __crypto_algsetup@DB_VERSION_UNIQUE_NAME@ +#define __crypto_decrypt_meta __crypto_decrypt_meta@DB_VERSION_UNIQUE_NAME@ +#define __db_generate_iv __db_generate_iv@DB_VERSION_UNIQUE_NAME@ +#define __db_rijndaelKeySetupEnc __db_rijndaelKeySetupEnc@DB_VERSION_UNIQUE_NAME@ +#define __db_rijndaelKeySetupDec __db_rijndaelKeySetupDec@DB_VERSION_UNIQUE_NAME@ +#define __db_rijndaelEncrypt __db_rijndaelEncrypt@DB_VERSION_UNIQUE_NAME@ +#define __db_rijndaelDecrypt __db_rijndaelDecrypt@DB_VERSION_UNIQUE_NAME@ +#define __db_rijndaelEncryptRound __db_rijndaelEncryptRound@DB_VERSION_UNIQUE_NAME@ +#define __db_rijndaelDecryptRound __db_rijndaelDecryptRound@DB_VERSION_UNIQUE_NAME@ +#define __db_makeKey __db_makeKey@DB_VERSION_UNIQUE_NAME@ +#define __db_cipherInit __db_cipherInit@DB_VERSION_UNIQUE_NAME@ +#define __db_blockEncrypt __db_blockEncrypt@DB_VERSION_UNIQUE_NAME@ +#define __db_padEncrypt __db_padEncrypt@DB_VERSION_UNIQUE_NAME@ +#define __db_blockDecrypt __db_blockDecrypt@DB_VERSION_UNIQUE_NAME@ +#define __db_padDecrypt __db_padDecrypt@DB_VERSION_UNIQUE_NAME@ +#define __db_cipherUpdateRounds __db_cipherUpdateRounds@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_setup __dbreg_setup@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_teardown __dbreg_teardown@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_new_id __dbreg_new_id@DB_VERSION_UNIQUE_NAME@ +#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_register_log __dbreg_register_log@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_register_getpgnos __dbreg_register_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_register_print __dbreg_register_print@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_register_read __dbreg_register_read@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_init_print __dbreg_init_print@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_init_getpgnos __dbreg_init_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_init_recover __dbreg_init_recover@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_register_recover __dbreg_register_recover@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_open_files __dbreg_open_files@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_close_files __dbreg_close_files@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_nofiles __dbreg_nofiles@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@ +#define __dbreg_fid_to_fname __dbreg_fid_to_fname@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_get_name __dbreg_get_name@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_do_open __dbreg_do_open@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_lazy_id __dbreg_lazy_id@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_push_id __dbreg_push_id@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_pop_id __dbreg_pop_id@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_pluck_id __dbreg_pluck_id@DB_VERSION_UNIQUE_NAME@ +#define __dbreg_print_dblist __dbreg_print_dblist@DB_VERSION_UNIQUE_NAME@ +#define __db_shalloc_init __db_shalloc_init@DB_VERSION_UNIQUE_NAME@ +#define __db_shalloc_size __db_shalloc_size@DB_VERSION_UNIQUE_NAME@ +#define __db_shalloc __db_shalloc@DB_VERSION_UNIQUE_NAME@ +#define __db_shalloc_free __db_shalloc_free@DB_VERSION_UNIQUE_NAME@ +#define __db_shsizeof __db_shsizeof@DB_VERSION_UNIQUE_NAME@ +#define __db_shalloc_dump __db_shalloc_dump@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 __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 __dbenv_close@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 __env_openfiles __env_openfiles@DB_VERSION_UNIQUE_NAME@ +#define __db_e_attach __db_e_attach@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_e_stat __db_e_stat@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 __fop_create_log __fop_create_log@DB_VERSION_UNIQUE_NAME@ +#define __fop_create_getpgnos __fop_create_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __fop_create_print __fop_create_print@DB_VERSION_UNIQUE_NAME@ +#define __fop_create_read __fop_create_read@DB_VERSION_UNIQUE_NAME@ +#define __fop_remove_log __fop_remove_log@DB_VERSION_UNIQUE_NAME@ +#define __fop_remove_getpgnos __fop_remove_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __fop_remove_print __fop_remove_print@DB_VERSION_UNIQUE_NAME@ +#define __fop_remove_read __fop_remove_read@DB_VERSION_UNIQUE_NAME@ +#define __fop_write_log __fop_write_log@DB_VERSION_UNIQUE_NAME@ +#define __fop_write_getpgnos __fop_write_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __fop_write_print __fop_write_print@DB_VERSION_UNIQUE_NAME@ +#define __fop_write_read __fop_write_read@DB_VERSION_UNIQUE_NAME@ +#define __fop_rename_log __fop_rename_log@DB_VERSION_UNIQUE_NAME@ +#define __fop_rename_getpgnos __fop_rename_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __fop_rename_print __fop_rename_print@DB_VERSION_UNIQUE_NAME@ +#define __fop_rename_read __fop_rename_read@DB_VERSION_UNIQUE_NAME@ +#define __fop_file_remove_log __fop_file_remove_log@DB_VERSION_UNIQUE_NAME@ +#define __fop_file_remove_getpgnos __fop_file_remove_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __fop_file_remove_print __fop_file_remove_print@DB_VERSION_UNIQUE_NAME@ +#define __fop_file_remove_read __fop_file_remove_read@DB_VERSION_UNIQUE_NAME@ +#define __fop_init_print __fop_init_print@DB_VERSION_UNIQUE_NAME@ +#define __fop_init_getpgnos __fop_init_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __fop_init_recover __fop_init_recover@DB_VERSION_UNIQUE_NAME@ +#define __fop_create __fop_create@DB_VERSION_UNIQUE_NAME@ +#define __fop_remove __fop_remove@DB_VERSION_UNIQUE_NAME@ +#define __fop_write __fop_write@DB_VERSION_UNIQUE_NAME@ +#define __fop_rename __fop_rename@DB_VERSION_UNIQUE_NAME@ +#define __fop_create_recover __fop_create_recover@DB_VERSION_UNIQUE_NAME@ +#define __fop_remove_recover __fop_remove_recover@DB_VERSION_UNIQUE_NAME@ +#define __fop_write_recover __fop_write_recover@DB_VERSION_UNIQUE_NAME@ +#define __fop_rename_recover __fop_rename_recover@DB_VERSION_UNIQUE_NAME@ +#define __fop_file_remove_recover __fop_file_remove_recover@DB_VERSION_UNIQUE_NAME@ +#define __fop_lock_handle __fop_lock_handle@DB_VERSION_UNIQUE_NAME@ +#define __fop_file_setup __fop_file_setup@DB_VERSION_UNIQUE_NAME@ +#define __fop_subdb_setup __fop_subdb_setup@DB_VERSION_UNIQUE_NAME@ +#define __fop_remove_setup __fop_remove_setup@DB_VERSION_UNIQUE_NAME@ +#define __fop_read_meta __fop_read_meta@DB_VERSION_UNIQUE_NAME@ +#define __fop_dummy __fop_dummy@DB_VERSION_UNIQUE_NAME@ +#define __fop_dbrename __fop_dbrename@DB_VERSION_UNIQUE_NAME@ +#define __ham_quick_delete __ham_quick_delete@DB_VERSION_UNIQUE_NAME@ +#define __ham_c_init __ham_c_init@DB_VERSION_UNIQUE_NAME@ +#define __ham_c_count __ham_c_count@DB_VERSION_UNIQUE_NAME@ +#define __ham_c_dup __ham_c_dup@DB_VERSION_UNIQUE_NAME@ +#define __ham_call_hash __ham_call_hash@DB_VERSION_UNIQUE_NAME@ +#define __ham_init_dbt __ham_init_dbt@DB_VERSION_UNIQUE_NAME@ +#define __ham_c_update __ham_c_update@DB_VERSION_UNIQUE_NAME@ +#define __ham_get_clist __ham_get_clist@DB_VERSION_UNIQUE_NAME@ +#define __ham_insdel_log __ham_insdel_log@DB_VERSION_UNIQUE_NAME@ +#define __ham_insdel_getpgnos __ham_insdel_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_insdel_print __ham_insdel_print@DB_VERSION_UNIQUE_NAME@ +#define __ham_insdel_read __ham_insdel_read@DB_VERSION_UNIQUE_NAME@ +#define __ham_newpage_log __ham_newpage_log@DB_VERSION_UNIQUE_NAME@ +#define __ham_newpage_getpgnos __ham_newpage_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_newpage_print __ham_newpage_print@DB_VERSION_UNIQUE_NAME@ +#define __ham_newpage_read __ham_newpage_read@DB_VERSION_UNIQUE_NAME@ +#define __ham_splitdata_log __ham_splitdata_log@DB_VERSION_UNIQUE_NAME@ +#define __ham_splitdata_getpgnos __ham_splitdata_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_splitdata_print __ham_splitdata_print@DB_VERSION_UNIQUE_NAME@ +#define __ham_splitdata_read __ham_splitdata_read@DB_VERSION_UNIQUE_NAME@ +#define __ham_replace_log __ham_replace_log@DB_VERSION_UNIQUE_NAME@ +#define __ham_replace_getpgnos __ham_replace_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_replace_print __ham_replace_print@DB_VERSION_UNIQUE_NAME@ +#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_getpgnos __ham_copypage_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_copypage_print __ham_copypage_print@DB_VERSION_UNIQUE_NAME@ +#define __ham_copypage_read __ham_copypage_read@DB_VERSION_UNIQUE_NAME@ +#define __ham_metagroup_log __ham_metagroup_log@DB_VERSION_UNIQUE_NAME@ +#define __ham_metagroup_getpgnos __ham_metagroup_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_metagroup_print __ham_metagroup_print@DB_VERSION_UNIQUE_NAME@ +#define __ham_metagroup_read __ham_metagroup_read@DB_VERSION_UNIQUE_NAME@ +#define __ham_groupalloc_log __ham_groupalloc_log@DB_VERSION_UNIQUE_NAME@ +#define __ham_groupalloc_getpgnos __ham_groupalloc_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_groupalloc_print __ham_groupalloc_print@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@ +#define __ham_curadj_getpgnos __ham_curadj_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_curadj_print __ham_curadj_print@DB_VERSION_UNIQUE_NAME@ +#define __ham_curadj_read __ham_curadj_read@DB_VERSION_UNIQUE_NAME@ +#define __ham_chgpg_log __ham_chgpg_log@DB_VERSION_UNIQUE_NAME@ +#define __ham_chgpg_getpgnos __ham_chgpg_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_chgpg_print __ham_chgpg_print@DB_VERSION_UNIQUE_NAME@ +#define __ham_chgpg_read __ham_chgpg_read@DB_VERSION_UNIQUE_NAME@ +#define __ham_init_print __ham_init_print@DB_VERSION_UNIQUE_NAME@ +#define __ham_init_getpgnos __ham_init_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __ham_init_recover __ham_init_recover@DB_VERSION_UNIQUE_NAME@ +#define __ham_pgin __ham_pgin@DB_VERSION_UNIQUE_NAME@ +#define __ham_pgout __ham_pgout@DB_VERSION_UNIQUE_NAME@ +#define __ham_mswap __ham_mswap@DB_VERSION_UNIQUE_NAME@ +#define __ham_add_dup __ham_add_dup@DB_VERSION_UNIQUE_NAME@ +#define __ham_dup_convert __ham_dup_convert@DB_VERSION_UNIQUE_NAME@ +#define __ham_make_dup __ham_make_dup@DB_VERSION_UNIQUE_NAME@ +#define __ham_dsearch __ham_dsearch@DB_VERSION_UNIQUE_NAME@ +#define __ham_cprint __ham_cprint@DB_VERSION_UNIQUE_NAME@ +#define __ham_func2 __ham_func2@DB_VERSION_UNIQUE_NAME@ +#define __ham_func3 __ham_func3@DB_VERSION_UNIQUE_NAME@ +#define __ham_func4 __ham_func4@DB_VERSION_UNIQUE_NAME@ +#define __ham_func5 __ham_func5@DB_VERSION_UNIQUE_NAME@ +#define __ham_test __ham_test@DB_VERSION_UNIQUE_NAME@ +#define __ham_get_meta __ham_get_meta@DB_VERSION_UNIQUE_NAME@ +#define __ham_release_meta __ham_release_meta@DB_VERSION_UNIQUE_NAME@ +#define __ham_dirty_meta __ham_dirty_meta@DB_VERSION_UNIQUE_NAME@ +#define __ham_db_create __ham_db_create@DB_VERSION_UNIQUE_NAME@ +#define __ham_db_close __ham_db_close@DB_VERSION_UNIQUE_NAME@ +#define __ham_open __ham_open@DB_VERSION_UNIQUE_NAME@ +#define __ham_metachk __ham_metachk@DB_VERSION_UNIQUE_NAME@ +#define __ham_new_file __ham_new_file@DB_VERSION_UNIQUE_NAME@ +#define __ham_new_subdb __ham_new_subdb@DB_VERSION_UNIQUE_NAME@ +#define __ham_item __ham_item@DB_VERSION_UNIQUE_NAME@ +#define __ham_item_reset __ham_item_reset@DB_VERSION_UNIQUE_NAME@ +#define __ham_item_init __ham_item_init@DB_VERSION_UNIQUE_NAME@ +#define __ham_item_last __ham_item_last@DB_VERSION_UNIQUE_NAME@ +#define __ham_item_first __ham_item_first@DB_VERSION_UNIQUE_NAME@ +#define __ham_item_prev __ham_item_prev@DB_VERSION_UNIQUE_NAME@ +#define __ham_item_next __ham_item_next@DB_VERSION_UNIQUE_NAME@ +#define __ham_putitem __ham_putitem@DB_VERSION_UNIQUE_NAME@ +#define __ham_reputpair __ham_reputpair@DB_VERSION_UNIQUE_NAME@ +#define __ham_del_pair __ham_del_pair@DB_VERSION_UNIQUE_NAME@ +#define __ham_replpair __ham_replpair@DB_VERSION_UNIQUE_NAME@ +#define __ham_onpage_replace __ham_onpage_replace@DB_VERSION_UNIQUE_NAME@ +#define __ham_split_page __ham_split_page@DB_VERSION_UNIQUE_NAME@ +#define __ham_add_el __ham_add_el@DB_VERSION_UNIQUE_NAME@ +#define __ham_copy_item __ham_copy_item@DB_VERSION_UNIQUE_NAME@ +#define __ham_add_ovflpage __ham_add_ovflpage@DB_VERSION_UNIQUE_NAME@ +#define __ham_get_cpage __ham_get_cpage@DB_VERSION_UNIQUE_NAME@ +#define __ham_next_cpage __ham_next_cpage@DB_VERSION_UNIQUE_NAME@ +#define __ham_lock_bucket __ham_lock_bucket@DB_VERSION_UNIQUE_NAME@ +#define __ham_dpair __ham_dpair@DB_VERSION_UNIQUE_NAME@ +#define __ham_insdel_recover __ham_insdel_recover@DB_VERSION_UNIQUE_NAME@ +#define __ham_newpage_recover __ham_newpage_recover@DB_VERSION_UNIQUE_NAME@ +#define __ham_replace_recover __ham_replace_recover@DB_VERSION_UNIQUE_NAME@ +#define __ham_splitdata_recover __ham_splitdata_recover@DB_VERSION_UNIQUE_NAME@ +#define __ham_copypage_recover __ham_copypage_recover@DB_VERSION_UNIQUE_NAME@ +#define __ham_metagroup_recover __ham_metagroup_recover@DB_VERSION_UNIQUE_NAME@ +#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_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@ +#define __ham_traverse __ham_traverse@DB_VERSION_UNIQUE_NAME@ +#define __ham_30_hashmeta __ham_30_hashmeta@DB_VERSION_UNIQUE_NAME@ +#define __ham_30_sizefix __ham_30_sizefix@DB_VERSION_UNIQUE_NAME@ +#define __ham_31_hashmeta __ham_31_hashmeta@DB_VERSION_UNIQUE_NAME@ +#define __ham_31_hash __ham_31_hash@DB_VERSION_UNIQUE_NAME@ +#define __ham_vrfy_meta __ham_vrfy_meta@DB_VERSION_UNIQUE_NAME@ +#define __ham_vrfy __ham_vrfy@DB_VERSION_UNIQUE_NAME@ +#define __ham_vrfy_structure __ham_vrfy_structure@DB_VERSION_UNIQUE_NAME@ +#define __ham_vrfy_hashing __ham_vrfy_hashing@DB_VERSION_UNIQUE_NAME@ +#define __ham_salvage __ham_salvage@DB_VERSION_UNIQUE_NAME@ +#define __ham_meta2pgset __ham_meta2pgset@DB_VERSION_UNIQUE_NAME@ +#define __db_chksum __db_chksum@DB_VERSION_UNIQUE_NAME@ +#define __db_derive_mac __db_derive_mac@DB_VERSION_UNIQUE_NAME@ +#define __db_check_chksum __db_check_chksum@DB_VERSION_UNIQUE_NAME@ +#define __db_SHA1Transform __db_SHA1Transform@DB_VERSION_UNIQUE_NAME@ +#define __db_SHA1Init __db_SHA1Init@DB_VERSION_UNIQUE_NAME@ +#define __db_SHA1Update __db_SHA1Update@DB_VERSION_UNIQUE_NAME@ +#define __db_SHA1Final __db_SHA1Final@DB_VERSION_UNIQUE_NAME@ +#define __lock_id __lock_id@DB_VERSION_UNIQUE_NAME@ +#define __lock_id_free __lock_id_free@DB_VERSION_UNIQUE_NAME@ +#define __lock_vec __lock_vec@DB_VERSION_UNIQUE_NAME@ +#define __lock_get __lock_get@DB_VERSION_UNIQUE_NAME@ +#define __lock_put __lock_put@DB_VERSION_UNIQUE_NAME@ +#define __lock_downgrade __lock_downgrade@DB_VERSION_UNIQUE_NAME@ +#define __lock_addfamilylocker __lock_addfamilylocker@DB_VERSION_UNIQUE_NAME@ +#define __lock_freefamilylocker __lock_freefamilylocker@DB_VERSION_UNIQUE_NAME@ +#define __lock_set_timeout __lock_set_timeout@DB_VERSION_UNIQUE_NAME@ +#define __lock_inherit_timeout __lock_inherit_timeout@DB_VERSION_UNIQUE_NAME@ +#define __lock_getlocker __lock_getlocker@DB_VERSION_UNIQUE_NAME@ +#define __lock_promote __lock_promote@DB_VERSION_UNIQUE_NAME@ +#define __lock_expired __lock_expired@DB_VERSION_UNIQUE_NAME@ +#define __lock_detect __lock_detect@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_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_id_set __lock_id_set@DB_VERSION_UNIQUE_NAME@ +#define __lock_stat __lock_stat@DB_VERSION_UNIQUE_NAME@ +#define __lock_dump_region __lock_dump_region@DB_VERSION_UNIQUE_NAME@ +#define __lock_printlock __lock_printlock@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 __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_stat __log_stat@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_vtruncate __log_vtruncate@DB_VERSION_UNIQUE_NAME@ +#define __log_is_outdated __log_is_outdated@DB_VERSION_UNIQUE_NAME@ +#define __log_archive __log_archive@DB_VERSION_UNIQUE_NAME@ +#define __log_cursor __log_cursor@DB_VERSION_UNIQUE_NAME@ +#define __log_dbenv_create __log_dbenv_create@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_newfile __log_newfile@DB_VERSION_UNIQUE_NAME@ +#define __log_flush __log_flush@DB_VERSION_UNIQUE_NAME@ +#define __log_file __log_file@DB_VERSION_UNIQUE_NAME@ +#define __log_name __log_name@DB_VERSION_UNIQUE_NAME@ +#define __log_rep_put __log_rep_put@DB_VERSION_UNIQUE_NAME@ +#define __memp_alloc __memp_alloc@DB_VERSION_UNIQUE_NAME@ +#ifdef DIAGNOSTIC +#define __memp_check_order __memp_check_order@DB_VERSION_UNIQUE_NAME@ +#endif +#define __memp_bhwrite __memp_bhwrite@DB_VERSION_UNIQUE_NAME@ +#define __memp_pgread __memp_pgread@DB_VERSION_UNIQUE_NAME@ +#define __memp_pg __memp_pg@DB_VERSION_UNIQUE_NAME@ +#define __memp_bhfree __memp_bhfree@DB_VERSION_UNIQUE_NAME@ +#define __memp_fget __memp_fget@DB_VERSION_UNIQUE_NAME@ +#define __memp_fcreate __memp_fcreate@DB_VERSION_UNIQUE_NAME@ +#define __memp_fopen_int __memp_fopen_int@DB_VERSION_UNIQUE_NAME@ +#define __memp_fclose_int __memp_fclose_int@DB_VERSION_UNIQUE_NAME@ +#define __memp_mf_discard __memp_mf_discard@DB_VERSION_UNIQUE_NAME@ +#define __memp_fn __memp_fn@DB_VERSION_UNIQUE_NAME@ +#define __memp_fns __memp_fns@DB_VERSION_UNIQUE_NAME@ +#define __memp_fput __memp_fput@DB_VERSION_UNIQUE_NAME@ +#define __memp_fset __memp_fset@DB_VERSION_UNIQUE_NAME@ +#define __memp_dbenv_create __memp_dbenv_create@DB_VERSION_UNIQUE_NAME@ +#define __memp_open __memp_open@DB_VERSION_UNIQUE_NAME@ +#define __memp_dbenv_refresh __memp_dbenv_refresh@DB_VERSION_UNIQUE_NAME@ +#define __mpool_region_destroy __mpool_region_destroy@DB_VERSION_UNIQUE_NAME@ +#define __memp_nameop __memp_nameop@DB_VERSION_UNIQUE_NAME@ +#define __memp_register __memp_register@DB_VERSION_UNIQUE_NAME@ +#define __memp_stat __memp_stat@DB_VERSION_UNIQUE_NAME@ +#define __memp_dump_region __memp_dump_region@DB_VERSION_UNIQUE_NAME@ +#define __memp_stat_hash __memp_stat_hash@DB_VERSION_UNIQUE_NAME@ +#define __memp_sync __memp_sync@DB_VERSION_UNIQUE_NAME@ +#define __memp_fsync __memp_fsync@DB_VERSION_UNIQUE_NAME@ +#define __mp_xxx_fh __mp_xxx_fh@DB_VERSION_UNIQUE_NAME@ +#define __memp_sync_int __memp_sync_int@DB_VERSION_UNIQUE_NAME@ +#define __memp_trickle __memp_trickle@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 __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 __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@ +#define __db_tas_mutex_destroy __db_tas_mutex_destroy@DB_VERSION_UNIQUE_NAME@ +#define __db_win32_mutex_init __db_win32_mutex_init@DB_VERSION_UNIQUE_NAME@ +#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@ +#define __os_ufree __os_ufree@DB_VERSION_UNIQUE_NAME@ +#define __os_strdup __os_strdup@DB_VERSION_UNIQUE_NAME@ +#define __os_calloc __os_calloc@DB_VERSION_UNIQUE_NAME@ +#define __os_malloc __os_malloc@DB_VERSION_UNIQUE_NAME@ +#define __os_realloc __os_realloc@DB_VERSION_UNIQUE_NAME@ +#define __os_free __os_free@DB_VERSION_UNIQUE_NAME@ +#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_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_set_errno __os_set_errno@DB_VERSION_UNIQUE_NAME@ +#define __os_fileid __os_fileid@DB_VERSION_UNIQUE_NAME@ +#define __os_fsync __os_fsync@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_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 __db_oflags __db_oflags@DB_VERSION_UNIQUE_NAME@ +#define __db_omode __db_omode@DB_VERSION_UNIQUE_NAME@ +#define __os_open __os_open@DB_VERSION_UNIQUE_NAME@ +#ifdef HAVE_QNX +#define __os_shmname __os_shmname@DB_VERSION_UNIQUE_NAME@ +#endif +#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@ +#define __os_isroot __os_isroot@DB_VERSION_UNIQUE_NAME@ +#define __db_rpath __db_rpath@DB_VERSION_UNIQUE_NAME@ +#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_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_region_unlink __os_region_unlink@DB_VERSION_UNIQUE_NAME@ +#define __os_unlink __os_unlink@DB_VERSION_UNIQUE_NAME@ +#if defined(DB_WIN32) +#define __os_win32_errno __os_win32_errno@DB_VERSION_UNIQUE_NAME@ +#endif +#define __os_fsync __os_fsync@DB_VERSION_UNIQUE_NAME@ +#define __os_openhandle __os_openhandle@DB_VERSION_UNIQUE_NAME@ +#define __os_closehandle __os_closehandle@DB_VERSION_UNIQUE_NAME@ +#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_exists __os_exists@DB_VERSION_UNIQUE_NAME@ +#define __os_ioinfo __os_ioinfo@DB_VERSION_UNIQUE_NAME@ +#define __os_is_winnt __os_is_winnt@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_incfirst_log __qam_incfirst_log@DB_VERSION_UNIQUE_NAME@ +#define __qam_incfirst_getpgnos __qam_incfirst_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __qam_incfirst_print __qam_incfirst_print@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@ +#define __qam_mvptr_getpgnos __qam_mvptr_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __qam_mvptr_print __qam_mvptr_print@DB_VERSION_UNIQUE_NAME@ +#define __qam_mvptr_read __qam_mvptr_read@DB_VERSION_UNIQUE_NAME@ +#define __qam_del_log __qam_del_log@DB_VERSION_UNIQUE_NAME@ +#define __qam_del_getpgnos __qam_del_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __qam_del_print __qam_del_print@DB_VERSION_UNIQUE_NAME@ +#define __qam_del_read __qam_del_read@DB_VERSION_UNIQUE_NAME@ +#define __qam_add_log __qam_add_log@DB_VERSION_UNIQUE_NAME@ +#define __qam_add_getpgnos __qam_add_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __qam_add_print __qam_add_print@DB_VERSION_UNIQUE_NAME@ +#define __qam_add_read __qam_add_read@DB_VERSION_UNIQUE_NAME@ +#define __qam_delext_log __qam_delext_log@DB_VERSION_UNIQUE_NAME@ +#define __qam_delext_getpgnos __qam_delext_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __qam_delext_print __qam_delext_print@DB_VERSION_UNIQUE_NAME@ +#define __qam_delext_read __qam_delext_read@DB_VERSION_UNIQUE_NAME@ +#define __qam_init_print __qam_init_print@DB_VERSION_UNIQUE_NAME@ +#define __qam_init_getpgnos __qam_init_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __qam_init_recover __qam_init_recover@DB_VERSION_UNIQUE_NAME@ +#define __qam_mswap __qam_mswap@DB_VERSION_UNIQUE_NAME@ +#define __qam_pgin_out __qam_pgin_out@DB_VERSION_UNIQUE_NAME@ +#define __qam_fprobe __qam_fprobe@DB_VERSION_UNIQUE_NAME@ +#define __qam_fclose __qam_fclose@DB_VERSION_UNIQUE_NAME@ +#define __qam_fremove __qam_fremove@DB_VERSION_UNIQUE_NAME@ +#define __qam_sync __qam_sync@DB_VERSION_UNIQUE_NAME@ +#define __qam_gen_filelist __qam_gen_filelist@DB_VERSION_UNIQUE_NAME@ +#define __qam_extent_names __qam_extent_names@DB_VERSION_UNIQUE_NAME@ +#define __qam_exid __qam_exid@DB_VERSION_UNIQUE_NAME@ +#define __qam_db_create __qam_db_create@DB_VERSION_UNIQUE_NAME@ +#define __qam_db_close __qam_db_close@DB_VERSION_UNIQUE_NAME@ +#define __db_prqueue __db_prqueue@DB_VERSION_UNIQUE_NAME@ +#define __qam_remove __qam_remove@DB_VERSION_UNIQUE_NAME@ +#define __qam_rename __qam_rename@DB_VERSION_UNIQUE_NAME@ +#define __qam_open __qam_open@DB_VERSION_UNIQUE_NAME@ +#define __qam_metachk __qam_metachk@DB_VERSION_UNIQUE_NAME@ +#define __qam_new_file __qam_new_file@DB_VERSION_UNIQUE_NAME@ +#define __qam_incfirst_recover __qam_incfirst_recover@DB_VERSION_UNIQUE_NAME@ +#define __qam_mvptr_recover __qam_mvptr_recover@DB_VERSION_UNIQUE_NAME@ +#define __qam_del_recover __qam_del_recover@DB_VERSION_UNIQUE_NAME@ +#define __qam_delext_recover __qam_delext_recover@DB_VERSION_UNIQUE_NAME@ +#define __qam_add_recover __qam_add_recover@DB_VERSION_UNIQUE_NAME@ +#define __qam_stat __qam_stat@DB_VERSION_UNIQUE_NAME@ +#define __qam_31_qammeta __qam_31_qammeta@DB_VERSION_UNIQUE_NAME@ +#define __qam_32_qammeta __qam_32_qammeta@DB_VERSION_UNIQUE_NAME@ +#define __qam_vrfy_meta __qam_vrfy_meta@DB_VERSION_UNIQUE_NAME@ +#define __qam_vrfy_data __qam_vrfy_data@DB_VERSION_UNIQUE_NAME@ +#define __qam_vrfy_structure __qam_vrfy_structure@DB_VERSION_UNIQUE_NAME@ +#define __rep_dbenv_create __rep_dbenv_create@DB_VERSION_UNIQUE_NAME@ +#define __rep_process_message __rep_process_message@DB_VERSION_UNIQUE_NAME@ +#define __rep_process_txn __rep_process_txn@DB_VERSION_UNIQUE_NAME@ +#define __rep_region_init __rep_region_init@DB_VERSION_UNIQUE_NAME@ +#define __rep_region_destroy __rep_region_destroy@DB_VERSION_UNIQUE_NAME@ +#define __rep_dbenv_close __rep_dbenv_close@DB_VERSION_UNIQUE_NAME@ +#define __rep_preclose __rep_preclose@DB_VERSION_UNIQUE_NAME@ +#define __rep_check_alloc __rep_check_alloc@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_lockpgno_init __rep_lockpgno_init@DB_VERSION_UNIQUE_NAME@ +#define __rep_unlockpages __rep_unlockpages@DB_VERSION_UNIQUE_NAME@ +#define __rep_lockpages __rep_lockpages@DB_VERSION_UNIQUE_NAME@ +#define __rep_is_client __rep_is_client@DB_VERSION_UNIQUE_NAME@ +#define __rep_send_vote __rep_send_vote@DB_VERSION_UNIQUE_NAME@ +#define __rep_grow_sites __rep_grow_sites@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 __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@ +#define __dbcl_refresh __dbcl_refresh@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_retcopy __dbcl_retcopy@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_txn_end __dbcl_txn_end@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_txn_setup __dbcl_txn_setup@DB_VERSION_UNIQUE_NAME@ +#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_cachesize __dbcl_env_cachesize@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_env_close __dbcl_env_close@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_env_create __dbcl_env_create@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_data_dir __dbcl_set_data_dir@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_encrypt __dbcl_env_encrypt@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_env_set_feedback __dbcl_env_set_feedback@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_env_flags __dbcl_env_flags@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_lg_bsize __dbcl_set_lg_bsize@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_lg_dir __dbcl_set_lg_dir@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_lg_max __dbcl_set_lg_max@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_lg_regionmax __dbcl_set_lg_regionmax@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_lk_conflict __dbcl_set_lk_conflict@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_set_lk_max_locks __dbcl_set_lk_max_locks@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_lk_max_lockers __dbcl_set_lk_max_lockers@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_lk_max_objects __dbcl_set_lk_max_objects@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_mp_mmapsize __dbcl_set_mp_mmapsize@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_set_shm_key __dbcl_set_shm_key@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_tas_spins __dbcl_set_tas_spins@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_timeout __dbcl_set_timeout@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_tmp_dir __dbcl_set_tmp_dir@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_tx_max __dbcl_set_tx_max@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_set_tx_timestamp __dbcl_set_tx_timestamp@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_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_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_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_cache_priority __dbcl_db_cache_priority@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_del __dbcl_db_del@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_dup_compare __dbcl_db_dup_compare@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_encrypt __dbcl_db_encrypt@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_flags __dbcl_db_flags@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_get __dbcl_db_get@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_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_lorder __dbcl_db_lorder@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_open __dbcl_db_open@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_re_delim __dbcl_db_re_delim@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_re_source __dbcl_db_re_source@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_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_fcreate __dbcl_memp_fcreate@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_env_close_ret __dbcl_env_close_ret@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_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_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@ +#define __dbcl_db_key_range_ret __dbcl_db_key_range_ret@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_open_ret __dbcl_db_open_ret@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_pget_ret __dbcl_db_pget_ret@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_put_ret __dbcl_db_put_ret@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_remove_ret __dbcl_db_remove_ret@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_rename_ret __dbcl_db_rename_ret@DB_VERSION_UNIQUE_NAME@ +#define __dbcl_db_stat_ret __dbcl_db_stat_ret@DB_VERSION_UNIQUE_NAME@ +#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 __env_cachesize_proc __env_cachesize_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_encrypt_proc __env_encrypt_proc@DB_VERSION_UNIQUE_NAME@ +#define __env_flags_proc __env_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 __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 __db_associate_proc __db_associate_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_bt_minkey_proc __db_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_encrypt_proc __db_encrypt_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_extentsize_proc __db_extentsize_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_flags_proc __db_flags_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_get_proc __db_get_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_h_ffactor_proc __db_h_ffactor_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_h_nelem_proc __db_h_nelem_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_key_range_proc __db_key_range_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_lorder_proc __db_lorder_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_open_proc __db_open_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_pagesize_proc __db_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_re_delim_proc __db_re_delim_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_re_len_proc __db_re_len_proc@DB_VERSION_UNIQUE_NAME@ +#define __db_re_pad_proc __db_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@ +#define __db_sync_proc __db_sync_proc@DB_VERSION_UNIQUE_NAME@ +#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 __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@ +#define get_tableent get_tableent@DB_VERSION_UNIQUE_NAME@ +#define __dbsrv_sharedb __dbsrv_sharedb@DB_VERSION_UNIQUE_NAME@ +#define __dbsrv_shareenv __dbsrv_shareenv@DB_VERSION_UNIQUE_NAME@ +#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 get_home get_home@DB_VERSION_UNIQUE_NAME@ +#define bdb_HCommand bdb_HCommand@DB_VERSION_UNIQUE_NAME@ +#if DB_DBM_HSEARCH != 0 +#define bdb_NdbmOpen bdb_NdbmOpen@DB_VERSION_UNIQUE_NAME@ +#endif +#if DB_DBM_HSEARCH != 0 +#define bdb_DbmCommand bdb_DbmCommand@DB_VERSION_UNIQUE_NAME@ +#endif +#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 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_EnvVerbose tcl_EnvVerbose@DB_VERSION_UNIQUE_NAME@ +#define tcl_EnvAttr tcl_EnvAttr@DB_VERSION_UNIQUE_NAME@ +#define tcl_EnvTest tcl_EnvTest@DB_VERSION_UNIQUE_NAME@ +#define _NewInfo _NewInfo@DB_VERSION_UNIQUE_NAME@ +#define _NameToPtr _NameToPtr@DB_VERSION_UNIQUE_NAME@ +#define _PtrToInfo _PtrToInfo@DB_VERSION_UNIQUE_NAME@ +#define _NameToInfo _NameToInfo@DB_VERSION_UNIQUE_NAME@ +#define _SetInfoData _SetInfoData@DB_VERSION_UNIQUE_NAME@ +#define _DeleteInfo _DeleteInfo@DB_VERSION_UNIQUE_NAME@ +#define _SetListElem _SetListElem@DB_VERSION_UNIQUE_NAME@ +#define _SetListElemInt _SetListElemInt@DB_VERSION_UNIQUE_NAME@ +#define _SetListRecnoElem _SetListRecnoElem@DB_VERSION_UNIQUE_NAME@ +#define _Set3DBTList _Set3DBTList@DB_VERSION_UNIQUE_NAME@ +#define _SetMultiList _SetMultiList@DB_VERSION_UNIQUE_NAME@ +#define _GetGlobPrefix _GetGlobPrefix@DB_VERSION_UNIQUE_NAME@ +#define _ReturnSetup _ReturnSetup@DB_VERSION_UNIQUE_NAME@ +#define _ErrorSetup _ErrorSetup@DB_VERSION_UNIQUE_NAME@ +#define _ErrorFunc _ErrorFunc@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@ +#define _debug_check _debug_check@DB_VERSION_UNIQUE_NAME@ +#define _CopyObjBytes _CopyObjBytes@DB_VERSION_UNIQUE_NAME@ +#define tcl_LockDetect tcl_LockDetect@DB_VERSION_UNIQUE_NAME@ +#define tcl_LockGet tcl_LockGet@DB_VERSION_UNIQUE_NAME@ +#define tcl_LockStat tcl_LockStat@DB_VERSION_UNIQUE_NAME@ +#define tcl_LockTimeout tcl_LockTimeout@DB_VERSION_UNIQUE_NAME@ +#define tcl_LockVec tcl_LockVec@DB_VERSION_UNIQUE_NAME@ +#define tcl_LogArchive tcl_LogArchive@DB_VERSION_UNIQUE_NAME@ +#define tcl_LogCompare tcl_LogCompare@DB_VERSION_UNIQUE_NAME@ +#define tcl_LogFile tcl_LogFile@DB_VERSION_UNIQUE_NAME@ +#define tcl_LogFlush tcl_LogFlush@DB_VERSION_UNIQUE_NAME@ +#define tcl_LogGet tcl_LogGet@DB_VERSION_UNIQUE_NAME@ +#define tcl_LogPut tcl_LogPut@DB_VERSION_UNIQUE_NAME@ +#define tcl_LogStat tcl_LogStat@DB_VERSION_UNIQUE_NAME@ +#define logc_Cmd logc_Cmd@DB_VERSION_UNIQUE_NAME@ +#define _MpInfoDelete _MpInfoDelete@DB_VERSION_UNIQUE_NAME@ +#define tcl_MpSync tcl_MpSync@DB_VERSION_UNIQUE_NAME@ +#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_RepElect tcl_RepElect@DB_VERSION_UNIQUE_NAME@ +#define tcl_RepFlush tcl_RepFlush@DB_VERSION_UNIQUE_NAME@ +#define tcl_RepLimit tcl_RepLimit@DB_VERSION_UNIQUE_NAME@ +#define tcl_RepRequest tcl_RepRequest@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 _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_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 __txn_begin@DB_VERSION_UNIQUE_NAME@ +#define __txn_xa_begin __txn_xa_begin@DB_VERSION_UNIQUE_NAME@ +#define __txn_compensate_begin __txn_compensate_begin@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_prepare __txn_prepare@DB_VERSION_UNIQUE_NAME@ +#define __txn_id __txn_id@DB_VERSION_UNIQUE_NAME@ +#define __txn_checkpoint __txn_checkpoint@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_regop_log __txn_regop_log@DB_VERSION_UNIQUE_NAME@ +#define __txn_regop_getpgnos __txn_regop_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __txn_regop_print __txn_regop_print@DB_VERSION_UNIQUE_NAME@ +#define __txn_regop_read __txn_regop_read@DB_VERSION_UNIQUE_NAME@ +#define __txn_ckp_log __txn_ckp_log@DB_VERSION_UNIQUE_NAME@ +#define __txn_ckp_getpgnos __txn_ckp_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __txn_ckp_print __txn_ckp_print@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@ +#define __txn_child_getpgnos __txn_child_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __txn_child_print __txn_child_print@DB_VERSION_UNIQUE_NAME@ +#define __txn_child_read __txn_child_read@DB_VERSION_UNIQUE_NAME@ +#define __txn_xa_regop_log __txn_xa_regop_log@DB_VERSION_UNIQUE_NAME@ +#define __txn_xa_regop_getpgnos __txn_xa_regop_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __txn_xa_regop_print __txn_xa_regop_print@DB_VERSION_UNIQUE_NAME@ +#define __txn_xa_regop_read __txn_xa_regop_read@DB_VERSION_UNIQUE_NAME@ +#define __txn_recycle_log __txn_recycle_log@DB_VERSION_UNIQUE_NAME@ +#define __txn_recycle_getpgnos __txn_recycle_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __txn_recycle_print __txn_recycle_print@DB_VERSION_UNIQUE_NAME@ +#define __txn_recycle_read __txn_recycle_read@DB_VERSION_UNIQUE_NAME@ +#define __txn_init_print __txn_init_print@DB_VERSION_UNIQUE_NAME@ +#define __txn_init_getpgnos __txn_init_getpgnos@DB_VERSION_UNIQUE_NAME@ +#define __txn_init_recover __txn_init_recover@DB_VERSION_UNIQUE_NAME@ +#define __txn_dbenv_create __txn_dbenv_create@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_map_gid __txn_map_gid@DB_VERSION_UNIQUE_NAME@ +#define __txn_recover __txn_recover@DB_VERSION_UNIQUE_NAME@ +#define __txn_get_prepared __txn_get_prepared@DB_VERSION_UNIQUE_NAME@ +#define __txn_open __txn_open@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_stat __txn_stat@DB_VERSION_UNIQUE_NAME@ +#define __txn_remevent __txn_remevent@DB_VERSION_UNIQUE_NAME@ +#define __txn_lockevent __txn_lockevent@DB_VERSION_UNIQUE_NAME@ +#define __txn_remlock __txn_remlock@DB_VERSION_UNIQUE_NAME@ +#define __txn_doevents __txn_doevents@DB_VERSION_UNIQUE_NAME@ +#define __db_xa_create __db_xa_create@DB_VERSION_UNIQUE_NAME@ +#define __db_rmid_to_env __db_rmid_to_env@DB_VERSION_UNIQUE_NAME@ +#define __db_xid_to_txn __db_xid_to_txn@DB_VERSION_UNIQUE_NAME@ +#define __db_map_rmid __db_map_rmid@DB_VERSION_UNIQUE_NAME@ +#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 xdr___env_cachesize_msg xdr___env_cachesize_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_cachesize_reply xdr___env_cachesize_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_close_msg xdr___env_close_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_close_reply xdr___env_close_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_create_msg xdr___env_create_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_create_reply xdr___env_create_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_dbremove_msg xdr___env_dbremove_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_dbremove_reply xdr___env_dbremove_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_dbrename_msg xdr___env_dbrename_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_dbrename_reply xdr___env_dbrename_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_encrypt_msg xdr___env_encrypt_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_encrypt_reply xdr___env_encrypt_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_flags_msg xdr___env_flags_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_flags_reply xdr___env_flags_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_open_msg xdr___env_open_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_open_reply xdr___env_open_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_remove_msg xdr___env_remove_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___env_remove_reply xdr___env_remove_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_abort_msg xdr___txn_abort_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_abort_reply xdr___txn_abort_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_begin_msg xdr___txn_begin_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_begin_reply xdr___txn_begin_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_commit_msg xdr___txn_commit_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_commit_reply xdr___txn_commit_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_discard_msg xdr___txn_discard_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_discard_reply xdr___txn_discard_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_prepare_msg xdr___txn_prepare_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_prepare_reply xdr___txn_prepare_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_recover_msg xdr___txn_recover_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___txn_recover_reply xdr___txn_recover_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_associate_msg xdr___db_associate_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_associate_reply xdr___db_associate_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_bt_maxkey_msg xdr___db_bt_maxkey_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_bt_maxkey_reply xdr___db_bt_maxkey_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_bt_minkey_msg xdr___db_bt_minkey_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_bt_minkey_reply xdr___db_bt_minkey_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_close_msg xdr___db_close_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_close_reply xdr___db_close_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_create_msg xdr___db_create_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_create_reply xdr___db_create_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_del_msg xdr___db_del_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_del_reply xdr___db_del_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_encrypt_msg xdr___db_encrypt_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_encrypt_reply xdr___db_encrypt_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_extentsize_msg xdr___db_extentsize_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_extentsize_reply xdr___db_extentsize_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_flags_msg xdr___db_flags_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_flags_reply xdr___db_flags_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_get_msg xdr___db_get_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_get_reply xdr___db_get_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_h_ffactor_msg xdr___db_h_ffactor_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_h_ffactor_reply xdr___db_h_ffactor_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_h_nelem_msg xdr___db_h_nelem_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_h_nelem_reply xdr___db_h_nelem_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_key_range_msg xdr___db_key_range_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_key_range_reply xdr___db_key_range_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_lorder_msg xdr___db_lorder_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_lorder_reply xdr___db_lorder_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_open_msg xdr___db_open_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_open_reply xdr___db_open_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_pagesize_msg xdr___db_pagesize_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_pagesize_reply xdr___db_pagesize_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_pget_msg xdr___db_pget_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_pget_reply xdr___db_pget_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_put_msg xdr___db_put_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_put_reply xdr___db_put_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_re_delim_msg xdr___db_re_delim_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_re_delim_reply xdr___db_re_delim_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_re_len_msg xdr___db_re_len_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_re_len_reply xdr___db_re_len_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_re_pad_msg xdr___db_re_pad_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_re_pad_reply xdr___db_re_pad_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_remove_msg xdr___db_remove_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_remove_reply xdr___db_remove_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_rename_msg xdr___db_rename_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_rename_reply xdr___db_rename_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_stat_msg xdr___db_stat_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_stat_reply xdr___db_stat_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_sync_msg xdr___db_sync_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_sync_reply xdr___db_sync_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_truncate_msg xdr___db_truncate_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_truncate_reply xdr___db_truncate_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_cursor_msg xdr___db_cursor_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_cursor_reply xdr___db_cursor_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_join_msg xdr___db_join_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___db_join_reply xdr___db_join_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_close_msg xdr___dbc_close_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_close_reply xdr___dbc_close_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_count_msg xdr___dbc_count_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_count_reply xdr___dbc_count_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_del_msg xdr___dbc_del_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_del_reply xdr___dbc_del_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_dup_msg xdr___dbc_dup_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_dup_reply xdr___dbc_dup_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_get_msg xdr___dbc_get_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_get_reply xdr___dbc_get_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_pget_msg xdr___dbc_pget_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_pget_reply xdr___dbc_pget_reply@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_put_msg xdr___dbc_put_msg@DB_VERSION_UNIQUE_NAME@ +#define xdr___dbc_put_reply xdr___dbc_put_reply@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/bdb/dbinc_auto/lock_ext.h b/bdb/dbinc_auto/lock_ext.h new file mode 100644 index 00000000000..be6b1d06d1e --- /dev/null +++ b/bdb/dbinc_auto/lock_ext.h @@ -0,0 +1,41 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _lock_ext_h_ +#define _lock_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __lock_id __P((DB_ENV *, u_int32_t *)); +int __lock_id_free __P((DB_ENV *, u_int32_t)); +int __lock_vec __P((DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **)); +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_downgrade __P((DB_ENV *, DB_LOCK *, db_lockmode_t, u_int32_t)); +int __lock_addfamilylocker __P((DB_ENV *, u_int32_t, u_int32_t)); +int __lock_freefamilylocker __P((DB_LOCKTAB *, u_int32_t)); +int __lock_set_timeout __P(( DB_ENV *, u_int32_t, db_timeout_t, u_int32_t)); +int __lock_inherit_timeout __P(( DB_ENV *, u_int32_t, u_int32_t)); +int __lock_getlocker __P((DB_LOCKTAB *, u_int32_t, u_int32_t, int, DB_LOCKER **)); +int __lock_promote __P((DB_LOCKTAB *, DB_LOCKOBJ *, u_int32_t)); +int __lock_expired __P((DB_ENV *, db_timeval_t *, db_timeval_t *)); +int __lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, int *)); +void __lock_dbenv_create __P((DB_ENV *)); +void __lock_dbenv_close __P((DB_ENV *)); +int __lock_open __P((DB_ENV *)); +int __lock_dbenv_refresh __P((DB_ENV *)); +void __lock_region_destroy __P((DB_ENV *, REGINFO *)); +int __lock_id_set __P((DB_ENV *, u_int32_t, u_int32_t)); +int __lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t)); +int __lock_dump_region __P((DB_ENV *, char *, FILE *)); +void __lock_printlock __P((DB_LOCKTAB *, struct __db_lock *, int)); +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)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_lock_ext_h_ */ diff --git a/bdb/dbinc_auto/log_ext.h b/bdb/dbinc_auto/log_ext.h new file mode 100644 index 00000000000..6fc69afd2b4 --- /dev/null +++ b/bdb/dbinc_auto/log_ext.h @@ -0,0 +1,32 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _log_ext_h_ +#define _log_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +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, logfile_validity *)); +int __log_dbenv_refresh __P((DB_ENV *)); +int __log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t)); +void __log_get_cached_ckp_lsn __P((DB_ENV *, DB_LSN *)); +void __log_region_destroy __P((DB_ENV *, REGINFO *)); +int __log_vtruncate __P((DB_ENV *, DB_LSN *, DB_LSN *)); +int __log_is_outdated __P((DB_ENV *dbenv, u_int32_t fnum, int *outdatedp)); +int __log_archive __P((DB_ENV *, char **[], u_int32_t)); +int __log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t)); +void __log_dbenv_create __P((DB_ENV *)); +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 *)); +int __log_flush __P((DB_ENV *, const DB_LSN *)); +int __log_file __P((DB_ENV *, const DB_LSN *, char *, size_t)); +int __log_name __P((DB_LOG *, u_int32_t, char **, DB_FH *, u_int32_t)); +int __log_rep_put __P((DB_ENV *, DB_LSN *, const DBT *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_log_ext_h_ */ diff --git a/bdb/dbinc_auto/mp_ext.h b/bdb/dbinc_auto/mp_ext.h new file mode 100644 index 00000000000..ceadb3d9adc --- /dev/null +++ b/bdb/dbinc_auto/mp_ext.h @@ -0,0 +1,44 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _mp_ext_h_ +#define _mp_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __memp_alloc __P((DB_MPOOL *, REGINFO *, MPOOLFILE *, size_t, roff_t *, void *)); +#ifdef DIAGNOSTIC +void __memp_check_order __P((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_pg __P((DB_MPOOLFILE *, BH *, int)); +void __memp_bhfree __P((DB_MPOOL *, DB_MPOOL_HASH *, BH *, int)); +int __memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *)); +int __memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t)); +int __memp_fopen_int __P((DB_MPOOLFILE *, MPOOLFILE *, const char *, u_int32_t, int, size_t)); +int __memp_fclose_int __P((DB_MPOOLFILE *, u_int32_t)); +int __memp_mf_discard __P((DB_MPOOL *, MPOOLFILE *)); +char * __memp_fn __P((DB_MPOOLFILE *)); +char * __memp_fns __P((DB_MPOOL *, MPOOLFILE *)); +int __memp_fput __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_open __P((DB_ENV *)); +int __memp_dbenv_refresh __P((DB_ENV *)); +void __mpool_region_destroy __P((DB_ENV *, REGINFO *)); +int __memp_nameop __P((DB_ENV *, u_int8_t *, const char *, const char *, const char *)); +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_dump_region __P((DB_ENV *, char *, FILE *)); +void __memp_stat_hash __P((REGINFO *, MPOOL *, u_int32_t *)); +int __memp_sync __P((DB_ENV *, DB_LSN *)); +int __memp_fsync __P((DB_MPOOLFILE *)); +int __mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **)); +int __memp_sync_int __P((DB_ENV *, DB_MPOOLFILE *, int, db_sync_op, int *)); +int __memp_trickle __P((DB_ENV *, int, int *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_mp_ext_h_ */ diff --git a/bdb/dbinc_auto/mutex_ext.h b/bdb/dbinc_auto/mutex_ext.h new file mode 100644 index 00000000000..a40f04d5578 --- /dev/null +++ b/bdb/dbinc_auto/mutex_ext.h @@ -0,0 +1,35 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _mutex_ext_h_ +#define _mutex_ext_h_ + +#if defined(__cplusplus) +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)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_mutex_ext_h_ */ diff --git a/bdb/dbinc_auto/os_ext.h b/bdb/dbinc_auto/os_ext.h new file mode 100644 index 00000000000..0a2e5ab2054 --- /dev/null +++ b/bdb/dbinc_auto/os_ext.h @@ -0,0 +1,74 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _os_ext_h_ +#define _os_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __os_abspath __P((const char *)); +int __os_umalloc __P((DB_ENV *, size_t, void *)); +int __os_urealloc __P((DB_ENV *, size_t, void *)); +int __os_ufree __P((DB_ENV *, void *)); +int __os_strdup __P((DB_ENV *, const char *, void *)); +int __os_calloc __P((DB_ENV *, size_t, size_t, void *)); +int __os_malloc __P((DB_ENV *, size_t, void *)); +int __os_realloc __P((DB_ENV *, size_t, void *)); +void __os_free __P((DB_ENV *, void *)); +void *__ua_memcpy __P((void *, const void *, size_t)); +int __os_clock __P((DB_ENV *, u_int32_t *, u_int32_t *)); +int __os_fs_notzero __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)); +void __os_set_errno __P((int)); +int __os_fileid __P((DB_ENV *, const char *, int, u_int8_t *)); +int __os_fsync __P((DB_ENV *, DB_FH *)); +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 *)); +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)); +u_int32_t __db_oflags __P((int)); +int __db_omode __P((const char *)); +int __os_open __P((DB_ENV *, const char *, u_int32_t, int, DB_FH *)); +#ifdef HAVE_QNX +int __os_shmname __P((DB_ENV *, const char *, char **)); +#endif +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 *, DB_IO *, int, 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 *, size_t, db_pgno_t, u_int32_t, int, DB_OS_SEEK)); +int __os_sleep __P((DB_ENV *, u_long, u_long)); +int __os_spin __P((DB_ENV *)); +void __os_yield __P((DB_ENV*, u_long)); +int __os_exists __P((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_region_unlink __P((DB_ENV *, const char *)); +int __os_unlink __P((DB_ENV *, const char *)); +#if defined(DB_WIN32) +int __os_win32_errno __P((void)); +#endif +int __os_fsync __P((DB_ENV *, DB_FH *)); +int __os_openhandle __P((DB_ENV *, const char *, int, int, DB_FH *)); +int __os_closehandle __P((DB_ENV *, DB_FH *)); +int __os_io __P((DB_ENV *, DB_IO *, int, 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_exists __P((const char *, int *)); +int __os_ioinfo __P((DB_ENV *, const char *, DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *)); +int __os_is_winnt __P((void)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_os_ext_h_ */ diff --git a/bdb/dbinc_auto/qam_auto.h b/bdb/dbinc_auto/qam_auto.h new file mode 100644 index 00000000000..655c6d0280f --- /dev/null +++ b/bdb/dbinc_auto/qam_auto.h @@ -0,0 +1,70 @@ +/* Do not edit: automatically built by gen_rec.awk. */ + +#ifndef __qam_AUTO_H +#define __qam_AUTO_H +#define DB___qam_incfirst 84 +typedef struct ___qam_incfirst_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + db_recno_t recno; + db_pgno_t meta_pgno; +} __qam_incfirst_args; + +#define DB___qam_mvptr 85 +typedef struct ___qam_mvptr_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t opcode; + int32_t fileid; + db_recno_t old_first; + db_recno_t new_first; + db_recno_t old_cur; + db_recno_t new_cur; + DB_LSN metalsn; + db_pgno_t meta_pgno; +} __qam_mvptr_args; + +#define DB___qam_del 79 +typedef struct ___qam_del_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + DB_LSN lsn; + db_pgno_t pgno; + u_int32_t indx; + db_recno_t recno; +} __qam_del_args; + +#define DB___qam_add 80 +typedef struct ___qam_add_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + DB_LSN lsn; + db_pgno_t pgno; + u_int32_t indx; + db_recno_t recno; + DBT data; + u_int32_t vflag; + DBT olddata; +} __qam_add_args; + +#define DB___qam_delext 83 +typedef struct ___qam_delext_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + int32_t fileid; + DB_LSN lsn; + db_pgno_t pgno; + u_int32_t indx; + db_recno_t recno; + DBT data; +} __qam_delext_args; + +#endif diff --git a/bdb/dbinc_auto/qam_ext.h b/bdb/dbinc_auto/qam_ext.h new file mode 100644 index 00000000000..16dbea79e4c --- /dev/null +++ b/bdb/dbinc_auto/qam_ext.h @@ -0,0 +1,70 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _qam_ext_h_ +#define _qam_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __qam_position __P((DBC *, db_recno_t *, qam_position_mode, 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((DB *, DB_TXN *, u_int32_t *)); +int __qam_incfirst_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_recno_t, db_pgno_t)); +int __qam_incfirst_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_incfirst_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +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)); +int __qam_mvptr_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_mvptr_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_mvptr_read __P((DB_ENV *, void *, __qam_mvptr_args **)); +int __qam_del_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t)); +int __qam_del_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_del_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_del_read __P((DB_ENV *, void *, __qam_del_args **)); +int __qam_add_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *, u_int32_t, const DBT *)); +int __qam_add_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_add_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_add_read __P((DB_ENV *, void *, __qam_add_args **)); +int __qam_delext_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *)); +int __qam_delext_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_delext_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_delext_read __P((DB_ENV *, void *, __qam_delext_args **)); +int __qam_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __qam_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __qam_init_recover __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_fclose __P((DB *, db_pgno_t)); +int __qam_fremove __P((DB *, db_pgno_t)); +int __qam_sync __P((DB *, u_int32_t)); +int __qam_gen_filelist __P(( DB *, QUEUE_FILELIST **)); +int __qam_extent_names __P((DB_ENV *, char *, char ***)); +void __qam_exid __P((DB *, u_int8_t *, u_int32_t)); +int __qam_db_create __P((DB *)); +int __qam_db_close __P((DB *)); +int __db_prqueue __P((DB *, FILE *, u_int32_t)); +int __qam_remove __P((DB *, DB_TXN *, const char *, const char *, DB_LSN *)); +int __qam_rename __P((DB *, DB_TXN *, const char *, const char *, const char *)); +int __qam_open __P((DB *, DB_TXN *, const char *, db_pgno_t, int, u_int32_t)); +int __qam_metachk __P((DB *, const char *, QMETA *)); +int __qam_new_file __P((DB *, DB_TXN *, DB_FH *, const char *)); +int __qam_incfirst_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_mvptr_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_del_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_delext_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_add_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __qam_stat __P((DB *, void *, u_int32_t)); +int __qam_31_qammeta __P((DB *, char *, u_int8_t *)); +int __qam_32_qammeta __P((DB *, char *, u_int8_t *)); +int __qam_vrfy_meta __P((DB *, VRFY_DBINFO *, QMETA *, db_pgno_t, u_int32_t)); +int __qam_vrfy_data __P((DB *, VRFY_DBINFO *, QPAGE *, db_pgno_t, u_int32_t)); +int __qam_vrfy_structure __P((DB *, VRFY_DBINFO *, u_int32_t)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_qam_ext_h_ */ diff --git a/bdb/dbinc_auto/rep_ext.h b/bdb/dbinc_auto/rep_ext.h new file mode 100644 index 00000000000..22e2d254fe8 --- /dev/null +++ b/bdb/dbinc_auto/rep_ext.h @@ -0,0 +1,30 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _rep_ext_h_ +#define _rep_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __rep_dbenv_create __P((DB_ENV *)); +int __rep_process_message __P((DB_ENV *, DBT *, DBT *, int *)); +int __rep_process_txn __P((DB_ENV *, DBT *)); +int __rep_region_init __P((DB_ENV *)); +int __rep_region_destroy __P((DB_ENV *)); +int __rep_dbenv_close __P((DB_ENV *)); +int __rep_preclose __P((DB_ENV *, int)); +int __rep_check_alloc __P((DB_ENV *, TXN_RECS *, int)); +int __rep_send_message __P((DB_ENV *, int, u_int32_t, DB_LSN *, const DBT *, u_int32_t)); +int __rep_new_master __P((DB_ENV *, REP_CONTROL *, int)); +int __rep_lockpgno_init __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __rep_unlockpages __P((DB_ENV *, u_int32_t)); +int __rep_lockpages __P((DB_ENV *, int (**)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t, DB_LSN *, DB_LSN *, TXN_RECS *, u_int32_t)); +int __rep_is_client __P((DB_ENV *)); +int __rep_send_vote __P((DB_ENV *, DB_LSN *, int, int, int)); +int __rep_grow_sites __P((DB_ENV *dbenv, int nsites)); +void __rep_print_message __P((DB_ENV *, int, REP_CONTROL *, char *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_rep_ext_h_ */ diff --git a/bdb/dbinc_auto/rpc_client_ext.h b/bdb/dbinc_auto/rpc_client_ext.h new file mode 100644 index 00000000000..9634b34abef --- /dev/null +++ b/bdb/dbinc_auto/rpc_client_ext.h @@ -0,0 +1,167 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _rpc_client_ext_h_ +#define _rpc_client_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __dbcl_envrpcserver __P((DB_ENV *, void *, const char *, long, long, 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)); +int __dbcl_refresh __P((DB_ENV *)); +int __dbcl_retcopy __P((DB_ENV *, DBT *, void *, u_int32_t, void **, u_int32_t *)); +void __dbcl_txn_end __P((DB_TXN *)); +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((long, 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_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int)); +int __dbcl_env_close __P((DB_ENV *, u_int32_t)); +int __dbcl_env_create __P((DB_ENV *, long)); +int __dbcl_set_data_dir __P((DB_ENV *, const char *)); +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_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_flags __P((DB_ENV *, u_int32_t, int)); +int __dbcl_set_lg_bsize __P((DB_ENV *, u_int32_t)); +int __dbcl_set_lg_dir __P((DB_ENV *, const char *)); +int __dbcl_set_lg_max __P((DB_ENV *, u_int32_t)); +int __dbcl_set_lg_regionmax __P((DB_ENV *, u_int32_t)); +int __dbcl_set_lk_conflict __P((DB_ENV *, u_int8_t *, int)); +int __dbcl_set_lk_detect __P((DB_ENV *, u_int32_t)); +int __dbcl_set_lk_max __P((DB_ENV *, u_int32_t)); +int __dbcl_set_lk_max_locks __P((DB_ENV *, u_int32_t)); +int __dbcl_set_lk_max_lockers __P((DB_ENV *, u_int32_t)); +int __dbcl_set_lk_max_objects __P((DB_ENV *, u_int32_t)); +int __dbcl_set_mp_mmapsize __P((DB_ENV *, size_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_set_shm_key __P((DB_ENV *, long)); +int __dbcl_set_tas_spins __P((DB_ENV *, u_int32_t)); +int __dbcl_set_timeout __P((DB_ENV *, u_int32_t, u_int32_t)); +int __dbcl_set_tmp_dir __P((DB_ENV *, const char *)); +int __dbcl_set_tx_max __P((DB_ENV *, u_int32_t)); +int __dbcl_set_tx_timestamp __P((DB_ENV *, time_t *)); +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, u_int32_t, int *)); +int __dbcl_rep_flush __P((DB_ENV *)); +int __dbcl_rep_process_message __P((DB_ENV *, DBT *, DBT *, int *)); +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 *, 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_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_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_cache_priority __P((DB *, DB_CACHE_PRIORITY)); +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_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_encrypt __P((DB *, const char *, 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_flags __P((DB *, u_int32_t)); +int __dbcl_db_get __P((DB *, DB_TXN *, DBT *, DBT *, 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_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_lorder __P((DB *, int)); +int __dbcl_db_open __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)); +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_re_delim __P((DB *, int)); +int __dbcl_db_re_len __P((DB *, u_int32_t)); +int __dbcl_db_re_pad __P((DB *, int)); +int __dbcl_db_re_source __P((DB *, const char *)); +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_stat __P((DB *, 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_fcreate __P((DB_ENV *, DB_MPOOLFILE **, 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_env_close_ret __P((DB_ENV *, u_int32_t, __env_close_reply *)); +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_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_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 *)); +int __dbcl_db_key_range_ret __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t, __db_key_range_reply *)); +int __dbcl_db_open_ret __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int, __db_open_reply *)); +int __dbcl_db_pget_ret __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t, __db_pget_reply *)); +int __dbcl_db_put_ret __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t, __db_put_reply *)); +int __dbcl_db_remove_ret __P((DB *, const char *, const char *, u_int32_t, __db_remove_reply *)); +int __dbcl_db_rename_ret __P((DB *, const char *, const char *, const char *, u_int32_t, __db_rename_reply *)); +int __dbcl_db_stat_ret __P((DB *, 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 *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_rpc_client_ext_h_ */ diff --git a/bdb/dbinc_auto/rpc_defs.in b/bdb/dbinc_auto/rpc_defs.in new file mode 100644 index 00000000000..cae76f5606d --- /dev/null +++ b/bdb/dbinc_auto/rpc_defs.in @@ -0,0 +1,4 @@ + +/* DO NOT EDIT: automatically built by dist/s_rpc. */ +#define DB_RPC_SERVERPROG ((unsigned long)(351457)) +#define DB_RPC_SERVERVERS ((unsigned long)(4001)) diff --git a/bdb/dbinc_auto/rpc_server_ext.h b/bdb/dbinc_auto/rpc_server_ext.h new file mode 100644 index 00000000000..c0c706881c7 --- /dev/null +++ b/bdb/dbinc_auto/rpc_server_ext.h @@ -0,0 +1,126 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _rpc_server_ext_h_ +#define _rpc_server_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +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_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_encrypt_proc __P((long, char *, u_int32_t, __env_encrypt_reply *)); +void __env_flags_proc __P((long, u_int32_t, u_int32_t, __env_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_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_encrypt_proc __P((long, char *, u_int32_t, __db_encrypt_reply *)); +void __db_extentsize_proc __P((long, u_int32_t, __db_extentsize_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_h_ffactor_proc __P((long, u_int32_t, __db_h_ffactor_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_lorder_proc __P((long, u_int32_t, __db_lorder_reply *)); +void __db_open_proc __P((long, long, char *, char *, u_int32_t, u_int32_t, u_int32_t, __db_open_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_re_delim_proc __P((long, u_int32_t, __db_re_delim_reply *)); +void __db_re_len_proc __P((long, u_int32_t, __db_re_len_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, 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 __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 *)); +ct_entry *get_tableent __P((long)); +ct_entry *__dbsrv_sharedb __P((ct_entry *, const char *, const char *, DBTYPE, u_int32_t)); +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)); +home_entry *get_home __P((char *)); +__env_cachesize_reply *__db_env_cachesize_4001 __P((__env_cachesize_msg *, struct svc_req *)); +__env_close_reply *__db_env_close_4001 __P((__env_close_msg *, struct svc_req *)); +__env_create_reply *__db_env_create_4001 __P((__env_create_msg *, struct svc_req *)); +__env_dbremove_reply *__db_env_dbremove_4001 __P((__env_dbremove_msg *, struct svc_req *)); +__env_dbrename_reply *__db_env_dbrename_4001 __P((__env_dbrename_msg *, struct svc_req *)); +__env_encrypt_reply *__db_env_encrypt_4001 __P((__env_encrypt_msg *, struct svc_req *)); +__env_flags_reply *__db_env_flags_4001 __P((__env_flags_msg *, struct svc_req *)); +__env_open_reply *__db_env_open_4001 __P((__env_open_msg *, struct svc_req *)); +__env_remove_reply *__db_env_remove_4001 __P((__env_remove_msg *, struct svc_req *)); +__txn_abort_reply *__db_txn_abort_4001 __P((__txn_abort_msg *, struct svc_req *)); +__txn_begin_reply *__db_txn_begin_4001 __P((__txn_begin_msg *, struct svc_req *)); +__txn_commit_reply *__db_txn_commit_4001 __P((__txn_commit_msg *, struct svc_req *)); +__txn_discard_reply *__db_txn_discard_4001 __P((__txn_discard_msg *, struct svc_req *)); +__txn_prepare_reply *__db_txn_prepare_4001 __P((__txn_prepare_msg *, struct svc_req *)); +__txn_recover_reply *__db_txn_recover_4001 __P((__txn_recover_msg *, struct svc_req *)); +__db_associate_reply *__db_db_associate_4001 __P((__db_associate_msg *, struct svc_req *)); +__db_bt_maxkey_reply *__db_db_bt_maxkey_4001 __P((__db_bt_maxkey_msg *, struct svc_req *)); +__db_bt_minkey_reply *__db_db_bt_minkey_4001 __P((__db_bt_minkey_msg *, struct svc_req *)); +__db_close_reply *__db_db_close_4001 __P((__db_close_msg *, struct svc_req *)); +__db_create_reply *__db_db_create_4001 __P((__db_create_msg *, struct svc_req *)); +__db_del_reply *__db_db_del_4001 __P((__db_del_msg *, struct svc_req *)); +__db_encrypt_reply *__db_db_encrypt_4001 __P((__db_encrypt_msg *, struct svc_req *)); +__db_extentsize_reply *__db_db_extentsize_4001 __P((__db_extentsize_msg *, struct svc_req *)); +__db_flags_reply *__db_db_flags_4001 __P((__db_flags_msg *, struct svc_req *)); +__db_get_reply *__db_db_get_4001 __P((__db_get_msg *, struct svc_req *)); +__db_h_ffactor_reply *__db_db_h_ffactor_4001 __P((__db_h_ffactor_msg *, struct svc_req *)); +__db_h_nelem_reply *__db_db_h_nelem_4001 __P((__db_h_nelem_msg *, struct svc_req *)); +__db_key_range_reply *__db_db_key_range_4001 __P((__db_key_range_msg *, struct svc_req *)); +__db_lorder_reply *__db_db_lorder_4001 __P((__db_lorder_msg *, struct svc_req *)); +__db_open_reply *__db_db_open_4001 __P((__db_open_msg *, struct svc_req *)); +__db_pagesize_reply *__db_db_pagesize_4001 __P((__db_pagesize_msg *, struct svc_req *)); +__db_pget_reply *__db_db_pget_4001 __P((__db_pget_msg *, struct svc_req *)); +__db_put_reply *__db_db_put_4001 __P((__db_put_msg *, struct svc_req *)); +__db_re_delim_reply *__db_db_re_delim_4001 __P((__db_re_delim_msg *, struct svc_req *)); +__db_re_len_reply *__db_db_re_len_4001 __P((__db_re_len_msg *, struct svc_req *)); +__db_re_pad_reply *__db_db_re_pad_4001 __P((__db_re_pad_msg *, struct svc_req *)); +__db_remove_reply *__db_db_remove_4001 __P((__db_remove_msg *, struct svc_req *)); +__db_rename_reply *__db_db_rename_4001 __P((__db_rename_msg *, struct svc_req *)); +__db_stat_reply *__db_db_stat_4001 __P((__db_stat_msg *, struct svc_req *)); +__db_sync_reply *__db_db_sync_4001 __P((__db_sync_msg *, struct svc_req *)); +__db_truncate_reply *__db_db_truncate_4001 __P((__db_truncate_msg *, struct svc_req *)); +__db_cursor_reply *__db_db_cursor_4001 __P((__db_cursor_msg *, struct svc_req *)); +__db_join_reply *__db_db_join_4001 __P((__db_join_msg *, struct svc_req *)); +__dbc_close_reply *__db_dbc_close_4001 __P((__dbc_close_msg *, struct svc_req *)); +__dbc_count_reply *__db_dbc_count_4001 __P((__dbc_count_msg *, struct svc_req *)); +__dbc_del_reply *__db_dbc_del_4001 __P((__dbc_del_msg *, struct svc_req *)); +__dbc_dup_reply *__db_dbc_dup_4001 __P((__dbc_dup_msg *, struct svc_req *)); +__dbc_get_reply *__db_dbc_get_4001 __P((__dbc_get_msg *, struct svc_req *)); +__dbc_pget_reply *__db_dbc_pget_4001 __P((__dbc_pget_msg *, struct svc_req *)); +__dbc_put_reply *__db_dbc_put_4001 __P((__dbc_put_msg *, struct svc_req *)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_rpc_server_ext_h_ */ diff --git a/bdb/dbinc_auto/tcl_ext.h b/bdb/dbinc_auto/tcl_ext.h new file mode 100644 index 00000000000..619ea4a9dfc --- /dev/null +++ b/bdb/dbinc_auto/tcl_ext.h @@ -0,0 +1,82 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _tcl_ext_h_ +#define _tcl_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int bdb_HCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*)); +#if DB_DBM_HSEARCH != 0 +int bdb_NdbmOpen __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBM **)); +#endif +#if DB_DBM_HSEARCH != 0 +int bdb_DbmCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*, int, DBM *)); +#endif +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 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_EnvVerbose __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *, Tcl_Obj *)); +int tcl_EnvAttr __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +int tcl_EnvTest __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +DBTCL_INFO *_NewInfo __P((Tcl_Interp *, void *, char *, enum INFOTYPE)); +void *_NameToPtr __P((CONST char *)); +DBTCL_INFO *_PtrToInfo __P((CONST void *)); +DBTCL_INFO *_NameToInfo __P((CONST char *)); +void _SetInfoData __P((DBTCL_INFO *, void *)); +void _DeleteInfo __P((DBTCL_INFO *)); +int _SetListElem __P((Tcl_Interp *, Tcl_Obj *, void *, int, void *, int)); +int _SetListElemInt __P((Tcl_Interp *, Tcl_Obj *, void *, int)); +int _SetListRecnoElem __P((Tcl_Interp *, Tcl_Obj *, db_recno_t, u_char *, int)); +int _Set3DBTList __P((Tcl_Interp *, Tcl_Obj *, DBT *, int, DBT *, int, DBT *)); +int _SetMultiList __P((Tcl_Interp *, Tcl_Obj *, DBT *, DBT*, int, int)); +int _GetGlobPrefix __P((char *, char **)); +int _ReturnSetup __P((Tcl_Interp *, int, int, char *)); +int _ErrorSetup __P((Tcl_Interp *, int, char *)); +void _ErrorFunc __P((CONST char *, char *)); +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, void (*)(u_int32_t, void *, void (*)(u_int32_t, const FN *, void *)))); +void _debug_check __P((void)); +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 *)); +int tcl_LockTimeout __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +int tcl_LockVec __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +int tcl_LogArchive __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +int tcl_LogCompare __P((Tcl_Interp *, int, Tcl_Obj * CONST*)); +int tcl_LogFile __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +int tcl_LogFlush __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +int tcl_LogGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +int tcl_LogPut __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +int tcl_LogStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *)); +int logc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*)); +void _MpInfoDelete __P((Tcl_Interp *, DBTCL_INFO *)); +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_RepElect __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *)); +int tcl_RepFlush __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_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 *)); +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_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) +} +#endif +#endif /* !_tcl_ext_h_ */ diff --git a/bdb/dbinc_auto/txn_auto.h b/bdb/dbinc_auto/txn_auto.h new file mode 100644 index 00000000000..ac841ba5bc3 --- /dev/null +++ b/bdb/dbinc_auto/txn_auto.h @@ -0,0 +1,55 @@ +/* Do not edit: automatically built by gen_rec.awk. */ + +#ifndef __txn_AUTO_H +#define __txn_AUTO_H +#define DB___txn_regop 10 +typedef struct ___txn_regop_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t opcode; + int32_t timestamp; +} __txn_regop_args; + +#define DB___txn_ckp 11 +typedef struct ___txn_ckp_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + DB_LSN ckp_lsn; + DB_LSN last_ckp; + int32_t timestamp; +} __txn_ckp_args; + +#define DB___txn_child 12 +typedef struct ___txn_child_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t child; + DB_LSN c_lsn; +} __txn_child_args; + +#define DB___txn_xa_regop 13 +typedef struct ___txn_xa_regop_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t opcode; + DBT xid; + int32_t formatID; + u_int32_t gtrid; + u_int32_t bqual; + DB_LSN begin_lsn; +} __txn_xa_regop_args; + +#define DB___txn_recycle 14 +typedef struct ___txn_recycle_args { + u_int32_t type; + DB_TXN *txnid; + DB_LSN prev_lsn; + u_int32_t min; + u_int32_t max; +} __txn_recycle_args; + +#endif diff --git a/bdb/dbinc_auto/txn_ext.h b/bdb/dbinc_auto/txn_ext.h new file mode 100644 index 00000000000..5a4381ed890 --- /dev/null +++ b/bdb/dbinc_auto/txn_ext.h @@ -0,0 +1,70 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _txn_ext_h_ +#define _txn_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +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_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_prepare __P((DB_TXN *, u_int8_t *)); +u_int32_t __txn_id __P((DB_TXN *)); +int __txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t)); +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 *)); +int __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t)); +int __txn_regop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __txn_regop_read __P((DB_ENV *, void *, __txn_regop_args **)); +int __txn_ckp_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, DB_LSN *, int32_t)); +int __txn_ckp_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __txn_ckp_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +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 *)); +int __txn_child_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __txn_child_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __txn_child_read __P((DB_ENV *, void *, __txn_child_args **)); +int __txn_xa_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, int32_t, u_int32_t, u_int32_t, DB_LSN *)); +int __txn_xa_regop_getpgnos __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_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_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __txn_recycle_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); +int __txn_recycle_read __P((DB_ENV *, void *, __txn_recycle_args **)); +int __txn_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __txn_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +int __txn_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *)); +void __txn_dbenv_create __P((DB_ENV *)); +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_map_gid __P((DB_ENV *, u_int8_t *, TXN_DETAIL **, size_t *)); +int __txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t)); +int __txn_get_prepared __P((DB_ENV *, XID *, DB_PREPLIST *, long, long *, u_int32_t)); +int __txn_open __P((DB_ENV *)); +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_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t)); +int __txn_remevent __P((DB_ENV *, DB_TXN *, const char *, u_int8_t*)); +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)); +int __txn_doevents __P((DB_ENV *, DB_TXN *, int, int)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_txn_ext_h_ */ diff --git a/bdb/dbinc_auto/xa_ext.h b/bdb/dbinc_auto/xa_ext.h new file mode 100644 index 00000000000..e4fc9895e18 --- /dev/null +++ b/bdb/dbinc_auto/xa_ext.h @@ -0,0 +1,20 @@ +/* DO NOT EDIT: automatically built by dist/s_include. */ +#ifndef _xa_ext_h_ +#define _xa_ext_h_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int __db_xa_create __P((DB *)); +int __db_rmid_to_env __P((int rmid, DB_ENV **envp)); +int __db_xid_to_txn __P((DB_ENV *, XID *, size_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)); +void __db_unmap_xid __P((DB_ENV *, XID *, size_t)); + +#if defined(__cplusplus) +} +#endif +#endif /* !_xa_ext_h_ */ diff --git a/bdb/dbm/dbm.c b/bdb/dbm/dbm.c index e5f423572c5..3aa6fff6982 100644 --- a/bdb/dbm/dbm.c +++ b/bdb/dbm/dbm.c @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ /* @@ -43,7 +43,7 @@ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: dbm.c,v 11.7 2000/11/30 00:58:35 ubell Exp $"; +static const char revid[] = "$Id: dbm.c,v 11.14 2002/02/22 16:11:10 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -60,6 +60,36 @@ static const char revid[] = "$Id: dbm.c,v 11.7 2000/11/30 00:58:35 ubell Exp $"; * * This package provides dbm and ndbm compatible interfaces to DB. * + * EXTERN: #if DB_DBM_HSEARCH != 0 + * + * EXTERN: int __db_ndbm_clearerr __P((DBM *)); + * EXTERN: void __db_ndbm_close __P((DBM *)); + * EXTERN: int __db_ndbm_delete __P((DBM *, datum)); + * EXTERN: int __db_ndbm_dirfno __P((DBM *)); + * EXTERN: int __db_ndbm_error __P((DBM *)); + * EXTERN: datum __db_ndbm_fetch __P((DBM *, datum)); + * EXTERN: datum __db_ndbm_firstkey __P((DBM *)); + * EXTERN: datum __db_ndbm_nextkey __P((DBM *)); + * EXTERN: DBM *__db_ndbm_open __P((const char *, int, int)); + * EXTERN: int __db_ndbm_pagfno __P((DBM *)); + * EXTERN: int __db_ndbm_rdonly __P((DBM *)); + * EXTERN: int __db_ndbm_store __P((DBM *, datum, datum, int)); + * + * EXTERN: int __db_dbm_close __P((void)); + * EXTERN: int __db_dbm_dbrdonly __P((void)); + * EXTERN: int __db_dbm_delete __P((datum)); + * EXTERN: int __db_dbm_dirf __P((void)); + * EXTERN: datum __db_dbm_fetch __P((datum)); + * EXTERN: datum __db_dbm_firstkey __P((void)); + * EXTERN: int __db_dbm_init __P((char *)); + * EXTERN: datum __db_dbm_nextkey __P((datum)); + * EXTERN: int __db_dbm_pagf __P((void)); + * EXTERN: int __db_dbm_store __P((datum, datum)); + * + * EXTERN: #endif + */ + +/* * The DBM routines, which call the NDBM routines. */ static DBM *__cur_db; @@ -210,7 +240,7 @@ __db_ndbm_open(file, oflags, mode) if ((ret = dbp->set_pagesize(dbp, 4096)) != 0 || (ret = dbp->set_h_ffactor(dbp, 40)) != 0 || (ret = dbp->set_h_nelem(dbp, 1)) != 0 || - (ret = dbp->open(dbp, + (ret = dbp->open(dbp, NULL, path, NULL, DB_HASH, __db_oflags(oflags), mode)) != 0) { __os_set_errno(ret); return (NULL); @@ -277,7 +307,7 @@ __db_ndbm_fetch(dbm, key) __os_set_errno(ENOENT); else { __os_set_errno(ret); - F_SET(dbc->dbp, DB_DBM_ERROR); + F_SET(dbc->dbp, DB_AM_DBM_ERROR); } } return (data); @@ -312,7 +342,7 @@ __db_ndbm_firstkey(dbm) __os_set_errno(ENOENT); else { __os_set_errno(ret); - F_SET(dbc->dbp, DB_DBM_ERROR); + F_SET(dbc->dbp, DB_AM_DBM_ERROR); } } return (key); @@ -347,7 +377,7 @@ __db_ndbm_nextkey(dbm) __os_set_errno(ENOENT); else { __os_set_errno(ret); - F_SET(dbc->dbp, DB_DBM_ERROR); + F_SET(dbc->dbp, DB_AM_DBM_ERROR); } } return (key); @@ -380,7 +410,7 @@ __db_ndbm_delete(dbm, key) __os_set_errno(ENOENT); else { __os_set_errno(ret); - F_SET(dbc->dbp, DB_DBM_ERROR); + F_SET(dbc->dbp, DB_AM_DBM_ERROR); } return (-1); } @@ -419,7 +449,7 @@ __db_ndbm_store(dbm, key, data, flags) return (1); __os_set_errno(ret); - F_SET(dbc->dbp, DB_DBM_ERROR); + F_SET(dbc->dbp, DB_AM_DBM_ERROR); return (-1); } @@ -431,7 +461,7 @@ __db_ndbm_error(dbm) dbc = (DBC *)dbm; - return (F_ISSET(dbc->dbp, DB_DBM_ERROR)); + return (F_ISSET(dbc->dbp, DB_AM_DBM_ERROR)); } int @@ -442,7 +472,7 @@ __db_ndbm_clearerr(dbm) dbc = (DBC *)dbm; - F_CLR(dbc->dbp, DB_DBM_ERROR); + F_CLR(dbc->dbp, DB_AM_DBM_ERROR); return (0); } diff --git a/bdb/dbreg/dbreg.c b/bdb/dbreg/dbreg.c new file mode 100644 index 00000000000..289fe67ed50 --- /dev/null +++ b/bdb/dbreg/dbreg.c @@ -0,0 +1,450 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: dbreg.c,v 11.68 2002/08/28 19:05:27 margo Exp $"; +#endif /* not lint */ + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include +#endif + +#include "db_int.h" +#include "dbinc/log.h" +#include "dbinc/txn.h" + +/* + * The dbreg subsystem, as its name implies, registers database handles so + * that we can associate log messages with them without logging a filename + * or a full, unique DB ID. Instead, we assign each dbp an int32_t which is + * easy and cheap to log, and use this subsystem to map back and forth. + * + * Overview of how dbreg ids are managed: + * + * OPEN + * dbreg_setup (Creates FNAME struct.) + * dbreg_new_id (Assigns new ID to dbp and logs it. May be postponed + * until we attempt to log something else using that dbp, if the dbp + * was opened on a replication client.) + * + * CLOSE + * dbreg_close_id (Logs closure of dbp/revocation of ID.) + * dbreg_revoke_id (As name implies, revokes ID.) + * dbreg_teardown (Destroys FNAME.) + * + * RECOVERY + * dbreg_setup + * dbreg_assign_id (Assigns a particular ID we have in the log to a dbp.) + * + * sometimes: dbreg_revoke_id; dbreg_teardown + * other times: normal close path + * + * A note about locking: + * + * FNAME structures are referenced only by their corresponding dbp's + * until they have a valid id. + * + * Once they have a valid id, they must get linked into the log + * 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: + * + * We don't want to have to grab the fq_mutex 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. + * + * If a handle is closed during an attempt by another thread to + * log with it, well, the application doing the close deserves to + * go down in flames and a lot else is about to fail anyway. + * + * When in the course of logging we encounter an invalid id + * and go to allocate it lazily, we *do* need to check again + * after grabbing the mutex, because it's possible to race with + * another thread that has also decided that it needs to allocate + * a id lazily. + * + * See SR #5623 for further discussion of the new dbreg design. + */ + +/* + * __dbreg_setup -- + * Allocate and initialize an FNAME structure. The FNAME structures + * live in the log shared region and map one-to-one with open database handles. + * When the handle needs to be logged, the FNAME should have a valid fid + * allocated. If the handle currently isn't logged, it still has an FNAME + * entry. If we later discover that the handle needs to be logged, we can + * allocate a id for it later. (This happens when the handle is on a + * replication client that later becomes a master.) + * + * PUBLIC: int __dbreg_setup __P((DB *, const char *, u_int32_t)); + */ +int +__dbreg_setup(dbp, name, create_txnid) + DB *dbp; + const char *name; + u_int32_t create_txnid; +{ + DB_ENV *dbenv; + DB_LOG *dblp; + FNAME *fnp; + int ret; + size_t len; + void *namep; + + dbenv = dbp->dbenv; + dblp = dbenv->lg_handle; + + fnp = NULL; + namep = NULL; + + /* Allocate an FNAME and, if necessary, a buffer for the name itself. */ + R_LOCK(dbenv, &dblp->reginfo); + if ((ret = + __db_shalloc(dblp->reginfo.addr, sizeof(FNAME), 0, &fnp)) != 0) { + R_UNLOCK(dbenv, &dblp->reginfo); + return (ret); + } + memset(fnp, 0, sizeof(FNAME)); + if (name != NULL) { + len = strlen(name) + 1; + if ((ret = __db_shalloc(dblp->reginfo.addr, + len, 0, &namep)) != 0) { + R_UNLOCK(dbenv, &dblp->reginfo); + return (ret); + } + fnp->name_off = R_OFFSET(&dblp->reginfo, namep); + memcpy(namep, name, len); + } else + fnp->name_off = INVALID_ROFF; + + R_UNLOCK(dbenv, &dblp->reginfo); + + /* + * 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->s_type = dbp->type; + memcpy(fnp->ufid, dbp->fileid, DB_FILE_ID_LEN); + fnp->meta_pgno = dbp->meta_pgno; + fnp->create_txnid = create_txnid; + + dbp->log_filename = fnp; + + return (0); +} + +/* + * __dbreg_teardown -- + * Destroy a DB handle's FNAME struct. + * + * PUBLIC: int __dbreg_teardown __P((DB *)); + */ +int +__dbreg_teardown(dbp) + DB *dbp; +{ + DB_ENV *dbenv; + DB_LOG *dblp; + FNAME *fnp; + + dbenv = dbp->dbenv; + dblp = dbenv->lg_handle; + fnp = dbp->log_filename; + + /* + * We may not have an FNAME if we were never opened. This is not an + * error. + */ + if (fnp == NULL) + return (0); + + DB_ASSERT(fnp->id == DB_LOGFILEID_INVALID); + + R_LOCK(dbenv, &dblp->reginfo); + if (fnp->name_off != INVALID_ROFF) + __db_shalloc_free(dblp->reginfo.addr, + R_ADDR(&dblp->reginfo, fnp->name_off)); + __db_shalloc_free(dblp->reginfo.addr, fnp); + R_UNLOCK(dbenv, &dblp->reginfo); + + dbp->log_filename = NULL; + + return (0); +} + +/* + * __dbreg_new_id -- + * Assign an unused dbreg id to this database handle. + * + * PUBLIC: int __dbreg_new_id __P((DB *, DB_TXN *)); + */ +int +__dbreg_new_id(dbp, txn) + DB *dbp; + DB_TXN *txn; +{ + DBT fid_dbt, r_name; + DB_ENV *dbenv; + DB_LOG *dblp; + DB_LSN unused; + FNAME *fnp; + LOG *lp; + int32_t id; + int ret; + + 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); + + /* + * It's possible that after deciding we needed to call this function, + * someone else allocated an ID before we grabbed the lock. Check + * to make sure there was no race and we have something useful to do. + */ + if (fnp->id != DB_LOGFILEID_INVALID) { + MUTEX_UNLOCK(dbenv, &lp->fq_mutex); + return (0); + } + + /* Get an unused ID from the free list. */ + if ((ret = __dbreg_pop_id(dbenv, &id)) != 0) + goto err; + + /* If no ID was found, allocate a new one. */ + if (id == DB_LOGFILEID_INVALID) + id = lp->fid_max++; + + fnp->id = id; + + /* Hook the FNAME into the list of open files. */ + SH_TAILQ_INSERT_HEAD(&lp->fq, fnp, q, __fname); + + /* + * Log the registry. We should only request a new ID in situations + * where logging is reasonable. + */ + DB_ASSERT(!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, 0, LOG_OPEN, + r_name.size == 0 ? NULL : &r_name, &fid_dbt, id, fnp->s_type, + fnp->meta_pgno, fnp->create_txnid)) != 0) + goto err; + + DB_ASSERT(dbp->type == fnp->s_type); + DB_ASSERT(dbp->meta_pgno == fnp->meta_pgno); + + if ((ret = __dbreg_add_dbentry(dbenv, dblp, dbp, id)) != 0) + goto err; + +err: MUTEX_UNLOCK(dbenv, &lp->fq_mutex); + return (ret); +} + +/* + * __dbreg_assign_id -- + * Assign a particular dbreg id to this database handle. + * + * PUBLIC: int __dbreg_assign_id __P((DB *, int32_t)); + */ +int +__dbreg_assign_id(dbp, id) + DB *dbp; + int32_t id; +{ + DB *close_dbp; + DB_ENV *dbenv; + DB_LOG *dblp; + FNAME *close_fnp, *fnp; + LOG *lp; + int ret; + + dbenv = dbp->dbenv; + dblp = dbenv->lg_handle; + lp = dblp->reginfo.primary; + fnp = dbp->log_filename; + + close_dbp = NULL; + close_fnp = NULL; + + /* The fq_mutex protects the FNAME list and id management. */ + MUTEX_LOCK(dbenv, &lp->fq_mutex); + + /* We should only call this on DB handles that have no ID. */ + DB_ASSERT(fnp->id == DB_LOGFILEID_INVALID); + + /* + * Make sure there isn't already a file open with this ID. There can + * be in recovery, if we're recovering across a point where an ID got + * reused. + */ + 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, + * 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 + * we're ready to return. + * + * Once we have the dbp, revoke its id; we're about to + * reuse it. + */ + ret = __dbreg_id_to_db_int(dbenv, NULL, &close_dbp, id, 0, 0); + if (ret == ENOENT) { + ret = 0; + goto cont; + } else if (ret != 0) + goto err; + + if ((ret = __dbreg_revoke_id(close_dbp, 1)) != 0) + goto err; + } + + /* + * Remove this ID from the free list, if it's there, and make sure + * we don't allocate it anew. + */ +cont: if ((ret = __dbreg_pluck_id(dbenv, id)) != 0) + goto err; + if (id >= lp->fid_max) + lp->fid_max = id + 1; + + /* Now go ahead and assign the id to our dbp. */ + fnp->id = id; + SH_TAILQ_INSERT_HEAD(&lp->fq, fnp, q, __fname); + + if ((ret = __dbreg_add_dbentry(dbenv, dblp, dbp, id)) != 0) + goto err; + +err: MUTEX_UNLOCK(dbenv, &lp->fq_mutex); + + /* There's nothing useful that our caller can do if this close fails. */ + if (close_dbp != NULL) + (void)close_dbp->close(close_dbp, DB_NOSYNC); + + return (ret); +} + +/* + * __dbreg_revoke_id -- + * Take a log id away from a dbp, in preparation for closing it, + * but without logging the close. + * + * PUBLIC: int __dbreg_revoke_id __P((DB *, int)); + */ +int +__dbreg_revoke_id(dbp, have_lock) + DB *dbp; + int have_lock; +{ + DB_ENV *dbenv; + DB_LOG *dblp; + FNAME *fnp; + LOG *lp; + int32_t id; + int ret; + + dbenv = dbp->dbenv; + dblp = dbenv->lg_handle; + lp = dblp->reginfo.primary; + fnp = dbp->log_filename; + + /* If we lack an ID, this is a null-op. */ + if (fnp == NULL || fnp->id == DB_LOGFILEID_INVALID) + return (0); + + if (!have_lock) + MUTEX_LOCK(dbenv, &lp->fq_mutex); + + id = fnp->id; + fnp->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); + + if (!have_lock) + MUTEX_UNLOCK(dbenv, &lp->fq_mutex); + return (ret); +} + +/* + * __dbreg_close_id -- + * Take a dbreg id away from a dbp that we're closing, and log + * the unregistry. + * + * PUBLIC: int __dbreg_close_id __P((DB *, DB_TXN *)); + */ +int +__dbreg_close_id(dbp, txn) + DB *dbp; + DB_TXN *txn; +{ + DBT fid_dbt, r_name, *dbtp; + DB_ENV *dbenv; + DB_LOG *dblp; + DB_LSN r_unused; + FNAME *fnp; + LOG *lp; + int ret; + + dbenv = dbp->dbenv; + dblp = dbenv->lg_handle; + lp = dblp->reginfo.primary; + fnp = dbp->log_filename; + + /* If we lack an ID, this is a null-op. */ + if (fnp == NULL || fnp->id == DB_LOGFILEID_INVALID) + return (0); + + MUTEX_LOCK(dbenv, &lp->fq_mutex); + + if (fnp->name_off == INVALID_ROFF) + dbtp = NULL; + else { + memset(&r_name, 0, sizeof(r_name)); + r_name.data = R_ADDR(&dblp->reginfo, fnp->name_off); + r_name.size = + (u_int32_t)strlen((char *)r_name.data) + 1; + dbtp = &r_name; + } + memset(&fid_dbt, 0, sizeof(fid_dbt)); + fid_dbt.data = fnp->ufid; + fid_dbt.size = DB_FILE_ID_LEN; + if ((ret = __dbreg_register_log(dbenv, txn, + &r_unused, 0, LOG_CLOSE, dbtp, &fid_dbt, fnp->id, + fnp->s_type, fnp->meta_pgno, TXN_INVALID)) != 0) + goto err; + + ret = __dbreg_revoke_id(dbp, 1); + +err: MUTEX_UNLOCK(dbenv, &lp->fq_mutex); + return (ret); +} diff --git a/bdb/dbreg/dbreg.src b/bdb/dbreg/dbreg.src new file mode 100644 index 00000000000..18429471e82 --- /dev/null +++ b/bdb/dbreg/dbreg.src @@ -0,0 +1,49 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + * + * $Id: dbreg.src,v 10.22 2002/03/27 04:31:44 bostic Exp $ + */ + +PREFIX __dbreg +DBPRIVATE + +INCLUDE #include "db_config.h" +INCLUDE +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" +INCLUDE #include "dbinc/db_dispatch.h" +INCLUDE #include "dbinc/db_am.h" +INCLUDE #include "dbinc/log.h" +INCLUDE #include "dbinc/rep.h" +INCLUDE #include "dbinc/txn.h" +INCLUDE + +/* + * Used for registering name/id translations at open or close. + * opcode: register or unregister + * name: file name + * fileid: unique file id + * ftype: file type + * ftype: database type + * id: transaction id of the subtransaction that created the fs object + */ +BEGIN register 2 +ARG opcode u_int32_t lu +DBT name DBT s +DBT uid DBT s +ARG fileid int32_t ld +ARG ftype DBTYPE lx +ARG meta_pgno db_pgno_t lu +ARG id u_int32_t lx +END diff --git a/bdb/dbreg/dbreg_auto.c b/bdb/dbreg/dbreg_auto.c new file mode 100644 index 00000000000..91eace3f4bf --- /dev/null +++ b/bdb/dbreg/dbreg_auto.c @@ -0,0 +1,358 @@ +/* Do not edit: automatically built by gen_rec.awk. */ +#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" +#include "dbinc/db_dispatch.h" +#include "dbinc/db_am.h" +#include "dbinc/log.h" +#include "dbinc/rep.h" +#include "dbinc/txn.h" + +/* + * PUBLIC: int __dbreg_register_log __P((DB_ENV *, DB_TXN *, + * PUBLIC: DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, + * PUBLIC: int32_t, DBTYPE, db_pgno_t, u_int32_t)); + */ +int +__dbreg_register_log(dbenv, txnid, ret_lsnp, flags, + opcode, name, uid, fileid, ftype, meta_pgno, + id) + DB_ENV *dbenv; + DB_TXN *txnid; + DB_LSN *ret_lsnp; + u_int32_t flags; + u_int32_t opcode; + const DBT *name; + const DBT *uid; + int32_t fileid; + DBTYPE ftype; + db_pgno_t meta_pgno; + u_int32_t id; +{ + DBT logrec; + DB_LSN *lsnp, null_lsn; + u_int32_t zero; + u_int32_t uinttmp; + u_int32_t npad, rectype, txn_num; + int ret; + u_int8_t *bp; + + rectype = DB___dbreg_register; + npad = 0; + + if (txnid == NULL) { + txn_num = 0; + null_lsn.file = 0; + null_lsn.offset = 0; + lsnp = &null_lsn; + } else { + if (TAILQ_FIRST(&txnid->kids) != NULL && + (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) + return (ret); + txn_num = txnid->txnid; + lsnp = &txnid->last_lsn; + } + + 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) + (uid == NULL ? 0 : uid->size) + + sizeof(u_int32_t) + + 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 ((ret = __os_malloc(dbenv, + logrec.size, &logrec.data)) != 0) + return (ret); + + 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)opcode; + 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 (uid == NULL) { + zero = 0; + memcpy(bp, &zero, sizeof(u_int32_t)); + bp += sizeof(u_int32_t); + } else { + memcpy(bp, &uid->size, sizeof(uid->size)); + bp += sizeof(uid->size); + memcpy(bp, uid->data, uid->size); + bp += uid->size; + } + + uinttmp = (u_int32_t)fileid; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + uinttmp = (u_int32_t)ftype; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + uinttmp = (u_int32_t)meta_pgno; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + uinttmp = (u_int32_t)id; + memcpy(bp, &uinttmp, sizeof(uinttmp)); + bp += sizeof(uinttmp); + + DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size); + ret = dbenv->log_put(dbenv, + ret_lsnp, (DBT *)&logrec, flags | DB_NOCOPY); + if (txnid != NULL && ret == 0) + txnid->last_lsn = *ret_lsnp; +#ifdef LOG_DIAGNOSTIC + if (ret != 0) + (void)__dbreg_register_print(dbenv, + (DBT *)&logrec, ret_lsnp, NULL, NULL); +#endif + __os_free(dbenv, logrec.data); + return (ret); +} + +/* + * PUBLIC: int __dbreg_register_getpgnos __P((DB_ENV *, DBT *, + * PUBLIC: DB_LSN *, db_recops, void *)); + */ +int +__dbreg_register_getpgnos(dbenv, rec, lsnp, notused1, summary) + DB_ENV *dbenv; + DBT *rec; + DB_LSN *lsnp; + db_recops notused1; + void *summary; +{ + TXN_RECS *t; + int ret; + COMPQUIET(rec, NULL); + COMPQUIET(notused1, DB_TXN_ABORT); + + t = (TXN_RECS *)summary; + + if ((ret = __rep_check_alloc(dbenv, t, 1)) != 0) + return (ret); + + t->array[t->npages].flags = LSN_PAGE_NOLOCK; + t->array[t->npages].lsn = *lsnp; + t->array[t->npages].fid = DB_LOGFILEID_INVALID; + memset(&t->array[t->npages].pgdesc, 0, + sizeof(t->array[t->npages].pgdesc)); + + t->npages++; + + return (0); +} + +/* + * PUBLIC: int __dbreg_register_print __P((DB_ENV *, DBT *, DB_LSN *, + * PUBLIC: db_recops, void *)); + */ +int +__dbreg_register_print(dbenv, dbtp, lsnp, notused2, notused3) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops notused2; + void *notused3; +{ + __dbreg_register_args *argp; + u_int32_t i; + int ch; + int ret; + + notused2 = DB_TXN_ABORT; + notused3 = NULL; + + if ((ret = __dbreg_register_read(dbenv, dbtp->data, &argp)) != 0) + return (ret); + (void)printf( + "[%lu][%lu]__dbreg_register: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", + (u_long)lsnp->file, + (u_long)lsnp->offset, + (u_long)argp->type, + (u_long)argp->txnid->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++) { + ch = ((u_int8_t *)argp->name.data)[i]; + printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch); + } + (void)printf("\n"); + (void)printf("\tuid: "); + for (i = 0; i < argp->uid.size; i++) { + ch = ((u_int8_t *)argp->uid.data)[i]; + printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch); + } + (void)printf("\n"); + (void)printf("\tfileid: %ld\n", (long)argp->fileid); + (void)printf("\tftype: 0x%lx\n", (u_long)argp->ftype); + (void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno); + (void)printf("\tid: 0x%lx\n", (u_long)argp->id); + (void)printf("\n"); + __os_free(dbenv, argp); + return (0); +} + +/* + * PUBLIC: int __dbreg_register_read __P((DB_ENV *, void *, + * PUBLIC: __dbreg_register_args **)); + */ +int +__dbreg_register_read(dbenv, recbuf, argpp) + DB_ENV *dbenv; + void *recbuf; + __dbreg_register_args **argpp; +{ + __dbreg_register_args *argp; + u_int32_t uinttmp; + u_int8_t *bp; + int ret; + + if ((ret = __os_malloc(dbenv, + sizeof(__dbreg_register_args) + sizeof(DB_TXN), &argp)) != 0) + return (ret); + + argp->txnid = (DB_TXN *)&argp[1]; + + bp = recbuf; + 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->prev_lsn, bp, sizeof(DB_LSN)); + bp += sizeof(DB_LSN); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->opcode = (u_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->uid, 0, sizeof(argp->uid)); + memcpy(&argp->uid.size, bp, sizeof(u_int32_t)); + bp += sizeof(u_int32_t); + argp->uid.data = bp; + bp += argp->uid.size; + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->fileid = (int32_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->ftype = (DBTYPE)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->meta_pgno = (db_pgno_t)uinttmp; + bp += sizeof(uinttmp); + + memcpy(&uinttmp, bp, sizeof(uinttmp)); + argp->id = (u_int32_t)uinttmp; + bp += sizeof(uinttmp); + + *argpp = argp; + return (0); +} + +/* + * PUBLIC: int __dbreg_init_print __P((DB_ENV *, int (***)(DB_ENV *, + * PUBLIC: DBT *, DB_LSN *, db_recops, void *), size_t *)); + */ +int +__dbreg_init_print(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, + __dbreg_register_print, DB___dbreg_register)) != 0) + return (ret); + return (0); +} + +/* + * PUBLIC: int __dbreg_init_getpgnos __P((DB_ENV *, + * PUBLIC: int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), + * PUBLIC: size_t *)); + */ +int +__dbreg_init_getpgnos(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, + __dbreg_register_getpgnos, DB___dbreg_register)) != 0) + return (ret); + return (0); +} + +/* + * PUBLIC: int __dbreg_init_recover __P((DB_ENV *, int (***)(DB_ENV *, + * PUBLIC: DBT *, DB_LSN *, db_recops, void *), size_t *)); + */ +int +__dbreg_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, + __dbreg_register_recover, DB___dbreg_register)) != 0) + return (ret); + return (0); +} diff --git a/bdb/dbreg/dbreg_rec.c b/bdb/dbreg/dbreg_rec.c new file mode 100644 index 00000000000..ba3ba0e06d9 --- /dev/null +++ b/bdb/dbreg/dbreg_rec.c @@ -0,0 +1,362 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1996-2002 + * Sleepycat Software. All rights reserved. + */ +/* + * Copyright (c) 1995, 1996 + * The President and Fellows of Harvard University. 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. 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" + +#ifndef lint +static const char revid[] = "$Id: dbreg_rec.c,v 11.108 2002/08/14 20:04:25 bostic Exp $"; +#endif /* not lint */ + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include +#endif + +#include "db_int.h" +#include "dbinc/db_page.h" +#include "dbinc/db_am.h" +#include "dbinc/log.h" +#include "dbinc/txn.h" + +static int __dbreg_open_file __P((DB_ENV *, + DB_TXN *, __dbreg_register_args *, void *)); + +/* + * PUBLIC: int __dbreg_register_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__dbreg_register_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + DB_ENTRY *dbe; + DB_LOG *dblp; + DB *dbp; + __dbreg_register_args *argp; + int do_close, do_open, do_rem, ret, t_ret; + + dblp = dbenv->lg_handle; + dbp = NULL; + +#ifdef DEBUG_RECOVER + REC_PRINT(__dbreg_register_print); +#endif + do_open = do_close = 0; + if ((ret = __dbreg_register_read(dbenv, dbtp->data, &argp)) != 0) + goto out; + + switch (argp->opcode) { + case LOG_OPEN: + if ((DB_REDO(op) || + op == DB_TXN_OPENFILES || op == DB_TXN_POPENFILES)) + do_open = 1; + else + do_close = 1; + break; + + case LOG_CLOSE: + if (DB_UNDO(op)) + do_open = 1; + else + do_close = 1; + break; + case LOG_RCLOSE: + /* + * LOG_RCLOSE was generated by recover because a file + * was left open. The POPENFILES pass, which is run + * to open files to abort prepared transactions, + * may not include the open for this file so we + * open it here. Note that a normal CLOSE is + * not legal before the prepared transaction is + * committed or aborted. + */ + if (DB_UNDO(op) || op == DB_TXN_POPENFILES) + do_open = 1; + else + do_close = 1; + break; + + case LOG_CHECKPOINT: + if (DB_UNDO(op) || + op == DB_TXN_OPENFILES || op == DB_TXN_POPENFILES) + do_open = 1; + break; + } + + if (do_open) { + /* + * We must open the db even if the meta page is not + * yet written as we may be creating subdatabase. + */ + if (op == DB_TXN_OPENFILES && argp->opcode != LOG_CHECKPOINT) + F_SET(dblp, DBLOG_FORCE_OPEN); + + /* + * During an abort or an open pass to recover prepared txns, + * we need to make sure that we use the same locker id on the + * open. We pass the txnid along to ensure this. + */ + ret = __dbreg_open_file(dbenv, + op == DB_TXN_ABORT || op == DB_TXN_POPENFILES ? + argp->txnid : NULL, argp, info); + if (ret == ENOENT || ret == EINVAL) { + /* + * If this is an OPEN while rolling forward, it's + * possible that the file was recreated since last + * time we got here. In that case, we've got deleted + * set and probably shouldn't, so we need to check + * for that case and possibly retry. + */ + if (op == DB_TXN_FORWARD_ROLL && + argp->txnid != 0 && + dblp->dbentry[argp->fileid].deleted) { + dblp->dbentry[argp->fileid].deleted = 0; + ret = + __dbreg_open_file(dbenv, NULL, argp, info); + } + ret = 0; + } + F_CLR(dblp, DBLOG_FORCE_OPEN); + } + + if (do_close) { + /* + * If we are undoing an open, or redoing a close, + * then we need to close the file. + * + * If the file is deleted, then we can just ignore this close. + * Otherwise, we should usually have a valid dbp we should + * close or whose reference count should be decremented. + * However, if we shut down without closing a file, we may, in + * fact, not have the file open, and that's OK. + */ + do_rem = 0; + MUTEX_THREAD_LOCK(dbenv, dblp->mutexp); + if (argp->fileid < dblp->dbentry_cnt) { + /* + * Typically, closes should match an open which means + * that if this is a close, there should be a valid + * entry in the dbentry table when we get here, + * however there is an exception. If this is an + * OPENFILES pass, then we may have started from + * a log file other than the first, and the + * corresponding open appears in an earlier file. + * We can ignore that case, but all others are errors. + */ + dbe = &dblp->dbentry[argp->fileid]; + if (dbe->dbp == NULL && !dbe->deleted) { + /* No valid entry here. */ + if ((argp->opcode != LOG_CLOSE && + argp->opcode != LOG_RCLOSE) || + (op != DB_TXN_OPENFILES && + op !=DB_TXN_POPENFILES)) { + __db_err(dbenv, + "Improper file close at %lu/%lu", + (u_long)lsnp->file, + (u_long)lsnp->offset); + ret = EINVAL; + } + MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + goto done; + } + + /* We have either an open entry or a deleted entry. */ + if ((dbp = dbe->dbp) != NULL) { + MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + (void)__dbreg_revoke_id(dbp, 0); + + /* + * If we're a replication client, it's + * possible to get here with a dbp that + * the user opened, but which we later + * assigned a fileid to. Be sure that + * we only close dbps that we opened in + * the recovery code; they should have + * DB_AM_RECOVER set. + * + * The only exception is if we're aborting + * in a normal environment; then we might + * get here with a non-AM_RECOVER database. + */ + if (F_ISSET(dbp, DB_AM_RECOVER) || + op == DB_TXN_ABORT) + do_rem = 1; + } else if (dbe->deleted) { + MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + __dbreg_rem_dbentry(dblp, argp->fileid); + } + } else + MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + if (do_rem) { + /* + * If we are undoing a create we'd better discard + * any buffers from the memory pool. + */ + if (dbp != NULL && dbp->mpf != NULL && argp->id != 0) { + if ((ret = dbp->mpf->close(dbp->mpf, + DB_MPOOL_DISCARD)) != 0) + goto out; + dbp->mpf = NULL; + } + + /* + * During recovery, all files are closed. On an abort, + * we only close the file if we opened it during the + * abort (DB_AM_RECOVER set), otherwise we simply do + * a __db_refresh. For the close case, if remove or + * rename has closed the file, don't request a sync, + * because the NULL mpf would be a problem. + */ + if (dbp != NULL) { + if (op == DB_TXN_ABORT && + !F_ISSET(dbp, DB_AM_RECOVER)) + t_ret = + __db_refresh(dbp, NULL, DB_NOSYNC); + else + t_ret = dbp->close(dbp, DB_NOSYNC); + if (t_ret != 0 && ret == 0) + ret = t_ret; + } + } + } +done: if (ret == 0) + *lsnp = argp->prev_lsn; +out: if (argp != NULL) + __os_free(dbenv, argp); + return (ret); +} + +/* + * __dbreg_open_file -- + * Called during log_register recovery. Make sure that we have an + * entry in the dbentry table for this ndx. Returns 0 on success, + * non-zero on error. + */ +static int +__dbreg_open_file(dbenv, txn, argp, info) + DB_ENV *dbenv; + DB_TXN *txn; + __dbreg_register_args *argp; + void *info; +{ + DB_ENTRY *dbe; + DB_LOG *lp; + DB *dbp; + u_int32_t id; + + lp = (DB_LOG *)dbenv->lg_handle; + /* + * We never re-open temporary files. Temp files are only + * useful during aborts in which case the dbp was entered + * when the file was registered. During recovery, we treat + * temp files as properly deleted files, allowing the open to + * fail and not reporting any errors when recovery fails to + * get a valid dbp from __dbreg_id_to_db. + */ + if (argp->name.size == 0) { + (void)__dbreg_add_dbentry(dbenv, lp, NULL, argp->fileid); + return (ENOENT); + } + + /* + * 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, lp->mutexp); + if (argp->fileid < lp->dbentry_cnt) + dbe = &lp->dbentry[argp->fileid]; + else + dbe = NULL; + + if (dbe != NULL) { + if (dbe->deleted) { + MUTEX_THREAD_UNLOCK(dbenv, lp->mutexp); + return (ENOENT); + } + if ((dbp = dbe->dbp) != NULL) { + if (dbp->meta_pgno != argp->meta_pgno || + memcmp(dbp->fileid, + argp->uid.data, DB_FILE_ID_LEN) != 0) { + MUTEX_THREAD_UNLOCK(dbenv, lp->mutexp); + (void)__dbreg_revoke_id(dbp, 0); + if (F_ISSET(dbp, DB_AM_RECOVER)) + dbp->close(dbp, DB_NOSYNC); + goto reopen; + } + + /* + * We should only get here if we already have the + * 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, lp->mutexp); + + /* + * This is a successful open. We need to record that + * in the txnlist so that we know how to handle the + * subtransaction that created the file system object. + */ + if (argp->id != TXN_INVALID && + __db_txnlist_update(dbenv, info, + argp->id, TXN_EXPECTED, NULL) == TXN_NOTFOUND) + (void)__db_txnlist_add(dbenv, + info, argp->id, TXN_EXPECTED, NULL); + return (0); + } + } + + MUTEX_THREAD_UNLOCK(dbenv, lp->mutexp); + + /* + * We are about to pass a recovery txn pointer into the main library. + * We need to make sure that any accessed fields are set appropriately. + */ +reopen: if (txn != NULL) { + id = txn->txnid; + memset(txn, 0, sizeof(DB_TXN)); + txn->txnid = id; + txn->mgrp = dbenv->tx_handle; + } + + return (__dbreg_do_open(dbenv, txn, lp, argp->uid.data, argp->name.data, + argp->ftype, argp->fileid, argp->meta_pgno, info, argp->id)); +} diff --git a/bdb/dbreg/dbreg_util.c b/bdb/dbreg/dbreg_util.c new file mode 100644 index 00000000000..0db5c640adb --- /dev/null +++ b/bdb/dbreg/dbreg_util.c @@ -0,0 +1,797 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2002 + * Sleepycat Software. All rights reserved. + */ + +#include "db_config.h" + +#ifndef lint +static const char revid[] = "$Id: dbreg_util.c,v 11.22 2002/09/10 02:43:10 bostic Exp $"; +#endif /* not lint */ + +#ifndef NO_SYSTEM_INCLUDES +#include +#include +#endif + +#include "db_int.h" +#include "dbinc/db_page.h" +#include "dbinc/db_am.h" +#include "dbinc/log.h" +#include "dbinc/txn.h" + +static int __dbreg_check_master __P((DB_ENV *, u_int8_t *, char *)); + +/* + * __dbreg_add_dbentry -- + * Adds a DB entry to the dbreg DB entry table. + * + * PUBLIC: int __dbreg_add_dbentry __P((DB_ENV *, DB_LOG *, DB *, int32_t)); + */ +int +__dbreg_add_dbentry(dbenv, dblp, dbp, ndx) + DB_ENV *dbenv; + DB_LOG *dblp; + DB *dbp; + int32_t ndx; +{ + int32_t i; + int ret; + + ret = 0; + + MUTEX_THREAD_LOCK(dbenv, dblp->mutexp); + + /* + * Check if we need to grow the table. Note, ndx is 0-based (the + * index into the DB entry table) an dbentry_cnt is 1-based, the + * number of available slots. + */ + if (dblp->dbentry_cnt <= ndx) { + if ((ret = __os_realloc(dbenv, + (ndx + DB_GROW_SIZE) * sizeof(DB_ENTRY), + &dblp->dbentry)) != 0) + goto err; + + /* Initialize the new entries. */ + for (i = dblp->dbentry_cnt; i < ndx + DB_GROW_SIZE; i++) { + dblp->dbentry[i].dbp = NULL; + dblp->dbentry[i].deleted = 0; + } + dblp->dbentry_cnt = i; + } + + DB_ASSERT(dblp->dbentry[ndx].dbp == NULL); + dblp->dbentry[ndx].deleted = dbp == NULL; + dblp->dbentry[ndx].dbp = dbp; + +err: MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + return (ret); +} + +/* + * __dbreg_rem_dbentry + * Remove an entry from the DB entry table. + * + * PUBLIC: void __dbreg_rem_dbentry __P((DB_LOG *, int32_t)); + */ +void +__dbreg_rem_dbentry(dblp, ndx) + DB_LOG *dblp; + int32_t ndx; +{ + MUTEX_THREAD_LOCK(dblp->dbenv, dblp->mutexp); + dblp->dbentry[ndx].dbp = NULL; + dblp->dbentry[ndx].deleted = 0; + MUTEX_THREAD_UNLOCK(dblp->dbenv, dblp->mutexp); +} + +/* + * __dbreg_open_files -- + * Put a LOG_CHECKPOINT log record for each open database. + * + * PUBLIC: int __dbreg_open_files __P((DB_ENV *)); + */ +int +__dbreg_open_files(dbenv) + DB_ENV *dbenv; +{ + DB_LOG *dblp; + DB_LSN r_unused; + DBT *dbtp, fid_dbt, t; + FNAME *fnp; + LOG *lp; + int ret; + + dblp = dbenv->lg_handle; + lp = dblp->reginfo.primary; + + 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)) { + if (fnp->name_off == INVALID_ROFF) + dbtp = NULL; + else { + memset(&t, 0, sizeof(t)); + t.data = R_ADDR(&dblp->reginfo, fnp->name_off); + t.size = (u_int32_t)strlen(t.data) + 1; + dbtp = &t; + } + memset(&fid_dbt, 0, sizeof(fid_dbt)); + fid_dbt.data = fnp->ufid; + fid_dbt.size = DB_FILE_ID_LEN; + /* + * Output LOG_CHECKPOINT records which will be + * processed during the OPENFILES pass of recovery. + * At the end of recovery we want to output the + * files that were open so that a future recovery + * run will have the correct files open during + * a backward pass. For this we output LOG_RCLOSE + * records so that the files will be closed on + * the forward pass. + */ + if ((ret = __dbreg_register_log(dbenv, + NULL, &r_unused, 0, + F_ISSET(dblp, DBLOG_RECOVER) ? LOG_RCLOSE : LOG_CHECKPOINT, + dbtp, &fid_dbt, fnp->id, fnp->s_type, fnp->meta_pgno, + TXN_INVALID)) != 0) + break; + } + + MUTEX_UNLOCK(dbenv, &lp->fq_mutex); + + return (ret); +} + +/* + * __dbreg_close_files -- + * Close files that were opened by the recovery daemon. We sync the + * file, unless its mpf pointer has been NULLed by a db_remove or + * db_rename. We may not have flushed the log_register record that + * closes the file. + * + * PUBLIC: int __dbreg_close_files __P((DB_ENV *)); + */ +int +__dbreg_close_files(dbenv) + DB_ENV *dbenv; +{ + DB_LOG *dblp; + DB *dbp; + int ret, t_ret; + int32_t i; + + /* If we haven't initialized logging, we have nothing to do. */ + if (!LOGGING_ON(dbenv)) + return (0); + + dblp = dbenv->lg_handle; + ret = 0; + MUTEX_THREAD_LOCK(dbenv, dblp->mutexp); + for (i = 0; i < dblp->dbentry_cnt; i++) { + /* We only want to close dbps that recovery opened. */ + if ((dbp = dblp->dbentry[i].dbp) != NULL && + F_ISSET(dbp, DB_AM_RECOVER)) { + /* + * It's unsafe to call DB->close while holding the + * thread lock, because we'll call __dbreg_rem_dbentry + * and grab it again. + * + * Just drop it. Since dbreg ids go monotonically + * upward, concurrent opens should be safe, and the + * user should have no business closing files while + * we're in this loop anyway--we're in the process of + * making all outstanding dbps invalid. + */ + MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + if ((t_ret = dbp->close(dbp, + dbp->mpf == NULL ? DB_NOSYNC : 0)) != 0 && ret == 0) + ret = t_ret; + MUTEX_THREAD_LOCK(dbenv, dblp->mutexp); + } + dblp->dbentry[i].deleted = 0; + dblp->dbentry[i].dbp = NULL; + } + MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + return (ret); +} + +/* + * __dbreg_nofiles -- + * Check that there are no open files in the process local table. + * Returns 0 if there are no files and EINVAL if there are any. + * + * PUBLIC: int __dbreg_nofiles __P((DB_ENV *)); + */ +int +__dbreg_nofiles(dbenv) + DB_ENV *dbenv; +{ + DB *dbp; + DB_LOG *dblp; + int ret; + int32_t i; + + /* If we haven't initialized logging, we have nothing to do. */ + if (!LOGGING_ON(dbenv)) + return (0); + + dblp = dbenv->lg_handle; + ret = 0; + MUTEX_THREAD_LOCK(dbenv, dblp->mutexp); + for (i = 0; i < dblp->dbentry_cnt; i++) { + if ((dbp = dblp->dbentry[i].dbp) != NULL && + !F_ISSET(dbp, DB_AM_RECOVER)) { + ret = EINVAL; + break; + } + } + MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + return (ret); +} + +/* + * __dbreg_id_to_db -- + * Return the DB corresponding to the specified dbreg id. + * + * PUBLIC: int __dbreg_id_to_db __P((DB_ENV *, DB_TXN *, DB **, int32_t, int)); + */ +int +__dbreg_id_to_db(dbenv, txn, dbpp, ndx, inc) + DB_ENV *dbenv; + DB_TXN *txn; + DB **dbpp; + int32_t ndx; + int inc; +{ + return (__dbreg_id_to_db_int(dbenv, txn, dbpp, ndx, inc, 1)); +} + +/* + * __dbreg_id_to_db_int -- + * Return the DB corresponding to the specified dbreg id. The internal + * version takes a final parameter that indicates whether we should attempt + * to open the file if no mapping is found. During recovery, the recovery + * routines all want to try to open the file (and this is called from + * __dbreg_id_to_db), however, if we have a multi-process environment where + * some processes may not have the files open (e.g., XA), then we also get + * called from __dbreg_assign_id and it's OK if there is no mapping. + * + * PUBLIC: int __dbreg_id_to_db_int __P((DB_ENV *, + * PUBLIC: DB_TXN *, DB **, int32_t, int, int)); + */ +int +__dbreg_id_to_db_int(dbenv, txn, dbpp, ndx, inc, tryopen) + DB_ENV *dbenv; + DB_TXN *txn; + DB **dbpp; + int32_t ndx; + int inc, tryopen; +{ + DB_LOG *dblp; + FNAME *fname; + int ret; + char *name; + + ret = 0; + dblp = dbenv->lg_handle; + COMPQUIET(inc, 0); + + MUTEX_THREAD_LOCK(dbenv, dblp->mutexp); + + /* + * Under XA, a process different than the one issuing DB operations + * may abort a transaction. In this case, the "recovery" routines + * are run by a process that does not necessarily have the file open, + * so we we must open the file explicitly. + */ + if (ndx >= dblp->dbentry_cnt || + (!dblp->dbentry[ndx].deleted && dblp->dbentry[ndx].dbp == NULL)) { + if (!tryopen || F_ISSET(dblp, DBLOG_RECOVER)) { + ret = ENOENT; + goto err; + } + + /* + * __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. + */ + MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + + if (__dbreg_id_to_fname(dblp, ndx, 0, &fname) != 0) + /* + * With transactional opens, we may actually have + * closed this file in the transaction in which + * case this will fail too. Then it's up to the + * caller to reopen the file. + */ + 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. + */ + name = R_ADDR(&dblp->reginfo, fname->name_off); + + /* + * At this point, we are not holding the thread lock, so exit + * directly instead of going through the exit code at the + * bottom. If the __dbreg_do_open succeeded, then we don't need + * to do any of the remaining error checking at the end of this + * routine. + * XXX I am sending a NULL txnlist and 0 txnid which may be + * completely broken ;( + */ + if ((ret = __dbreg_do_open(dbenv, txn, dblp, + fname->ufid, name, fname->s_type, + ndx, fname->meta_pgno, NULL, 0)) != 0) + return (ret); + + *dbpp = dblp->dbentry[ndx].dbp; + return (0); + } + + /* + * Return DB_DELETED if the file has been deleted (it's not an error). + */ + if (dblp->dbentry[ndx].deleted) { + ret = DB_DELETED; + goto err; + } + + /* It's an error if we don't have a corresponding writeable DB. */ + if ((*dbpp = dblp->dbentry[ndx].dbp) == NULL) + ret = ENOENT; + +err: MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp); + return (ret); +} + +/* + * __dbreg_id_to_fname -- + * Traverse the shared-memory region looking for the entry that + * matches the passed dbreg id. Returns 0 on success; -1 on error. + * + * PUBLIC: int __dbreg_id_to_fname __P((DB_LOG *, int32_t, int, FNAME **)); + */ +int +__dbreg_id_to_fname(dblp, lid, have_lock, fnamep) + DB_LOG *dblp; + int32_t lid; + int have_lock; + FNAME **fnamep; +{ + DB_ENV *dbenv; + FNAME *fnp; + LOG *lp; + int ret; + + dbenv = dblp->dbenv; + lp = dblp->reginfo.primary; + + 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)) { + if (fnp->id == lid) { + *fnamep = fnp; + ret = 0; + break; + } + } + if (!have_lock) + MUTEX_UNLOCK(dbenv, &lp->fq_mutex); + + return (ret); +} +/* + * __dbreg_fid_to_fname -- + * Traverse the shared-memory region looking for the entry that + * matches the passed file unique id. Returns 0 on success; -1 on error. + * + * PUBLIC: int __dbreg_fid_to_fname __P((DB_LOG *, u_int8_t *, int, FNAME **)); + */ +int +__dbreg_fid_to_fname(dblp, fid, have_lock, fnamep) + DB_LOG *dblp; + u_int8_t *fid; + int have_lock; + FNAME **fnamep; +{ + DB_ENV *dbenv; + FNAME *fnp; + LOG *lp; + int ret; + + dbenv = dblp->dbenv; + lp = dblp->reginfo.primary; + + 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)) { + if (memcmp(fnp->ufid, fid, DB_FILE_ID_LEN) == 0) { + *fnamep = fnp; + ret = 0; + break; + } + } + if (!have_lock) + MUTEX_UNLOCK(dbenv, &lp->fq_mutex); + + return (ret); +} + +/* + * __dbreg_get_name + * + * Interface to get name of registered files. This is mainly diagnostic + * and the name passed could be transient unless there is something + * ensuring that the file cannot be closed. + * + * PUBLIC: int __dbreg_get_name __P((DB_ENV *, u_int8_t *, char **)); + */ +int +__dbreg_get_name(dbenv, fid, namep) + DB_ENV *dbenv; + u_int8_t *fid; + char **namep; +{ + DB_LOG *dblp; + FNAME *fname; + + dblp = dbenv->lg_handle; + + if (dblp != NULL && __dbreg_fid_to_fname(dblp, fid, 0, &fname) == 0) { + *namep = R_ADDR(&dblp->reginfo, fname->name_off); + return (0); + } + + return (-1); +} + +/* + * __dbreg_do_open -- + * 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)); + */ +int +__dbreg_do_open(dbenv, + txn, lp, uid, name, ftype, ndx, meta_pgno, info, id) + DB_ENV *dbenv; + DB_TXN *txn; + DB_LOG *lp; + u_int8_t *uid; + char *name; + DBTYPE ftype; + int32_t ndx; + db_pgno_t meta_pgno; + void *info; + u_int32_t id; +{ + DB *dbp; + int ret; + u_int32_t cstat; + + if ((ret = db_create(&dbp, lp->dbenv, 0)) != 0) + return (ret); + + /* + * We can open files under a number of different scenarios. + * First, we can open a file during a normal txn_abort, if that file + * was opened and closed during the transaction (as is the master + * database of a sub-database). + * Second, we might be aborting a transaction in XA and not have + * it open in the process that is actually doing the abort. + * Third, we might be in recovery. + * In case 3, there is no locking, so there is no issue. + * In cases 1 and 2, we are guaranteed to already hold any locks + * that we need, since we're still in the same transaction, so by + * setting DB_AM_RECOVER, we guarantee that we don't log and that + * we don't try to acquire locks on behalf of a different locker id. + */ + F_SET(dbp, DB_AM_RECOVER); + if (meta_pgno != PGNO_BASE_MD) { + memcpy(dbp->fileid, uid, DB_FILE_ID_LEN); + dbp->meta_pgno = meta_pgno; + } + dbp->type = ftype; + if ((ret = __db_dbopen(dbp, txn, name, NULL, + DB_ODDFILESIZE, __db_omode("rw----"), meta_pgno)) == 0) { + + /* + * Verify that we are opening the same file that we were + * referring to when we wrote this log record. + */ + 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; + else + cstat = TXN_EXPECTED; + + /* Assign the specific dbreg id to this dbp. */ + if ((ret = __dbreg_assign_id(dbp, ndx)) != 0) + goto err; + + /* + * If we successfully opened this file, then we need to + * convey that information to the txnlist so that we + * know how to handle the subtransaction that created + * the file system object. + */ + if (id != TXN_INVALID) { + if ((ret = __db_txnlist_update(dbenv, + info, id, cstat, NULL)) == TXN_NOTFOUND) + ret = __db_txnlist_add(dbenv, + info, id, cstat, NULL); + else if (ret > 0) + ret = 0; + } +err: if (cstat == TXN_IGNORE) + goto not_right; + return (ret); + } else { + /* Record that the open failed in the txnlist. */ + if (id != TXN_INVALID && (ret = __db_txnlist_update(dbenv, + info, id, TXN_UNEXPECTED, NULL)) == TXN_NOTFOUND) + ret = __db_txnlist_add(dbenv, + info, id, TXN_UNEXPECTED, NULL); + } +not_right: + (void)dbp->close(dbp, 0); + /* Add this file as deleted. */ + (void)__dbreg_add_dbentry(dbenv, lp, NULL, ndx); + return (ENOENT); +} + +static int +__dbreg_check_master(dbenv, uid, name) + DB_ENV *dbenv; + u_int8_t *uid; + char *name; +{ + DB *dbp; + int ret; + + ret = 0; + if ((ret = db_create(&dbp, dbenv, 0)) != 0) + return (ret); + dbp->type = DB_BTREE; + F_SET(dbp, DB_AM_RECOVER); + ret = __db_dbopen(dbp, + NULL, name, NULL, 0, __db_omode("rw----"), PGNO_BASE_MD); + + if (ret == 0 && memcmp(uid, dbp->fileid, DB_FILE_ID_LEN) != 0) + ret = EINVAL; + + (void)dbp->close(dbp, 0); + return (ret); +} + +/* + * __dbreg_lazy_id -- + * When a replication client gets upgraded to being a replication master, + * it may have database handles open that have not been assigned an ID, but + * which have become legal to use for logging. + * + * This function lazily allocates a new ID for such a function, in a + * new transaction created for the purpose. We need to do this in a new + * transaction because we definitely wish to commit the dbreg_register, but + * 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. + * + * PUBLIC: int __dbreg_lazy_id __P((DB *)); + */ +int +__dbreg_lazy_id(dbp) + DB *dbp; +{ + DB_ENV *dbenv; + DB_TXN *txn; + int ret; + + dbenv = dbp->dbenv; + + DB_ASSERT(F_ISSET(dbenv, DB_ENV_REP_MASTER)); + + if ((ret = dbenv->txn_begin(dbenv, NULL, &txn, 0)) != 0) + return (ret); + + if ((ret = __dbreg_new_id(dbp, txn)) != 0) { + (void)txn->abort(txn); + return (ret); + } + + return (txn->commit(txn, DB_TXN_NOSYNC)); +} + +/* + * __dbreg_push_id and __dbreg_pop_id -- + * Dbreg ids from closed files are kept on a stack in shared memory + * for recycling. (We want to reuse them as much as possible because each + * 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. + * + * PUBLIC: int __dbreg_push_id __P((DB_ENV *, int32_t)); + * PUBLIC: int __dbreg_pop_id __P((DB_ENV *, int32_t *)); + */ +int +__dbreg_push_id(dbenv, id) + DB_ENV *dbenv; + int32_t id; +{ + DB_LOG *dblp; + LOG *lp; + int32_t *stack, *newstack; + int ret; + + dblp = dbenv->lg_handle; + lp = dblp->reginfo.primary; + + if (lp->free_fid_stack != INVALID_ROFF) + stack = R_ADDR(&dblp->reginfo, lp->free_fid_stack); + else + stack = NULL; + + /* Check if we have room on the stack. */ + if (lp->free_fids_alloced <= lp->free_fids + 1) { + R_LOCK(dbenv, &dblp->reginfo); + if ((ret = __db_shalloc(dblp->reginfo.addr, + (lp->free_fids_alloced + 20) * sizeof(u_int32_t), 0, + &newstack)) != 0) { + R_UNLOCK(dbenv, &dblp->reginfo); + return (ret); + } + + memcpy(newstack, stack, + lp->free_fids_alloced * sizeof(u_int32_t)); + lp->free_fid_stack = R_OFFSET(&dblp->reginfo, newstack); + lp->free_fids_alloced += 20; + + if (stack != NULL) + __db_shalloc_free(dblp->reginfo.addr, stack); + + stack = newstack; + R_UNLOCK(dbenv, &dblp->reginfo); + } + + DB_ASSERT(stack != NULL); + stack[lp->free_fids++] = id; + return (0); +} + +int +__dbreg_pop_id(dbenv, id) + DB_ENV *dbenv; + int32_t *id; +{ + DB_LOG *dblp; + LOG *lp; + int32_t *stack; + + dblp = dbenv->lg_handle; + lp = dblp->reginfo.primary; + + /* Do we have anything to pop? */ + if (lp->free_fid_stack != INVALID_ROFF && lp->free_fids > 0) { + stack = R_ADDR(&dblp->reginfo, lp->free_fid_stack); + *id = stack[--lp->free_fids]; + } else + *id = DB_LOGFILEID_INVALID; + + return (0); +} + +/* + * __dbreg_pluck_id -- + * Remove a particular dbreg id from the stack of free ids. This is + * used when we open a file, as in recovery, with a specific ID that might + * 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. + * + * PUBLIC: int __dbreg_pluck_id __P((DB_ENV *, int32_t)); + */ +int +__dbreg_pluck_id(dbenv, id) + DB_ENV *dbenv; + int32_t id; +{ + DB_LOG *dblp; + LOG *lp; + int32_t *stack; + int i; + + dblp = dbenv->lg_handle; + lp = dblp->reginfo.primary; + + /* Do we have anything to look at? */ + if (lp->free_fid_stack != INVALID_ROFF) { + stack = R_ADDR(&dblp->reginfo, lp->free_fid_stack); + for (i = 0; i < lp->free_fids; i++) + if (id == stack[i]) { + /* + * Found it. Overwrite it with the top + * id (which may harmlessly be itself), + * and shorten the stack by one. + */ + stack[i] = stack[lp->free_fids - 1]; + lp->free_fids--; + return (0); + } + } + + return (0); +} + +#ifdef DEBUG +/* + * __dbreg_print_dblist -- + * Display the list of files. + * + * PUBLIC: void __dbreg_print_dblist __P((DB_ENV *)); + */ +void +__dbreg_print_dblist(dbenv) + DB_ENV *dbenv; +{ + DB *dbp; + DB_LOG *dblp; + FNAME *fnp; + LOG *lp; + int del, first; + char *name; + + dblp = dbenv->lg_handle; + lp = dblp->reginfo.primary; + + 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)) { + if (first) { + first = 0; + __db_err(dbenv, + "ID\t\t\tName\tType\tPgno\tTxnid\tDBP-info"); + } + if (fnp->name_off == INVALID_ROFF) + name = ""; + else + name = R_ADDR(&dblp->reginfo, fnp->name_off); + + dbp = fnp->id >= dblp->dbentry_cnt ? NULL : + dblp->dbentry[fnp->id].dbp; + del = fnp->id >= dblp->dbentry_cnt ? 0 : + dblp->dbentry[fnp->id].deleted; + __db_err(dbenv, "%ld\t%s\t\t\t%s\t%lu\t%lx\t%s %d %lx %lx", + (long)fnp->id, name, + __db_dbtype_to_string(fnp->s_type), + (u_long)fnp->meta_pgno, (u_long)fnp->create_txnid, + dbp == NULL ? "No DBP" : "DBP", del, P_TO_ULONG(dbp), + dbp == NULL ? 0 : dbp->flags); + } + + MUTEX_UNLOCK(dbenv, &lp->fq_mutex); +} +#endif diff --git a/bdb/dist/Makefile.in b/bdb/dist/Makefile.in index 4a47953e3e1..a7cc0e11f34 100644 --- a/bdb/dist/Makefile.in +++ b/bdb/dist/Makefile.in @@ -1,114 +1,10 @@ -# $Id: Makefile.in,v 11.66 2000/11/27 16:27:51 bostic Exp $ +# $Id: Makefile.in,v 11.175 2002/08/29 14:22:20 margo Exp $ srcdir= @srcdir@/.. builddir=. ################################################## -# C, C++ -################################################## -CPPFLAGS= -I$(builddir) -I$(srcdir)/include @CPPFLAGS@ -CFLAGS= -c $(CPPFLAGS) @CFLAGS@ -CXXFLAGS= -c $(CPPFLAGS) @CXXFLAGS@ - -CC= @MAKEFILE_CC@ -CCLINK= @MAKEFILE_CCLINK@ -CXX= @MAKEFILE_CXX@ - -INSTALLER= @INSTALLER@ - -LDFLAGS= @LDFLAGS@ -LIBDB_ARGS= @LIBDB_ARGS@ -LIBJSO_LIBS= @LIBJSO_LIBS@ -LIBS= @LIBS@ -LIBSO_LIBS= @LIBSO_LIBS@ -LIBTOOL= @LIBTOOL@ -LIBTSO_LIBS= @LIBTSO_LIBS@ -LIBXSO_LIBS= @LIBXSO_LIBS@ - -POSTLINK= @POSTLINK@ -SOLINK= @SOLINK@ -SOFLAGS= @SOFLAGS@ -SOMAJOR= @DB_VERSION_MAJOR@ -SOVERSION= @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@ - -libdb= libdb.a - -libso_base= libdb -libso_linkname= $(libso_base)-$(SOVERSION).la -libso= $(libso_base)-$(SOVERSION).@SOSUFFIX@ -libso_target= $(libso_base)-$(SOVERSION).la -libso_default= $(libso_base).@SOSUFFIX@ -libso_major= $(libso_base)-$(SOMAJOR).@SOSUFFIX@ - -################################################## -# C++ -# -# C++ support is optional, and it can be used with or without shared libraries. -# You must configure it using: -# --enable-cxx -################################################## -libcxx= libdb_cxx.a -libxso_base= libdb_cxx -libxso= $(libxso_base)-$(SOVERSION).@SOSUFFIX@ -libxso_target= $(libxso_base)-$(SOVERSION).la -libxso_default= $(libxso_base).@SOSUFFIX@ -libxso_major= $(libxso_base)-$(SOMAJOR).@SOSUFFIX@ - -################################################## -# JAVA -# -# Java support is optional and requires shared librarires. -# You must configure it using: -# --enable-java --enable-dynamic -################################################## -CLASSPATH= $(JAVA_CLASSTOP) -JAR= @JAR@ -JAVAC= env CLASSPATH=$(CLASSPATH) @JAVAC@ -JAVACFLAGS= @JAVACFLAGS@ -JAVA_BUILTFILE= .javabuilt -JAVA_CLASSTOP= $(srcdir)/java/classes -JAVA_SRCDIR= $(srcdir)/java/src -JAVA_DBREL= com/sleepycat/db -JAVA_DBDIR= $(JAVA_SRCDIR)/$(JAVA_DBREL) -JAVA_EXDIR= $(JAVA_SRCDIR)/com/sleepycat/examples - -libj_jarfile= db.jar -libjso_base= libdb_java -libjso= $(libjso_base)-$(SOVERSION).@SOSUFFIX@ -libjso_target= $(libjso_base)-$(SOVERSION).la -libjso_default= $(libjso_base).@SOSUFFIX@ -libjso_major= $(libjso_base)-$(SOMAJOR).@SOSUFFIX@ -libjso_g= $(libjso_base)-$(SOVERSION)_g.@SOSUFFIX@ - -################################################## -# TCL -# -# Tcl support is optional and requires shared libraries. -# You must configure it using: -# --enable-tcl --with-tcl=DIR --enable-dynamic -################################################## -TCFLAGS= @TCFLAGS@ -libtso_base= libdb_tcl -libtso= $(libtso_base)-$(SOVERSION).@SOSUFFIX@ -libtso_target= $(libtso_base)-$(SOVERSION).la -libtso_default= $(libtso_base).@SOSUFFIX@ -libtso_major= $(libtso_base)-$(SOMAJOR).@SOSUFFIX@ - -################################################## -# DB_DUMP185 UTILITY -# -# The db_dump185 application should be compiled using the system's db.h file -# (which should be a DB 1.85/1.86 include file), and the system's 1.85/1.86 -# object library. To include the right db.h, don't include -I$(builddir) on -# the compile line. You may also need to add a local include directory and -# local libraries, for example. Do that by adding -I options to the DB185INC -# line, and -l options to the DB185LIB line. -################################################## -DB185INC= -c @CFLAGS@ -I$(srcdir)/include @CPPFLAGS@ -DB185LIB= - -################################################## -# INSTALLATION DIRECTORIES AND PERMISSIONS +# Installation directories and permissions. ################################################## prefix= @prefix@ exec_prefix=@exec_prefix@ @@ -124,396 +20,1333 @@ fmode= 444 transform=@program_transform_name@ ################################################## -# PATHS FOR STANDARD USER-LEVEL COMMANDS +# Paths for standard user-level commands. ################################################## SHELL= @db_cv_path_sh@ -ar= @db_cv_path_ar@ cr +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@ +ranlib= @db_cv_path_ranlib@ rm= @db_cv_path_rm@ +rpm= @db_cv_path_rpm@ strip= @db_cv_path_strip@ +################################################## +# General library information. +################################################## +DEF_LIB= @DEFAULT_LIB@ +DEF_LIB_CXX= @DEFAULT_LIB_CXX@ +INSTALLER= @INSTALLER@ +LIBTOOL= @LIBTOOL@ + +POSTLINK= @POSTLINK@ +SOLINK= @MAKEFILE_SOLINK@ +SOFLAGS= @SOFLAGS@ +SOMAJOR= @DB_VERSION_MAJOR@ +SOVERSION= @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@ + +################################################## +# C API. +################################################## +CPPFLAGS= -I$(builddir) -I$(srcdir) -I$(srcdir)/dbinc @CPPFLAGS@ +CFLAGS= -c $(CPPFLAGS) @CFLAGS@ +CC= @MAKEFILE_CC@ +CCLINK= @MAKEFILE_CCLINK@ + +LDFLAGS= @LDFLAGS@ +LIBS= @LIBS@ +LIBSO_LIBS= @LIBSO_LIBS@ + +libdb= libdb.a +libso_base= libdb +libso= $(libso_base)-$(SOVERSION).@SOSUFFIX@ +libso_static= $(libso_base)-$(SOVERSION).a +libso_target= $(libso_base)-$(SOVERSION).la +libso_default= $(libso_base).@SOSUFFIX@ +libso_major= $(libso_base)-$(SOMAJOR).@SOSUFFIX@ + +################################################## +# C++ API. +# +# C++ support is optional, and can be built with static or shared libraries. +################################################## +CXXFLAGS= -c $(CPPFLAGS) @CXXFLAGS@ +CXX= @MAKEFILE_CXX@ +CXXLINK= @MAKEFILE_CXXLINK@ +XSOLINK= @MAKEFILE_XSOLINK@ +LIBXSO_LIBS= @LIBXSO_LIBS@ + +libcxx= libdb_cxx.a +libxso_base= libdb_cxx +libxso= $(libxso_base)-$(SOVERSION).@SOSUFFIX@ +libxso_static= $(libxso_base)-$(SOVERSION).a +libxso_target= $(libxso_base)-$(SOVERSION).la +libxso_default= $(libxso_base).@SOSUFFIX@ +libxso_major= $(libxso_base)-$(SOMAJOR).@SOSUFFIX@ + +################################################## +# Java API. +# +# Java support is optional and requires shared librarires. +################################################## +CLASSPATH= $(JAVA_CLASSTOP) +LIBJSO_LIBS= @LIBJSO_LIBS@ + +JAR= @JAR@ +JAVAC= env CLASSPATH="$(CLASSPATH)" @JAVAC@ +JAVACFLAGS= @JAVACFLAGS@ +JAVA_CLASSTOP= ./classes +JAVA_RPCCLASSES=./classes.rpc +JAVA_SRCDIR= $(srcdir)/java/src +JAVA_DBREL= com/sleepycat/db +JAVA_EXREL= com/sleepycat/examples +JAVA_RPCREL= com/sleepycat/db/rpcserver +JAVA_DBDIR= $(JAVA_SRCDIR)/$(JAVA_DBREL) +JAVA_EXDIR= $(JAVA_SRCDIR)/$(JAVA_EXREL) +JAVA_RPCDIR= $(srcdir)/rpc_server/java + +libj_jarfile= db.jar +libj_exjarfile= dbexamples.jar +rpc_jarfile= dbsvc.jar +libjso_base= libdb_java +libjso= $(libjso_base)-$(SOVERSION).@JMODSUFFIX@ +libjso_static= $(libjso_base)-$(SOVERSION).a +libjso_target= $(libjso_base)-$(SOVERSION).la +libjso_default= $(libjso_base).@JMODSUFFIX@ +libjso_major= $(libjso_base)-$(SOMAJOR).@JMODSUFFIX@ +libjso_g= $(libjso_base)-$(SOVERSION)_g.@JMODSUFFIX@ + +################################################## +# TCL API. +# +# Tcl support is optional and requires shared libraries. +################################################## +TCFLAGS= @TCFLAGS@ +LIBTSO_LIBS= @LIBTSO_LIBS@ +libtso_base= libdb_tcl +libtso= $(libtso_base)-$(SOVERSION).@MODSUFFIX@ +libtso_static= $(libtso_base)-$(SOVERSION).a +libtso_target= $(libtso_base)-$(SOVERSION).la +libtso_default= $(libtso_base).@MODSUFFIX@ +libtso_major= $(libtso_base)-$(SOMAJOR).@MODSUFFIX@ + +################################################## +# db_dump185 UTILITY +# +# The db_dump185 application should be compiled using the system's db.h file +# (which should be a DB 1.85/1.86 include file), and the system's 1.85/1.86 +# object library. To include the right db.h, don't include -I$(builddir) on +# the compile line. You may also need to add a local include directory and +# local libraries, for example. Do that by adding -I options to the DB185INC +# line, and -l options to the DB185LIB line. +################################################## +DB185INC= -c @CFLAGS@ -I$(srcdir) @CPPFLAGS@ +DB185LIB= + ################################################## # NOTHING BELOW THIS LINE SHOULD EVER NEED TO BE MODIFIED. ################################################## -OBJS= @ADDITIONAL_OBJS@ @LIBOBJS@ @RPC_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@ bt_verify@o@ \ - btree_auto@o@ 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_iface@o@ db_join@o@ db_log2@o@ \ - db_meta@o@ db_method@o@ db_overflow@o@ db_pr@o@ db_rec@o@ \ - db_reclaim@o@ db_ret@o@ db_salloc@o@ db_shash@o@ db_upg@o@ \ - db_upg_opd@o@ db_vrfy@o@ db_vrfyutil@o@ dbm@o@ env_method@o@ \ - env_open@o@ env_recover@o@ env_region@o@ hash@o@ hash_auto@o@ \ - hash_conv@o@ hash_dup@o@ hash_func@o@ hash_meta@o@ hash_method@o@ \ - hash_page@o@ hash_rec@o@ hash_reclaim@o@ hash_stat@o@ hash_upgrade@o@ \ - hash_verify@o@ hsearch@o@ lock@o@ lock_conflict@o@ \ + +################################################## +# Object and utility lists. +################################################## +C_OBJS= @ADDITIONAL_OBJS@ @LTLIBOBJS@ @RPC_CLIENT_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@ bt_verify@o@ btree_auto@o@ 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_shash@o@ db_truncate@o@ db_upg@o@ db_upg_opd@o@ db_vrfy@o@ \ + db_vrfyutil@o@ dbm@o@ dbreg@o@ dbreg_auto@o@ dbreg_rec@o@ \ + dbreg_util@o@ env_file@o@ env_method@o@ env_open@o@ env_recover@o@ \ + env_region@o@ fileops_auto@o@ fop_basic@o@ fop_rec@o@ \ + fop_util@o@ hash@o@ hash_auto@o@ hash_conv@o@ hash_dup@o@ \ + hash_func@o@ hash_meta@o@ hash_method@o@ hash_open@o@ \ + hash_page@o@ hash_rec@o@ hash_reclaim@o@ hash_stat@o@ \ + hash_upgrade@o@ hash_verify@o@ hmac@o@ hsearch@o@ lock@o@ \ lock_deadlock@o@ lock_method@o@ lock_region@o@ lock_stat@o@ \ - lock_util@o@ log@o@ log_archive@o@ log_auto@o@ log_compare@o@ \ - log_findckp@o@ log_get@o@ log_method@o@ log_put@o@ log_rec@o@ \ - log_register@o@ mp_alloc@o@ mp_bh@o@ mp_fget@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_dir@o@ os_errno@o@ os_fid@o@ os_finit@o@ \ - os_fsync@o@ os_handle@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_unlink@o@ qam@o@ qam_auto@o@ qam_conv@o@ qam_files@o@ \ - qam_method@o@ qam_open@o@ qam_rec@o@ qam_stat@o@ qam_upgrade@o@ \ - qam_verify@o@ txn@o@ txn_auto@o@ txn_rec@o@ txn_region@o@ xa@o@ \ - xa_db@o@ xa_map@o@ + lock_util@o@ log@o@ log_archive@o@ log_compare@o@ log_get@o@ \ + log_method@o@ log_put@o@ mp_alloc@o@ mp_bh@o@ mp_fget@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_unlink@o@ \ + qam@o@ qam_auto@o@ qam_conv@o@ qam_files@o@ qam_method@o@ \ + qam_open@o@ qam_rec@o@ qam_stat@o@ qam_upgrade@o@ qam_verify@o@ \ + rep_method@o@ rep_record@o@ rep_region@o@ rep_util@o@ sha1@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@ -COBJS= cxx_app@o@ cxx_except@o@ cxx_lock@o@ cxx_log@o@ cxx_mpool@o@ \ - cxx_table@o@ cxx_txn@o@ +CXX_OBJS=\ + cxx_db@o@ cxx_dbc@o@ cxx_dbt@o@ cxx_env@o@ cxx_except@o@ \ + cxx_lock@o@ cxx_logc@o@ cxx_mpool@o@ cxx_txn@o@ -DBSOBJS=dbs@o@ dbs_am@o@ dbs_checkpoint@o@ dbs_debug@o@ dbs_handles@o@ \ - dbs_log@o@ dbs_qam@o@ dbs_spawn@o@ dbs_trickle@o@ dbs_util@o@ \ - dbs_yield@o@ - -EOBJS= ex_access@o@ ex_btrec@o@ ex_dbclient@o@ ex_env@o@ ex_lock@o@ \ - ex_mpool@o@ ex_thread@o@ ex_tpcb@o@ - -JOBJS= java_Db@o@ java_DbEnv@o@ java_DbLock@o@ java_DbLsn@o@ java_DbTxn@o@ \ - java_Dbc@o@ java_Dbt@o@ java_info@o@ java_locked@o@ java_util@o@ - -RPC_OBJS=client@o@ db_server_clnt@o@ db_server_xdr@o@ gen_client@o@ \ - gen_client_ret@o@ -RPC_SRV=db_server_proc@o@ db_server_svc@o@ db_server_util@o@ gen_db_server@o@ - -TOBJS= tcl_compat@o@ tcl_db@o@ tcl_db_pkg@o@ tcl_dbcursor@o@ tcl_env@o@ \ - tcl_internal@o@ tcl_lock@o@ tcl_log@o@ tcl_mp@o@ tcl_txn@o@ - -UOBJS= db_archive@o@ db_checkpoint@o@ db_deadlock@o@ db_dump185@o@ \ - db_dump@o@ db_load@o@ db_printlog@o@ db_recover@o@ db_stat@o@ \ - db_upgrade@o@ db_verify@o@ util_log@o@ util_sig@o@ - -PROGS= @ADDITIONAL_PROGS@ db_archive db_checkpoint db_deadlock \ - db_dump db_load db_printlog db_recover db_stat db_upgrade db_verify +JAVA_OBJS=\ + java_Db@o@ java_DbEnv@o@ java_DbLock@o@ java_DbLogc@o@ \ + java_DbLsn@o@ java_DbTxn@o@ java_DbUtil@o@ java_Dbc@o@ \ + java_Dbt@o@ \ + java_info@o@ java_locked@o@ java_util@o@ java_stat_auto@o@ JAVA_DBSRCS=\ $(JAVA_DBDIR)/Db.java $(JAVA_DBDIR)/DbAppendRecno.java \ - $(JAVA_DBDIR)/DbBtreeCompare.java \ - $(JAVA_DBDIR)/DbBtreePrefix.java $(JAVA_DBDIR)/DbBtreeStat.java \ + $(JAVA_DBDIR)/DbAppDispatch.java \ + $(JAVA_DBDIR)/DbBtreeCompare.java $(JAVA_DBDIR)/DbBtreePrefix.java \ + $(JAVA_DBDIR)/DbBtreeStat.java $(JAVA_DBDIR)/DbClient.java \ $(JAVA_DBDIR)/DbConstants.java $(JAVA_DBDIR)/DbDeadlockException.java \ $(JAVA_DBDIR)/DbDupCompare.java $(JAVA_DBDIR)/DbEnv.java \ $(JAVA_DBDIR)/DbEnvFeedback.java $(JAVA_DBDIR)/DbErrcall.java \ $(JAVA_DBDIR)/DbException.java $(JAVA_DBDIR)/DbFeedback.java \ $(JAVA_DBDIR)/DbHash.java $(JAVA_DBDIR)/DbHashStat.java \ $(JAVA_DBDIR)/DbKeyRange.java $(JAVA_DBDIR)/DbLock.java \ - $(JAVA_DBDIR)/DbLockStat.java $(JAVA_DBDIR)/DbLogStat.java \ + $(JAVA_DBDIR)/DbLockNotGrantedException.java \ + $(JAVA_DBDIR)/DbLockRequest.java $(JAVA_DBDIR)/DbLockStat.java \ + $(JAVA_DBDIR)/DbLogc.java $(JAVA_DBDIR)/DbLogStat.java \ $(JAVA_DBDIR)/DbLsn.java $(JAVA_DBDIR)/DbMemoryException.java \ $(JAVA_DBDIR)/DbMpoolFStat.java $(JAVA_DBDIR)/DbMpoolStat.java \ + $(JAVA_DBDIR)/DbMultipleDataIterator.java \ + $(JAVA_DBDIR)/DbMultipleIterator.java \ + $(JAVA_DBDIR)/DbMultipleKeyDataIterator.java \ + $(JAVA_DBDIR)/DbMultipleRecnoDataIterator.java \ $(JAVA_DBDIR)/DbOutputStreamErrcall.java \ - $(JAVA_DBDIR)/DbQueueStat.java $(JAVA_DBDIR)/DbRecoveryInit.java \ - $(JAVA_DBDIR)/DbRunRecoveryException.java $(JAVA_DBDIR)/DbTxn.java \ - $(JAVA_DBDIR)/DbTxnRecover.java $(JAVA_DBDIR)/DbTxnStat.java \ - $(JAVA_DBDIR)/Dbc.java $(JAVA_DBDIR)/Dbt.java + $(JAVA_DBDIR)/DbPreplist.java $(JAVA_DBDIR)/DbQueueStat.java \ + $(JAVA_DBDIR)/DbRepStat.java $(JAVA_DBDIR)/DbRepTransport.java \ + $(JAVA_DBDIR)/DbRunRecoveryException.java \ + $(JAVA_DBDIR)/DbSecondaryKeyCreate.java $(JAVA_DBDIR)/DbTxn.java \ + $(JAVA_DBDIR)/DbTxnStat.java \ + $(JAVA_DBDIR)/DbUtil.java $(JAVA_DBDIR)/Dbc.java $(JAVA_DBDIR)/Dbt.java JAVA_EXSRCS=\ $(JAVA_EXDIR)/AccessExample.java \ $(JAVA_EXDIR)/BtRecExample.java \ + $(JAVA_EXDIR)/BulkAccessExample.java \ $(JAVA_EXDIR)/EnvExample.java \ $(JAVA_EXDIR)/LockExample.java \ $(JAVA_EXDIR)/TpcbExample.java -################################################## -# Note: Berkeley DB Makefiles are configured to build either a static or -# a dynamic library. You should not attempt to build both library types -# in the same directory, as they have incompatible object file formats. -# To build both static and dynamic libraries, create two separate build -# directories, and configure and build them separately. -################################################## -all: @DEFAULT_LIB@ @ADDITIONAL_LIBS@ @ADDITIONAL_LANG@ $(PROGS) +TCL_OBJS=\ + tcl_compat@o@ tcl_db@o@ tcl_db_pkg@o@ tcl_dbcursor@o@ tcl_env@o@ \ + tcl_internal@o@ tcl_lock@o@ tcl_log@o@ tcl_mp@o@ tcl_rep@o@ \ + tcl_txn@o@ tcl_util@o@ -$(libdb): $(OBJS) - $(ar) $@ $(OBJS) +RPC_CLIENT_OBJS=\ + client@o@ db_server_clnt@o@ db_server_xdr@o@ gen_client@o@ \ + gen_client_ret@o@ + +RPC_SRV_OBJS=\ + db_server_proc@o@ db_server_svc@o@ db_server_util@o@ \ + gen_db_server@o@ + +RPC_CXXSRV_OBJS=\ + db_server_cxxproc@o@ db_server_cxxutil@o@ db_server_svc@o@ \ + gen_db_server@o@ + +RPC_JAVASRV_SRCS=\ + $(JAVA_RPCDIR)/DbDispatcher.java \ + $(JAVA_RPCDIR)/DbServer.java \ + $(JAVA_RPCDIR)/FreeList.java \ + $(JAVA_RPCDIR)/LocalIterator.java \ + $(JAVA_RPCDIR)/RpcDb.java \ + $(JAVA_RPCDIR)/RpcDbEnv.java \ + $(JAVA_RPCDIR)/RpcDbTxn.java \ + $(JAVA_RPCDIR)/RpcDbc.java \ + $(JAVA_RPCDIR)/Timer.java \ + $(JAVA_RPCDIR)/gen/DbServerStub.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_msg.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_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 + +################################################## +# List of files installed into the library directory. +################################################## +LIB_INSTALL_FILE_LIST=\ + $(libdb) \ + $(libso) \ + $(libso_default) \ + $(libso_major) \ + $(libso_static) \ + $(libso_target) \ + $(libcxx) \ + $(libxso) \ + $(libxso_default) \ + $(libxso_major) \ + $(libxso_static) \ + $(libxso_target) \ + $(libtso) \ + $(libtso_default) \ + $(libtso_major) \ + $(libtso_static) \ + $(libtso_target) \ + $(libjso) \ + $(libjso_default) \ + $(libjso_g) \ + $(libjso_major) \ + $(libjso_static) \ + $(libjso_target) \ + $(libj_exjarfile) \ + $(libj_jarfile) + +################################################## +# We're building a standard library or a RPM file hierarchy, potentially +# for Embedix. Note: "all" must be the first target in the Makefile. +################################################## +all: @BUILD_TARGET@ libdb.a + +install-strip install: all @INSTALL_TARGET@ + +################################################## +# Library and standard utilities build. +################################################## +library_build: @INSTALL_LIBS@ @ADDITIONAL_LANG@ $(UTIL_PROGS) + +$(libdb): $(C_OBJS) + $(ar) cr $@ $(C_OBJS) test ! -f $(ranlib) || $(ranlib) $@ -$(libcxx): $(COBJS) $(OBJS) - $(ar) $@ $(COBJS) $(OBJS) +$(libcxx): $(CXX_OBJS) $(C_OBJS) + $(ar) cr $@ $(CXX_OBJS) $(C_OBJS) test ! -f $(ranlib) || $(ranlib) $@ -$(libso_target): $(OBJS) - $(SOLINK) $(SOFLAGS) -o $(libso_target) \ - $(OBJS) $(LDFLAGS) $(LIBSO_LIBS) +$(libso_target): $(C_OBJS) + $(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) $(LIBSO_LIBS) -$(libxso_target): $(COBJS) $(OBJS) - $(SOLINK) $(SOFLAGS) -o $(libxso_target) \ - $(COBJS) $(OBJS) $(LDFLAGS) $(LIBXSO_LIBS) +$(libjso_target): $(JAVA_OBJS) $(C_OBJS) + $(SOLINK) -jnimodule $(SOFLAGS) $(LDFLAGS) \ + -o $@ $(JAVA_OBJS) $(C_OBJS) $(LIBJSO_LIBS) -$(libjso_target): $(JOBJS) $(OBJS) - $(SOLINK) $(SOFLAGS) -o $(libjso_target) \ - $(JOBJS) $(OBJS) $(LDFLAGS) $(LIBJSO_LIBS) +$(libtso_target): $(TCL_OBJS) $(C_OBJS) + $(SOLINK) -module $(SOFLAGS) $(LDFLAGS) \ + -o $@ $(TCL_OBJS) $(C_OBJS) $(LIBTSO_LIBS) -$(libtso_target): $(TOBJS) $(OBJS) - $(SOLINK) $(SOFLAGS) -o $(libtso_target) \ - $(TOBJS) $(OBJS) $(LDFLAGS) $(LIBTSO_LIBS) +$(libxso_target): $(CXX_OBJS) $(C_OBJS) + $(XSOLINK) $(SOFLAGS) $(LDFLAGS) \ + -o $@ $(CXX_OBJS) $(C_OBJS) $(LIBXSO_LIBS) ################################################## # Creating individual dependencies and actions for building class # files is possible, but it is very messy and error prone. ################################################## -java: $(JAVA_CLASSTOP) $(JAVA_BUILTFILE) +java: $(libj_jarfile) $(libj_exjarfile) -$(JAVA_BUILTFILE): $(JAVA_DBSRCS) $(JAVA_EXSRCS) - @test -f $(rm) || (echo 'rm not found.'; exit 1) - @test -f $(cp) || (echo 'cp not found.'; exit 1) +$(libj_jarfile): $(JAVA_DBSRCS) + @test -d $(JAVA_CLASSTOP) || \ + ($(mkdir) -p $(JAVA_CLASSTOP) && $(chmod) $(dmode) $(JAVA_CLASSTOP)) $(JAVAC) -d $(JAVA_CLASSTOP) $(JAVACFLAGS) $(JAVA_DBSRCS) - @cd $(JAVA_CLASSTOP) && $(JAR) cf $(libj_jarfile) $(JAVA_DBREL) - $(JAVAC) -d $(JAVA_CLASSTOP) $(JAVACFLAGS) $(JAVA_EXSRCS) - @echo This file helps with building java using make > $(JAVA_BUILTFILE) + cd $(JAVA_CLASSTOP) && $(JAR) cf ../$(libj_jarfile) $(JAVA_DBREL) + +$(libj_exjarfile): $(libj_jarfile) $(JAVA_EXSRCS) + @test -d $(JAVA_CLASSTOP) || \ + ($(mkdir) -p $(JAVA_CLASSTOP) && $(chmod) $(dmode) $(JAVA_CLASSTOP)) + $(JAVAC) -d $(JAVA_CLASSTOP) $(JAVACFLAGS) $(JAVA_EXSRCS) + cd $(JAVA_CLASSTOP) && $(JAR) cf ../$(libj_exjarfile) $(JAVA_EXREL) + +$(rpc_jarfile): $(libj_jarfile) $(RPC_JAVASRV_SRCS) + @test -d $(JAVA_RPCCLASSES) || \ + ($(mkdir) -p $(JAVA_RPCCLASSES) && \ + $(chmod) $(dmode) $(JAVA_RPCCLASSES)) + env CLASSPATH=$(CLASSPATH):$(JAVA_RPCDIR)/oncrpc.jar \ + @JAVAC@ -d $(JAVA_RPCCLASSES) $(JAVACFLAGS) $(RPC_JAVASRV_SRCS) + cd $(JAVA_RPCCLASSES) && $(JAR) cf ../$(rpc_jarfile) $(JAVA_RPCREL) -$(JAVA_CLASSTOP): - @test -f $(mkdir) || (echo 'mkdir not found.'; exit 1) - $(mkdir) $(JAVA_CLASSTOP) ################################################## # Utilities ################################################## -berkeley_db_svc: $(RPC_SRV) util_log@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) $(RPC_SRV) util_log@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -db_archive: db_archive@o@ util_sig@o@ @DEFAULT_LIB@ +berkeley_db_svc: $(RPC_SRV_OBJS) util_log@o@ $(DEF_LIB) $(CCLINK) -o $@ $(LDFLAGS) \ - db_archive@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) + $(RPC_SRV_OBJS) util_log@o@ $(DEF_LIB) $(LIBS) $(POSTLINK) $@ -db_checkpoint: db_checkpoint@o@ util_log@o@ util_sig@o@ @DEFAULT_LIB@ +berkeley_db_cxxsvc: $(RPC_CXXSRV_OBJS) util_log@o@ $(DEF_LIB_CXX) + $(CXXLINK) -o $@ $(LDFLAGS) \ + $(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.DbServer \$$@ + chmod +x $@ + +db_archive: db_archive@o@ util_sig@o@ $(DEF_LIB) $(CCLINK) -o $@ $(LDFLAGS) \ - db_checkpoint@o@ util_log@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) + db_archive@o@ util_sig@o@ $(DEF_LIB) $(LIBS) $(POSTLINK) $@ -db_deadlock: db_deadlock@o@ util_log@o@ util_sig@o@ @DEFAULT_LIB@ +db_checkpoint: db_checkpoint@o@ util_log@o@ util_sig@o@ $(DEF_LIB) $(CCLINK) -o $@ $(LDFLAGS) \ - db_deadlock@o@ util_log@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) + db_checkpoint@o@ util_log@o@ util_sig@o@ $(DEF_LIB) $(LIBS) $(POSTLINK) $@ -db_dump: db_dump@o@ util_sig@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) db_dump@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -db_dump185: db_dump185@o@ @LIBOBJS@ - $(CCLINK) -o $@ $(LDFLAGS) db_dump185@o@ @LIBOBJS@ $(DB185LIB) - $(POSTLINK) $@ - -db_load: db_load@o@ util_sig@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) db_load@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -db_printlog: db_printlog@o@ util_sig@o@ @DEFAULT_LIB@ +db_deadlock: db_deadlock@o@ util_log@o@ util_sig@o@ $(DEF_LIB) $(CCLINK) -o $@ $(LDFLAGS) \ - db_printlog@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) + db_deadlock@o@ util_log@o@ util_sig@o@ $(DEF_LIB) $(LIBS) $(POSTLINK) $@ -db_recover: db_recover@o@ util_sig@o@ @DEFAULT_LIB@ +db_dump: db_dump@o@ util_cache@o@ util_sig@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) db_dump@o@ util_cache@o@ util_sig@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +db_dump185: db_dump185@o@ @LTLIBOBJS@ + $(CCLINK) -o $@ $(LDFLAGS) db_dump185@o@ @LTLIBOBJS@ $(DB185LIB) + $(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) + $(POSTLINK) $@ + +db_printlog: db_printlog@o@ util_sig@o@ $(DEF_LIB) $(CCLINK) -o $@ $(LDFLAGS) \ - db_recover@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) + db_printlog@o@ util_sig@o@ $(DEF_LIB) $(LIBS) $(POSTLINK) $@ -db_stat: db_stat@o@ util_sig@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) db_stat@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -db_upgrade: db_upgrade@o@ util_sig@o@ @DEFAULT_LIB@ +db_recover: db_recover@o@ util_sig@o@ $(DEF_LIB) $(CCLINK) -o $@ $(LDFLAGS) \ - db_upgrade@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) + db_recover@o@ util_sig@o@ $(DEF_LIB) $(LIBS) $(POSTLINK) $@ -db_verify: db_verify@o@ util_sig@o@ @DEFAULT_LIB@ +db_stat: db_stat@o@ util_cache@o@ util_sig@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) db_stat@o@ util_cache@o@ util_sig@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +db_upgrade: db_upgrade@o@ util_sig@o@ $(DEF_LIB) $(CCLINK) -o $@ $(LDFLAGS) \ - db_verify@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS) + db_upgrade@o@ util_sig@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +db_verify: db_verify@o@ util_cache@o@ util_sig@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) \ + db_verify@o@ util_cache@o@ util_sig@o@ $(DEF_LIB) $(LIBS) $(POSTLINK) $@ ################################################## -# Example programs +# Library and standard utilities install. ################################################## -ex_access: ex_access@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) ex_access@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ +library_install: install_setup +library_install: install_include install_lib install_utilities install_docs -ex_btrec: ex_btrec@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) ex_btrec@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -ex_dbclient: ex_dbclient@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) ex_dbclient@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -ex_env: ex_env@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) ex_env@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -ex_lock: ex_lock@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) ex_lock@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -ex_mpool: ex_mpool@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) ex_mpool@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -ex_thread: ex_thread@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) ex_thread@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -ex_tpcb: ex_tpcb@o@ @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) ex_tpcb@o@ $(LIBDB_ARGS) $(LIBS) - $(POSTLINK) $@ - -################################################## -# Multi-threaded tester. -################################################## -dbs: $(DBSOBJS) @DEFAULT_LIB@ - $(CCLINK) -o $@ $(LDFLAGS) $(DBSOBJS) $(LIBDB_ARGS) @DBS_LIBS@ $(LIBS) - $(POSTLINK) $@ - -################################################## -# Standard Makefile targets. -################################################## -RMLIST= berkeley_db_svc db_dump185 dbs ex_access ex_btrec ex_dbclient \ - ex_env ex_lock ex_mpool ex_thread ex_tpcb -clean: - $(rm) -f $(OBJS) - $(rm) -f $(COBJS) $(DBSOBJS) $(EOBJS) $(CEOBJS) $(JOBJS) - $(rm) -f $(TOBJS) $(UOBJS) $(RPC_OBJS) $(RPC_SRV) - $(rm) -f $(PROGS) $(RMLIST) - $(rm) -f *@o@ *.o *.lo core *.core - $(rm) -rf ALL.OUT TESTDIR - $(rm) -rf .libs $(libdb) $(libcxx) - $(rm) -rf $(libso_target) $(libso) $(libso_default) $(libso_major) - $(rm) -rf $(libxso_target) $(libxso) $(libxso_default) $(libxso_major) - $(rm) -rf $(libtso_target) $(libtso) $(libtso_default) $(libtso_major) - $(rm) -rf $(libjso_target) $(libjso) $(libjso_default) $(libjso_major) - -depend obj: - -realclean distclean: clean - $(rm) -f Makefile config.cache config.log config.status db_config.h - $(rm) -f confdefs.h db.h db_int.h db_185.h include.tcl libtool - -install: all install_setup \ - install_include install_lib install_utilities install_docs - -uninstall: uninstall_utilities uninstall_include uninstall_lib uninstall_docs +uninstall: uninstall_include uninstall_lib uninstall_utilities uninstall_docs install_setup: - @test -f $(chmod) || (echo 'chmod not found.'; exit 1) - @test -f $(cp) || (echo 'cp not found.'; exit 1) - @test -f $(mkdir) || (echo 'mkdir not found.'; exit 1) - @test -f $(rm) || (echo 'rm not found.'; exit 1) + @test -d $(prefix) || \ + ($(mkdir) -p $(prefix) && $(chmod) $(dmode) $(prefix)) +INCDOT= db.h db_cxx.h @ADDITIONAL_INCS@ +INCINC= cxx_common.h cxx_except.h install_include: @echo "Installing DB include files: $(includedir) ..." @test -d $(includedir) || \ ($(mkdir) -p $(includedir) && $(chmod) $(dmode) $(includedir)) - @cd $(includedir) && $(rm) -f db.h db_185.h db_cxx.h - @$(cp) -p db.h \ - $(srcdir)/include/db_cxx.h @ADDITIONAL_INCS@ $(includedir) - @cd $(includedir) && $(chmod) $(fmode) db.h db_cxx.h @ADDITIONAL_INCS@ + @cd $(includedir) && $(rm) -f $(INCDOT) $(INCINC) + @$(cp) -p $(INCDOT) $(includedir) + @cd $(srcdir)/dbinc/ && $(cp) -p $(INCINC) $(includedir) + @cd $(includedir) && $(chmod) $(fmode) $(INCDOT) $(INCINC) uninstall_include: - -cd $(includedir) && $(rm) -f db.h db_185.h db_cxx.h + @cd $(includedir) && $(rm) -f $(INCDOT) $(INCINC) -install_lib: @DEFAULT_INSTALL@ +install_lib: + @echo "Installing DB library: $(libdir) ..." + @test -d $(libdir) || \ + ($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir)) + @cd $(libdir) && $(rm) -f $(LIB_INSTALL_FILE_LIST) + @$(INSTALLER) @INSTALL_LIBS@ $(libdir) + @(cd $(libdir) && \ + test -f $(libso) && $(ln) -s $(libso) $(libso_default); \ + test -f $(libso) && $(ln) -s $(libso) $(libso_major); \ + test -f $(libso_static) && $(ln) -s $(libso_static) $(libdb); \ + test -f $(libxso) && $(ln) -s $(libxso) $(libxso_default); \ + test -f $(libxso) && $(ln) -s $(libxso) $(libxso_major); \ + test -f $(libxso_static) && $(ln) -s $(libxso_static) $(libcxx); \ + 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 $(libj_jarfile) && \ + $(cp) $(libj_jarfile) $(libdir) && \ + $(chmod) $(fmode) $(libdir)/$(libj_jarfile)) || true uninstall_lib: - -cd $(libdir) && $(rm) -f $(libdb) $(libcxx) \ - $(libso_target) $(libso) $(libso_default) $(libso_major) \ - $(libxso_target) $(libxso) $(libxso_default) $(libxso_major) \ - $(libtso_target) $(libtso) $(libtso_default) $(libtso_major) \ - $(libjso_target) $(libjso) $(libjso_default) $(libjso_major) \ - $(libj_jarfile) - -install_static: - @echo "Installing DB library: $(libdir) ..." - @test -d $(libdir) || \ - ($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir)) - @cd $(libdir) && $(rm) -f $(libdb) - @$(cp) -p $(libdb) $(libdir) - @cd $(libdir) && $(chmod) $(fmode) $(libdb) - -install_static_cxx: - @echo "Installing DB C++ static library: $(libdir) ..." - @test -d $(libdir) || \ - ($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir)) - @cd $(libdir) && $(rm) -f $(libcxx) - @$(cp) -p $(libcxx) $(libdir) - @cd $(libdir) && $(chmod) $(fmode) $(libcxx) - -install_dynamic: - @echo "Installing DB library: $(libdir) ..." - @test -d $(libdir) || \ - ($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir)) - @cd $(libdir) && $(rm) -f \ - $(libso_target) $(libso) $(libso_default) $(libso_major) - @$(INSTALLER) $(libso_target) $(libdir) - @cd $(libdir) && $(ln) -s $(libso) $(libso_default) - @cd $(libdir) && $(ln) -s $(libso) $(libso_major) - @$(LIBTOOL) --mode=finish $(libdir) - -install_dynamic_cxx: - @echo "Installing DB C++ library: $(libdir) ..." - @test -d $(libdir) || \ - ($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir)) - @cd $(libdir) && $(rm) -f \ - $(libxso_target) $(libxso) $(libxso_default) $(libxso_major) - @$(INSTALLER) $(libxso_target) $(libdir) - @cd $(libdir) && $(ln) -s $(libxso) $(libxso_default) - @cd $(libdir) && $(ln) -s $(libxso) $(libxso_major) - -install_tcl: - @echo "Installing DB Tcl library: $(libdir) ..." - @test -d $(libdir) || \ - ($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir)) - @cd $(libdir) && $(rm) -f \ - $(libtso_target) $(libtso) $(libtso_default) $(libtso_major) - @$(INSTALLER) $(libtso_target) $(libdir) - @cd $(libdir) && $(ln) -s $(libtso) $(libtso_default) - @cd $(libdir) && $(ln) -s $(libtso) $(libtso_major) - -install_java: - @echo "Installing DB Java library: $(libdir) ..." - @test -d $(libdir) || \ - ($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir)) - @cd $(libdir) && $(rm) -f \ - $(libjso_target) $(libjso) $(libjso_default) $(libjso_major) - @$(INSTALLER) $(libjso_target) $(libdir) - @cd $(libdir) && $(ln) -s $(libjso) $(libjso_default) - @cd $(libdir) && $(ln) -s $(libjso) $(libjso_major) - @cd $(libdir) && $(ln) -s $(libjso) $(libjso_g) - @$(cp) $(JAVA_CLASSTOP)/$(libj_jarfile) $(libdir) + @cd $(libdir) && $(rm) -f $(LIB_INSTALL_FILE_LIST) install_utilities: - @echo "Installing DB utilities: $(bindir) ..." + echo "Installing DB utilities: $(bindir) ..." @test -d $(bindir) || \ ($(mkdir) -p $(bindir) && $(chmod) $(dmode) $(bindir)) - @cd $(bindir) && $(rm) -f $(PROGS) - @$(INSTALLER) -fp $(PROGS) $(bindir) - @cd $(bindir) && (test ! -f $(strip) || $(strip) $(PROGS)) - @cd $(bindir) && $(chmod) $(emode) $(PROGS) + @for i in $(UTIL_PROGS); do \ + $(rm) -f $(bindir)/$$i $(bindir)/$$i.exe; \ + test -f $$i.exe && i=$$i.exe || true; \ + $(INSTALLER) $$i $(bindir)/$$i; \ + test -f $(strip) && $(strip) $(bindir)/$$i || true; \ + $(chmod) $(emode) $(bindir)/$$i; \ + done uninstall_utilities: - -cd $(bindir) && $(rm) -f $(PROGS) + @(cd $(bindir); for i in $(UTIL_PROGS); do \ + $(rm) -f $$i $$i.exe; \ + done) +DOCLIST=\ + api_c api_cxx api_java api_tcl images index.html ref reftoc.html \ + sleepycat utility install_docs: @echo "Installing documentation: $(docdir) ..." @test -d $(docdir) || \ ($(mkdir) -p $(docdir) && $(chmod) $(dmode) $(docdir)) - @cd $(docdir) && $(rm) -rf * - @cd $(srcdir)/docs && $(cp) -pr * $(docdir)/ + @cd $(docdir) && $(rm) -rf $(DOCLIST) + @cd $(srcdir)/docs && $(cp) -pr $(DOCLIST) $(docdir)/ uninstall_docs: - -cd $(docdir) && $(rm) -rf * + @cd $(docdir) && $(rm) -rf $(DOCLIST) ################################################## -# Object build rules. +# RPM, Embedix build and install. +################################################## +RPM_ARCHIVE=db-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@.tar.gz +rpm_build: + @$(rm) -rf BUILD RPMS SOURCES SPECS SRPMS RPM_INSTALL + @$(mkdir) -p BUILD && $(chmod) $(dmode) BUILD + @$(mkdir) -p RPMS/i386 && $(chmod) $(dmode) RPMS RPMS/i386 + @$(mkdir) -p SOURCES && $(chmod) $(dmode) SOURCES + @$(mkdir) -p SPECS && $(chmod) $(dmode) SPECS + @$(mkdir) -p SRPMS && $(chmod) $(dmode) SRPMS + $(cp) @db_cv_path_rpm_archive@/$(RPM_ARCHIVE) SOURCES/ + $(cp) db.spec SPECS/db.spec + $(rpm) --rcfile @CONFIGURATION_PATH@/rpmrc -ba SPECS/db.spec + +rpm_install: + +RPM_SRPMS=db-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@-1.src.rpm +embedix_install: + $(cp) db.ecd @db_cv_path_embedix_install@/config-data/ecds/db.ecd + $(chmod) $(fmode) @db_cv_path_embedix_install@/config-data/ecds/db.ecd + $(cp) SRPMS/$(RPM_SRPMS) \ + @db_cv_path_embedix_install@/Packages/SRPMS/$(RPM_SRPMS) + $(chmod) $(fmode) \ + @db_cv_path_embedix_install@/Packages/SRPMS/$(RPM_SRPMS) + +################################################## +# Remaining standard Makefile targets. +################################################## +CLEAN_LIST=\ + berkeley_db_svc berkeley_db_cxxsvc berkeley_db_javasvc \ + db_dump185 db_perf dbs bench_001 \ + ex_access ex_apprec ex_btrec ex_dbclient ex_env ex_lock ex_mpool \ + ex_repquote ex_thread ex_tpcb excxx_access excxx_btrec excxx_env \ + excxx_lock excxx_mpool excxx_tpcb rpmrc + +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_RPCCLASSES) $(rpc_jarfile) + $(rm) -rf tags *@o@ *.o *.o.lock *.lo core *.core + $(rm) -rf ALL.OUT.* BUILD PARALLEL_TESTDIR.* RPMS RPM_INSTALL + $(rm) -rf RUN_LOG RUNQUEUE SOURCES SPECS SRPMS TESTDIR TESTDIR.A + $(rm) -rf logtrack_seen.db tm .libs $(LIB_INSTALL_FILE_LIST) + +REALCLEAN_LIST=\ + Makefile confdefs.h config.cache config.log config.status db.h \ + db.spec db185_int.h db_185.h db_config.h db_cxx.h db_int.h \ + db_int_def.h include.tcl + +distclean maintainer-clean realclean: clean + $(rm) -rf $(REALCLEAN_LIST) + $(rm) -rf libtool + +check depend dvi info obj TAGS: + @echo "$@: make target not supported" && true + +dist: + @echo "$@: make target not supported" && false + +################################################## +# Multi-threaded testers, benchmarks. +################################################## +dbs@o@: $(srcdir)/test_server/dbs.c + $(CC) $(CFLAGS) $? +dbs_am@o@: $(srcdir)/test_server/dbs_am.c + $(CC) $(CFLAGS) $? +dbs_checkpoint@o@: $(srcdir)/test_server/dbs_checkpoint.c + $(CC) $(CFLAGS) $? +dbs_debug@o@: $(srcdir)/test_server/dbs_debug.c + $(CC) $(CFLAGS) $? +dbs_handles@o@: $(srcdir)/test_server/dbs_handles.c + $(CC) $(CFLAGS) $? +dbs_log@o@: $(srcdir)/test_server/dbs_log.c + $(CC) $(CFLAGS) $? +dbs_qam@o@: $(srcdir)/test_server/dbs_qam.c + $(CC) $(CFLAGS) $? +dbs_spawn@o@: $(srcdir)/test_server/dbs_spawn.c + $(CC) $(CFLAGS) $? +dbs_trickle@o@: $(srcdir)/test_server/dbs_trickle.c + $(CC) $(CFLAGS) $? +dbs_util@o@: $(srcdir)/test_server/dbs_util.c + $(CC) $(CFLAGS) $? +dbs_yield@o@: $(srcdir)/test_server/dbs_yield.c + $(CC) $(CFLAGS) $? +DBS_OBJS=\ + dbs@o@ dbs_am@o@ dbs_checkpoint@o@ dbs_debug@o@ dbs_handles@o@ \ + dbs_log@o@ dbs_qam@o@ dbs_spawn@o@ dbs_trickle@o@ dbs_util@o@ \ + dbs_yield@o@ +dbs: $(DBS_OBJS) $(DEF_LIB) + $(CCLINK) -o $@ \ + $(LDFLAGS) $(DBS_OBJS) $(DEF_LIB) @LOAD_LIBS@ $(LIBS) + $(POSTLINK) $@ + +db_perf@o@: $(srcdir)/test_perf/db_perf.c + $(CC) $(CFLAGS) $? +perf_cache_check@o@: $(srcdir)/test_perf/perf_cache_check.c + $(CC) $(CFLAGS) $? +perf_checkpoint@o@: $(srcdir)/test_perf/perf_checkpoint.c + $(CC) $(CFLAGS) $? +perf_config@o@: $(srcdir)/test_perf/perf_config.c + $(CC) $(CFLAGS) $? +perf_dbs@o@: $(srcdir)/test_perf/perf_dbs.c + $(CC) $(CFLAGS) $? +perf_debug@o@: $(srcdir)/test_perf/perf_debug.c + $(CC) $(CFLAGS) $? +perf_file@o@: $(srcdir)/test_perf/perf_file.c + $(CC) $(CFLAGS) $? +perf_key@o@: $(srcdir)/test_perf/perf_key.c + $(CC) $(CFLAGS) $? +perf_log@o@: $(srcdir)/test_perf/perf_log.c + $(CC) $(CFLAGS) $? +perf_misc@o@: $(srcdir)/test_perf/perf_misc.c + $(CC) $(CFLAGS) $? +perf_op@o@: $(srcdir)/test_perf/perf_op.c + $(CC) $(CFLAGS) $? +perf_parse@o@: $(srcdir)/test_perf/perf_parse.c + $(CC) $(CFLAGS) $? +perf_rand@o@: $(srcdir)/test_perf/perf_rand.c + $(CC) $(CFLAGS) $? +perf_spawn@o@: $(srcdir)/test_perf/perf_spawn.c + $(CC) $(CFLAGS) $? +perf_thread@o@: $(srcdir)/test_perf/perf_thread.c + $(CC) $(CFLAGS) $? +perf_trickle@o@: $(srcdir)/test_perf/perf_trickle.c + $(CC) $(CFLAGS) $? +perf_txn@o@: $(srcdir)/test_perf/perf_txn.c + $(CC) $(CFLAGS) $? +perf_util@o@: $(srcdir)/test_perf/perf_util.c + $(CC) $(CFLAGS) $? +perf_vx@o@: $(srcdir)/test_perf/perf_vx.c + $(CC) $(CFLAGS) $? +DBPERF_OBJS=\ + db_perf@o@ perf_cache_check@o@ perf_checkpoint@o@ perf_config@o@ \ + perf_dbs@o@ perf_debug@o@ perf_file@o@ perf_key@o@ perf_log@o@ \ + perf_misc@o@ perf_op@o@ perf_parse@o@ perf_rand@o@ \ + perf_spawn@o@ perf_thread@o@ perf_trickle@o@ perf_txn@o@ \ + perf_util@o@ perf_vx@o@ +db_perf: $(DBPERF_OBJS) $(DEF_LIB) + $(CCLINK) -o $@ \ + $(LDFLAGS) $(DBPERF_OBJS) $(DEF_LIB) @LOAD_LIBS@ $(LIBS) + $(POSTLINK) $@ + +tm@o@: $(srcdir)/mutex/tm.c + $(CC) $(CFLAGS) $? +tm: tm@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) tm@o@ $(DEF_LIB) @LOAD_LIBS@ $(LIBS) + $(POSTLINK) $@ + +################################################## +# Example programs for C. +################################################## +bench_001@o@: $(srcdir)/examples_c/bench_001.c + $(CC) $(CFLAGS) $? +bench_001: bench_001@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) bench_001@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +ex_access@o@: $(srcdir)/examples_c/ex_access.c + $(CC) $(CFLAGS) $? +ex_access: ex_access@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) ex_access@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +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_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: $(EX_APPREC_OBJS) $(DEF_LIB) + $(CCLINK) -o $@ \ + $(LDFLAGS) $(EX_APPREC_OBJS) $(DEF_LIB) @LOAD_LIBS@ $(LIBS) + +ex_btrec@o@: $(srcdir)/examples_c/ex_btrec.c + $(CC) $(CFLAGS) $? +ex_btrec: ex_btrec@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) ex_btrec@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +ex_dbclient@o@: $(srcdir)/examples_c/ex_dbclient.c + $(CC) $(CFLAGS) $? +ex_dbclient: ex_dbclient@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) ex_dbclient@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +ex_env@o@: $(srcdir)/examples_c/ex_env.c + $(CC) $(CFLAGS) $? +ex_env: ex_env@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) ex_env@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +ex_lock@o@: $(srcdir)/examples_c/ex_lock.c + $(CC) $(CFLAGS) $? +ex_lock: ex_lock@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) ex_lock@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +ex_mpool@o@: $(srcdir)/examples_c/ex_mpool.c + $(CC) $(CFLAGS) $? +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 + $(CC) $(CFLAGS) $? +ex_rq_main@o@: $(srcdir)/examples_c/ex_repquote/ex_rq_main.c + $(CC) $(CFLAGS) $? +ex_rq_master@o@: $(srcdir)/examples_c/ex_repquote/ex_rq_master.c + $(CC) $(CFLAGS) $? +ex_rq_net@o@: $(srcdir)/examples_c/ex_repquote/ex_rq_net.c + $(CC) $(CFLAGS) $? +ex_rq_util@o@: $(srcdir)/examples_c/ex_repquote/ex_rq_util.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) + $(CCLINK) -o $@ \ + $(LDFLAGS) $(EX_RQ_OBJS) $(DEF_LIB) @LOAD_LIBS@ $(LIBS) + $(POSTLINK) $@ + +ex_thread@o@: $(srcdir)/examples_c/ex_thread.c + $(CC) $(CFLAGS) $? +ex_thread: ex_thread@o@ $(DEF_LIB) + $(CCLINK) -o $@ \ + $(LDFLAGS) ex_thread@o@ $(DEF_LIB) @LOAD_LIBS@ $(LIBS) + $(POSTLINK) $@ + +ex_tpcb@o@: $(srcdir)/examples_c/ex_tpcb.c + $(CC) $(CFLAGS) $? +ex_tpcb: ex_tpcb@o@ $(DEF_LIB) + $(CCLINK) -o $@ $(LDFLAGS) ex_tpcb@o@ $(DEF_LIB) $(LIBS) + $(POSTLINK) $@ + +################################################## +# Example programs for C++. +################################################## +AccessExample@o@: $(srcdir)/examples_cxx/AccessExample.cpp + $(CXX) $(CXXFLAGS) $? +excxx_access: AccessExample@o@ $(DEF_LIB_CXX) + $(CXXLINK) -o $@ $(LDFLAGS) AccessExample@o@ $(DEF_LIB_CXX) $(LIBS) + $(POSTLINK) $@ + +BtRecExample@o@: $(srcdir)/examples_cxx/BtRecExample.cpp + $(CXX) $(CXXFLAGS) $? +excxx_btrec: BtRecExample@o@ $(DEF_LIB_CXX) + $(CXXLINK) -o $@ $(LDFLAGS) BtRecExample@o@ $(DEF_LIB_CXX) $(LIBS) + $(POSTLINK) $@ + +EnvExample@o@: $(srcdir)/examples_cxx/EnvExample.cpp + $(CXX) $(CXXFLAGS) $? +excxx_env: EnvExample@o@ $(DEF_LIB_CXX) + $(CXXLINK) -o $@ $(LDFLAGS) EnvExample@o@ $(DEF_LIB_CXX) $(LIBS) + $(POSTLINK) $@ + +LockExample@o@: $(srcdir)/examples_cxx/LockExample.cpp + $(CXX) $(CXXFLAGS) $? +excxx_lock: LockExample@o@ $(DEF_LIB_CXX) + $(CXXLINK) -o $@ $(LDFLAGS) LockExample@o@ $(DEF_LIB_CXX) $(LIBS) + $(POSTLINK) $@ + +MpoolExample@o@: $(srcdir)/examples_cxx/MpoolExample.cpp + $(CXX) $(CXXFLAGS) $? +excxx_mpool: MpoolExample@o@ $(DEF_LIB_CXX) + $(CXXLINK) -o $@ $(LDFLAGS) MpoolExample@o@ $(DEF_LIB_CXX) $(LIBS) + $(POSTLINK) $@ + +TpcbExample@o@: $(srcdir)/examples_cxx/TpcbExample.cpp + $(CXX) $(CXXFLAGS) $? +excxx_tpcb: TpcbExample@o@ $(DEF_LIB_CXX) + $(CXXLINK) -o $@ $(LDFLAGS) TpcbExample@o@ $(DEF_LIB_CXX) $(LIBS) + $(POSTLINK) $@ + +################################################## +# C API build rules. +################################################## +aes_method@o@: $(srcdir)/crypto/aes_method.c + $(CC) $(CFLAGS) $? +bt_compare@o@: $(srcdir)/btree/bt_compare.c + $(CC) $(CFLAGS) $? +bt_conv@o@: $(srcdir)/btree/bt_conv.c + $(CC) $(CFLAGS) $? +bt_curadj@o@: $(srcdir)/btree/bt_curadj.c + $(CC) $(CFLAGS) $? +bt_cursor@o@: $(srcdir)/btree/bt_cursor.c + $(CC) $(CFLAGS) $? +bt_delete@o@: $(srcdir)/btree/bt_delete.c + $(CC) $(CFLAGS) $? +bt_method@o@: $(srcdir)/btree/bt_method.c + $(CC) $(CFLAGS) $? +bt_open@o@: $(srcdir)/btree/bt_open.c + $(CC) $(CFLAGS) $? +bt_put@o@: $(srcdir)/btree/bt_put.c + $(CC) $(CFLAGS) $? +bt_rec@o@: $(srcdir)/btree/bt_rec.c + $(CC) $(CFLAGS) $? +bt_reclaim@o@: $(srcdir)/btree/bt_reclaim.c + $(CC) $(CFLAGS) $? +bt_recno@o@: $(srcdir)/btree/bt_recno.c + $(CC) $(CFLAGS) $? +bt_rsearch@o@: $(srcdir)/btree/bt_rsearch.c + $(CC) $(CFLAGS) $? +bt_search@o@: $(srcdir)/btree/bt_search.c + $(CC) $(CFLAGS) $? +bt_split@o@: $(srcdir)/btree/bt_split.c + $(CC) $(CFLAGS) $? +bt_stack@o@: $(srcdir)/btree/bt_stack.c + $(CC) $(CFLAGS) $? +bt_stat@o@: $(srcdir)/btree/bt_stat.c + $(CC) $(CFLAGS) $? +bt_upgrade@o@: $(srcdir)/btree/bt_upgrade.c + $(CC) $(CFLAGS) $? +bt_verify@o@: $(srcdir)/btree/bt_verify.c + $(CC) $(CFLAGS) $? +btree_auto@o@: $(srcdir)/btree/btree_auto.c + $(CC) $(CFLAGS) $? +crdel_auto@o@: $(srcdir)/db/crdel_auto.c + $(CC) $(CFLAGS) $? +crdel_rec@o@: $(srcdir)/db/crdel_rec.c + $(CC) $(CFLAGS) $? +crypto@o@: $(srcdir)/crypto/crypto.c + $(CC) $(CFLAGS) $? +db185@o@: $(srcdir)/db185/db185.c + $(CC) $(CFLAGS) $? +db@o@: $(srcdir)/db/db.c + $(CC) $(CFLAGS) $? +db_am@o@: $(srcdir)/db/db_am.c + $(CC) $(CFLAGS) $? +db_auto@o@: $(srcdir)/db/db_auto.c + $(CC) $(CFLAGS) $? +db_byteorder@o@: $(srcdir)/common/db_byteorder.c + $(CC) $(CFLAGS) $? +db_cam@o@: $(srcdir)/db/db_cam.c + $(CC) $(CFLAGS) $? +db_conv@o@: $(srcdir)/db/db_conv.c + $(CC) $(CFLAGS) $? +db_dispatch@o@: $(srcdir)/db/db_dispatch.c + $(CC) $(CFLAGS) $? +db_dup@o@: $(srcdir)/db/db_dup.c + $(CC) $(CFLAGS) $? +db_err@o@: $(srcdir)/common/db_err.c + $(CC) $(CFLAGS) $? +db_getlong@o@: $(srcdir)/common/db_getlong.c + $(CC) $(CFLAGS) $? +db_idspace@o@: $(srcdir)/common/db_idspace.c + $(CC) $(CFLAGS) $? +db_iface@o@: $(srcdir)/db/db_iface.c + $(CC) $(CFLAGS) $? +db_join@o@: $(srcdir)/db/db_join.c + $(CC) $(CFLAGS) $? +db_log2@o@: $(srcdir)/common/db_log2.c + $(CC) $(CFLAGS) $? +db_meta@o@: $(srcdir)/db/db_meta.c + $(CC) $(CFLAGS) $? +db_method@o@: $(srcdir)/db/db_method.c + $(CC) $(CFLAGS) $? +db_open@o@: $(srcdir)/db/db_open.c + $(CC) $(CFLAGS) $? +db_overflow@o@: $(srcdir)/db/db_overflow.c + $(CC) $(CFLAGS) $? +db_pr@o@: $(srcdir)/db/db_pr.c + $(CC) $(CFLAGS) $? +db_rec@o@: $(srcdir)/db/db_rec.c + $(CC) $(CFLAGS) $? +db_reclaim@o@: $(srcdir)/db/db_reclaim.c + $(CC) $(CFLAGS) $? +db_rename@o@: $(srcdir)/db/db_rename.c + $(CC) $(CFLAGS) $? +db_remove@o@: $(srcdir)/db/db_remove.c + $(CC) $(CFLAGS) $? +db_ret@o@: $(srcdir)/db/db_ret.c + $(CC) $(CFLAGS) $? +db_salloc@o@: $(srcdir)/env/db_salloc.c + $(CC) $(CFLAGS) $? +db_shash@o@: $(srcdir)/env/db_shash.c + $(CC) $(CFLAGS) $? +db_truncate@o@: $(srcdir)/db/db_truncate.c + $(CC) $(CFLAGS) $? +db_upg@o@: $(srcdir)/db/db_upg.c + $(CC) $(CFLAGS) $? +db_upg_opd@o@: $(srcdir)/db/db_upg_opd.c + $(CC) $(CFLAGS) $? +db_vrfy@o@: $(srcdir)/db/db_vrfy.c + $(CC) $(CFLAGS) $? +db_vrfyutil@o@: $(srcdir)/db/db_vrfyutil.c + $(CC) $(CFLAGS) $? +dbm@o@: $(srcdir)/dbm/dbm.c + $(CC) $(CFLAGS) $? +dbreg@o@: $(srcdir)/dbreg/dbreg.c + $(CC) $(CFLAGS) $? +dbreg_auto@o@: $(srcdir)/dbreg/dbreg_auto.c + $(CC) $(CFLAGS) $? +dbreg_rec@o@: $(srcdir)/dbreg/dbreg_rec.c + $(CC) $(CFLAGS) $? +dbreg_util@o@: $(srcdir)/dbreg/dbreg_util.c + $(CC) $(CFLAGS) $? +env_file@o@: $(srcdir)/env/env_file.c + $(CC) $(CFLAGS) $? +env_method@o@: $(srcdir)/env/env_method.c + $(CC) $(CFLAGS) $? +env_open@o@: $(srcdir)/env/env_open.c + $(CC) $(CFLAGS) $? +env_recover@o@: $(srcdir)/env/env_recover.c + $(CC) $(CFLAGS) $? +env_region@o@: $(srcdir)/env/env_region.c + $(CC) $(CFLAGS) $? +fileops_auto@o@: $(srcdir)/fileops/fileops_auto.c + $(CC) $(CFLAGS) $? +fop_basic@o@: $(srcdir)/fileops/fop_basic.c + $(CC) $(CFLAGS) $? +fop_rec@o@: $(srcdir)/fileops/fop_rec.c + $(CC) $(CFLAGS) $? +fop_util@o@: $(srcdir)/fileops/fop_util.c + $(CC) $(CFLAGS) $? +hash@o@: $(srcdir)/hash/hash.c + $(CC) $(CFLAGS) $? +hash_auto@o@: $(srcdir)/hash/hash_auto.c + $(CC) $(CFLAGS) $? +hash_conv@o@: $(srcdir)/hash/hash_conv.c + $(CC) $(CFLAGS) $? +hash_dup@o@: $(srcdir)/hash/hash_dup.c + $(CC) $(CFLAGS) $? +hash_func@o@: $(srcdir)/hash/hash_func.c + $(CC) $(CFLAGS) $? +hash_meta@o@: $(srcdir)/hash/hash_meta.c + $(CC) $(CFLAGS) $? +hash_method@o@: $(srcdir)/hash/hash_method.c + $(CC) $(CFLAGS) $? +hash_open@o@: $(srcdir)/hash/hash_open.c + $(CC) $(CFLAGS) $? +hash_page@o@: $(srcdir)/hash/hash_page.c + $(CC) $(CFLAGS) $? +hash_rec@o@: $(srcdir)/hash/hash_rec.c + $(CC) $(CFLAGS) $? +hash_reclaim@o@: $(srcdir)/hash/hash_reclaim.c + $(CC) $(CFLAGS) $? +hash_stat@o@: $(srcdir)/hash/hash_stat.c + $(CC) $(CFLAGS) $? +hash_upgrade@o@: $(srcdir)/hash/hash_upgrade.c + $(CC) $(CFLAGS) $? +hash_verify@o@: $(srcdir)/hash/hash_verify.c + $(CC) $(CFLAGS) $? +hmac@o@: $(srcdir)/hmac/hmac.c + $(CC) $(CFLAGS) $? +hsearch@o@: $(srcdir)/hsearch/hsearch.c + $(CC) $(CFLAGS) $? +lock@o@: $(srcdir)/lock/lock.c + $(CC) $(CFLAGS) $? +lock_deadlock@o@:$(srcdir)/lock/lock_deadlock.c + $(CC) $(CFLAGS) $? +lock_method@o@:$(srcdir)/lock/lock_method.c + $(CC) $(CFLAGS) $? +lock_region@o@:$(srcdir)/lock/lock_region.c + $(CC) $(CFLAGS) $? +lock_stat@o@:$(srcdir)/lock/lock_stat.c + $(CC) $(CFLAGS) $? +lock_util@o@:$(srcdir)/lock/lock_util.c + $(CC) $(CFLAGS) $? +log@o@: $(srcdir)/log/log.c + $(CC) $(CFLAGS) $? +log_archive@o@: $(srcdir)/log/log_archive.c + $(CC) $(CFLAGS) $? +log_compare@o@: $(srcdir)/log/log_compare.c + $(CC) $(CFLAGS) $? +log_get@o@: $(srcdir)/log/log_get.c + $(CC) $(CFLAGS) $? +log_method@o@: $(srcdir)/log/log_method.c + $(CC) $(CFLAGS) $? +log_put@o@: $(srcdir)/log/log_put.c + $(CC) $(CFLAGS) $? +mp_alloc@o@: $(srcdir)/mp/mp_alloc.c + $(CC) $(CFLAGS) $? +mp_bh@o@: $(srcdir)/mp/mp_bh.c + $(CC) $(CFLAGS) $? +mp_fget@o@: $(srcdir)/mp/mp_fget.c + $(CC) $(CFLAGS) $? +mp_fopen@o@: $(srcdir)/mp/mp_fopen.c + $(CC) $(CFLAGS) $? +mp_fput@o@: $(srcdir)/mp/mp_fput.c + $(CC) $(CFLAGS) $? +mp_fset@o@: $(srcdir)/mp/mp_fset.c + $(CC) $(CFLAGS) $? +mp_method@o@: $(srcdir)/mp/mp_method.c + $(CC) $(CFLAGS) $? +mp_region@o@: $(srcdir)/mp/mp_region.c + $(CC) $(CFLAGS) $? +mp_register@o@: $(srcdir)/mp/mp_register.c + $(CC) $(CFLAGS) $? +mp_stat@o@: $(srcdir)/mp/mp_stat.c + $(CC) $(CFLAGS) $? +mp_sync@o@: $(srcdir)/mp/mp_sync.c + $(CC) $(CFLAGS) $? +mp_trickle@o@: $(srcdir)/mp/mp_trickle.c + $(CC) $(CFLAGS) $? +mt19937db@o@: $(srcdir)/crypto/mersenne/mt19937db.c + $(CC) $(CFLAGS) $? +mut_fcntl@o@: $(srcdir)/mutex/mut_fcntl.c + $(CC) $(CFLAGS) $? +mut_pthread@o@: $(srcdir)/mutex/mut_pthread.c + $(CC) $(CFLAGS) $? +mut_tas@o@: $(srcdir)/mutex/mut_tas.c + $(CC) $(CFLAGS) $? +mutex@o@: $(srcdir)/mutex/mutex.c + $(CC) $(CFLAGS) $? +os_abs@o@: $(srcdir)/os/os_abs.c + $(CC) $(CFLAGS) $? +os_alloc@o@: $(srcdir)/os/os_alloc.c + $(CC) $(CFLAGS) $? +os_clock@o@: $(srcdir)/os/os_clock.c + $(CC) $(CFLAGS) $? +os_config@o@: $(srcdir)/os/os_config.c + $(CC) $(CFLAGS) $? +os_dir@o@: $(srcdir)/os/os_dir.c + $(CC) $(CFLAGS) $? +os_errno@o@: $(srcdir)/os/os_errno.c + $(CC) $(CFLAGS) $? +os_fid@o@: $(srcdir)/os/os_fid.c + $(CC) $(CFLAGS) $? +os_fsync@o@: $(srcdir)/os/os_fsync.c + $(CC) $(CFLAGS) $? +os_id@o@: $(srcdir)/os/os_id.c + $(CC) $(CFLAGS) $? +os_handle@o@: $(srcdir)/os/os_handle.c + $(CC) $(CFLAGS) $? +os_map@o@: $(srcdir)/os/os_map.c + $(CC) $(CFLAGS) $? +os_method@o@: $(srcdir)/os/os_method.c + $(CC) $(CFLAGS) $? +os_oflags@o@: $(srcdir)/os/os_oflags.c + $(CC) $(CFLAGS) $? +os_open@o@: $(srcdir)/os/os_open.c + $(CC) $(CFLAGS) $? +os_region@o@: $(srcdir)/os/os_region.c + $(CC) $(CFLAGS) $? +os_rename@o@: $(srcdir)/os/os_rename.c + $(CC) $(CFLAGS) $? +os_root@o@: $(srcdir)/os/os_root.c + $(CC) $(CFLAGS) $? +os_rpath@o@: $(srcdir)/os/os_rpath.c + $(CC) $(CFLAGS) $? +os_rw@o@: $(srcdir)/os/os_rw.c + $(CC) $(CFLAGS) $? +os_seek@o@: $(srcdir)/os/os_seek.c + $(CC) $(CFLAGS) $? +os_sleep@o@: $(srcdir)/os/os_sleep.c + $(CC) $(CFLAGS) $? +os_spin@o@: $(srcdir)/os/os_spin.c + $(CC) $(CFLAGS) $? +os_stat@o@: $(srcdir)/os/os_stat.c + $(CC) $(CFLAGS) $? +os_tmpdir@o@: $(srcdir)/os/os_tmpdir.c + $(CC) $(CFLAGS) $? +os_unlink@o@: $(srcdir)/os/os_unlink.c + $(CC) $(CFLAGS) $? +qam@o@: $(srcdir)/qam/qam.c + $(CC) $(CFLAGS) $? +qam_auto@o@: $(srcdir)/qam/qam_auto.c + $(CC) $(CFLAGS) $? +qam_conv@o@: $(srcdir)/qam/qam_conv.c + $(CC) $(CFLAGS) $? +qam_files@o@: $(srcdir)/qam/qam_files.c + $(CC) $(CFLAGS) $? +qam_method@o@: $(srcdir)/qam/qam_method.c + $(CC) $(CFLAGS) $? +qam_open@o@: $(srcdir)/qam/qam_open.c + $(CC) $(CFLAGS) $? +qam_rec@o@: $(srcdir)/qam/qam_rec.c + $(CC) $(CFLAGS) $? +qam_stat@o@: $(srcdir)/qam/qam_stat.c + $(CC) $(CFLAGS) $? +qam_upgrade@o@: $(srcdir)/qam/qam_upgrade.c + $(CC) $(CFLAGS) $? +qam_verify@o@: $(srcdir)/qam/qam_verify.c + $(CC) $(CFLAGS) $? +rep_method@o@: $(srcdir)/rep/rep_method.c + $(CC) $(CFLAGS) $? +rep_record@o@: $(srcdir)/rep/rep_record.c + $(CC) $(CFLAGS) $? +rep_region@o@: $(srcdir)/rep/rep_region.c + $(CC) $(CFLAGS) $? +rep_util@o@: $(srcdir)/rep/rep_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 + $(CC) $(CFLAGS) $? +sha1@o@: $(srcdir)/hmac/sha1.c + $(CC) $(CFLAGS) $? +txn@o@: $(srcdir)/txn/txn.c + $(CC) $(CFLAGS) $? +txn_auto@o@: $(srcdir)/txn/txn_auto.c + $(CC) $(CFLAGS) $? +txn_method@o@: $(srcdir)/txn/txn_method.c + $(CC) $(CFLAGS) $? +txn_rec@o@: $(srcdir)/txn/txn_rec.c + $(CC) $(CFLAGS) $? +txn_recover@o@: $(srcdir)/txn/txn_recover.c + $(CC) $(CFLAGS) $? +txn_region@o@: $(srcdir)/txn/txn_region.c + $(CC) $(CFLAGS) $? +txn_stat@o@: $(srcdir)/txn/txn_stat.c + $(CC) $(CFLAGS) $? +txn_util@o@: $(srcdir)/txn/txn_util.c + $(CC) $(CFLAGS) $? +util_cache@o@: $(srcdir)/common/util_cache.c + $(CC) $(CFLAGS) $? +util_log@o@: $(srcdir)/common/util_log.c + $(CC) $(CFLAGS) $? +util_sig@o@: $(srcdir)/common/util_sig.c + $(CC) $(CFLAGS) $? +uts4_cc@o@: $(srcdir)/mutex/uts4_cc.s + $(AS) $(ASFLAGS) -o $@ $? +xa@o@: $(srcdir)/xa/xa.c + $(CC) $(CFLAGS) $? +xa_db@o@: $(srcdir)/xa/xa_db.c + $(CC) $(CFLAGS) $? +xa_map@o@: $(srcdir)/xa/xa_map.c + $(CC) $(CFLAGS) $? + +################################################## +# C++ API build rules. +################################################## +cxx_db@o@: $(srcdir)/cxx/cxx_db.cpp + $(CXX) $(CXXFLAGS) $? +cxx_dbc@o@: $(srcdir)/cxx/cxx_dbc.cpp + $(CXX) $(CXXFLAGS) $? +cxx_dbt@o@: $(srcdir)/cxx/cxx_dbt.cpp + $(CXX) $(CXXFLAGS) $? +cxx_env@o@: $(srcdir)/cxx/cxx_env.cpp + $(CXX) $(CXXFLAGS) $? +cxx_except@o@: $(srcdir)/cxx/cxx_except.cpp + $(CXX) $(CXXFLAGS) $? +cxx_lock@o@: $(srcdir)/cxx/cxx_lock.cpp + $(CXX) $(CXXFLAGS) $? +cxx_logc@o@: $(srcdir)/cxx/cxx_logc.cpp + $(CXX) $(CXXFLAGS) $? +cxx_mpool@o@: $(srcdir)/cxx/cxx_mpool.cpp + $(CXX) $(CXXFLAGS) $? +cxx_txn@o@: $(srcdir)/cxx/cxx_txn.cpp + $(CXX) $(CXXFLAGS) $? + +################################################## +# Java API build rules. +################################################## +java_Db@o@::$(srcdir)/libdb_java/java_Db.c + $(CC) $(CFLAGS) $? +java_DbEnv@o@: $(srcdir)/libdb_java/java_DbEnv.c + $(CC) $(CFLAGS) $? +java_DbLock@o@: $(srcdir)/libdb_java/java_DbLock.c + $(CC) $(CFLAGS) $? +java_DbLogc@o@: $(srcdir)/libdb_java/java_DbLogc.c + $(CC) $(CFLAGS) $? +java_DbLsn@o@: $(srcdir)/libdb_java/java_DbLsn.c + $(CC) $(CFLAGS) $? +java_DbTxn@o@: $(srcdir)/libdb_java/java_DbTxn.c + $(CC) $(CFLAGS) $? +java_DbUtil@o@: $(srcdir)/libdb_java/java_DbUtil.c + $(CC) $(CFLAGS) $? +java_Dbc@o@: $(srcdir)/libdb_java/java_Dbc.c + $(CC) $(CFLAGS) $? +java_Dbt@o@: $(srcdir)/libdb_java/java_Dbt.c + $(CC) $(CFLAGS) $? +java_info@o@: $(srcdir)/libdb_java/java_info.c + $(CC) $(CFLAGS) $? +java_locked@o@: $(srcdir)/libdb_java/java_locked.c + $(CC) $(CFLAGS) $? +java_util@o@: $(srcdir)/libdb_java/java_util.c + $(CC) $(CFLAGS) $? +java_stat_auto@o@: $(srcdir)/libdb_java/java_stat_auto.c + $(CC) $(CFLAGS) $? + +################################################## +# Tcl API build rules. +################################################## +tcl_compat@o@: $(srcdir)/tcl/tcl_compat.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_db@o@: $(srcdir)/tcl/tcl_db.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_db_pkg@o@: $(srcdir)/tcl/tcl_db_pkg.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_dbcursor@o@: $(srcdir)/tcl/tcl_dbcursor.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_env@o@: $(srcdir)/tcl/tcl_env.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_internal@o@: $(srcdir)/tcl/tcl_internal.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_lock@o@: $(srcdir)/tcl/tcl_lock.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_log@o@: $(srcdir)/tcl/tcl_log.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_mp@o@: $(srcdir)/tcl/tcl_mp.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_rep@o@: $(srcdir)/tcl/tcl_rep.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_txn@o@: $(srcdir)/tcl/tcl_txn.c + $(CC) $(CFLAGS) $(TCFLAGS) $? +tcl_util@o@: $(srcdir)/tcl/tcl_util.c + $(CC) $(CFLAGS) $(TCFLAGS) $? + +################################################## +# RPC build rules. +################################################## +# RPC client files +client@o@: $(srcdir)/rpc_client/client.c + $(CC) $(CFLAGS) $? +db_server_clnt@o@: $(srcdir)/rpc_client/db_server_clnt.c + $(CC) $(CFLAGS) $? +gen_client@o@: $(srcdir)/rpc_client/gen_client.c + $(CC) $(CFLAGS) $? +gen_client_ret@o@: $(srcdir)/rpc_client/gen_client_ret.c + $(CC) $(CFLAGS) $? + +# RPC server files +db_server_proc@o@: $(srcdir)/rpc_server/c/db_server_proc.c + $(CC) $(CFLAGS) $? +db_server_svc@o@: $(srcdir)/rpc_server/c/db_server_svc.c + $(CC) $(CFLAGS) $? +db_server_util@o@: $(srcdir)/rpc_server/c/db_server_util.c + $(CC) $(CFLAGS) $? +db_server_xdr@o@: $(srcdir)/rpc_server/c/db_server_xdr.c + $(CC) $(CFLAGS) $? +gen_db_server@o@: $(srcdir)/rpc_server/c/gen_db_server.c + $(CC) $(CFLAGS) $? +db_server_cxxproc@o@: $(srcdir)/rpc_server/cxx/db_server_cxxproc.cpp + $(CXX) $(CXXFLAGS) $? +db_server_cxxutil@o@: $(srcdir)/rpc_server/cxx/db_server_cxxutil.cpp + $(CXX) $(CXXFLAGS) $? + +################################################## +# Utility build rules. ################################################## -# Utilities db_archive@o@: $(srcdir)/db_archive/db_archive.c $(CC) $(CFLAGS) $? db_checkpoint@o@: $(srcdir)/db_checkpoint/db_checkpoint.c @@ -537,446 +1370,9 @@ db_upgrade@o@: $(srcdir)/db_upgrade/db_upgrade.c db_verify@o@: $(srcdir)/db_verify/db_verify.c $(CC) $(CFLAGS) $? -# Examples -ex_access@o@: $(srcdir)/examples_c/ex_access.c - $(CC) $(CFLAGS) $? -ex_btrec@o@: $(srcdir)/examples_c/ex_btrec.c - $(CC) $(CFLAGS) $? -ex_dbclient@o@: $(srcdir)/examples_c/ex_dbclient.c - $(CC) $(CFLAGS) $? -ex_env@o@: $(srcdir)/examples_c/ex_env.c - $(CC) $(CFLAGS) $? -ex_lock@o@: $(srcdir)/examples_c/ex_lock.c - $(CC) $(CFLAGS) $? -ex_mpool@o@: $(srcdir)/examples_c/ex_mpool.c - $(CC) $(CFLAGS) $? -ex_thread@o@: $(srcdir)/examples_c/ex_thread.c - $(CC) $(CFLAGS) $? -ex_tpcb@o@: $(srcdir)/examples_c/ex_tpcb.c - $(CC) $(CFLAGS) $? - -# DB files -crdel_auto@o@: $(srcdir)/db/crdel_auto.c - $(CC) $(CFLAGS) $? -crdel_rec@o@: $(srcdir)/db/crdel_rec.c - $(CC) $(CFLAGS) $? -db@o@: $(srcdir)/db/db.c - $(CC) $(CFLAGS) $? -db_am@o@: $(srcdir)/db/db_am.c - $(CC) $(CFLAGS) $? -db_auto@o@: $(srcdir)/db/db_auto.c - $(CC) $(CFLAGS) $? -db_cam@o@: $(srcdir)/db/db_cam.c - $(CC) $(CFLAGS) $? -db_conv@o@: $(srcdir)/db/db_conv.c - $(CC) $(CFLAGS) $? -db_dispatch@o@: $(srcdir)/db/db_dispatch.c - $(CC) $(CFLAGS) $? -db_dup@o@: $(srcdir)/db/db_dup.c - $(CC) $(CFLAGS) $? -db_iface@o@: $(srcdir)/db/db_iface.c - $(CC) $(CFLAGS) $? -db_join@o@: $(srcdir)/db/db_join.c - $(CC) $(CFLAGS) $? -db_meta@o@: $(srcdir)/db/db_meta.c - $(CC) $(CFLAGS) $? -db_method@o@: $(srcdir)/db/db_method.c - $(CC) $(CFLAGS) $? -db_overflow@o@: $(srcdir)/db/db_overflow.c - $(CC) $(CFLAGS) $? -db_pr@o@: $(srcdir)/db/db_pr.c - $(CC) $(CFLAGS) $? -db_rec@o@: $(srcdir)/db/db_rec.c - $(CC) $(CFLAGS) $? -db_reclaim@o@: $(srcdir)/db/db_reclaim.c - $(CC) $(CFLAGS) $? -db_ret@o@: $(srcdir)/db/db_ret.c - $(CC) $(CFLAGS) $? -db_upg@o@: $(srcdir)/db/db_upg.c - $(CC) $(CFLAGS) $? -db_upg_opd@o@: $(srcdir)/db/db_upg_opd.c - $(CC) $(CFLAGS) $? -db_vrfy@o@: $(srcdir)/db/db_vrfy.c - $(CC) $(CFLAGS) $? -db_vrfyutil@o@: $(srcdir)/db/db_vrfyutil.c - $(CC) $(CFLAGS) $? - -# Environment files -db_salloc@o@: $(srcdir)/env/db_salloc.c - $(CC) $(CFLAGS) $? -db_shash@o@: $(srcdir)/env/db_shash.c - $(CC) $(CFLAGS) $? -env_method@o@: $(srcdir)/env/env_method.c - $(CC) $(CFLAGS) $? -env_open@o@: $(srcdir)/env/env_open.c - $(CC) $(CFLAGS) $? -env_recover@o@: $(srcdir)/env/env_recover.c - $(CC) $(CFLAGS) $? -env_region@o@: $(srcdir)/env/env_region.c - $(CC) $(CFLAGS) $? - -# Common files -db_byteorder@o@: $(srcdir)/common/db_byteorder.c - $(CC) $(CFLAGS) $? -db_err@o@: $(srcdir)/common/db_err.c - $(CC) $(CFLAGS) $? -db_getlong@o@: $(srcdir)/common/db_getlong.c - $(CC) $(CFLAGS) $? -db_log2@o@: $(srcdir)/common/db_log2.c - $(CC) $(CFLAGS) $? -util_log@o@: $(srcdir)/common/util_log.c - $(CC) $(CFLAGS) $? -util_sig@o@: $(srcdir)/common/util_sig.c - $(CC) $(CFLAGS) $? - -# Btree files -bt_compare@o@: $(srcdir)/btree/bt_compare.c - $(CC) $(CFLAGS) $? -bt_conv@o@: $(srcdir)/btree/bt_conv.c - $(CC) $(CFLAGS) $? -bt_curadj@o@: $(srcdir)/btree/bt_curadj.c - $(CC) $(CFLAGS) $? -bt_cursor@o@: $(srcdir)/btree/bt_cursor.c - $(CC) $(CFLAGS) $? -bt_delete@o@: $(srcdir)/btree/bt_delete.c - $(CC) $(CFLAGS) $? -bt_method@o@: $(srcdir)/btree/bt_method.c - $(CC) $(CFLAGS) $? -bt_open@o@: $(srcdir)/btree/bt_open.c - $(CC) $(CFLAGS) $? -bt_put@o@: $(srcdir)/btree/bt_put.c - $(CC) $(CFLAGS) $? -bt_rec@o@: $(srcdir)/btree/bt_rec.c - $(CC) $(CFLAGS) $? -bt_reclaim@o@: $(srcdir)/btree/bt_reclaim.c - $(CC) $(CFLAGS) $? -bt_recno@o@: $(srcdir)/btree/bt_recno.c - $(CC) $(CFLAGS) $? -bt_rsearch@o@: $(srcdir)/btree/bt_rsearch.c - $(CC) $(CFLAGS) $? -bt_search@o@: $(srcdir)/btree/bt_search.c - $(CC) $(CFLAGS) $? -bt_split@o@: $(srcdir)/btree/bt_split.c - $(CC) $(CFLAGS) $? -bt_stack@o@: $(srcdir)/btree/bt_stack.c - $(CC) $(CFLAGS) $? -bt_stat@o@: $(srcdir)/btree/bt_stat.c - $(CC) $(CFLAGS) $? -bt_upgrade@o@: $(srcdir)/btree/bt_upgrade.c - $(CC) $(CFLAGS) $? -bt_verify@o@: $(srcdir)/btree/bt_verify.c - $(CC) $(CFLAGS) $? -btree_auto@o@: $(srcdir)/btree/btree_auto.c - $(CC) $(CFLAGS) $? - -# Queue files -qam@o@: $(srcdir)/qam/qam.c - $(CC) $(CFLAGS) $? -qam_auto@o@: $(srcdir)/qam/qam_auto.c - $(CC) $(CFLAGS) $? -qam_conv@o@: $(srcdir)/qam/qam_conv.c - $(CC) $(CFLAGS) $? -qam_files@o@: $(srcdir)/qam/qam_files.c - $(CC) $(CFLAGS) $? -qam_method@o@: $(srcdir)/qam/qam_method.c - $(CC) $(CFLAGS) $? -qam_open@o@: $(srcdir)/qam/qam_open.c - $(CC) $(CFLAGS) $? -qam_rec@o@: $(srcdir)/qam/qam_rec.c - $(CC) $(CFLAGS) $? -qam_stat@o@: $(srcdir)/qam/qam_stat.c - $(CC) $(CFLAGS) $? -qam_upgrade@o@: $(srcdir)/qam/qam_upgrade.c - $(CC) $(CFLAGS) $? -qam_verify@o@: $(srcdir)/qam/qam_verify.c - $(CC) $(CFLAGS) $? - -# C++ files -cxx_app@o@: $(srcdir)/cxx/cxx_app.cpp - $(CXX) $(CXXFLAGS) $? -cxx_except@o@: $(srcdir)/cxx/cxx_except.cpp - $(CXX) $(CXXFLAGS) $? -cxx_lock@o@: $(srcdir)/cxx/cxx_lock.cpp - $(CXX) $(CXXFLAGS) $? -cxx_log@o@: $(srcdir)/cxx/cxx_log.cpp - $(CXX) $(CXXFLAGS) $? -cxx_mpool@o@: $(srcdir)/cxx/cxx_mpool.cpp - $(CXX) $(CXXFLAGS) $? -cxx_table@o@: $(srcdir)/cxx/cxx_table.cpp - $(CXX) $(CXXFLAGS) $? -cxx_txn@o@: $(srcdir)/cxx/cxx_txn.cpp - $(CXX) $(CXXFLAGS) $? - -# Java files -java_Db@o@::$(srcdir)/libdb_java/java_Db.c - $(CC) $(CFLAGS) $? -java_DbEnv@o@: $(srcdir)/libdb_java/java_DbEnv.c - $(CC) $(CFLAGS) $? -java_DbLock@o@: $(srcdir)/libdb_java/java_DbLock.c - $(CC) $(CFLAGS) $? -java_DbLsn@o@: $(srcdir)/libdb_java/java_DbLsn.c - $(CC) $(CFLAGS) $? -java_DbTxn@o@: $(srcdir)/libdb_java/java_DbTxn.c - $(CC) $(CFLAGS) $? -java_Dbc@o@: $(srcdir)/libdb_java/java_Dbc.c - $(CC) $(CFLAGS) $? -java_Dbt@o@: $(srcdir)/libdb_java/java_Dbt.c - $(CC) $(CFLAGS) $? -java_info@o@: $(srcdir)/libdb_java/java_info.c - $(CC) $(CFLAGS) $? -java_locked@o@: $(srcdir)/libdb_java/java_locked.c - $(CC) $(CFLAGS) $? -java_util@o@: $(srcdir)/libdb_java/java_util.c - $(CC) $(CFLAGS) $? - -# Tcl files -tcl_compat@o@: $(srcdir)/tcl/tcl_compat.c - $(CC) $(CFLAGS) $(TCFLAGS) $? -tcl_db@o@: $(srcdir)/tcl/tcl_db.c - $(CC) $(CFLAGS) $(TCFLAGS) $? -tcl_db_pkg@o@: $(srcdir)/tcl/tcl_db_pkg.c - $(CC) $(CFLAGS) $(TCFLAGS) $? -tcl_dbcursor@o@: $(srcdir)/tcl/tcl_dbcursor.c - $(CC) $(CFLAGS) $(TCFLAGS) $? -tcl_env@o@: $(srcdir)/tcl/tcl_env.c - $(CC) $(CFLAGS) $(TCFLAGS) $? -tcl_internal@o@: $(srcdir)/tcl/tcl_internal.c - $(CC) $(CFLAGS) $(TCFLAGS) $? -tcl_lock@o@: $(srcdir)/tcl/tcl_lock.c - $(CC) $(CFLAGS) $(TCFLAGS) $? -tcl_log@o@: $(srcdir)/tcl/tcl_log.c - $(CC) $(CFLAGS) $(TCFLAGS) $? -tcl_mp@o@: $(srcdir)/tcl/tcl_mp.c - $(CC) $(CFLAGS) $(TCFLAGS) $? -tcl_txn@o@: $(srcdir)/tcl/tcl_txn.c - $(CC) $(CFLAGS) $(TCFLAGS) $? - -# Hash files -hash_auto@o@: $(srcdir)/hash/hash_auto.c - $(CC) $(CFLAGS) $? -hash@o@: $(srcdir)/hash/hash.c - $(CC) $(CFLAGS) $? -hash_conv@o@: $(srcdir)/hash/hash_conv.c - $(CC) $(CFLAGS) $? -hash_dup@o@: $(srcdir)/hash/hash_dup.c - $(CC) $(CFLAGS) $? -hash_func@o@: $(srcdir)/hash/hash_func.c - $(CC) $(CFLAGS) $? -hash_meta@o@: $(srcdir)/hash/hash_meta.c - $(CC) $(CFLAGS) $? -hash_method@o@: $(srcdir)/hash/hash_method.c - $(CC) $(CFLAGS) $? -hash_page@o@: $(srcdir)/hash/hash_page.c - $(CC) $(CFLAGS) $? -hash_rec@o@: $(srcdir)/hash/hash_rec.c - $(CC) $(CFLAGS) $? -hash_reclaim@o@: $(srcdir)/hash/hash_reclaim.c - $(CC) $(CFLAGS) $? -hash_stat@o@: $(srcdir)/hash/hash_stat.c - $(CC) $(CFLAGS) $? -hash_upgrade@o@: $(srcdir)/hash/hash_upgrade.c - $(CC) $(CFLAGS) $? -hash_verify@o@: $(srcdir)/hash/hash_verify.c - $(CC) $(CFLAGS) $? - -# Lock files -lock@o@: $(srcdir)/lock/lock.c - $(CC) $(CFLAGS) $? -lock_conflict@o@:$(srcdir)/lock/lock_conflict.c - $(CC) $(CFLAGS) $? -lock_deadlock@o@:$(srcdir)/lock/lock_deadlock.c - $(CC) $(CFLAGS) $? -lock_method@o@:$(srcdir)/lock/lock_method.c - $(CC) $(CFLAGS) $? -lock_region@o@:$(srcdir)/lock/lock_region.c - $(CC) $(CFLAGS) $? -lock_stat@o@:$(srcdir)/lock/lock_stat.c - $(CC) $(CFLAGS) $? -lock_util@o@:$(srcdir)/lock/lock_util.c - $(CC) $(CFLAGS) $? - -# Log files -log@o@: $(srcdir)/log/log.c - $(CC) $(CFLAGS) $? -log_archive@o@: $(srcdir)/log/log_archive.c - $(CC) $(CFLAGS) $? -log_auto@o@: $(srcdir)/log/log_auto.c - $(CC) $(CFLAGS) $? -log_compare@o@: $(srcdir)/log/log_compare.c - $(CC) $(CFLAGS) $? -log_findckp@o@: $(srcdir)/log/log_findckp.c - $(CC) $(CFLAGS) $? -log_get@o@: $(srcdir)/log/log_get.c - $(CC) $(CFLAGS) $? -log_method@o@: $(srcdir)/log/log_method.c - $(CC) $(CFLAGS) $? -log_put@o@: $(srcdir)/log/log_put.c - $(CC) $(CFLAGS) $? -log_rec@o@: $(srcdir)/log/log_rec.c - $(CC) $(CFLAGS) $? -log_register@o@: $(srcdir)/log/log_register.c - $(CC) $(CFLAGS) $? - -# Mpool files -mp_alloc@o@: $(srcdir)/mp/mp_alloc.c - $(CC) $(CFLAGS) $? -mp_bh@o@: $(srcdir)/mp/mp_bh.c - $(CC) $(CFLAGS) $? -mp_fget@o@: $(srcdir)/mp/mp_fget.c - $(CC) $(CFLAGS) $? -mp_fopen@o@: $(srcdir)/mp/mp_fopen.c - $(CC) $(CFLAGS) $? -mp_fput@o@: $(srcdir)/mp/mp_fput.c - $(CC) $(CFLAGS) $? -mp_fset@o@: $(srcdir)/mp/mp_fset.c - $(CC) $(CFLAGS) $? -mp_method@o@: $(srcdir)/mp/mp_method.c - $(CC) $(CFLAGS) $? -mp_region@o@: $(srcdir)/mp/mp_region.c - $(CC) $(CFLAGS) $? -mp_register@o@: $(srcdir)/mp/mp_register.c - $(CC) $(CFLAGS) $? -mp_stat@o@: $(srcdir)/mp/mp_stat.c - $(CC) $(CFLAGS) $? -mp_sync@o@: $(srcdir)/mp/mp_sync.c - $(CC) $(CFLAGS) $? -mp_trickle@o@: $(srcdir)/mp/mp_trickle.c - $(CC) $(CFLAGS) $? - -# Mutex files -mutex@o@: $(srcdir)/mutex/mutex.c - $(CC) $(CFLAGS) $? -mut_fcntl@o@: $(srcdir)/mutex/mut_fcntl.c - $(CC) $(CFLAGS) $? -mut_pthread@o@: $(srcdir)/mutex/mut_pthread.c - $(CC) $(CFLAGS) $? -mut_tas@o@: $(srcdir)/mutex/mut_tas.c - $(CC) $(CFLAGS) $? -# UTS4 spinlock assembly. -uts4_cc@o@: $(srcdir)/mutex/uts4_cc.s - $(AS) $(ASFLAGS) -o $@ $? - -# Transaction files -txn@o@: $(srcdir)/txn/txn.c - $(CC) $(CFLAGS) $? -txn_auto@o@: $(srcdir)/txn/txn_auto.c - $(CC) $(CFLAGS) $? -txn_rec@o@: $(srcdir)/txn/txn_rec.c - $(CC) $(CFLAGS) $? -txn_region@o@: $(srcdir)/txn/txn_region.c - $(CC) $(CFLAGS) $? - -# XA files -xa@o@: $(srcdir)/xa/xa.c - $(CC) $(CFLAGS) $? -xa_db@o@: $(srcdir)/xa/xa_db.c - $(CC) $(CFLAGS) $? -xa_map@o@: $(srcdir)/xa/xa_map.c - $(CC) $(CFLAGS) $? - -# RPC client files -client@o@: $(srcdir)/rpc_client/client.c - $(CC) $(CFLAGS) $? -db_server_clnt@o@: $(srcdir)/rpc_client/db_server_clnt.c - $(CC) $(CFLAGS) $? -gen_client@o@: $(srcdir)/rpc_client/gen_client.c - $(CC) $(CFLAGS) $? -gen_client_ret@o@: $(srcdir)/rpc_client/gen_client_ret.c - $(CC) $(CFLAGS) $? - -# RPC server files -db_server_proc@o@: $(srcdir)/rpc_server/db_server_proc.c - $(CC) $(CFLAGS) $? -db_server_svc@o@: $(srcdir)/rpc_server/db_server_svc.c - $(CC) $(CFLAGS) $? -db_server_util@o@: $(srcdir)/rpc_server/db_server_util.c - $(CC) $(CFLAGS) $? -db_server_xdr@o@: $(srcdir)/rpc_server/db_server_xdr.c - $(CC) $(CFLAGS) $? -gen_db_server@o@: $(srcdir)/rpc_server/gen_db_server.c - $(CC) $(CFLAGS) $? - -# Historic compatibility files -db185@o@: $(srcdir)/db185/db185.c - $(CC) $(CFLAGS) $? -dbm@o@: $(srcdir)/dbm/dbm.c - $(CC) $(CFLAGS) $? -hsearch@o@: $(srcdir)/hsearch/hsearch.c - $(CC) $(CFLAGS) $? - -# OS specific files -os_abs@o@: $(srcdir)/os/os_abs.c - $(CC) $(CFLAGS) $? -os_alloc@o@: $(srcdir)/os/os_alloc.c - $(CC) $(CFLAGS) $? -os_dir@o@: $(srcdir)/os/os_dir.c - $(CC) $(CFLAGS) $? -os_errno@o@: $(srcdir)/os/os_errno.c - $(CC) $(CFLAGS) $? -os_fid@o@: $(srcdir)/os/os_fid.c - $(CC) $(CFLAGS) $? -os_finit@o@: $(srcdir)/os/os_finit.c - $(CC) $(CFLAGS) $? -os_fsync@o@: $(srcdir)/os/os_fsync.c - $(CC) $(CFLAGS) $? -os_handle@o@: $(srcdir)/os/os_handle.c - $(CC) $(CFLAGS) $? -os_map@o@: $(srcdir)/os/os_map.c - $(CC) $(CFLAGS) $? -os_method@o@: $(srcdir)/os/os_method.c - $(CC) $(CFLAGS) $? -os_oflags@o@: $(srcdir)/os/os_oflags.c - $(CC) $(CFLAGS) $? -os_open@o@: $(srcdir)/os/os_open.c - $(CC) $(CFLAGS) $? -os_region@o@: $(srcdir)/os/os_region.c - $(CC) $(CFLAGS) $? -os_rename@o@: $(srcdir)/os/os_rename.c - $(CC) $(CFLAGS) $? -os_root@o@: $(srcdir)/os/os_root.c - $(CC) $(CFLAGS) $? -os_rpath@o@: $(srcdir)/os/os_rpath.c - $(CC) $(CFLAGS) $? -os_rw@o@: $(srcdir)/os/os_rw.c - $(CC) $(CFLAGS) $? -os_seek@o@: $(srcdir)/os/os_seek.c - $(CC) $(CFLAGS) $? -os_sleep@o@: $(srcdir)/os/os_sleep.c - $(CC) $(CFLAGS) $? -os_spin@o@: $(srcdir)/os/os_spin.c - $(CC) $(CFLAGS) $? -os_stat@o@: $(srcdir)/os/os_stat.c - $(CC) $(CFLAGS) $? -os_tmpdir@o@: $(srcdir)/os/os_tmpdir.c - $(CC) $(CFLAGS) $? -os_unlink@o@: $(srcdir)/os/os_unlink.c - $(CC) $(CFLAGS) $? - -# Dbs. -dbs@o@: $(srcdir)/test_server/dbs.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_am@o@: $(srcdir)/test_server/dbs_am.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_checkpoint@o@: $(srcdir)/test_server/dbs_checkpoint.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_debug@o@: $(srcdir)/test_server/dbs_debug.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_handles@o@: $(srcdir)/test_server/dbs_handles.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_log@o@: $(srcdir)/test_server/dbs_log.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_qam@o@: $(srcdir)/test_server/dbs_qam.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_spawn@o@: $(srcdir)/test_server/dbs_spawn.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_trickle@o@: $(srcdir)/test_server/dbs_trickle.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_util@o@: $(srcdir)/test_server/dbs_util.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? -dbs_yield@o@: $(srcdir)/test_server/dbs_yield.c - $(CC) $(CFLAGS) -I$(srcdir)/test_server $? - -# Replacement files +################################################## +# C library replacement files. +################################################## getcwd@o@: $(srcdir)/clib/getcwd.c $(CC) $(CFLAGS) $? getopt@o@: $(srcdir)/clib/getopt.c @@ -991,12 +1387,11 @@ raise@o@: $(srcdir)/clib/raise.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) $? strerror@o@: $(srcdir)/clib/strerror.c $(CC) $(CFLAGS) $? vsnprintf@o@: $(srcdir)/clib/vsnprintf.c $(CC) $(CFLAGS) $? - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/bdb/dist/RELEASE b/bdb/dist/RELEASE index 7b7d7bde003..fe9b6667bbe 100644 --- a/bdb/dist/RELEASE +++ b/bdb/dist/RELEASE @@ -1,8 +1,11 @@ -# $Id: RELEASE,v 11.72 2001/01/24 15:20:14 bostic Exp $ +# $Id: RELEASE,v 11.123 2002/09/13 22:16:02 bostic Exp $ + +DB_VERSION_MAJOR=4 +DB_VERSION_MINOR=1 +DB_VERSION_PATCH=24 +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_VERSION_MAJOR=3 -DB_VERSION_MINOR=2 -DB_VERSION_PATCH=9 DB_RELEASE_DATE=`date "+%B %e, %Y"` - -DB_VERSION_STRING="Sleepycat Software: Berkeley DB $DB_VERSION_MAJOR.$DB_VERSION_MINOR.${DB_VERSION_PATCH}a: ($DB_RELEASE_DATE)" +DB_VERSION_STRING="Sleepycat Software: Berkeley DB $DB_VERSION: ($DB_RELEASE_DATE)" diff --git a/bdb/dist/acconfig.h b/bdb/dist/acconfig.h deleted file mode 100644 index 19f85a460d9..00000000000 --- a/bdb/dist/acconfig.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * $Id: acconfig.h,v 11.29 2000/09/20 16:30:33 bostic Exp $ - */ - -/* Define if you are building a version for running the test suite. */ -#undef CONFIG_TEST - -/* Define if you want a debugging version. */ -#undef DEBUG - -/* Define if you want a version that logs read operations. */ -#undef DEBUG_ROP - -/* Define if you want a version that logs write operations. */ -#undef DEBUG_WOP - -/* Define if you want a version with run-time diagnostic checking. */ -#undef DIAGNOSTIC - -/* Define if you want to mask harmless unitialized memory read/writes. */ -#undef UMRW - -/* Define if fcntl/F_SETFD denies child access to file descriptors. */ -#undef HAVE_FCNTL_F_SETFD - -/* Define if building big-file environment (e.g., AIX, HP/UX, Solaris). */ -#undef HAVE_FILE_OFFSET_BITS - -/* Mutex possibilities. */ -#undef HAVE_MUTEX_68K_GCC_ASSEMBLY -#undef HAVE_MUTEX_AIX_CHECK_LOCK -#undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY -#undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY -#undef HAVE_MUTEX_HPPA_MSEM_INIT -#undef HAVE_MUTEX_IA64_GCC_ASSEMBLY -#undef HAVE_MUTEX_MACOS -#undef HAVE_MUTEX_MSEM_INIT -#undef HAVE_MUTEX_PPC_GCC_ASSEMBLY -#undef HAVE_MUTEX_PTHREADS -#undef HAVE_MUTEX_RELIANTUNIX_INITSPIN -#undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY -#undef HAVE_MUTEX_SEMA_INIT -#undef HAVE_MUTEX_SGI_INIT_LOCK -#undef HAVE_MUTEX_SOLARIS_LOCK_TRY -#undef HAVE_MUTEX_SOLARIS_LWP -#undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY -#undef HAVE_MUTEX_THREADS -#undef HAVE_MUTEX_UI_THREADS -#undef HAVE_MUTEX_UTS_CC_ASSEMBLY -#undef HAVE_MUTEX_VMS -#undef HAVE_MUTEX_VXWORKS -#undef HAVE_MUTEX_WIN16 -#undef HAVE_MUTEX_WIN32 -#undef HAVE_MUTEX_X86_GCC_ASSEMBLY -#undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY - -/* Define if building on QNX. */ -#undef HAVE_QNX - -/* Define if building RPC client/server. */ -#undef HAVE_RPC - -/* Define if your sprintf returns a pointer, not a length. */ -#undef SPRINTF_RET_CHARPNT - -@BOTTOM@ - -/* - * Big-file configuration. - */ -#ifdef HAVE_FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 64 -#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 -#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 -#endif -#ifndef HAVE_STRERROR -#define strerror __db_Cstrerror -#endif -#ifndef HAVE_VSNPRINTF -#define vsnprintf __db_Cvsnprintf -#endif diff --git a/bdb/dist/aclocal/config.ac b/bdb/dist/aclocal/config.ac new file mode 100644 index 00000000000..cd288425946 --- /dev/null +++ b/bdb/dist/aclocal/config.ac @@ -0,0 +1,51 @@ +# Features we don't test for, but want the #defines to exist for +# other ports. +AH_TEMPLATE(HAVE_VXWORKS, [Define to 1 if building VxWorks.]) + +AH_TEMPLATE(HAVE_FILESYSTEM_NOTZERO, + [Define to 1 if allocated filesystem blocks are not zeroed.]) + +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]) diff --git a/bdb/dist/aclocal/cxx.ac b/bdb/dist/aclocal/cxx.ac new file mode 100644 index 00000000000..49103cc661a --- /dev/null +++ b/bdb/dist/aclocal/cxx.ac @@ -0,0 +1,17 @@ +# C++ checks to determine what style of headers to use and +# whether to use "using" clauses. + +AC_DEFUN(AC_CXX_HAVE_STDHEADERS, [ +AC_SUBST(cxx_have_stdheaders) +AC_CACHE_CHECK([whether C++ supports the ISO C++ standard includes], +db_cv_cxx_have_stdheaders, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +],[std::ostream *o; return 0;], + db_cv_cxx_have_stdheaders=yes, db_cv_cxx_have_stdheaders=no) + AC_LANG_RESTORE +]) +if test "$db_cv_cxx_have_stdheaders" = yes; then + cxx_have_stdheaders="#define HAVE_CXX_STDHEADERS 1" +fi]) diff --git a/bdb/dist/aclocal/gcc.ac b/bdb/dist/aclocal/gcc.ac new file mode 100644 index 00000000000..0949d982f17 --- /dev/null +++ b/bdb/dist/aclocal/gcc.ac @@ -0,0 +1,36 @@ +# Version 2.96 of gcc (shipped with RedHat Linux 7.[01] and Mandrake) had +# serious problems. +AC_DEFUN(AC_GCC_CONFIG1, [ +AC_CACHE_CHECK([whether we are using gcc version 2.96], +db_cv_gcc_2_96, [ +db_cv_gcc_2_96=no +if test "$GCC" = "yes"; then + GCC_VERSION=`${MAKEFILE_CC} --version` + case ${GCC_VERSION} in + 2.96*) + db_cv_gcc_2_96=yes;; + esac +fi]) +if test "$db_cv_gcc_2_96" = "yes"; then + CFLAGS=`echo "$CFLAGS" | sed 's/-O2/-O/'` + CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-O2/-O/'` + AC_MSG_WARN([INSTALLED GCC COMPILER HAS SERIOUS BUGS; PLEASE UPGRADE.]) + AC_MSG_WARN([GCC OPTIMIZATION LEVEL SET TO -O.]) +fi]) + +# Versions of g++ up to 2.8.0 required -fhandle-exceptions, but it is +# renamed as -fexceptions and is the default in versions 2.8.0 and after. +AC_DEFUN(AC_GCC_CONFIG2, [ +AC_CACHE_CHECK([whether g++ requires -fhandle-exceptions], +db_cv_gxx_except, [ +db_cv_gxx_except=no; +if test "$GXX" = "yes"; then + GXX_VERSION=`${MAKEFILE_CXX} --version` + case ${GXX_VERSION} in + 1.*|2.[[01234567]].*|*-1.*|*-2.[[01234567]].*) + db_cv_gxx_except=yes;; + esac +fi]) +if test "$db_cv_gxx_except" = "yes"; then + CXXFLAGS="$CXXFLAGS -fhandle-exceptions" +fi]) diff --git a/bdb/dist/aclocal/libtool.ac b/bdb/dist/aclocal/libtool.ac new file mode 100644 index 00000000000..e99faf15e4e --- /dev/null +++ b/bdb/dist/aclocal/libtool.ac @@ -0,0 +1,3633 @@ +# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001 +## 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. + +# serial 46 AC_PROG_LIBTOOL + +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +]) + +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +_LT_AC_PROG_ECHO_BACKSLASH +# 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 + AC_PATH_MAGIC + fi + ;; +esac + +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE(libtool-lock, + [ --disable-libtool-lock avoid locking (might break parallel builds)]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_SAVE + AC_LANG_C + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_RESTORE]) + 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 + ;; + +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one + AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, + [AC_TRY_LINK([], + [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); + DllMain (0, 0, 0);], + [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) + + case $host/$CC in + *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) + # old mingw systems require "-dll" to link a DLL, while more recent ones + # require "-mdll" + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -mdll" + AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, + [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) + CFLAGS="$SAVE_CFLAGS" ;; + *-*-cygwin* | *-*-pw32*) + # cygwin systems need to pass --dll to the linker, and not link + # crt.o which will require a WinMain@16 definition. + lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; + esac + ;; + ]) +esac + +_LT_AC_LTCONFIG_HACK + +]) + +# AC_LIBTOOL_HEADER_ASSERT +# ------------------------ +AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], +[AC_CACHE_CHECK([whether $CC supports assert without backlinking], + [lt_cv_func_assert_works], + [case $host in + *-*-solaris*) + if test "$GCC" = yes && test "$with_gnu_ld" != yes; then + case `$CC --version 2>/dev/null` in + [[12]].*) lt_cv_func_assert_works=no ;; + *) lt_cv_func_assert_works=yes ;; + esac + fi + ;; + esac]) + +if test "x$lt_cv_func_assert_works" = xyes; then + AC_CHECK_HEADERS(assert.h) +fi +])# AC_LIBTOOL_HEADER_ASSERT + +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h) +])# _LT_AC_CHECK_DLFCN + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +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_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix*) + symcode='[[BCDEGRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $host_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + symcode='[[ABCDGISTW]]' +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # 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'" + + # Check to see that the pipe works correctly. + pipe_works=no + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[[]] = +{ +EOF + sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$no_builtin_flag" + if AC_TRY_EVAL(ac_link) && test -s conftest; then + pipe_works=yes + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AC_FD_CC + fi + else + echo "cannot find nm_test_var in $nlist" >&AC_FD_CC + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC + fi + else + echo "$progname: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" +if test -z "$lt_cv_sys_global_symbol_pipe"; then + global_symbol_to_cdecl= + global_symbol_to_c_name_address= +else + global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" + global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" +fi +if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; +then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + +# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR +# --------------------------------- +AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], +[# Find the correct PATH separator. Usually this is `:', but +# DJGPP uses `;' like DOS. +if test "X${PATH_SEPARATOR+set}" != Xset; then + UNAME=${UNAME-`uname 2>/dev/null`} + case X$UNAME in + *-DOS) lt_cv_sys_path_separator=';' ;; + *) lt_cv_sys_path_separator=':' ;; + esac + PATH_SEPARATOR=$lt_cv_sys_path_separator +fi +])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +AC_DIVERT_POP +])# _LT_AC_PROG_ECHO_BACKSLASH + +# _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], +[if test "$cross_compiling" = yes; then : + [$4] +else + AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + 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 AC_TRY_EVAL(ac_link) && 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) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[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 + ;; + + cygwin* | mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + 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" + AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + 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" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + 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 +])# AC_LIBTOOL_DLOPEN_SELF + +AC_DEFUN([_LT_AC_LTCONFIG_HACK], +[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" +need_locks="$enable_libtool_lock" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +if test x"$host" != x"$build"; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +# Transform linux* to *-*-linux-gnu*, to support old configure scripts. +case $host_os in +linux-gnu*) ;; +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` +esac + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +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="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="[$]2" + +## FIXME: this should be a separate macro +## +AC_MSG_CHECKING([for objdir]) +rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + objdir=_libs +fi +rmdir .libs 2>/dev/null +AC_MSG_RESULT($objdir) +## +## END FIXME + + +## FIXME: this should be a separate macro +## +AC_ARG_WITH(pic, +[ --with-pic try to use only PIC/non-PIC objects [default=use both]], +pic_mode="$withval", pic_mode=default) +test -z "$pic_mode" && pic_mode=default + +# We assume here that the value for lt_cv_prog_cc_pic will not be cached +# in isolation, and that seeing it set (from the cache) indicates that +# the associated values are set (in the cache) correctly too. +AC_MSG_CHECKING([for $compiler option to produce PIC]) +AC_CACHE_VAL(lt_cv_prog_cc_pic, +[ lt_cv_prog_cc_pic= + lt_cv_prog_cc_shlib= + lt_cv_prog_cc_wl= + lt_cv_prog_cc_static= + lt_cv_prog_cc_no_builtin= + lt_cv_prog_cc_can_build_shared=$can_build_shared + + if test "$GCC" = yes; then + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-static' + + case $host_os in + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # not sure about C++ programs. + lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" + ;; + 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_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_cv_prog_cc_pic='-fno-common' + ;; + cygwin* | 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_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_cv_prog_cc_pic=-Kconform_pic + fi + ;; + *) + lt_cv_prog_cc_pic='-fPIC' + ;; + esac + else + # PORTME Check for PIC flags for the system compiler. + case $host_os in + aix3* | aix4* | aix5*) + lt_cv_prog_cc_wl='-Wl,' + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_cv_prog_cc_static='-Bstatic' + else + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better lt_cv_prog_cc_static that works with the bundled CC? + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" + lt_cv_prog_cc_pic='+Z' + ;; + + irix5* | irix6*) + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | 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_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + + newsos6) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + ;; + + sco3.2v5*) + lt_cv_prog_cc_pic='-Kpic' + lt_cv_prog_cc_static='-dn' + lt_cv_prog_cc_shlib='-belf' + ;; + + solaris*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Wl,' + ;; + + sunos4*) + lt_cv_prog_cc_pic='-PIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + if test "x$host_vendor" = xsni; then + lt_cv_prog_cc_wl='-LD' + else + lt_cv_prog_cc_wl='-Wl,' + fi + ;; + + uts4*) + lt_cv_prog_cc_pic='-pic' + lt_cv_prog_cc_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_cv_prog_cc_pic='-Kconform_pic' + lt_cv_prog_cc_static='-Bstatic' + fi + ;; + + *) + lt_cv_prog_cc_can_build_shared=no + ;; + esac + fi +]) +if test -z "$lt_cv_prog_cc_pic"; then + AC_MSG_RESULT([none]) +else + AC_MSG_RESULT([$lt_cv_prog_cc_pic]) + + # Check to make sure the pic_flag actually works. + AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) + AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" + AC_TRY_COMPILE([], [], [dnl + case $host_os in + hpux9* | hpux10* | hpux11*) + # On HP-UX, both CC and GCC only warn that PIC is supported... then + # they create non-PIC objects. So, if there were any warnings, we + # assume that PIC is not supported. + if test -s conftest.err; then + lt_cv_prog_cc_pic_works=no + else + lt_cv_prog_cc_pic_works=yes + fi + ;; + *) + lt_cv_prog_cc_pic_works=yes + ;; + esac + ], [dnl + lt_cv_prog_cc_pic_works=no + ]) + CFLAGS="$save_CFLAGS" + ]) + + if test "X$lt_cv_prog_cc_pic_works" = Xno; then + lt_cv_prog_cc_pic= + lt_cv_prog_cc_can_build_shared=no + else + lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" + fi + + AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) +fi +## +## END FIXME + +# Check for any special shared library compilation flags. +if test -n "$lt_cv_prog_cc_shlib"; then + AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) + lt_cv_prog_cc_can_build_shared=no + fi +fi + +## FIXME: this should be a separate macro +## +AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) +AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl + lt_cv_prog_cc_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" + AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) + LDFLAGS="$save_LDFLAGS" +]) + +# Belt *and* braces to stop my trousers falling down: +test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= +AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) + +pic_flag="$lt_cv_prog_cc_pic" +special_shlib_compile_flags="$lt_cv_prog_cc_shlib" +wl="$lt_cv_prog_cc_wl" +link_static_flag="$lt_cv_prog_cc_static" +no_builtin_flag="$lt_cv_prog_cc_no_builtin" +can_build_shared="$lt_cv_prog_cc_can_build_shared" +## +## END FIXME + + +## FIXME: this should be a separate macro +## +# Check to see if options -o and -c are simultaneously supported by compiler +AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) +AC_CACHE_VAL([lt_cv_compiler_c_o], [ +$rm -r conftest 2>/dev/null +mkdir conftest +cd conftest +echo "int some_variable = 0;" > conftest.$ac_ext +mkdir out +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers +# that will create temporary files in the current directory regardless of +# the output directory. Thus, making CWD read-only will cause this test +# to fail, enabling locking or at least warning the user not to do parallel +# builds. +chmod -w . +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" +compiler_c_o=no +if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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_compiler_c_o=no + else + lt_cv_compiler_c_o=yes + fi +else + # Append any errors to the config.log. + cat out/conftest.err 1>&AC_FD_CC + lt_cv_compiler_c_o=no +fi +CFLAGS="$save_CFLAGS" +chmod u+w . +$rm conftest* out/* +rmdir out +cd .. +rmdir conftest +$rm -r conftest 2>/dev/null +]) +compiler_c_o=$lt_cv_compiler_c_o +AC_MSG_RESULT([$compiler_c_o]) + +if test x"$compiler_c_o" = x"yes"; then + # Check to see if we can write to a .lo + AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) + AC_CACHE_VAL([lt_cv_compiler_o_lo], [ + lt_cv_compiler_o_lo=no + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -c -o conftest.lo" + save_objext="$ac_objext" + ac_objext=lo + AC_TRY_COMPILE([], [int some_variable = 0;], [dnl + # 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_cv_compiler_o_lo=no + else + lt_cv_compiler_o_lo=yes + fi + ]) + ac_objext="$save_objext" + CFLAGS="$save_CFLAGS" + ]) + compiler_o_lo=$lt_cv_compiler_o_lo + AC_MSG_RESULT([$compiler_o_lo]) +else + compiler_o_lo=no +fi +## +## END FIXME + +## FIXME: this should be a separate macro +## +# Check to see if we can do hard links to lock some files if needed +hard_links="nottested" +if test "$compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + 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 + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +## +## END FIXME + +## FIXME: this should be a separate macro +## +if test "$GCC" = yes; then + # Check to see if options -fno-rtti -fno-exceptions are supported by compiler + AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) + echo "int some_variable = 0;" > conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" + compiler_rtti_exceptions=no + AC_TRY_COMPILE([], [int some_variable = 0;], [dnl + # 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 + compiler_rtti_exceptions=no + else + compiler_rtti_exceptions=yes + fi + ]) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT([$compiler_rtti_exceptions]) + + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi +fi +## +## END FIXME + +## FIXME: this should be a separate macro +## +# See if the linker supports building shared libraries. +AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) + +allow_undefined_flag= +no_undefined_flag= +need_lib_prefix=unknown +need_version=unknown +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +archive_cmds= +archive_expsym_cmds= +old_archive_from_new_cmds= +old_archive_from_expsyms_cmds= +export_dynamic_flag_spec= +whole_archive_flag_spec= +thread_safe_flag_spec= +hardcode_into_libs=no +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no +hardcode_shlibpath_var=unsupported +runpath_var= +link_all_deplibs=unknown +always_export_symbols=no +export_symbols_cmds='$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= +# exclude_expsyms can be an egrep regular expression 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="_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=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, the GNU linker is very broken + # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. + ld_shlibs=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. + +EOF + ;; + + amigaos*) + archive_cmds='$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='-L$libdir' + hardcode_minus_L=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 use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=yes + + extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ + sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ + test -f $output_objdir/impgen.exe || (cd $output_objdir && \ + if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ + else $CC -o impgen impgen.c ; fi)~ + $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' + + old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' + + # cygwin and mingw dlls have different entry points and sets of symbols + # to exclude. + # FIXME: what about values for MSVC? + dll_entry=__cygwin_dll_entry@12 + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ + case $host_os in + mingw*) + # mingw values + dll_entry=_DllMainCRTStartup@12 + dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ + ;; + esac + + # mingw and cygwin differ, and it's simplest to just exclude the union + # of the two symbol sets. + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one (in ltdll.c) + if test "x$lt_cv_need_dllmain" = "xyes"; then + ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " + ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ + test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' + else + ltdll_obj= + ltdll_cmds= + fi + + # Extract the symbol export list from an `--export-all' def file, + # then regenerate the def file from the symbol export list, so that + # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left be newer dlltools. + export_symbols_cmds="$ltdll_cmds"' + $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ + sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' + + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is. + # If DATA tags from a recent dlltool are present, honour them! + archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname-def; + else + echo EXPORTS > $output_objdir/$soname-def; + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \[$]# in + 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; + fi~ + '"$ltdll_cmds"' + $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ + $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ + $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** 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. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + 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' + case $host_os in + cygwin* | mingw* | pw32*) + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + ;; + esac + fi +else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$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=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=unsupported + 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="" + else + aix_use_runtimelinking=no + + # 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 + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # 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. + + hardcode_direct=yes + archive_cmds='' + hardcode_libdir_separator=':' + + #### Local change for Sleepycat's Berkeley DB [#5779]: + # Added $aix_export variable to control use of exports file. + # For non-gcc, we don't use exports files, and rather trust + # the binder's -qmkshrobj option to export all the mangled + # symbols we need for C++ and java. + + aix_export="\${wl}$exp_sym_flag:\$export_symbols" + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + 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=yes + else + # We have old collect2 + hardcode_direct=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=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + shared_flag='${wl}-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + + # Test for -qmkshrobj and use it if it's available. + # It's superior for determining exportable symbols, + # especially for C++ or JNI libraries, which have + # mangled names. + # + AC_LANG_CONFTEST(void f(){}) + if AC_TRY_EVAL(CC -c conftest.c) && AC_TRY_EVAL(CC -o conftest conftest.$ac_objext -qmkshrobj -lC_r); then + lt_cv_aix_mkshrobj=yes + else + lt_cv_aix_mkshrobj=no + fi + + if test "$lt_cv_aix_mkshrobj" = yes; then + aix_export="-qmkshrobj" + fi + fi + + # It seems that -bexpall can do strange things, so it is better to + # generate a list of symbols to export. + always_export_symbols=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='-berok' + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + 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 $aix_export $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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag $aix_export" + else + hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='${wl}-berok' + # This is a bit strange, but 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 ${allow_undefined_flag} '"\${wl}$no_entry_flag $aix_export"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$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='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=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=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$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='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + ;; + + darwin* | rhapsody*) + case "$host_os" in + rhapsody* | darwin1.[[012]]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + + #### Local change for Sleepycat's Berkeley DB [#5664] [#6511] + case "$host_os" in + darwin[[12345]].*) + # removed double quotes in the following line: + archive_cmds='$nonopt $(test x$module = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' + ;; + *) # Darwin6.0 on (Mac OS/X Jaguar) + archive_cmds='$nonopt $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -dynamiclib -install_name $rpath/$soname $verstring' + ;; + esac + #### End of changes for Sleepycat's Berkeley DB [#5664] [#6511] + + # We need to add '_' to the symbols in $export_symbols first + #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' + hardcode_direct=yes + hardcode_shlibpath_var=no + whole_archive_flag_spec='-all_load $convenience' + ;; + + freebsd1*) + ld_shlibs=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='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9* | hpux10* | hpux11*) + case $host_os in + hpux9*) archive_cmds='$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' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; + esac + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + export_dynamic_flag_spec='${wl}-E' + ;; + + irix5* | irix6*) + if test "$GCC" = yes; then + archive_cmds='$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='$LD -shared $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='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case "$host_os" in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$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='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$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=' -expect_unresolved \*' + archive_cmds='$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='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$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='${wl}-rpath ${wl}$libdir' + else + 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 "-exported_symbol " >> $lib.exp; echo "\$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='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + export_dynamic_flag_spec='${wl}-Bexport' + ;; + + solaris*) + # gcc --version < 3.0 without binutils cannot create self contained + # shared libraries reliably, requiring libgcc.a to resolve some of + # the object symbols generated in some cases. Libraries that use + # assert need libgcc.a to resolve __eprintf, for example. Linking + # a copy of libgcc.a into every shared library to guarantee resolving + # such symbols causes other problems: According to Tim Van Holder + # , C++ libraries end up with a separate + # (to the application) exception stack for one thing. + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + case `$CC --version 2>/dev/null` in + [[12]].*) + cat <&2 + +*** Warning: Releases of GCC earlier than version 3.0 cannot reliably +*** create self contained shared libraries on Solaris systems, without +*** introducing a dependency on libgcc.a. Therefore, libtool is disabling +*** -no-undefined support, which will at least allow you to build shared +*** libraries. However, you may find that when you link such libraries +*** into an application without using GCC, you have to manually add +*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to +*** upgrade to a newer version of GCC. Another option is to rebuild your +*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. + +EOF + no_undefined_flag= + ;; + esac + fi + # $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='-R$libdir' + 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' ;; + esac + link_all_deplibs=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='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + if test "x$host_vendor" = xsno; then + archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + else + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + 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= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5uw7* | 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' + else + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac +fi +AC_MSG_RESULT([$ld_shlibs]) +test "$ld_shlibs" = no && can_build_shared=no +## +## END FIXME + +## FIXME: this should be a separate macro +## +# Check hardcoding attributes. +AC_MSG_CHECKING([how to hardcode library paths into programs]) +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var"; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != 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 "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +AC_MSG_RESULT([$hardcode_action]) +## +## END FIXME + +## FIXME: this should be a separate macro +## +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +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" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi +## +## END FIXME + +reload_cmds='$LD$reload_flag -o $output$reload_objs' +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +## FIXME: this should be a separate macro +## +# PORTME Fill in your ld.so characteristics +AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' + ;; + +aix4* | aix5*) + version_type=linux + + #### Local change for Sleepycat's Berkeley DB [#5779]: + # If we don't set need_version, we'll get x.so.0.0.0, + # even if -avoid-version is set. + need_version=no + + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can + # not hardcode correct soname into executable. Probably we can + # add versioning support to collect2, so additional links can + # be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}.so$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + need_version=no + need_lib_prefix=no + case $GCC,$host_os in + yes,cygwin*) + library_names_spec='$libname.dll.a' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' + postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + ;; + yes,mingw*) + library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` + ;; + yes,pw32*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + ;; + *) + library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + #### Local change for Sleepycat's Berkeley DB [#6117]: + # added support for -jnimodule, encapsulated below in ${darwin_suffix} + darwin_suffix='$(test .$jnimodule = .yes && echo jnilib || (test .$module = .yes && echo so || echo dylib))' + library_names_spec='${libname}${release}${versuffix}.'"${darwin_suffix}"' ${libname}${release}${major}.'"${darwin_suffix}"' ${libname}.'"${darwin_suffix}" + soname_spec='${libname}${release}${major}.'"${darwin_suffix}" + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + *) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + dynamic_linker="$host_os dld.sl" + version_type=sunos + need_lib_prefix=no + need_version=no + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6*) + version_type=irix + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + case $host_os in + irix5*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}${release}.so$major $libname.so' + 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}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + 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 + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + 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}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}.so$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}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=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 + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no +## +## END FIXME + +## FIXME: this should be a separate macro +## +# Report the final consequences. +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) +## +## END FIXME + +## FIXME: this should be a separate macro +## +AC_MSG_CHECKING([whether to build shared libraries]) +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 +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*) + 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]) +## +## END FIXME + +## FIXME: this should be a separate macro +## +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) +## +## END FIXME + +if test "$hardcode_action" = 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 + +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_DLOPEN_SELF + +## FIXME: this should be a separate macro +## +if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds 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. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], + [$rm conftest* + echo 'static int dummy;' > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile); then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_cv_prog_cc_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi]) + AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) + ;; + esac +fi +need_lc=${lt_cv_archive_cmds_need_lc-yes} +## +## END FIXME + +## FIXME: this should be a separate macro +## +# The second 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 + : +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. + test -f Makefile && make "$ltmain" +fi + +if test -f "$ltmain"; then + trap "$rm \"${ofile}T\"; exit 1" 1 2 15 + $rm -f "${ofile}T" + + echo creating $ofile + + # 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 CC LD LN_S NM SHELL \ + reload_flag reload_cmds wl \ + pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ + thread_safe_flag_spec whole_archive_flag_spec libname_spec \ + library_names_spec soname_spec \ + RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ + old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ + postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ + old_striplib striplib file_magic_cmd export_symbols_cmds \ + deplibs_check_method allow_undefined_flag no_undefined_flag \ + finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ + global_symbol_to_c_name_address \ + hardcode_libdir_flag_spec hardcode_libdir_separator \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do + + case $var in + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ + extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + finish_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 + + cat <<__EOF__ > "${ofile}T" +#! $SHELL + +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996-2000 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. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$need_lc + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# The default C compiler. +CC=$lt_CC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# 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 + +# How to pass a linker flag through the compiler. +wl=$lt_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_pic_flag +pic_mode=$pic_mode + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_compiler_c_o + +# Can we write directly to a .lo ? +compiler_o_lo=$lt_compiler_o_lo + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# 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 + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_link_static_flag + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# 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 + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + case $host_os in + aix3*) + cat <<\EOF >> "${ofile}T" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + case $host_os in + cygwin* | mingw* | pw32* | os2*) + cat <<'EOF' >> "${ofile}T" + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments +# /* impgen.c starts here */ +# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# 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. +# */ +# +# #include /* for printf() */ +# #include /* for open(), lseek(), read() */ +# #include /* for O_RDONLY, O_BINARY */ +# #include /* for strdup() */ +# +# /* O_BINARY isn't required (or even defined sometimes) under Unix */ +# #ifndef O_BINARY +# #define O_BINARY 0 +# #endif +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (dll < 1) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) + + mv -f "${ofile}T" "$ofile" || \ + (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") + chmod +x "$ofile" +fi +## +## END FIXME + +])# _LT_AC_LTCONFIG_HACK + +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) + +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) + +# AC_ENABLE_SHARED - implement the --enable-shared flag +# Usage: AC_ENABLE_SHARED[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(shared, +changequote(<<, >>)dnl +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case $enableval in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl +]) + +# AC_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)]) + +# AC_ENABLE_STATIC - implement the --enable-static flag +# Usage: AC_ENABLE_STATIC[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(static, +changequote(<<, >>)dnl +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case $enableval in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl +]) + +# AC_DISABLE_STATIC - set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no)]) + + +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(fast-install, +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case $enableval in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +]) + +# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no)]) + +# AC_LIBTOOL_PICMODE - implement the --with-pic flag +# Usage: AC_LIBTOOL_PICMODE[(MODE)] +# Where MODE is either `yes' or `no'. If omitted, it defaults to +# `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default)]) + + +# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "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 + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +]) + + +# AC_PATH_MAGIC - find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl +AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) + else + MAGIC_CMD=: + fi +fi +]) + + +# AC_PROG_LD - find the path to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | [[A-Za-z]]:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + 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. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$lt_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_PROG_LD_GNU +]) + +# AC_PROG_LD_GNU - +AC_DEFUN([AC_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + lt_cv_prog_gnu_ld=yes +else + lt_cv_prog_gnu_ld=no +fi]) +with_gnu_ld=$lt_cv_prog_gnu_ld +]) + +# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker +# -- PORTME Some linkers may need a different reload flag. +AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], +[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, +[lt_cv_ld_reload_flag='-r']) +reload_flag=$lt_cv_ld_reload_flag +test -n "$reload_flag" && reload_flag=" $reload_flag" +]) + +# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], +[AC_CACHE_CHECK([how to recognise dependant libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given egrep regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin* | mingw* | pw32*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.[[012]]) + lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + +freebsd*) + 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_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20*|hpux11*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + +irix5* | irix6*) + case $host_os in + irix5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux-gnu*) + case $host_cpu in + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + 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` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv5uw[[78]]* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + 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]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + esac + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +]) + + +# AC_PROG_NM - find the path to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl +AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + 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 + if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then + lt_cv_path_NM="$tmp_nm -B" + break + elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + lt_cv_path_NM="$tmp_nm -p" + break + else + 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 + fi + fi + done + IFS="$ac_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +AC_MSG_RESULT([$NM]) +]) + +# AC_CHECK_LIBM - check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, main, LIBM="-lm") + ;; +esac +]) + +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl convenience library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-convenience to the +# configure arguments. Note that LIBLTDL and INCLTDL are not +# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not +# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed +# with '${top_builddir}/' and INCLTDL 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 + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-install to the configure +# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is +# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed +# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and INCLTDL 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. +# 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 + AC_CHECK_LIB(ltdl, main, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + INCLTDL= + fi +]) + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) diff --git a/bdb/dist/aclocal/mutex.ac b/bdb/dist/aclocal/mutex.ac new file mode 100644 index 00000000000..f3f5529c74f --- /dev/null +++ b/bdb/dist/aclocal/mutex.ac @@ -0,0 +1,611 @@ +# $Id: mutex.ac,v 11.38 2002/07/25 20:07:52 sue Exp $ + +# POSIX pthreads tests: inter-process safe and intra-process only. +# +# We need to run a test here, because the PTHREAD_PROCESS_SHARED flag compiles +# fine on problematic systems, but won't actually work. This is a problem for +# cross-compilation environments. I think inter-process mutexes are as likely +# to fail in cross-compilation environments as real ones (especially since the +# likely cross-compilation environment is Linux, where inter-process mutexes +# don't currently work -- the latest estimate I've heard is Q1 2002, as part +# of IBM's NGPT package). So: +# +# If checking for inter-process pthreads mutexes: +# If it's local, run a test. +# If it's a cross-compilation, fail. +# +# If the user specified pthreads mutexes and we're checking for intra-process +# mutexes only: +# If it's local, run a test. +# If it's a cross-compilation, run a link-test. +# +# So, the thing you can't do here is configure for inter-process POSIX pthread +# mutexes when cross-compiling. Since we're using the GNU/Cygnus toolchain for +# cross-compilation, the target system is likely Linux or *BSD, so we're doing +# the right thing. +AC_DEFUN(AM_PTHREADS_SHARED, [ +AC_TRY_RUN([ +#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)); +}], [db_cv_mutex="$1"],, [db_cv_mutex="no"])]) +AC_DEFUN(AM_PTHREADS_PRIVATE, [ +AC_TRY_RUN([ +#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)); +}], [db_cv_mutex="$1"],, +AC_TRY_LINK([ +#include ],[ + 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)); +], [db_cv_mutex="$1"]))]) + +# Figure out mutexes for this compiler/architecture. +AC_DEFUN(AM_DEFINE_MUTEXES, [ + +# Mutexes we don't test for, but want the #defines to exist for +# other ports. +AH_TEMPLATE(HAVE_MUTEX_VMS, [Define to 1 to use VMS mutexes.]) +AH_TEMPLATE(HAVE_MUTEX_VXWORKS, [Define to 1 to use VxWorks mutexes.]) +AH_TEMPLATE(HAVE_MUTEX_WIN32, [Define to 1 to use Windows mutexes.]) + +AC_CACHE_CHECK([for mutexes], db_cv_mutex, [ +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, current Linux +# and *BSD systems). +# +# If we're on Solaris, we insist that -lthread or -lpthread be used. 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. Otherwise, we try first without the library +# and then with it: there's some information that SCO/UnixWare/OpenUNIX needs +# this. [#4950] +# +# 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. +if test "$db_cv_posixmutexes" = yes; then + case "$host_os" in + solaris*) + db_cv_mutex="posix_library_only";; + *) + db_cv_mutex="posix_only";; + esac +fi + +if test "$db_cv_uimutexes" = yes; then + case "$host_os" in + solaris*) + db_cv_mutex="ui_library_only";; + *) + db_cv_mutex="ui_only";; + esac +fi + +# LWP threads: _lwp_XXX +if test "$db_cv_mutex" = no; then +AC_TRY_LINK([ +#include ],[ + 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)); +], [db_cv_mutex="Solaris/lwp"]) +fi + +# UI threads: thr_XXX +# +# Try with and without the -lthread library. +if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "ui_only"; then +AC_TRY_LINK([ +#include +#include ],[ + 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)); +], [db_cv_mutex="UI/threads"]) +fi +if test "$db_cv_mutex" = no -o \ + "$db_cv_mutex" = "ui_only" -o "$db_cv_mutex" = "ui_library_only"; then +LIBS="$LIBS -lthread" +AC_TRY_LINK([ +#include +#include ],[ + 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)); +], [db_cv_mutex="UI/threads/library"]) +LIBS="$orig_libs" +fi +if test "$db_cv_mutex" = "ui_only" -o "$db_cv_mutex" = "ui_library_only"; then + AC_MSG_ERROR([unable to find UI mutex interfaces]) +fi + +# POSIX.1 pthreads: pthread_XXX +# +# Try with and without the -lpthread library. 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 + AM_PTHREADS_SHARED("POSIX/pthreads") +fi +if test "$db_cv_mutex" = no -o \ + "$db_cv_mutex" = "posix_only" -o "$db_cv_mutex" = "posix_library_only"; then + LIBS="$LIBS -lpthread" + AM_PTHREADS_SHARED("POSIX/pthreads/library") + LIBS="$orig_libs" +fi +if test "$db_cv_mutex" = "posix_only"; then + AM_PTHREADS_PRIVATE("POSIX/pthreads/private") +fi +if test "$db_cv_mutex" = "posix_only" -o \ + "$db_cv_mutex" = "posix_library_only"; then + LIBS="$LIBS -lpthread" + AM_PTHREADS_PRIVATE("POSIX/pthreads/library/private") + LIBS="$orig_libs" +fi + +if test "$db_cv_mutex" = "posix_only" -o \ + "$db_cv_mutex" = "posix_library_only"; then + AC_MSG_ERROR([unable to find POSIX 1003.1 mutex interfaces]) +fi + +# msemaphore: HPPA only +# Try HPPA before general msem test, it needs special alignment. +if test "$db_cv_mutex" = no; then +AC_TRY_LINK([ +#include ],[ +#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 +], [db_cv_mutex="HP/msem_init"]) +fi + +# msemaphore: AIX, OSF/1 +if test "$db_cv_mutex" = no; then +AC_TRY_LINK([ +#include +#include ],[ + typedef msemaphore tsl_t; + msemaphore x; + msem_init(&x, 0); + msem_lock(&x, 0); + msem_unlock(&x, 0); + exit(0); +], [db_cv_mutex="UNIX/msem_init"]) +fi + +# ReliantUNIX +if test "$db_cv_mutex" = no; then +LIBS="$LIBS -lmproc" +AC_TRY_LINK([ +#include ],[ + typedef spinlock_t tsl_t; + spinlock_t x; + initspin(&x, 1); + cspinlock(&x); + spinunlock(&x); +], [db_cv_mutex="ReliantUNIX/initspin"]) +LIBS="$orig_libs" +fi + +# SCO: UnixWare has threads in libthread, but OpenServer doesn't. +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if defined(__USLC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="SCO/x86/cc-assembly"]) +fi + +# abilock_t: SGI +if test "$db_cv_mutex" = no; then +AC_TRY_LINK([ +#include ],[ + typedef abilock_t tsl_t; + abilock_t x; + init_lock(&x); + acquire_lock(&x); + release_lock(&x); +], [db_cv_mutex="SGI/init_lock"]) +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 +AC_TRY_LINK([ +#include ],[ + typedef sema_t tsl_t; + sema_t x; + sema_init(&x, 1, USYNC_PROCESS, NULL); + sema_wait(&x); + sema_post(&x); +], [db_cv_mutex="UNIX/sema_init"]) +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. +if test "$db_cv_mutex" = no; then +AC_TRY_LINK([ +#include ],[ + typedef lock_t tsl_t; + lock_t x; + _lock_try(&x); + _lock_clear(&x); +], [db_cv_mutex="Solaris/_lock_try"]) +fi + +# _check_lock/_clear_lock: AIX +if test "$db_cv_mutex" = no; then +AC_TRY_LINK([ +#include ],[ + int x; + _check_lock(&x,0,1); + _clear_lock(&x,0); +], [db_cv_mutex="AIX/_check_lock"]) +fi + +# Alpha/gcc: OSF/1 +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if defined(__alpha) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="ALPHA/gcc-assembly"]) +fi + +# ARM/gcc: Linux +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if defined(__arm__) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="ARM/gcc-assembly"]) +fi + +# PaRisc/gcc: HP/UX +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if (defined(__hppa) || defined(__hppa__)) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="HPPA/gcc-assembly"]) +fi + +# PPC/gcc: +# Test for Apple first, it requires slightly different assembly. +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GNUC__) && defined(__APPLE__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="PPC_APPLE/gcc-assembly"]) +fi +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="PPC_GENERIC/gcc-assembly"]) +fi + +# Sparc/gcc: SunOS, Solaris +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if defined(__sparc__) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="Sparc/gcc-assembly"]) +fi + +# 68K/gcc: SunOS +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if (defined(mc68020) || defined(sun3)) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="68K/gcc-assembly"]) +fi + +# x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if (defined(i386) || defined(__i386__)) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="x86/gcc-assembly"]) +fi + +# S390/gcc: Linux +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if defined(__s390__) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="S390/gcc-assembly"]) +fi + +# ia86/gcc: Linux +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if defined(__ia64) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="ia64/gcc-assembly"]) +fi + +# uts/cc: UTS +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if defined(_UTS) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="UTS/cc-assembly"]) +fi + +# default to UNIX fcntl system call mutexes. +if test "$db_cv_mutex" = no; then + db_cv_mutex="UNIX/fcntl" +fi +]) + +case "$db_cv_mutex" in +68K/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_68K_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_68K_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and 68K assembly language mutexes.]);; +AIX/_check_lock) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_AIX_CHECK_LOCK) + AH_TEMPLATE(HAVE_MUTEX_AIX_CHECK_LOCK, + [Define to 1 to use the AIX _check_lock mutexes.]);; +ALPHA/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_ALPHA_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_ALPHA_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and Alpha assembly language mutexes.]);; +ARM/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_ARM_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_ARM_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and ARM assembly language mutexes.]);; +HP/msem_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_HPPA_MSEM_INIT) + AH_TEMPLATE(HAVE_MUTEX_HPPA_MSEM_INIT, + [Define to 1 to use the msem_XXX mutexes on HP-UX.]);; +HPPA/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_HPPA_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_HPPA_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and PaRisc assembly language mutexes.]);; +ia64/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_IA64_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_IA64_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and IA64 assembly language mutexes.]);; +POSIX/pthreads) 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/private) 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.]) + 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" + 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" + 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.]) + AC_DEFINE(HAVE_MUTEX_THREAD_ONLY) + AH_TEMPLATE(HAVE_MUTEX_THREAD_ONLY, + [Define to 1 to configure mutexes intra-process only.]);; +PPC_GENERIC/gcc-assembly) + ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_PPC_GENERIC_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_PPC_GENERIC_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and generic PowerPC assembly language.]);; +PPC_APPLE/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_PPC_APPLE_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_PPC_APPLE_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and Apple PowerPC assembly language.]);; +ReliantUNIX/initspin) LIBS="$LIBS -lmproc" + ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_RELIANTUNIX_INITSPIN) + AH_TEMPLATE(HAVE_MUTEX_RELIANTUNIX_INITSPIN, + [Define to 1 to use Reliant UNIX initspin mutexes.]);; +S390/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_S390_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_S390_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and S/390 assembly language mutexes.]);; +SCO/x86/cc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY, + [Define to 1 to use the SCO compiler and x86 assembly language mutexes.]);; +SGI/init_lock) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_SGI_INIT_LOCK) + AH_TEMPLATE(HAVE_MUTEX_SGI_INIT_LOCK, + [Define to 1 to use the SGI XXX_lock mutexes.]);; +Solaris/_lock_try) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_SOLARIS_LOCK_TRY) + AH_TEMPLATE(HAVE_MUTEX_SOLARIS_LOCK_TRY, + [Define to 1 to use the Solaris _lock_XXX mutexes.]);; +Solaris/lwp) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_SOLARIS_LWP) + AH_TEMPLATE(HAVE_MUTEX_SOLARIS_LWP, + [Define to 1 to use the Solaris lwp threads mutexes.]);; +Sparc/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_SPARC_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_SPARC_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and Sparc 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" + AC_DEFINE(HAVE_MUTEX_UI_THREADS) + AH_TEMPLATE(HAVE_MUTEX_UI_THREADS, + [Define to 1 to use the UNIX International mutexes.]);; +UNIX/msem_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_MSEM_INIT) + AH_TEMPLATE(HAVE_MUTEX_MSEM_INIT, + [Define to 1 to use the msem_XXX mutexes on systems other than HP-UX.]);; +UNIX/sema_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_SEMA_INIT) + AH_TEMPLATE(HAVE_MUTEX_SEMA_INIT, + [Define to 1 to use the obsolete POSIX 1003.1 sema_XXX mutexes.]);; +UTS/cc-assembly) ADDITIONAL_OBJS="$ADDITIONAL_OBJS uts4.cc${o}" + AC_DEFINE(HAVE_MUTEX_UTS_CC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_UTS_CC_ASSEMBLY, + [Define to 1 to use the UTS compiler and 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.]);; +UNIX/fcntl) AC_MSG_WARN( + [NO FAST MUTEXES FOUND FOR THIS COMPILER/ARCHITECTURE.]) + ADDITIONAL_OBJS="mut_fcntl${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_FCNTL) + AH_TEMPLATE(HAVE_MUTEX_FCNTL, + [Define to 1 to use the UNIX fcntl system call mutexes.]);; +*) 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.]) +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. +AH_TEMPLATE(HAVE_MUTEX_SYSTEM_RESOURCES, + [Define to 1 if mutexes hold system resources.]) + +case "$host_os$db_cv_mutex" in +*qnx*POSIX/pthread*|openedition*POSIX/pthread*) + AC_DEFINE(HAVE_MUTEX_SYSTEM_RESOURCES);; +esac]) diff --git a/bdb/dist/aclocal/mutex.m4 b/bdb/dist/aclocal/mutex.m4 deleted file mode 100644 index a6b1fa1a053..00000000000 --- a/bdb/dist/aclocal/mutex.m4 +++ /dev/null @@ -1,407 +0,0 @@ -dnl $Id: mutex.m4,v 11.20 2000/12/20 22:16:56 bostic Exp $ - -dnl Figure out mutexes for this compiler/architecture. -AC_DEFUN(AM_DEFINE_MUTEXES, [ - -AC_CACHE_CHECK([for mutexes], db_cv_mutex, [dnl -db_cv_mutex=no - -orig_libs=$LIBS - -dnl User-specified POSIX mutexes. -dnl -dnl Assume that -lpthread exists when the user specifies POSIX mutexes. (I -dnl only expect this option to be used on Solaris, which has -lpthread.) -if test "$db_cv_posixmutexes" = yes; then - db_cv_mutex="posix_only" -fi - -dnl User-specified UI mutexes. -dnl -dnl Assume that -lthread exists when the user specifies UI mutexes. (I only -dnl expect this option to be used on Solaris, which has -lthread.) -if test "$db_cv_uimutexes" = yes; then - db_cv_mutex="ui_only" -fi - -dnl LWP threads: _lwp_XXX -dnl -dnl Test for LWP threads before testing for UI/POSIX threads, we prefer them -dnl on Solaris. There are two reasons: the Solaris C library has UI/POSIX -dnl interface stubs, but they're broken, configuring them for inter-process -dnl mutexes doesn't return an error, but it doesn't work either. Second, -dnl there's a bug in SunOS 5.7 where applications get pwrite, not pwrite64, -dnl if they load the C library before the appropriate threads library, e.g., -dnl tclsh using dlopen to load the DB library. Anyway, by using LWP threads -dnl we avoid answering lots of user questions, not to mention the bugs. -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([ -#include -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)); -}], [db_cv_mutex="Solaris/lwp"]) -fi - -dnl UI threads: thr_XXX -dnl -dnl Try with and without the -lthread library. -if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "ui_only"; then -LIBS="-lthread $LIBS" -AC_TRY_RUN([ -#include -#include -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)); -}], [db_cv_mutex="UI/threads/library"]) -LIBS="$orig_libs" -fi -if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "ui_only"; then -AC_TRY_RUN([ -#include -#include -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)); -}], [db_cv_mutex="UI/threads"]) -fi -if test "$db_cv_mutex" = "ui_only"; then - AC_MSG_ERROR([unable to find UI mutex interfaces]) -fi - - -dnl POSIX.1 pthreads: pthread_XXX -dnl -dnl Try with and without the -lpthread library. -if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then -AC_TRY_RUN([ -#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)); -}], [db_cv_mutex="POSIX/pthreads"]) -fi -if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then -LIBS="-lpthread $LIBS" -AC_TRY_RUN([ -#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)); -}], [db_cv_mutex="POSIX/pthreads/library"]) -LIBS="$orig_libs" -fi -if test "$db_cv_mutex" = "posix_only"; then - AC_MSG_ERROR([unable to find POSIX mutex interfaces]) -fi - -dnl msemaphore: HPPA only -dnl Try HPPA before general msem test, it needs special alignment. -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([ -#include -main(){ -#if defined(__hppa) - typedef msemaphore tsl_t; - msemaphore x; - msem_init(&x, 0); - msem_lock(&x, 0); - msem_unlock(&x, 0); - exit(0); -#else - exit(1); -#endif -}], [db_cv_mutex="HP/msem_init"]) -fi - -dnl msemaphore: AIX, OSF/1 -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([ -#include -#include ; -main(){ - typedef msemaphore tsl_t; - msemaphore x; - msem_init(&x, 0); - msem_lock(&x, 0); - msem_unlock(&x, 0); - exit(0); -}], [db_cv_mutex="UNIX/msem_init"]) -fi - -dnl ReliantUNIX -if test "$db_cv_mutex" = no; then -LIBS="$LIBS -lmproc" -AC_TRY_LINK([#include ], -[typedef spinlock_t tsl_t; -spinlock_t x; initspin(&x, 1); cspinlock(&x); spinunlock(&x);], -[db_cv_mutex="ReliantUNIX/initspin"]) -LIBS="$orig_libs" -fi - -dnl SCO: UnixWare has threads in libthread, but OpenServer doesn't. -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([ -main(){ -#if defined(__USLC__) - exit(0); -#endif - exit(1); -}], [db_cv_mutex="SCO/x86/cc-assembly"]) -fi - -dnl abilock_t: SGI -if test "$db_cv_mutex" = no; then -AC_TRY_LINK([#include ], -[typedef abilock_t tsl_t; -abilock_t x; init_lock(&x); acquire_lock(&x); release_lock(&x);], -[db_cv_mutex="SGI/init_lock"]) -fi - -dnl sema_t: Solaris -dnl The sema_XXX calls do not work on Solaris 5.5. I see no reason to ever -dnl turn this test on, unless we find some other platform that uses the old -dnl POSIX.1 interfaces. (I plan to move directly to pthreads on Solaris.) -if test "$db_cv_mutex" = DOESNT_WORK; then -AC_TRY_LINK([#include ], -[typedef sema_t tsl_t; - sema_t x; - sema_init(&x, 1, USYNC_PROCESS, NULL); sema_wait(&x); sema_post(&x);], -[db_cv_mutex="UNIX/sema_init"]) -fi - -dnl _lock_try/_lock_clear: Solaris -dnl On Solaris systems without Pthread or UI mutex interfaces, DB uses the -dnl undocumented _lock_try _lock_clear function calls instead of either the -dnl sema_trywait(3T) or sema_wait(3T) function calls. This is because of -dnl problems in those interfaces in some releases of the Solaris C library. -if test "$db_cv_mutex" = no; then -AC_TRY_LINK([#include ], -[typedef lock_t tsl_t; - lock_t x; - _lock_try(&x); _lock_clear(&x);], -[db_cv_mutex="Solaris/_lock_try"]) -fi - -dnl _check_lock/_clear_lock: AIX -if test "$db_cv_mutex" = no; then -AC_TRY_LINK([#include ], -[int x; _check_lock(&x,0,1); _clear_lock(&x,0);], -[db_cv_mutex="AIX/_check_lock"]) -fi - -dnl Alpha/gcc: OSF/1 -dnl The alpha/gcc code doesn't work as far as I know. There are -dnl two versions, both have problems. See Support Request #1583. -if test "$db_cv_mutex" = DOESNT_WORK; then -AC_TRY_RUN([main(){ -#if defined(__alpha) -#if defined(__GNUC__) -exit(0); -#endif -#endif -exit(1);}], -[db_cv_mutex="ALPHA/gcc-assembly"]) -fi - -dnl PaRisc/gcc: HP/UX -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([main(){ -#if defined(__hppa) -#if defined(__GNUC__) -exit(0); -#endif -#endif -exit(1);}], -[db_cv_mutex="HPPA/gcc-assembly"]) -fi - -dnl PPC/gcc: -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([main(){ -#if defined(__powerpc__) -#if defined(__GNUC__) -exit(0); -#endif -#endif -exit(1);}], -[db_cv_mutex="PPC/gcc-assembly"]) -fi - -dnl Sparc/gcc: SunOS, Solaris -dnl The sparc/gcc code doesn't always work, specifically, I've seen assembler -dnl failures from the stbar instruction on SunOS 4.1.4/sun4c and gcc 2.7.2.2. -if test "$db_cv_mutex" = DOESNT_WORK; then -AC_TRY_RUN([main(){ -#if defined(__sparc__) -#if defined(__GNUC__) - exit(0); -#endif -#endif - exit(1); -}], [db_cv_mutex="Sparc/gcc-assembly"]) -fi - -dnl 68K/gcc: SunOS -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([main(){ -#if (defined(mc68020) || defined(sun3)) -#if defined(__GNUC__) - exit(0); -#endif -#endif - exit(1); -}], [db_cv_mutex="68K/gcc-assembly"]) -fi - -dnl x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([main(){ -#if defined(i386) || defined(__i386__) -#if defined(__GNUC__) - exit(0); -#endif -#endif - exit(1); -}], [db_cv_mutex="x86/gcc-assembly"]) -fi - -dnl x86_64/gcc: FreeBSD, NetBSD, BSD/OS, Linux -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([main(){ -#if defined(x86_64) || defined(__x86_64__) -#if defined(__GNUC__) - exit(0); -#endif -#endif - exit(1); -}], [db_cv_mutex="x86_64/gcc-assembly"]) -fi - -dnl ia86/gcc: Linux -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([main(){ -#if defined(__ia64) -#if defined(__GNUC__) - exit(0); -#endif -#endif - exit(1); -}], [db_cv_mutex="ia64/gcc-assembly"]) -fi - -dnl: uts/cc: UTS -if test "$db_cv_mutex" = no; then -AC_TRY_RUN([main(){ -#if defined(_UTS) - exit(0); -#endif - exit(1); -}], [db_cv_mutex="UTS/cc-assembly"]) -fi -]) - -if test "$db_cv_mutex" = no; then - AC_MSG_WARN( - [THREAD MUTEXES NOT AVAILABLE FOR THIS COMPILER/ARCHITECTURE.]) - ADDITIONAL_OBJS="mut_fcntl${o} $ADDITIONAL_OBJS" -else - AC_DEFINE(HAVE_MUTEX_THREADS) -fi - -case "$db_cv_mutex" in -68K/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_68K_GCC_ASSEMBLY);; -AIX/_check_lock) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_AIX_CHECK_LOCK);; -ALPHA/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_ALPHA_GCC_ASSEMBLY);; -HP/msem_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_HPPA_MSEM_INIT);; -HPPA/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_HPPA_GCC_ASSEMBLY);; -ia64/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_IA64_GCC_ASSEMBLY);; -POSIX/pthreads) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_PTHREADS);; -POSIX/pthreads/library) LIBS="-lpthread $LIBS" - ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_PTHREADS);; -PPC/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_PPC_GCC_ASSEMBLY);; -ReliantUNIX/initspin) LIBS="$LIBS -lmproc" - ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_RELIANTUNIX_INITSPIN);; -SCO/x86/cc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY);; -SGI/init_lock) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_SGI_INIT_LOCK);; -Solaris/_lock_try) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_SOLARIS_LOCK_TRY);; -Solaris/lwp) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_SOLARIS_LWP);; -Sparc/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_SPARC_GCC_ASSEMBLY);; -UI/threads) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_UI_THREADS);; -UI/threads/library) LIBS="-lthread $LIBS" - ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_UI_THREADS);; -UNIX/msem_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_MSEM_INIT);; -UNIX/sema_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_SEMA_INIT);; -UTS/cc-assembly) ADDITIONAL_OBJS="$ADDITIONAL_OBJS uts4.cc${o}" - AC_DEFINE(HAVE_MUTEX_UTS_CC_ASSEMBLY);; -x86/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" - AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY);; -esac -])dnl diff --git a/bdb/dist/aclocal/options.ac b/bdb/dist/aclocal/options.ac new file mode 100644 index 00000000000..ba45c34dfe9 --- /dev/null +++ b/bdb/dist/aclocal/options.ac @@ -0,0 +1,197 @@ +# $Id: options.ac,v 11.19 2002/06/25 19:31:48 bostic Exp $ + +# Process user-specified options. +AC_DEFUN(AM_OPTIONS_SET, [ + +# --enable-bigfile was the configuration option that Berkeley DB used before +# autoconf 2.50 was released (which had --enable-largefile integrated in). +AC_ARG_ENABLE(bigfile, + [AC_HELP_STRING([--disable-bigfile], + [Obsolete; use --disable-largefile instead.])], + [AC_MSG_ERROR( + [--enable-bigfile no longer supported, use --enable-largefile])]) + +AC_MSG_CHECKING(if --enable-compat185 option specified) +AC_ARG_ENABLE(compat185, + [AC_HELP_STRING([--enable-compat185], + [Build DB 1.85 compatibility API.])], + [db_cv_compat185="$enable_compat185"], [db_cv_compat185="no"]) +AC_MSG_RESULT($db_cv_compat185) + +AC_MSG_CHECKING(if --enable-cxx option specified) +AC_ARG_ENABLE(cxx, + [AC_HELP_STRING([--enable-cxx], + [Build C++ API.])], + [db_cv_cxx="$enable_cxx"], [db_cv_cxx="no"]) +AC_MSG_RESULT($db_cv_cxx) + +AC_MSG_CHECKING(if --enable-debug option specified) +AC_ARG_ENABLE(debug, + [AC_HELP_STRING([--enable-debug], + [Build a debugging version.])], + [db_cv_debug="$enable_debug"], [db_cv_debug="no"]) +AC_MSG_RESULT($db_cv_debug) + +AC_MSG_CHECKING(if --enable-debug_rop option specified) +AC_ARG_ENABLE(debug_rop, + [AC_HELP_STRING([--enable-debug_rop], + [Build a version that logs read operations.])], + [db_cv_debug_rop="$enable_debug_rop"], [db_cv_debug_rop="no"]) +AC_MSG_RESULT($db_cv_debug_rop) + +AC_MSG_CHECKING(if --enable-debug_wop option specified) +AC_ARG_ENABLE(debug_wop, + [AC_HELP_STRING([--enable-debug_wop], + [Build a version that logs write operations.])], + [db_cv_debug_wop="$enable_debug_wop"], [db_cv_debug_wop="no"]) +AC_MSG_RESULT($db_cv_debug_wop) + +AC_MSG_CHECKING(if --enable-diagnostic option specified) +AC_ARG_ENABLE(diagnostic, + [AC_HELP_STRING([--enable-diagnostic], + [Build a version with run-time diagnostics.])], + [db_cv_diagnostic="$enable_diagnostic"], [db_cv_diagnostic="no"]) +AC_MSG_RESULT($db_cv_diagnostic) + +AC_MSG_CHECKING(if --enable-dump185 option specified) +AC_ARG_ENABLE(dump185, + [AC_HELP_STRING([--enable-dump185], + [Build db_dump185(1) to dump 1.85 databases.])], + [db_cv_dump185="$enable_dump185"], [db_cv_dump185="no"]) +AC_MSG_RESULT($db_cv_dump185) + +AC_MSG_CHECKING(if --enable-java option specified) +AC_ARG_ENABLE(java, + [AC_HELP_STRING([--enable-java], + [Build Java API.])], + [db_cv_java="$enable_java"], [db_cv_java="no"]) +AC_MSG_RESULT($db_cv_java) + +AC_MSG_CHECKING(if --enable-posixmutexes option specified) +AC_ARG_ENABLE(posixmutexes, + [AC_HELP_STRING([--enable-posixmutexes], + [Force use of POSIX standard mutexes.])], + [db_cv_posixmutexes="$enable_posixmutexes"], [db_cv_posixmutexes="no"]) +AC_MSG_RESULT($db_cv_posixmutexes) + +AC_MSG_CHECKING(if --enable-rpc option specified) +AC_ARG_ENABLE(rpc, + [AC_HELP_STRING([--enable-rpc], + [Build RPC client/server.])], + [db_cv_rpc="$enable_rpc"], [db_cv_rpc="no"]) +AC_MSG_RESULT($db_cv_rpc) + +AC_MSG_CHECKING(if --enable-tcl option specified) +AC_ARG_ENABLE(tcl, + [AC_HELP_STRING([--enable-tcl], + [Build Tcl API.])], + [db_cv_tcl="$enable_tcl"], [db_cv_tcl="no"]) +AC_MSG_RESULT($db_cv_tcl) + +AC_MSG_CHECKING(if --enable-test option specified) +AC_ARG_ENABLE(test, + [AC_HELP_STRING([--enable-test], + [Configure to run the test suite.])], + [db_cv_test="$enable_test"], [db_cv_test="no"]) +AC_MSG_RESULT($db_cv_test) + +AC_MSG_CHECKING(if --enable-uimutexes option specified) +AC_ARG_ENABLE(uimutexes, + [AC_HELP_STRING([--enable-uimutexes], + [Force use of Unix International mutexes.])], + [db_cv_uimutexes="$enable_uimutexes"], [db_cv_uimutexes="no"]) +AC_MSG_RESULT($db_cv_uimutexes) + +AC_MSG_CHECKING(if --enable-umrw option specified) +AC_ARG_ENABLE(umrw, + [AC_HELP_STRING([--enable-umrw], + [Mask harmless unitialized memory read/writes.])], + [db_cv_umrw="$enable_umrw"], [db_cv_umrw="no"]) +AC_MSG_RESULT($db_cv_umrw) + +AC_MSG_CHECKING([if --with-embedix=DIR option specified]) +AC_ARG_WITH(embedix, + [AC_HELP_STRING([--with-embedix=DIR], + [Embedix install directory location.])], + [with_embedix="$withval"], [with_embedix="no"]) +if test "$with_embedix" = "no"; then + db_cv_embedix="no" + AC_MSG_RESULT($with_embedix) +else + db_cv_embedix="yes" + if test "$with_embedix" = "yes"; then + db_cv_path_embedix_install="/opt/Embedix" + else + db_cv_path_embedix_install="$with_embedix" + fi + AC_MSG_RESULT($db_cv_path_embedix_install) +fi + +AC_MSG_CHECKING(if --with-mutex=MUTEX option specified) +AC_ARG_WITH(mutex, + [AC_HELP_STRING([--with-mutex=MUTEX], + [Selection of non-standard mutexes.])], + [with_mutex="$withval"], [with_mutex="no"]) +if test "$with_mutex" = "yes"; then + AC_MSG_ERROR([--with-mutex requires a mutex name argument]) +fi +if test "$with_mutex" != "no"; then + db_cv_mutex="$with_mutex" +fi +AC_MSG_RESULT($with_mutex) + +AC_MSG_CHECKING(if --with-rpm=DIR option specified) +AC_ARG_WITH(rpm, + [AC_HELP_STRING([--with-rpm=DIR], + [Directory location of RPM archive.])], + [with_rpm="$withval"], [with_rpm="no"]) +if test "$with_rpm" = "no"; then + db_cv_rpm="no" +else + if test "$with_rpm" = "yes"; then + AC_MSG_ERROR([--with-rpm requires a directory argument]) + fi + db_cv_rpm="yes" + db_cv_path_rpm_archive="$with_rpm" +fi +AC_MSG_RESULT($with_rpm) + +AC_MSG_CHECKING([if --with-tcl=DIR option specified]) +AC_ARG_WITH(tcl, + [AC_HELP_STRING([--with-tcl=DIR], + [Directory location of tclConfig.sh.])], + [with_tclconfig="$withval"], [with_tclconfig="no"]) +AC_MSG_RESULT($with_tclconfig) +if test "$with_tclconfig" != "no"; then + db_cv_tcl="yes" +fi + +AC_MSG_CHECKING([if --with-uniquename=NAME option specified]) +AC_ARG_WITH(uniquename, + [AC_HELP_STRING([--with-uniquename=NAME], + [Build a uniquely named library.])], + [with_uniquename="$withval"], [with_uniquename="no"]) +if test "$with_uniquename" = "no"; then + db_cv_uniquename="no" + AC_MSG_RESULT($with_uniquename) +else + db_cv_uniquename="yes" + if test "$with_uniquename" != "yes"; then + DB_VERSION_UNIQUE_NAME="$with_uniquename" + fi + AC_MSG_RESULT($DB_VERSION_UNIQUE_NAME) +fi + +# Embedix requires RPM. +if test "$db_cv_embedix" = "yes"; then + if test "$db_cv_rpm" = "no"; then + AC_MSG_ERROR([--with-embedix requires --with-rpm]) + fi +fi + +# Test requires Tcl +if test "$db_cv_test" = "yes"; then + if test "$db_cv_tcl" = "no"; then + AC_MSG_ERROR([--enable-test requires --enable-tcl]) + fi +fi]) diff --git a/bdb/dist/aclocal/options.m4 b/bdb/dist/aclocal/options.m4 deleted file mode 100644 index c51a3952419..00000000000 --- a/bdb/dist/aclocal/options.m4 +++ /dev/null @@ -1,121 +0,0 @@ -dnl $Id: options.m4,v 11.10 2000/07/07 15:50:39 bostic Exp $ - -dnl Process user-specified options. -AC_DEFUN(AM_OPTIONS_SET, [ - -AC_MSG_CHECKING(if --disable-bigfile option specified) -AC_ARG_ENABLE(bigfile, - [ --disable-bigfile Disable AIX, HP/UX, Solaris big files.], - [db_cv_bigfile="yes"], [db_cv_bigfile="no"]) -AC_MSG_RESULT($db_cv_bigfile) - -AC_MSG_CHECKING(if --enable-compat185 option specified) -AC_ARG_ENABLE(compat185, - [ --enable-compat185 Build DB 1.85 compatibility API.], - [db_cv_compat185="$enable_compat185"], [db_cv_compat185="no"]) -AC_MSG_RESULT($db_cv_compat185) - -AC_MSG_CHECKING(if --enable-cxx option specified) -AC_ARG_ENABLE(cxx, - [ --enable-cxx Build C++ API.], - [db_cv_cxx="$enable_cxx"], [db_cv_cxx="no"]) -AC_MSG_RESULT($db_cv_cxx) - -AC_MSG_CHECKING(if --enable-debug option specified) -AC_ARG_ENABLE(debug, - [ --enable-debug Build a debugging version.], - [db_cv_debug="$enable_debug"], [db_cv_debug="no"]) -AC_MSG_RESULT($db_cv_debug) - -AC_MSG_CHECKING(if --enable-debug_rop option specified) -AC_ARG_ENABLE(debug_rop, - [ --enable-debug_rop Build a version that logs read operations.], - [db_cv_debug_rop="$enable_debug_rop"], [db_cv_debug_rop="no"]) -AC_MSG_RESULT($db_cv_debug_rop) - -AC_MSG_CHECKING(if --enable-debug_wop option specified) -AC_ARG_ENABLE(debug_wop, - [ --enable-debug_wop Build a version that logs write operations.], - [db_cv_debug_wop="$enable_debug_wop"], [db_cv_debug_wop="no"]) -AC_MSG_RESULT($db_cv_debug_wop) - -AC_MSG_CHECKING(if --enable-diagnostic option specified) -AC_ARG_ENABLE(diagnostic, - [ --enable-diagnostic Build a version with run-time diagnostics.], - [db_cv_diagnostic="$enable_diagnostic"], [db_cv_diagnostic="no"]) -AC_MSG_RESULT($db_cv_diagnostic) - -AC_MSG_CHECKING(if --enable-dump185 option specified) -AC_ARG_ENABLE(dump185, - [ --enable-dump185 Build db_dump185(1) to dump 1.85 databases.], - [db_cv_dump185="$enable_dump185"], [db_cv_dump185="no"]) -AC_MSG_RESULT($db_cv_dump185) - -AC_MSG_CHECKING(if --enable-dynamic option specified) -AC_ARG_ENABLE(dynamic, - [ --enable-dynamic Build with dynamic libraries.], - [db_cv_dynamic="$enable_dynamic"], [db_cv_dynamic="no"]) -AC_MSG_RESULT($db_cv_dynamic) - -AC_MSG_CHECKING(if --enable-java option specified) -AC_ARG_ENABLE(java, - [ --enable-java Build Java API.], - [db_cv_java="$enable_java"], [db_cv_java="no"]) -AC_MSG_RESULT($db_cv_java) - -AC_MSG_CHECKING(if --enable-posixmutexes option specified) -AC_ARG_ENABLE(posixmutexes, - [ --enable-posixmutexes Force use of POSIX standard mutexes.], - [db_cv_posixmutexes="$enable_posixmutexes"], [db_cv_posixmutexes="no"]) -AC_MSG_RESULT($db_cv_posixmutexes) - -AC_MSG_CHECKING(if --enable-rpc option specified) -AC_ARG_ENABLE(rpc, - [ --enable-rpc Build RPC client/server.], - [db_cv_rpc="$enable_rpc"], [db_cv_rpc="no"]) -AC_MSG_RESULT($db_cv_rpc) - -dnl --enable-shared is an alias for --enable-dynamic. We support it for -dnl compatibility with other applications, e.g., Tcl. -AC_MSG_CHECKING(if --enable-shared option specified) -AC_ARG_ENABLE(shared, - [ --enable-shared Build with dynamic libraries.], - [db_cv_shared="$enable_shared"], [db_cv_shared="no"]) -AC_MSG_RESULT($db_cv_shared) -if test "$db_cv_shared" != "no"; then - db_cv_dynamic="yes" -fi - -AC_MSG_CHECKING(if --enable-tcl option specified) -AC_ARG_ENABLE(tcl, - [ --enable-tcl Build Tcl API.], - [db_cv_tcl="$enable_tcl"], [db_cv_tcl="no"]) -AC_MSG_RESULT($db_cv_tcl) - -AC_MSG_CHECKING(if --enable-test option specified) -AC_ARG_ENABLE(test, - [ --enable-test Configure to run the test suite.], - [db_cv_test="$enable_test"], [db_cv_test="no"]) -AC_MSG_RESULT($db_cv_test) - -AC_MSG_CHECKING(if --enable-uimutexes option specified) -AC_ARG_ENABLE(uimutexes, - [ --enable-uimutexes Force use of Unix International mutexes.], - [db_cv_uimutexes="$enable_uimutexes"], [db_cv_uimutexes="no"]) -AC_MSG_RESULT($db_cv_uimutexes) - -AC_MSG_CHECKING(if --enable-umrw option specified) -AC_ARG_ENABLE(umrw, - [ --enable-umrw Mask harmless unitialized memory read/writes.], - [db_cv_umrw="$enable_umrw"], [db_cv_umrw="no"]) -AC_MSG_RESULT($db_cv_umrw) - -AC_MSG_CHECKING([if --with-tcl option specified]) -AC_ARG_WITH(tcl, - [ --with-tcl=DIR Directory location of tclConfig.sh.], - with_tclconfig=${withval}, with_tclconfig="no") -AC_MSG_RESULT($with_tclconfig) -if test "$with_tclconfig" != "no"; then - db_cv_tcl="yes" -fi -])dnl diff --git a/bdb/dist/aclocal/programs.ac b/bdb/dist/aclocal/programs.ac new file mode 100644 index 00000000000..7bfa1fa2646 --- /dev/null +++ b/bdb/dist/aclocal/programs.ac @@ -0,0 +1,80 @@ +# $Id: programs.ac,v 11.20 2001/09/24 02:09:25 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(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(db_cv_path_cp, cp, missing_cp) +if test "$db_cv_path_cp" = missing_cp; then + AC_MSG_ERROR([No cp utility found.]) +fi + +if test "$db_cv_rpm" = "yes"; then + AC_CHECK_TOOL(path_ldconfig, ldconfig, missing_ldconfig) + AC_PATH_PROG(db_cv_path_ldconfig, $path_ldconfig, missing_ldconfig) + if test "$db_cv_path_ldconfig" != missing_ldconfig; then + RPM_POST_INSTALL="%post -p $db_cv_path_ldconfig" + RPM_POST_UNINSTALL="%postun -p $db_cv_path_ldconfig" + fi +fi + +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.]) +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 + +# 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(db_cv_path_rm, rm, missing_rm) +if test "$db_cv_path_rm" = missing_rm; then + AC_MSG_ERROR([No rm utility found.]) +fi + +if test "$db_cv_rpm" = "yes"; then + AC_CHECK_TOOL(db_cv_path_rpm, rpm, missing_rpm) + if test "$db_cv_path_rpm" = missing_rpm; then + AC_MSG_ERROR([No rpm utility found.]) + 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. +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 + +# 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 + 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 + +]) diff --git a/bdb/dist/aclocal/programs.m4 b/bdb/dist/aclocal/programs.m4 deleted file mode 100644 index 9ec04f4d8cd..00000000000 --- a/bdb/dist/aclocal/programs.m4 +++ /dev/null @@ -1,48 +0,0 @@ -dnl $Id: programs.m4,v 11.11 2000/03/30 21:20:50 bostic Exp $ - -dnl Check for programs used in building/installation. -AC_DEFUN(AM_PROGRAMS_SET, [ - -AC_PATH_PROG(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_PATH_PROG(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_PATH_PROG(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_PATH_PROG(db_cv_path_ln, ln, missing_ln) -if test "$db_cv_path_ln" = missing_ln; then - AC_MSG_ERROR([No ln utility found.]) -fi -AC_PATH_PROG(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_PATH_PROG(db_cv_path_ranlib, ranlib, missing_ranlib) -AC_PATH_PROG(db_cv_path_rm, rm, missing_rm) -if test "$db_cv_path_rm" = missing_rm; then - AC_MSG_ERROR([No rm utility found.]) -fi -AC_PATH_PROG(db_cv_path_sh, sh, missing_sh) -if test "$db_cv_path_sh" = missing_sh; then - AC_MSG_ERROR([No sh utility found.]) -fi -AC_PATH_PROG(db_cv_path_strip, strip, missing_strip) -if test "$db_cv_path_strip" = missing_strip; then - AC_MSG_ERROR([No strip utility found.]) -fi - -dnl Check for programs used in testing. -if test "$db_cv_test" = "yes"; then - AC_PATH_PROG(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 - -])dnl diff --git a/bdb/dist/aclocal/sosuffix.ac b/bdb/dist/aclocal/sosuffix.ac new file mode 100644 index 00000000000..1197128293b --- /dev/null +++ b/bdb/dist/aclocal/sosuffix.ac @@ -0,0 +1,69 @@ +# $Id: sosuffix.ac,v 1.1 2002/07/08 13:15:05 dda Exp $ +# Determine shared object suffixes. +# +# Our method is to use the libtool variable $library_names_spec, +# set by using AC_PROG_LIBTOOL. This variable is a snippet of shell +# defined in terms of $versuffix, $release, $libname, $module and $jnimodule. +# We want to eval it and grab the suffix used for shared objects. +# By setting $module and $jnimodule to yes/no, we obtain the suffixes +# used to create dlloadable, or java loadable modules. +# On many (*nix) systems, these all evaluate to .so, but there +# are some notable exceptions. + +# This macro is used internally to discover the suffix for the current +# settings of $module and $jnimodule. The result is stored in $_SOSUFFIX. +AC_DEFUN(_SOSUFFIX_INTERNAL, [ + versuffix="" + release="" + libname=libfoo + eval library_names=\"$library_names_spec\" + _SOSUFFIX=`echo "$library_names" | sed -e 's/.*\.\([[a-zA-Z0-9_]]*\).*/\1/'` + if test "$_SOSUFFIX" = '' ; then + _SOSUFFIX=so + if test "$enable_shared" = "yes" && test "$_SOSUFFIX_MESSAGE" = ""; then + _SOSUFFIX_MESSAGE=yes + AC_MSG_WARN([libtool may not know about this architecture.]) + AC_MSG_WARN([assuming .$_SUFFIX suffix for dynamic libraries.]) + fi + fi +]) + +# SOSUFFIX_CONFIG will set the variable SOSUFFIX to be the +# shared library extension used for general linking, not dlopen. +AC_DEFUN(SOSUFFIX_CONFIG, [ + AC_MSG_CHECKING([SOSUFFIX from libtool]) + module=no + jnimodule=no + _SOSUFFIX_INTERNAL + SOSUFFIX=$_SOSUFFIX + AC_MSG_RESULT($SOSUFFIX) + AC_SUBST(SOSUFFIX) +]) + +# MODSUFFIX_CONFIG will set the variable MODSUFFIX to be the +# shared library extension used for dlopen'ed modules. +# To discover this, we set $module, simulating libtool's -module option. +AC_DEFUN(MODSUFFIX_CONFIG, [ + AC_MSG_CHECKING([MODSUFFIX from libtool]) + module=yes + jnimodule=no + _SOSUFFIX_INTERNAL + MODSUFFIX=$_SOSUFFIX + AC_MSG_RESULT($MODSUFFIX) + AC_SUBST(MODSUFFIX) +]) + +# JMODSUFFIX_CONFIG will set the variable JMODSUFFIX to be the +# shared library extension used JNI modules opened by Java. +# To discover this, we set $jnimodule, simulating libtool's -jnimodule option. +# -jnimodule is currently a Sleepycat local extension to libtool. +AC_DEFUN(JMODSUFFIX_CONFIG, [ + AC_MSG_CHECKING([JMODSUFFIX from libtool]) + module=yes + jnimodule=yes + _SOSUFFIX_INTERNAL + JMODSUFFIX=$_SOSUFFIX + AC_MSG_RESULT($JMODSUFFIX) + AC_SUBST(JMODSUFFIX) +]) + diff --git a/bdb/dist/aclocal/tcl.ac b/bdb/dist/aclocal/tcl.ac new file mode 100644 index 00000000000..80ed19c5a97 --- /dev/null +++ b/bdb/dist/aclocal/tcl.ac @@ -0,0 +1,136 @@ +# $Id: tcl.ac,v 11.14 2002/09/07 17:25:58 dda 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 +# terms for the Berkeley DB distribution dist/aclocal/tcl.m4 file are as +# follows (copied from the license.terms file in the Tcl 8.3 distribution): +# +# This software is copyrighted by the Regents of the University of +# California, Sun Microsystems, Inc., Scriptics Corporation, +# and other parties. The following terms apply to all files associated +# with the software unless explicitly disclaimed in individual files. +# +# The authors hereby grant permission to use, copy, modify, distribute, +# and license this software and its documentation for any purpose, provided +# that existing copyright notices are retained in all copies and that this +# notice is included verbatim in any distributions. No written agreement, +# license, or royalty fee is required for any of the authorized uses. +# Modifications to this software may be copyrighted by their authors +# and need not follow the licensing terms described here, provided that +# the new terms are clearly indicated on the first page of each file where +# they apply. +# +# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY +# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY +# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE +# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE +# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +# MODIFICATIONS. +# +# GOVERNMENT USE: If you are acquiring this software on behalf of the +# U.S. government, the Government shall have only "Restricted Rights" +# in the software and related documentation as defined in the Federal +# Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you +# are acquiring the software on behalf of the Department of Defense, the +# software shall be classified as "Commercial Computer Software" and the +# Government shall have only "Restricted Rights" as defined in Clause +# 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the +# authors grant the U.S. Government and others acting in its behalf +# permission to use and distribute the software in accordance with the +# terms specified in this license. + +AC_DEFUN(SC_PATH_TCLCONFIG, [ + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + # First check to see if --with-tclconfig was specified. + if test "${with_tclconfig}" != no; then + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) + fi + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d /usr/local/lib 2>/dev/null` ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + ]) + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + AC_MSG_ERROR(can't find Tcl configuration definitions) + else + TCL_BIN_DIR=${ac_cv_c_tclconfig} + fi +]) + +AC_DEFUN(SC_LOAD_TCLCONFIG, [ + AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) + + if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . $TCL_BIN_DIR/tclConfig.sh + else + AC_MSG_RESULT([file not found]) + 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}" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + + # + # If the DB Tcl library isn't loaded with the Tcl spec and library + # flags on AIX, the resulting libdb_tcl-X.Y.so.0 will drop core at + # load time. [#4843] Furthermore, with Tcl 8.3, the link flags + # given by the Tcl spec are insufficient for our use. [#5779] + # + case "$host_os" in + aix4.[[2-9]].*) + LIBTSO_LIBS="$LIBTSO_LIBS $TCL_LIB_SPEC $TCL_LIB_FLAG" + LIBTSO_LIBS="$LIBTSO_LIBS -L$TCL_EXEC_PREFIX/lib -ltcl$TCL_VERSION";; + aix*) + LIBTSO_LIBS="$LIBTSO_LIBS $TCL_LIB_SPEC $TCL_LIB_FLAG";; + esac + AC_SUBST(TCL_BIN_DIR) + AC_SUBST(TCL_SRC_DIR) + AC_SUBST(TCL_LIB_FILE) + + AC_SUBST(TCL_TCLSH) + TCL_TCLSH="${TCL_PREFIX}/bin/tclsh${TCL_VERSION}" +]) + +# Optional Tcl API. +AC_DEFUN(AM_TCL_LOAD, [ +if test "$db_cv_tcl" = "yes"; then + if test "$enable_shared" = "no"; then + 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)" +fi]) diff --git a/bdb/dist/aclocal/tcl.m4 b/bdb/dist/aclocal/tcl.m4 deleted file mode 100644 index 3d0aec2e8ff..00000000000 --- a/bdb/dist/aclocal/tcl.m4 +++ /dev/null @@ -1,126 +0,0 @@ -dnl $Id: tcl.m4,v 11.5 2000/06/27 13:21:28 bostic Exp $ - -dnl The SC_* macros in this file are from the unix/tcl.m4 files in the Tcl -dnl 8.3.0 distribution, with some minor changes. For this reason, license -dnl terms for the Berkeley DB distribution dist/aclocal/tcl.m4 file are as -dnl follows (copied from the license.terms file in the Tcl 8.3 distribution): -dnl -dnl This software is copyrighted by the Regents of the University of -dnl California, Sun Microsystems, Inc., Scriptics Corporation, -dnl and other parties. The following terms apply to all files associated -dnl with the software unless explicitly disclaimed in individual files. -dnl -dnl The authors hereby grant permission to use, copy, modify, distribute, -dnl and license this software and its documentation for any purpose, provided -dnl that existing copyright notices are retained in all copies and that this -dnl notice is included verbatim in any distributions. No written agreement, -dnl license, or royalty fee is required for any of the authorized uses. -dnl Modifications to this software may be copyrighted by their authors -dnl and need not follow the licensing terms described here, provided that -dnl the new terms are clearly indicated on the first page of each file where -dnl they apply. -dnl -dnl IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -dnl FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -dnl ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -dnl DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -dnl POSSIBILITY OF SUCH DAMAGE. -dnl -dnl THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -dnl FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -dnl IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -dnl NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -dnl MODIFICATIONS. -dnl -dnl GOVERNMENT USE: If you are acquiring this software on behalf of the -dnl U.S. government, the Government shall have only "Restricted Rights" -dnl in the software and related documentation as defined in the Federal -dnl Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -dnl are acquiring the software on behalf of the Department of Defense, the -dnl software shall be classified as "Commercial Computer Software" and the -dnl Government shall have only "Restricted Rights" as defined in Clause -dnl 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -dnl authors grant the U.S. Government and others acting in its behalf -dnl permission to use and distribute the software in accordance with the -dnl terms specified in this license. - -AC_DEFUN(SC_PATH_TCLCONFIG, [ - AC_CACHE_VAL(ac_cv_c_tclconfig,[ - - # First check to see if --with-tclconfig was specified. - if test "${with_tclconfig}" != no; then - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) - fi - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d /usr/local/lib 2>/dev/null` ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - ]) - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - AC_MSG_ERROR(can't find Tcl configuration definitions) - else - TCL_BIN_DIR=${ac_cv_c_tclconfig} - fi -]) - -AC_DEFUN(SC_LOAD_TCLCONFIG, [ - AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) - - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . $TCL_BIN_DIR/tclConfig.sh - else - AC_MSG_RESULT([file not found]) - 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}" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - - AC_SUBST(TCL_BIN_DIR) - AC_SUBST(TCL_SRC_DIR) - AC_SUBST(TCL_LIB_FILE) - - AC_SUBST(TCL_TCLSH) - TCL_TCLSH="${TCL_PREFIX}/bin/tclsh${TCL_VERSION}" -]) - -dnl Optional Tcl API. -AC_DEFUN(AM_TCL_LOAD, [ -if test "$db_cv_tcl" != no; then - if test "$db_cv_dynamic" != "yes"; then - AC_MSG_ERROR([--with-tcl requires --enable-dynamic]) - 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 - - LIBS="$LIBS $TCL_LIB_SPEC $TCL_LIBS" - - ADDITIONAL_LIBS="$ADDITIONAL_LIBS \$(libtso_target)" - DEFAULT_INSTALL="${DEFAULT_INSTALL} install_tcl" -fi]) diff --git a/bdb/dist/aclocal/types.ac b/bdb/dist/aclocal/types.ac new file mode 100644 index 00000000000..db8aaac6884 --- /dev/null +++ b/bdb/dist/aclocal/types.ac @@ -0,0 +1,146 @@ +# $Id: types.ac,v 11.10 2001/12/10 14:16:49 bostic Exp $ + +# 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] +AC_DEFUN(DB_INCLUDES, [[ +#include +#include ]]) + +# Check the sizes we know about, and see if any of them match what's needed. +# +# Prefer ints to anything else, because read, write and others historically +# returned an int. +AC_DEFUN(AM_SEARCH_USIZES, [ + case "$3" in + "$ac_cv_sizeof_unsigned_int") + $1="typedef unsigned int $2;";; + "$ac_cv_sizeof_unsigned_char") + $1="typedef unsigned char $2;";; + "$ac_cv_sizeof_unsigned_short") + $1="typedef unsigned short $2;";; + "$ac_cv_sizeof_unsigned_long") + $1="typedef unsigned long $2;";; + *) + AC_MSG_ERROR([No unsigned $3-byte integral type]);; + esac]) +AC_DEFUN(AM_SEARCH_SSIZES, [ + case "$3" in + "$ac_cv_sizeof_int") + $1="typedef int $2;";; + "$ac_cv_sizeof_char") + $1="typedef char $2;";; + "$ac_cv_sizeof_short") + $1="typedef short $2;";; + "$ac_cv_sizeof_long") + $1="typedef long $2;";; + *) + AC_MSG_ERROR([No signed $3-byte integral type]);; + esac]) + +# Check for the standard system types. +AC_DEFUN(AM_TYPES, [ + +# We need to know the sizes of various objects on this system. +# We don't use the SIZEOF_XXX values created by autoconf. +AC_CHECK_SIZEOF(char,, DB_INCLUDES) +AC_CHECK_SIZEOF(unsigned char,, DB_INCLUDES) +AC_CHECK_SIZEOF(short,, DB_INCLUDES) +AC_CHECK_SIZEOF(unsigned short,, DB_INCLUDES) +AC_CHECK_SIZEOF(int,, DB_INCLUDES) +AC_CHECK_SIZEOF(unsigned int,, DB_INCLUDES) +AC_CHECK_SIZEOF(long,, DB_INCLUDES) +AC_CHECK_SIZEOF(unsigned long,, DB_INCLUDES) +AC_CHECK_SIZEOF(size_t,, DB_INCLUDES) +AC_CHECK_SIZEOF(char *,, DB_INCLUDES) + +# We require off_t and size_t, and we don't try to substitute our own +# if we can't find them. +AC_CHECK_TYPE(off_t,,, DB_INCLUDES) +if test "$ac_cv_type_off_t" = no; then + AC_MSG_ERROR([No off_t type.]) +fi + +AC_CHECK_TYPE(size_t,,, DB_INCLUDES) +if test "$ac_cv_type_size_t" = no; then + AC_MSG_ERROR([No size_t type.]) +fi + +# We look for u_char, u_short, u_int, u_long -- if we can't find them, +# we create our own. +AC_SUBST(u_char_decl) +AC_CHECK_TYPE(u_char,,, DB_INCLUDES) +if test "$ac_cv_type_u_char" = no; then + u_char_decl="typedef unsigned char u_char;" +fi + +AC_SUBST(u_short_decl) +AC_CHECK_TYPE(u_short,,, DB_INCLUDES) +if test "$ac_cv_type_u_short" = no; then + u_short_decl="typedef unsigned short u_short;" +fi + +AC_SUBST(u_int_decl) +AC_CHECK_TYPE(u_int,,, DB_INCLUDES) +if test "$ac_cv_type_u_int" = no; then + u_int_decl="typedef unsigned int u_int;" +fi + +AC_SUBST(u_long_decl) +AC_CHECK_TYPE(u_long,,, DB_INCLUDES) +if test "$ac_cv_type_u_long" = no; then + u_long_decl="typedef unsigned long u_long;" +fi + +AC_SUBST(u_int8_decl) +AC_CHECK_TYPE(u_int8_t,,, DB_INCLUDES) +if test "$ac_cv_type_u_int8_t" = no; then + AM_SEARCH_USIZES(u_int8_decl, u_int8_t, 1) +fi + +AC_SUBST(u_int16_decl) +AC_CHECK_TYPE(u_int16_t,,, DB_INCLUDES) +if test "$ac_cv_type_u_int16_t" = no; then + AM_SEARCH_USIZES(u_int16_decl, u_int16_t, 2) +fi + +AC_SUBST(int16_decl) +AC_CHECK_TYPE(int16_t,,, DB_INCLUDES) +if test "$ac_cv_type_int16_t" = no; then + AM_SEARCH_SSIZES(int16_decl, int16_t, 2) +fi + +AC_SUBST(u_int32_decl) +AC_CHECK_TYPE(u_int32_t,,, DB_INCLUDES) +if test "$ac_cv_type_u_int32_t" = no; then + AM_SEARCH_USIZES(u_int32_decl, u_int32_t, 4) +fi + +AC_SUBST(int32_decl) +AC_CHECK_TYPE(int32_t,,, DB_INCLUDES) +if test "$ac_cv_type_int32_t" = no; then + AM_SEARCH_SSIZES(int32_decl, int32_t, 4) +fi + +# Check for ssize_t -- if none exists, find a signed integral type that's +# the same size as a size_t. +AC_SUBST(ssize_t_decl) +AC_CHECK_TYPE(ssize_t,,, DB_INCLUDES) +if test "$ac_cv_type_ssize_t" = no; then + AM_SEARCH_SSIZES(ssize_t_decl, ssize_t, $ac_cv_sizeof_size_t) +fi + +# Find the largest integral type. +AC_SUBST(db_align_t_decl) +AC_CHECK_TYPE(unsigned long long,,, DB_INCLUDES) +if test "$ac_cv_type_unsigned_long_long" = no; then + db_align_t_decl="typedef unsigned long db_align_t;" +else + db_align_t_decl="typedef unsigned long long db_align_t;" +fi + +# Find an integral type which is the same size as a pointer. +AC_SUBST(db_alignp_t_decl) +AM_SEARCH_USIZES(db_alignp_t_decl, db_alignp_t, $ac_cv_sizeof_char_p) + +]) diff --git a/bdb/dist/aclocal/types.m4 b/bdb/dist/aclocal/types.m4 deleted file mode 100644 index a9a03ab6d87..00000000000 --- a/bdb/dist/aclocal/types.m4 +++ /dev/null @@ -1,139 +0,0 @@ -dnl $Id: types.m4,v 11.4 1999/12/04 19:18:28 bostic Exp $ - -dnl Check for the standard shorthand types. -AC_DEFUN(AM_SHORTHAND_TYPES, [dnl - -AC_SUBST(ssize_t_decl) -AC_CACHE_CHECK([for ssize_t], db_cv_ssize_t, [dnl -AC_TRY_COMPILE([#include ], ssize_t foo;, - [db_cv_ssize_t=yes], [db_cv_ssize_t=no])]) -if test "$db_cv_ssize_t" = no; then - ssize_t_decl="typedef int ssize_t;" -fi - -AC_SUBST(u_char_decl) -AC_CACHE_CHECK([for u_char], db_cv_uchar, [dnl -AC_TRY_COMPILE([#include ], u_char foo;, - [db_cv_uchar=yes], [db_cv_uchar=no])]) -if test "$db_cv_uchar" = no; then - u_char_decl="typedef unsigned char u_char;" -fi - -AC_SUBST(u_short_decl) -AC_CACHE_CHECK([for u_short], db_cv_ushort, [dnl -AC_TRY_COMPILE([#include ], u_short foo;, - [db_cv_ushort=yes], [db_cv_ushort=no])]) -if test "$db_cv_ushort" = no; then - u_short_decl="typedef unsigned short u_short;" -fi - -AC_SUBST(u_int_decl) -AC_CACHE_CHECK([for u_int], db_cv_uint, [dnl -AC_TRY_COMPILE([#include ], u_int foo;, - [db_cv_uint=yes], [db_cv_uint=no])]) -if test "$db_cv_uint" = no; then - u_int_decl="typedef unsigned int u_int;" -fi - -AC_SUBST(u_long_decl) -AC_CACHE_CHECK([for u_long], db_cv_ulong, [dnl -AC_TRY_COMPILE([#include ], u_long foo;, - [db_cv_ulong=yes], [db_cv_ulong=no])]) -if test "$db_cv_ulong" = no; then - u_long_decl="typedef unsigned long u_long;" -fi - -dnl DB/Vi use specific integer sizes. -AC_SUBST(u_int8_decl) -AC_CACHE_CHECK([for u_int8_t], db_cv_uint8, [dnl -AC_TRY_COMPILE([#include ], u_int8_t foo;, - [db_cv_uint8=yes], - AC_TRY_RUN([main(){exit(sizeof(unsigned char) != 1);}], - [db_cv_uint8="unsigned char"], [db_cv_uint8=no]))]) -if test "$db_cv_uint8" = no; then - AC_MSG_ERROR(No unsigned 8-bit integral type.) -fi -if test "$db_cv_uint8" != yes; then - u_int8_decl="typedef $db_cv_uint8 u_int8_t;" -fi - -AC_SUBST(u_int16_decl) -AC_CACHE_CHECK([for u_int16_t], db_cv_uint16, [dnl -AC_TRY_COMPILE([#include ], u_int16_t foo;, - [db_cv_uint16=yes], -AC_TRY_RUN([main(){exit(sizeof(unsigned short) != 2);}], - [db_cv_uint16="unsigned short"], -AC_TRY_RUN([main(){exit(sizeof(unsigned int) != 2);}], - [db_cv_uint16="unsigned int"], [db_cv_uint16=no])))]) -if test "$db_cv_uint16" = no; then - AC_MSG_ERROR([No unsigned 16-bit integral type.]) -fi -if test "$db_cv_uint16" != yes; then - u_int16_decl="typedef $db_cv_uint16 u_int16_t;" -fi - -AC_SUBST(int16_decl) -AC_CACHE_CHECK([for int16_t], db_cv_int16, [dnl -AC_TRY_COMPILE([#include ], int16_t foo;, - [db_cv_int16=yes], -AC_TRY_RUN([main(){exit(sizeof(short) != 2);}], - [db_cv_int16="short"], -AC_TRY_RUN([main(){exit(sizeof(int) != 2);}], - [db_cv_int16="int"], [db_cv_int16=no])))]) -if test "$db_cv_int16" = no; then - AC_MSG_ERROR([No signed 16-bit integral type.]) -fi -if test "$db_cv_int16" != yes; then - int16_decl="typedef $db_cv_int16 int16_t;" -fi - -AC_SUBST(u_int32_decl) -AC_CACHE_CHECK([for u_int32_t], db_cv_uint32, [dnl -AC_TRY_COMPILE([#include ], u_int32_t foo;, - [db_cv_uint32=yes], -AC_TRY_RUN([main(){exit(sizeof(unsigned int) != 4);}], - [db_cv_uint32="unsigned int"], -AC_TRY_RUN([main(){exit(sizeof(unsigned long) != 4);}], - [db_cv_uint32="unsigned long"], [db_cv_uint32=no])))]) -if test "$db_cv_uint32" = no; then - AC_MSG_ERROR([No unsigned 32-bit integral type.]) -fi -if test "$db_cv_uint32" != yes; then - u_int32_decl="typedef $db_cv_uint32 u_int32_t;" -fi - -AC_SUBST(int32_decl) -AC_CACHE_CHECK([for int32_t], db_cv_int32, [dnl -AC_TRY_COMPILE([#include ], int32_t foo;, - [db_cv_int32=yes], -AC_TRY_RUN([main(){exit(sizeof(int) != 4);}], - [db_cv_int32="int"], -AC_TRY_RUN([main(){exit(sizeof(long) != 4);}], - [db_cv_int32="long"], [db_cv_int32=no])))]) -if test "$db_cv_int32" = no; then - AC_MSG_ERROR([No signed 32-bit integral type.]) -fi -if test "$db_cv_int32" != yes; then - int32_decl="typedef $db_cv_int32 int32_t;" -fi - -dnl Figure out largest integral type. -AC_SUBST(db_align_t_decl) -AC_CACHE_CHECK([for largest integral type], db_cv_align_t, [dnl -AC_TRY_COMPILE([#include ], long long foo;, - [db_cv_align_t="unsigned long long"], [db_cv_align_t="unsigned long"])]) -db_align_t_decl="typedef $db_cv_align_t db_align_t;" - -dnl Figure out integral type the same size as a pointer. -AC_SUBST(db_alignp_t_decl) -AC_CACHE_CHECK([for integral type equal to pointer size], db_cv_alignp_t, [dnl -db_cv_alignp_t=$db_cv_align_t -AC_TRY_RUN([main(){exit(sizeof(unsigned int) != sizeof(char *));}], - [db_cv_alignp_t="unsigned int"]) -AC_TRY_RUN([main(){exit(sizeof(unsigned long) != sizeof(char *));}], - [db_cv_alignp_t="unsigned long"]) -AC_TRY_RUN([main(){exit(sizeof(unsigned long long) != sizeof(char *));}], - [db_cv_alignp_t="unsigned long long"])]) -db_alignp_t_decl="typedef $db_cv_alignp_t db_alignp_t;" - -])dnl diff --git a/bdb/dist/aclocal_java/ac_check_class.ac b/bdb/dist/aclocal_java/ac_check_class.ac new file mode 100644 index 00000000000..915198af567 --- /dev/null +++ b/bdb/dist/aclocal_java/ac_check_class.ac @@ -0,0 +1,107 @@ +dnl @synopsis AC_CHECK_CLASS +dnl +dnl AC_CHECK_CLASS tests the existence of a given Java class, either in +dnl a jar or in a '.class' file. +dnl +dnl *Warning*: its success or failure can depend on a proper setting of the +dnl CLASSPATH env. variable. +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +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 +AC_DEFUN([AC_CHECK_CLASS],[ +AC_REQUIRE([AC_PROG_JAVA]) +ac_var_name=`echo $1 | sed 's/\./_/g'` +dnl Normaly I'd use a AC_CACHE_CHECK here but since the variable name is +dnl dynamic I need an extra level of extraction +AC_MSG_CHECKING([for $1 class]) +AC_CACHE_VAL(ac_cv_class_$ac_var_name, [ +if test x$ac_cv_prog_uudecode_base64 = xyes; then +dnl /** +dnl * Test.java: used to test dynamicaly if a class exists. +dnl */ +dnl public class Test +dnl { +dnl +dnl public static void +dnl main( String[] argv ) +dnl { +dnl Class lib; +dnl if (argv.length < 1) +dnl { +dnl System.err.println ("Missing argument"); +dnl System.exit (77); +dnl } +dnl try +dnl { +dnl lib = Class.forName (argv[0]); +dnl } +dnl catch (ClassNotFoundException e) +dnl { +dnl System.exit (1); +dnl } +dnl lib = null; +dnl System.exit (0); +dnl } +dnl +dnl } +cat << \EOF > Test.uue +begin-base64 644 Test.class +yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE +bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 +bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ +AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt +ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV +ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp +VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM +amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi +AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B +AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA +AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN +uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK +AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA +JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA +JwAAAAIAKA== +==== +EOF + if uudecode$EXEEXT Test.uue; then + : + else + echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC + echo "configure: failed file was:" >&AC_FD_CC + cat Test.uue >&AC_FD_CC + ac_cv_prog_uudecode_base64=no + fi + rm -f Test.uue + if AC_TRY_COMMAND($JAVA $JAVAFLAGS Test $1) >/dev/null 2>&1; then + eval "ac_cv_class_$ac_var_name=yes" + else + eval "ac_cv_class_$ac_var_name=no" + fi + rm -f Test.class +else + AC_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"], + [eval "ac_cv_class_$ac_var_name=no"]) +fi +eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" +eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`" +HAVE_LAST_CLASS=$ac_var_val +if test x$ac_var_val = xyes; then + ifelse([$2], , :, [$2]) +else + ifelse([$3], , :, [$3]) +fi +]) +dnl for some reason the above statment didn't fall though here? +dnl do scripts have variable scoping? +eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" +AC_MSG_RESULT($ac_var_val) +]) diff --git a/bdb/dist/aclocal_java/ac_check_classpath.ac b/bdb/dist/aclocal_java/ac_check_classpath.ac new file mode 100644 index 00000000000..4a78d0f8785 --- /dev/null +++ b/bdb/dist/aclocal_java/ac_check_classpath.ac @@ -0,0 +1,23 @@ +dnl @synopsis AC_CHECK_CLASSPATH +dnl +dnl AC_CHECK_CLASSPATH just displays the CLASSPATH, for the edification +dnl of the user. +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +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 +AC_DEFUN([AC_CHECK_CLASSPATH],[ +if test "x$CLASSPATH" = x; then + echo "You have no CLASSPATH, I hope it is good" +else + echo "You have CLASSPATH $CLASSPATH, hope it is correct" +fi +]) diff --git a/bdb/dist/aclocal_java/ac_check_junit.ac b/bdb/dist/aclocal_java/ac_check_junit.ac new file mode 100644 index 00000000000..3b81d1dc3fc --- /dev/null +++ b/bdb/dist/aclocal_java/ac_check_junit.ac @@ -0,0 +1,54 @@ +dnl @synopsis AC_CHECK_JUNIT +dnl +dnl AC_CHECK_JUNIT tests the availability of the Junit testing +dnl framework, and set some variables for conditional compilation +dnl of the test suite by automake. +dnl +dnl If available, JUNIT is set to a command launching the text +dnl based user interface of Junit, @JAVA_JUNIT@ is set to $JAVA_JUNIT +dnl and @TESTS_JUNIT@ is set to $TESTS_JUNIT, otherwise they are set +dnl to empty values. +dnl +dnl You can use these variables in your Makefile.am file like this : +dnl +dnl # Some of the following classes are built only if junit is available +dnl JAVA_JUNIT = Class1Test.java Class2Test.java AllJunitTests.java +dnl +dnl noinst_JAVA = Example1.java Example2.java @JAVA_JUNIT@ +dnl +dnl EXTRA_JAVA = $(JAVA_JUNIT) +dnl +dnl TESTS_JUNIT = AllJunitTests +dnl +dnl TESTS = StandaloneTest1 StandaloneTest2 @TESTS_JUNIT@ +dnl +dnl EXTRA_TESTS = $(TESTS_JUNIT) +dnl +dnl AllJunitTests : +dnl echo "#! /bin/sh" > $@ +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 +AC_DEFUN([AC_CHECK_JUNIT],[ +AC_CACHE_VAL(ac_cv_prog_JUNIT,[ +AC_CHECK_CLASS(junit.textui.TestRunner) +if test x"`eval 'echo $ac_cv_class_junit_textui_TestRunner'`" != xno ; then + ac_cv_prog_JUNIT='$(CLASSPATH_ENV) $(JAVA) $(JAVAFLAGS) junit.textui.TestRunner' +fi]) +AC_MSG_CHECKING([for junit]) +if test x"`eval 'echo $ac_cv_prog_JUNIT'`" != x ; then + JUNIT="$ac_cv_prog_JUNIT" + JAVA_JUNIT='$(JAVA_JUNIT)' + TESTS_JUNIT='$(TESTS_JUNIT)' +else + JUNIT= + JAVA_JUNIT= + TESTS_JUNIT= +fi +AC_MSG_RESULT($JAVA_JUNIT) +AC_SUBST(JUNIT) +AC_SUBST(JAVA_JUNIT) +AC_SUBST(TESTS_JUNIT)]) diff --git a/bdb/dist/aclocal_java/ac_check_rqrd_class.ac b/bdb/dist/aclocal_java/ac_check_rqrd_class.ac new file mode 100644 index 00000000000..ab62e33c887 --- /dev/null +++ b/bdb/dist/aclocal_java/ac_check_rqrd_class.ac @@ -0,0 +1,26 @@ +dnl @synopsis AC_CHECK_RQRD_CLASS +dnl +dnl AC_CHECK_RQRD_CLASS tests the existence of a given Java class, either in +dnl a jar or in a '.class' file and fails if it doesn't exist. +dnl Its success or failure can depend on a proper setting of the +dnl CLASSPATH env. variable. +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +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 + +AC_DEFUN([AC_CHECK_RQRD_CLASS],[ +CLASS=`echo $1|sed 's/\./_/g'` +AC_CHECK_CLASS($1) +if test "$HAVE_LAST_CLASS" = "no"; then + AC_MSG_ERROR([Required class $1 missing, exiting.]) +fi +]) diff --git a/bdb/dist/aclocal_java/ac_java_options.ac b/bdb/dist/aclocal_java/ac_java_options.ac new file mode 100644 index 00000000000..567afca7fa5 --- /dev/null +++ b/bdb/dist/aclocal_java/ac_java_options.ac @@ -0,0 +1,32 @@ +dnl @synopsis AC_JAVA_OPTIONS +dnl +dnl AC_JAVA_OPTIONS adds configure command line options used for Java m4 +dnl macros. This Macro is optional. +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +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 +AC_DEFUN([AC_JAVA_OPTIONS],[ +AC_ARG_WITH(java-prefix, + [ --with-java-prefix=PFX prefix where Java runtime is installed (optional)]) +AC_ARG_WITH(javac-flags, + [ --with-javac-flags=FLAGS flags to pass to the Java compiler (optional)]) +AC_ARG_WITH(java-flags, + [ --with-java-flags=FLAGS flags to pass to the Java VM (optional)]) +JAVAPREFIX=$with_java_prefix +JAVACFLAGS=$with_javac_flags +JAVAFLAGS=$with_java_flags +AC_SUBST(JAVAPREFIX)dnl +AC_SUBST(JAVACFLAGS)dnl +AC_SUBST(JAVAFLAGS)dnl +AC_SUBST(JAVA)dnl +AC_SUBST(JAVAC)dnl +]) diff --git a/bdb/dist/aclocal_java/ac_jni_include_dirs.ac b/bdb/dist/aclocal_java/ac_jni_include_dirs.ac new file mode 100644 index 00000000000..65cfbbfd13e --- /dev/null +++ b/bdb/dist/aclocal_java/ac_jni_include_dirs.ac @@ -0,0 +1,112 @@ +dnl @synopsis AC_JNI_INCLUDE_DIR +dnl +dnl AC_JNI_INCLUDE_DIR finds include directories needed +dnl for compiling programs using the JNI interface. +dnl +dnl JNI include directories are usually in the java distribution +dnl This is deduced from the value of JAVAC. When this macro +dnl completes, a list of directories is left in the variable +dnl JNI_INCLUDE_DIRS. +dnl +dnl Example usage follows: +dnl +dnl AC_JNI_INCLUDE_DIR +dnl +dnl for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS +dnl do +dnl CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR" +dnl done +dnl +dnl If you want to force a specific compiler: +dnl +dnl - at the configure.in level, set JAVAC=yourcompiler before calling +dnl AC_JNI_INCLUDE_DIR +dnl +dnl - at the configure level, setenv JAVAC +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.8 2002/09/04 21:27:30 dda Exp $ +dnl +AC_DEFUN(AC_JNI_INCLUDE_DIR,[ + +JNI_INCLUDE_DIRS="" + +test "x$JAVAC" = x && AC_MSG_ERROR(['$JAVAC' undefined]) +AC_PATH_PROG(_ACJNI_JAVAC, $JAVAC, $JAVAC) +test ! -x "$_ACJNI_JAVAC" && AC_MSG_ERROR([$JAVAC could not be found in path]) +AC_MSG_CHECKING(absolute path of $JAVAC) +case "$_ACJNI_JAVAC" in +/*) AC_MSG_RESULT($_ACJNI_JAVAC);; +*) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);; +esac + +_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC") +_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'` +case "$host_os" in + darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'` + _JINC="$_JTOPDIR/Headers";; + *) _JINC="$_JTOPDIR/include";; +esac + +# If we find jni.h in /usr/include, then it's not a java-only tree, so +# don't add /usr/include or subdirectories to the list of includes. +# An extra -I/usr/include can foul things up with newer gcc's. +if test -f "$_JINC/jni.h"; then + if test "$_JINC" != "/usr/include"; then + JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JINC" + fi +else + _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'` + if test -f "$_JTOPDIR/include/jni.h"; then + if test "$_JTOPDIR" != "/usr"; then + JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include" + fi + else + AC_MSG_ERROR([cannot find java include files]) + fi +fi + +# get the likely subdirectories for system specific java includes +if test "$_JTOPDIR" != "/usr"; then + case "$host_os" in + aix*) _JNI_INC_SUBDIRS="aix";; + bsdi*) _JNI_INC_SUBDIRS="bsdos";; + linux*) _JNI_INC_SUBDIRS="linux genunix";; + osf*) _JNI_INC_SUBDIRS="alpha";; + solaris*) _JNI_INC_SUBDIRS="solaris";; + *) _JNI_INC_SUBDIRS="genunix";; + esac +fi + +# add any subdirectories that are present +for _JINCSUBDIR in $_JNI_INC_SUBDIRS +do + if test -d "$_JTOPDIR/include/$_JINCSUBDIR"; then + JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$_JINCSUBDIR" + fi +done +]) + +# _ACJNI_FOLLOW_SYMLINKS +# Follows symbolic links on , +# finally setting variable _ACJNI_FOLLOWED +# -------------------- +AC_DEFUN(_ACJNI_FOLLOW_SYMLINKS,[ +# find the include directory relative to the javac executable +_cur="$1" +while ls -ld "$_cur" 2>/dev/null | grep " -> " >/dev/null; do + AC_MSG_CHECKING(symlink for $_cur) + _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 + AC_MSG_RESULT($_cur) +done +_ACJNI_FOLLOWED="$_cur" +])# _ACJNI + diff --git a/bdb/dist/aclocal_java/ac_prog_jar.ac b/bdb/dist/aclocal_java/ac_prog_jar.ac new file mode 100644 index 00000000000..9dfa1be6dad --- /dev/null +++ b/bdb/dist/aclocal_java/ac_prog_jar.ac @@ -0,0 +1,36 @@ +dnl @synopsis AC_PROG_JAR +dnl +dnl AC_PROG_JAR tests for an existing jar program. It uses the environment +dnl variable JAR then tests in sequence various common jar programs. +dnl +dnl If you want to force a specific compiler: +dnl +dnl - at the configure.in level, set JAR=yourcompiler before calling +dnl AC_PROG_JAR +dnl +dnl - at the configure level, setenv JAR +dnl +dnl You can use the JAR variable in your Makefile.in, with @JAR@. +dnl +dnl Note: This macro depends on the autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download that whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +dnl +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 +AC_DEFUN([AC_PROG_JAR],[ +AC_REQUIRE([AC_EXEEXT])dnl +if test "x$JAVAPREFIX" = x; then + test "x$JAR" = x && AC_CHECK_PROGS(JAR, jar$EXEEXT) +else + test "x$JAR" = x && AC_CHECK_PROGS(JAR, jar, $JAVAPREFIX) +fi +test "x$JAR" = x && AC_MSG_ERROR([no acceptable jar program found in \$PATH]) +AC_PROVIDE([$0])dnl +]) diff --git a/bdb/dist/aclocal_java/ac_prog_java.ac b/bdb/dist/aclocal_java/ac_prog_java.ac new file mode 100644 index 00000000000..8cb24445132 --- /dev/null +++ b/bdb/dist/aclocal_java/ac_prog_java.ac @@ -0,0 +1,77 @@ +dnl @synopsis AC_PROG_JAVA +dnl +dnl Here is a summary of the main macros: +dnl +dnl AC_PROG_JAVAC: finds a Java compiler. +dnl +dnl AC_PROG_JAVA: finds a Java virtual machine. +dnl +dnl AC_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!). +dnl +dnl AC_CHECK_RQRD_CLASS: finds if we have the given class and stops otherwise. +dnl +dnl AC_TRY_COMPILE_JAVA: attempt to compile user given source. +dnl +dnl AC_TRY_RUN_JAVA: attempt to compile and run user given source. +dnl +dnl AC_JAVA_OPTIONS: adds Java configure options. +dnl +dnl AC_PROG_JAVA tests an existing Java virtual machine. It uses the +dnl environment variable JAVA then tests in sequence various common Java +dnl virtual machines. For political reasons, it starts with the free ones. +dnl You *must* call [AC_PROG_JAVAC] before. +dnl +dnl If you want to force a specific VM: +dnl +dnl - at the configure.in level, set JAVA=yourvm before calling AC_PROG_JAVA +dnl (but after AC_INIT) +dnl +dnl - at the configure level, setenv JAVA +dnl +dnl You can use the JAVA variable in your Makefile.in, with @JAVA@. +dnl +dnl *Warning*: its success or failure can depend on a proper setting of the +dnl CLASSPATH env. variable. +dnl +dnl TODO: allow to exclude virtual machines (rationale: most Java programs +dnl cannot run with some VM like kaffe). +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +dnl +dnl A Web page, with a link to the latest CVS snapshot is at +dnl . +dnl +dnl This is a sample configure.in +dnl Process this file with autoconf to produce a configure script. +dnl +dnl AC_INIT(UnTag.java) +dnl +dnl dnl Checks for programs. +dnl AC_CHECK_CLASSPATH +dnl AC_PROG_JAVAC +dnl AC_PROG_JAVA +dnl +dnl dnl Checks for classes +dnl AC_CHECK_RQRD_CLASS(org.xml.sax.Parser) +dnl AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver) +dnl +dnl AC_OUTPUT(Makefile) +dnl +dnl @author Stephane Bortzmeyer +dnl @version $Id: ac_prog_java.ac,v 1.1 2001/08/23 16:58:43 dda Exp $ +dnl +AC_DEFUN([AC_PROG_JAVA],[ +AC_REQUIRE([AC_EXEEXT])dnl +if test x$JAVAPREFIX = x; then + test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT) +else + test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT, $JAVAPREFIX) +fi +test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH]) +AC_PROG_JAVA_WORKS +AC_PROVIDE([$0])dnl +]) diff --git a/bdb/dist/aclocal_java/ac_prog_java_works.ac b/bdb/dist/aclocal_java/ac_prog_java_works.ac new file mode 100644 index 00000000000..36acd2676fa --- /dev/null +++ b/bdb/dist/aclocal_java/ac_prog_java_works.ac @@ -0,0 +1,97 @@ +dnl @synopsis AC_PROG_JAVA_WORKS +dnl +dnl Internal use ONLY. +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +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 +AC_DEFUN([AC_PROG_JAVA_WORKS], [ +AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes) +if test x$uudecode = xyes; then +AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [ +dnl /** +dnl * Test.java: used to test if java compiler works. +dnl */ +dnl public class Test +dnl { +dnl +dnl public static void +dnl main( String[] argv ) +dnl { +dnl System.exit (0); +dnl } +dnl +dnl } +cat << \EOF > Test.uue +begin-base64 644 Test.class +yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE +bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 +bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s +YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG +aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB +AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB +AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ= +==== +EOF +if uudecode$EXEEXT Test.uue; then + ac_cv_prog_uudecode_base64=yes +else + echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC + echo "configure: failed file was:" >&AC_FD_CC + cat Test.uue >&AC_FD_CC + ac_cv_prog_uudecode_base64=no +fi +rm -f Test.uue]) +fi +if test x$ac_cv_prog_uudecode_base64 != xyes; then + rm -f Test.class + AC_MSG_WARN([I have to compile Test.class from scratch]) + if test x$ac_cv_prog_javac_works = xno; then + AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly]) + fi + if test x$ac_cv_prog_javac_works = x; then + AC_PROG_JAVAC + fi +fi +AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [ +JAVA_TEST=Test.java +CLASS_TEST=Test.class +TEST=Test +changequote(, )dnl +cat << \EOF > $JAVA_TEST +/* [#]line __oline__ "configure" */ +public class Test { +public static void main (String args[]) { + System.exit (0); +} } +EOF +changequote([, ])dnl +if test x$ac_cv_prog_uudecode_base64 != xyes; then + if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then + : + else + echo "configure: failed program was:" >&AC_FD_CC + cat $JAVA_TEST >&AC_FD_CC + AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)) + fi +fi +if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then + ac_cv_prog_java_works=yes +else + echo "configure: failed program was:" >&AC_FD_CC + cat $JAVA_TEST >&AC_FD_CC + AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?)) +fi +rm -fr $JAVA_TEST $CLASS_TEST Test.uue +]) +AC_PROVIDE([$0])dnl +] +) diff --git a/bdb/dist/aclocal_java/ac_prog_javac.ac b/bdb/dist/aclocal_java/ac_prog_javac.ac new file mode 100644 index 00000000000..5ded7d1b7e6 --- /dev/null +++ b/bdb/dist/aclocal_java/ac_prog_javac.ac @@ -0,0 +1,43 @@ +dnl @synopsis AC_PROG_JAVAC +dnl +dnl AC_PROG_JAVAC tests an existing Java compiler. It uses the environment +dnl variable JAVAC then tests in sequence various common Java compilers. For +dnl political reasons, it starts with the free ones. +dnl +dnl If you want to force a specific compiler: +dnl +dnl - at the configure.in level, set JAVAC=yourcompiler before calling +dnl AC_PROG_JAVAC +dnl +dnl - at the configure level, setenv JAVAC +dnl +dnl You can use the JAVAC variable in your Makefile.in, with @JAVAC@. +dnl +dnl *Warning*: its success or failure can depend on a proper setting of the +dnl CLASSPATH env. variable. +dnl +dnl TODO: allow to exclude compilers (rationale: most Java programs cannot compile +dnl with some compilers like guavac). +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +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 +AC_DEFUN([AC_PROG_JAVAC],[ +AC_REQUIRE([AC_EXEEXT])dnl +if test "x$JAVAPREFIX" = x; then + test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, javac$EXEEXT "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT) +else + test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, javac$EXEEXT "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT, $JAVAPREFIX) +fi +test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH]) +AC_PROG_JAVAC_WORKS +AC_PROVIDE([$0])dnl +]) diff --git a/bdb/dist/aclocal_java/ac_prog_javac_works.ac b/bdb/dist/aclocal_java/ac_prog_javac_works.ac new file mode 100644 index 00000000000..139a99f989b --- /dev/null +++ b/bdb/dist/aclocal_java/ac_prog_javac_works.ac @@ -0,0 +1,35 @@ +dnl @synopsis AC_PROG_JAVAC_WORKS +dnl +dnl Internal use ONLY. +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +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 +AC_DEFUN([AC_PROG_JAVAC_WORKS],[ +AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [ +JAVA_TEST=Test.java +CLASS_TEST=Test.class +cat << \EOF > $JAVA_TEST +/* [#]line __oline__ "configure" */ +public class Test { +} +EOF +if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then + ac_cv_prog_javac_works=yes +else + AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)]) + echo "configure: failed program was:" >&AC_FD_CC + cat $JAVA_TEST >&AC_FD_CC +fi +rm -f $JAVA_TEST $CLASS_TEST +]) +AC_PROVIDE([$0])dnl +]) diff --git a/bdb/dist/aclocal_java/ac_prog_javadoc.ac b/bdb/dist/aclocal_java/ac_prog_javadoc.ac new file mode 100644 index 00000000000..5154d3f1f3b --- /dev/null +++ b/bdb/dist/aclocal_java/ac_prog_javadoc.ac @@ -0,0 +1,37 @@ +dnl @synopsis AC_PROG_JAVADOC +dnl +dnl AC_PROG_JAVADOC tests for an existing javadoc generator. It uses the environment +dnl variable JAVADOC then tests in sequence various common javadoc generator. +dnl +dnl If you want to force a specific compiler: +dnl +dnl - at the configure.in level, set JAVADOC=yourgenerator before calling +dnl AC_PROG_JAVADOC +dnl +dnl - at the configure level, setenv JAVADOC +dnl +dnl You can use the JAVADOC variable in your Makefile.in, with @JAVADOC@. +dnl +dnl Note: This macro depends on the autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download that whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +dnl +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 +AC_DEFUN([AC_PROG_JAVADOC],[ +AC_REQUIRE([AC_EXEEXT])dnl +if test "x$JAVAPREFIX" = x; then + test "x$JAVADOC" = x && AC_CHECK_PROGS(JAVADOC, javadoc$EXEEXT) +else + test "x$JAVADOC" = x && AC_CHECK_PROGS(JAVADOC, javadoc, $JAVAPREFIX) +fi +test "x$JAVADOC" = x && AC_MSG_ERROR([no acceptable javadoc generator found in \$PATH]) +AC_PROVIDE([$0])dnl +]) + diff --git a/bdb/dist/aclocal_java/ac_prog_javah.ac b/bdb/dist/aclocal_java/ac_prog_javah.ac new file mode 100644 index 00000000000..1b16d9e24e5 --- /dev/null +++ b/bdb/dist/aclocal_java/ac_prog_javah.ac @@ -0,0 +1,26 @@ +dnl @synopsis AC_PROG_JAVAH +dnl +dnl AC_PROG_JAVAH tests the availability of the javah header generator +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 +AC_DEFUN([AC_PROG_JAVAH],[ +AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl +AC_REQUIRE([AC_PROG_CPP])dnl +AC_PATH_PROG(JAVAH,javah) +if test x"`eval 'echo $ac_cv_path_JAVAH'`" != x ; then + AC_TRY_CPP([#include ],,[ + ac_save_CPPFLAGS="$CPPFLAGS" +changequote(, )dnl + ac_dir=`echo $ac_cv_path_JAVAH | sed 's,\(.*\)/[^/]*/[^/]*$,\1/include,'` + ac_machdep=`echo $build_os | sed 's,[-0-9].*,,'` +changequote([, ])dnl + CPPFLAGS="$ac_save_CPPFLAGS -I$ac_dir -I$ac_dir/$ac_machdep" + AC_TRY_CPP([#include ], + ac_save_CPPFLAGS="$CPPFLAGS", + AC_MSG_WARN([unable to include ])) + CPPFLAGS="$ac_save_CPPFLAGS"]) +fi]) diff --git a/bdb/dist/aclocal_java/ac_try_compile_java.ac b/bdb/dist/aclocal_java/ac_try_compile_java.ac new file mode 100644 index 00000000000..775569ba054 --- /dev/null +++ b/bdb/dist/aclocal_java/ac_try_compile_java.ac @@ -0,0 +1,39 @@ +dnl @synopsis AC_TRY_COMPILE_JAVA +dnl +dnl AC_TRY_COMPILE_JAVA attempt to compile user given source. +dnl +dnl *Warning*: its success or failure can depend on a proper setting of the +dnl CLASSPATH env. variable. +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +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 +AC_DEFUN([AC_TRY_COMPILE_JAVA],[ +AC_REQUIRE([AC_PROG_JAVAC])dnl +cat << \EOF > Test.java +/* [#]line __oline__ "configure" */ +ifelse([$1], , , [import $1;]) +public class Test { +[$2] +} +EOF +if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class +then +dnl Don't remove the temporary files here, so they can be examined. + ifelse([$3], , :, [$3]) +else + echo "configure: failed program was:" >&AC_FD_CC + cat Test.java >&AC_FD_CC +ifelse([$4], , , [ rm -fr Test* + $4 +])dnl +fi +rm -fr Test*]) diff --git a/bdb/dist/aclocal_java/ac_try_run_javac.ac b/bdb/dist/aclocal_java/ac_try_run_javac.ac new file mode 100644 index 00000000000..cf91306aff6 --- /dev/null +++ b/bdb/dist/aclocal_java/ac_try_run_javac.ac @@ -0,0 +1,40 @@ +dnl @synopsis AC_TRY_RUN_JAVA +dnl +dnl AC_TRY_RUN_JAVA attempt to compile and run user given source. +dnl +dnl *Warning*: its success or failure can depend on a proper setting of the +dnl CLASSPATH env. variable. +dnl +dnl Note: This is part of the set of autoconf M4 macros for Java programs. +dnl It is VERY IMPORTANT that you download the whole set, some +dnl macros depend on other. Unfortunately, the autoconf archive does not +dnl support the concept of set of macros, so I had to break it for +dnl submission. +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 +AC_DEFUN([AC_TRY_RUN_JAVA],[ +AC_REQUIRE([AC_PROG_JAVAC])dnl +AC_REQUIRE([AC_PROG_JAVA])dnl +cat << \EOF > Test.java +/* [#]line __oline__ "configure" */ +ifelse([$1], , , [include $1;]) +public class Test { +[$2] +} +EOF +if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class && ($JAVA $JAVAFLAGS Test; exit) 2>/dev/null +then +dnl Don't remove the temporary files here, so they can be examined. + ifelse([$3], , :, [$3]) +else + echo "configure: failed program was:" >&AC_FD_CC + cat Test.java >&AC_FD_CC +ifelse([$4], , , [ rm -fr Test* + $4 +])dnl +fi +rm -fr Test*]) diff --git a/bdb/dist/build/script b/bdb/dist/buildrel similarity index 56% rename from bdb/dist/build/script rename to bdb/dist/buildrel index 8eef3099f08..b796169c719 100644 --- a/bdb/dist/build/script +++ b/bdb/dist/buildrel @@ -1,12 +1,12 @@ #!/bin/sh - -# $Id: script,v 1.21 2001/01/19 18:13:16 bostic Exp $ +# $Id: buildrel,v 1.39 2002/09/06 14:30:31 bostic Exp $ # # Build the distribution archives. # # A set of commands intended to be cut and pasted into a csh window. # Development tree, release home. -setenv D /a/db +setenv D `pwd` # Update the release number. cd $D/dist @@ -21,13 +21,8 @@ cd $D && cvs -q update cd $D/dist && sh s_all cd $D && cvs -q commit -# Build the documentation. -cd $D/docs_src && make clean -cd $D/docs_src && make -cd $D/docs_src && make && make check - # Copy a development tree into a release tree. -setenv R /a/db-$VERSION +setenv R /var/tmp/db-$VERSION rm -rf $R && mkdir -p $R cd $D && tar cf - \ `cvs -q status | sed -n -e "/Repository/s;.*/CVSROOT/db/;;" -e "s/,v//p"` | \ @@ -37,34 +32,29 @@ cd $D && tar cf - \ cd $R/dist && sh s_perm cd $R/dist && sh s_symlink -# Build the documents. -cd $R/docs_src && make - # Build a version. cd $R && rm -rf build_run && mkdir build_run cd $R/build_run && ~bostic/bin/dbconf && make >& mklog # Smoke test. -./ex_access +cd $R/build_run && ./ex_access + +# Build the documentation. +cd $R/docs_src && sh build clean +cd $R/docs_src && sh build |& sed '/.html$/d' # Check the install -make prefix=`pwd`/BDB install - -# Run distribution check scripts -$R/dist/build/chk.def -$R/dist/build/chk.define -$R/dist/build/chk.offt -$R/dist/build/chk.srcfiles -$R/dist/build/chk.tags +cd $R/build_run && make prefix=`pwd`/BDB install # Clean up the tree. cd $R && rm -rf build_run docs_src -cd $R && rm -rf test_thread test_purify test_server test_vxworks test/TODO -cd $R && rm -rf test/upgrade/databases && mkdir test/upgrade/databases +cd $R && rm -rf test/TODO test/upgrade test_perf test_purify +cd $R && rm -rf test_server test_thread test_vxworks test_xa # 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/dist && sh s_perm chown -R 100.100 $R # DISCARD ROOT PRIVILEGES @@ -76,19 +66,44 @@ cd $R/../db-${LR} && find . | sort > /tmp/__OLD cd $R && find . | sort > /tmp/__NEW diff -c /tmp/__OLD /tmp/__NEW -# Create the tar archive release. +# Create the crypto tar archive release. setenv T "$R/../db-$VERSION.tar.gz" cd $R/.. && tar cf - db-$VERSION | gzip --best > $T chmod 444 $T -# Create the zip archive release. -# -# Remove symbolic links to tags files. They're large and we don't want to -# store real symbolic links in the archive for portability reasons. +# 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 && rm -rf $R/../__TMP +cd $RNC/dist && sh s_crypto + # ACQUIRE ROOT PRIVILEGES -cd $R && rm -f `find . -type l -name 'tags'` +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/dist && sh s_perm +chown -R 100.100 $RNC # DISCARD ROOT PRIVILEGES +# Create the non-crypto tar archive release. +setenv T "$R/../db-$VERSION.NC.tar.gz" +cd $RNC/.. && tar cf - db-$VERSION.NC | gzip --best > $T +chmod 444 $T + +# Remove symbolic links to tags files. They're large and we don't want +# to store real symbolic links in the zip archive for portability reasons. +# ACQUIRE ROOT PRIVILEGES +cd $R && rm -f `find . -type l -name 'tags'` +cd $RNC && rm -f `find . -type l -name 'tags'` +# DISCARD ROOT PRIVILEGES + +# Create the crypto zip archive release. setenv T "$R/../db-$VERSION.zip" cd $R/.. && zip -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 +chmod 444 $T diff --git a/bdb/dist/config.guess b/bdb/dist/config.guess new file mode 100755 index 00000000000..fd30ab0314c --- /dev/null +++ b/bdb/dist/config.guess @@ -0,0 +1,1354 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-07-23' + +# 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 +# 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. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $files ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; +unset files' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-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 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + eval $set_cc_for_build + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; + esac + fi + rm -f $dummy.s $dummy && rmdir $tmpdir + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + 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 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + 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 + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + 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 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + 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 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + 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 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # 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 + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????: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 ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo rs6000-ibm-aix3.2.5 + 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 ;; + *: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 + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + 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 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy && rmdir $tmpdir + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + 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 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + 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 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; + 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 i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + 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 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + 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 + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # 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 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + 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 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + 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 + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + 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 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/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 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*: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) + 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 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + 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 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + 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 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +rm -f $dummy.c $dummy && rmdir $tmpdir + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/bdb/dist/config.sub b/bdb/dist/config.sub new file mode 100755 index 00000000000..9ff085efaf7 --- /dev/null +++ b/bdb/dist/config.sub @@ -0,0 +1,1460 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-07-03' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# 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 +# 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. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# 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* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # 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/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipstx39 | mipstx39el \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -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* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -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*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/bdb/dist/configure.ac b/bdb/dist/configure.ac new file mode 100644 index 00000000000..4a747cfe3b6 --- /dev/null +++ b/bdb/dist/configure.ac @@ -0,0 +1,608 @@ +# $Id: configure.ac,v 11.156 2002/09/04 13:51:17 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_CONFIG_SRCDIR([../db/db.c]) +AC_CONFIG_HEADER(db_config.h:config.hin) + +# Configure setup. +AC_CANONICAL_HOST() +AC_ARG_PROGRAM() + +# We cannot build in the top-level directory. +AC_MSG_CHECKING(if building in the top-level directory) +[ test -d db_archive ] && AC_MSG_ERROR([ +Berkeley DB cannot be built in the top-level distribution directory.]) +AC_MSG_RESULT(no) + +# Substitution variables. +AC_SUBST(ADDITIONAL_INCS) +AC_SUBST(ADDITIONAL_LANG) +AC_SUBST(ADDITIONAL_OBJS) +AC_SUBST(ADDITIONAL_PROGS) +AC_SUBST(BUILD_TARGET) +AC_SUBST(CFLAGS) +AC_SUBST(CONFIGURATION_ARGS) +AC_SUBST(CONFIGURATION_PATH) +AC_SUBST(CPPFLAGS) +AC_SUBST(CXX) +AC_SUBST(CXXFLAGS) +AC_SUBST(DEFAULT_LIB) +AC_SUBST(DEFAULT_LIB_CXX) +AC_SUBST(EMBEDIX_ECD_CXX) +AC_SUBST(EMBEDIX_ECD_RPC) +AC_SUBST(EMBEDIX_ROOT) +AC_SUBST(INSTALLER) +AC_SUBST(INSTALL_LIBS) +AC_SUBST(INSTALL_TARGET) +AC_SUBST(JAR) +AC_SUBST(JAVACFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(LIBJSO_LIBS) +AC_SUBST(LIBS) +AC_SUBST(LIBSO_LIBS) +AC_SUBST(LIBTOOL) +AC_SUBST(LIBTSO_LIBS) +AC_SUBST(LIBXSO_LIBS) +AC_SUBST(LOAD_LIBS) +AC_SUBST(MAKEFILE_CC) +AC_SUBST(MAKEFILE_CCLINK) +AC_SUBST(MAKEFILE_CXX) +AC_SUBST(MAKEFILE_CXXLINK) +AC_SUBST(MAKEFILE_SOLINK) +AC_SUBST(MAKEFILE_XSOLINK) +AC_SUBST(POSTLINK) +AC_SUBST(RPC_CLIENT_OBJS) +AC_SUBST(RPM_POST_INSTALL) +AC_SUBST(RPM_POST_UNINSTALL) +AC_SUBST(SOFLAGS) +AC_SUBST(db_cv_path_embedix_install) +AC_SUBST(db_cv_path_rpm_archive) +AC_SUBST(db_int_def) +AC_SUBST(o) + +# RPM needs the current absolute path. +# RPM needs the list of original arguments, but we don't include the RPM +# option itself. +CONFIGURATION_PATH=${PWD-`pwd`} +CONFIGURATION_ARGS=`echo "$*" | + sed -e 's/--with-embedix[[^ ]]*//' -e 's/--with-rpm[[^ ]]*//'` + +# Set the version. +AM_VERSION_SET + +# Set the default installation location. +AC_PREFIX_DEFAULT(/usr/local/BerkeleyDB.@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@) + +# Process all options before using them. +AM_OPTIONS_SET + +# Set some #defines based on configuration options. +if test "$db_cv_diagnostic" = yes; then + AC_DEFINE(DIAGNOSTIC) + AH_TEMPLATE(DIAGNOSTIC, + [Define to 1 if you want a version with run-time diagnostic checking.]) +fi +if test "$db_cv_debug_rop" = yes; then + AC_DEFINE(DEBUG_ROP) + AH_TEMPLATE(DEBUG_ROP, + [Define to 1 if you want a version that logs read operations.]) +fi +if test "$db_cv_debug_wop" = yes; then + AC_DEFINE(DEBUG_WOP) + AH_TEMPLATE(DEBUG_WOP, + [Define to 1 if you want a version that logs write operations.]) +fi +if test "$db_cv_umrw" = yes; then + AC_DEFINE(UMRW) + AH_TEMPLATE(UMRW, + [Define to 1 to mask harmless unitialized memory read/writes.]) + +fi +if test "$db_cv_test" = yes; then + AC_DEFINE(CONFIG_TEST) + AH_TEMPLATE(CONFIG_TEST, + [Define to 1 if you want to build a version for running the test suite.]) +fi + +# Check for programs used in building and installation. +AM_PROGRAMS_SET +AC_PROG_INSTALL + +# RPM/Embedix support: change the standard make and install targets +if test "$db_cv_rpm" = "yes"; then + BUILD_TARGET="rpm_build" + echo "topdir: $CONFIGURATION_PATH" > rpmrc + if test "$db_cv_embedix" = "yes"; then + EMBEDIX_ROOT="/usr" + INSTALL_TARGET="embedix_install" + else + INSTALL_TARGET="rpm_install" + fi +else + BUILD_TARGET="library_build" + INSTALL_TARGET="library_install" +fi + +# This is where we handle stuff that autoconf can't handle: compiler, +# preprocessor and load flags, libraries that the standard tests don't +# look for. The default optimization is -O. We would like to set the +# default optimization for systems using gcc to -O2, but we can't. By +# the time we know we're using gcc, it's too late to set optimization +# flags. +# +# There are additional libraries we need for some compiler/architecture +# combinations. +# +# Some architectures require DB to be compiled with special flags and/or +# libraries for threaded applications +# +# The makefile CC may be different than the CC used in config testing, +# because the makefile CC may be set to use $(LIBTOOL). +# +# XXX +# Don't override anything if it's already set from the environment. +optimize_def="-O" +case "$host_os" in +aix4.3.*|aix5*) + optimize_def="-O2" + CC=${CC-"xlc_r"} + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" + LDFLAGS="$LDFLAGS -Wl,-brtl";; +bsdi3*) optimize_def="-O2" + CC=${CC-"shlicc2"} + LIBS="$LIBS -lipc";; +bsdi*) optimize_def="-O2";; +freebsd*) + optimize_def="-O2" + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" + LDFLAGS="$LDFLAGS -pthread";; +hpux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT";; +irix*) optimize_def="-O2" + CPPFLAGS="$CPPFLAGS -D_SGI_MP_SOURCE";; +linux*) optimize_def="-O2" + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";; +mpeix*) CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_SOCKET_SOURCE" + LIBS="$LIBS -lsocket -lsvipc";; +osf*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" + LDFLAGS="$LDFLAGS -pthread";; +*qnx) AC_DEFINE(HAVE_QNX) + AH_TEMPLATE(HAVE_QNX, [Define to 1 if building on QNX.]);; +solaris*) + CPPFLAGS="$CPPFLAGS -D_REENTRANT";; +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 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" +fi + +# 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) + +# Because of shared library building, the ${CC} used for config tests +# may be different than the ${CC} we want to put in the Makefile. +# The latter is known as ${MAKEFILE_CC} in this script. +MAKEFILE_CC="${CC}" +MAKEFILE_CCLINK="${CC}" +MAKEFILE_CXX="nocxx" +MAKEFILE_CXXLINK="nocxx" + +# See if we need the C++ compiler at all. If so, we'd like to find one that +# interoperates with the C compiler we chose. Since we prefered cc over gcc, +# we'll also prefer the vendor's compiler over g++/gcc. If we're wrong, the +# user can set CC and CXX in their environment before running configure. +# +# AC_PROG_CXX sets CXX, but it uses $CXX and $CCC (in that order) as its +# first choices. +if test "$db_cv_cxx" = "yes"; then + if test "$GCC" != "yes"; then + case "$host_os" in + aix*) AC_CHECK_TOOL(CCC, xlC_r) + LIBXSO_LIBS="-lC_r $LIBXSO_LIBS" + LIBS="-lC_r $LIBS";; + hpux*) AC_CHECK_TOOL(CCC, aCC);; + irix*) AC_CHECK_TOOL(CCC, CC);; + osf*) AC_CHECK_TOOL(CCC, cxx);; + solaris*) AC_CHECK_TOOL(CCC, CC);; + esac + fi + AC_PROG_CXX + AC_CXX_HAVE_STDHEADERS + MAKEFILE_CXX="${CXX}" + MAKEFILE_CXXLINK="${CXX}" +fi + +# Do some gcc specific configuration. +AC_GCC_CONFIG1 +AC_GCC_CONFIG2 + +# We need the -Kthread/-pthread flag when compiling on SCO/Caldera's UnixWare +# and OpenUNIX releases. We can't make the test until we know which compiler +# we're using. +case "$host_os" in +sysv5UnixWare*|sysv5OpenUNIX8*) + if test "$GCC" == "yes"; then + CPPFLAGS="$CPPFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + else + CPPFLAGS="$CPPFLAGS -Kthread" + LDFLAGS="$LDFLAGS -Kthread" + fi;; +esac + +# Export our compiler preferences for the libtool configuration. +export CC CCC +CCC=CXX + +# Libtool configuration. +AC_PROG_LIBTOOL + +LIBTOOL="\$(SHELL) ./libtool" +SOFLAGS="-rpath \$(libdir)" + +# Set SOSUFFIX and friends +SOSUFFIX_CONFIG +MODSUFFIX_CONFIG +JMODSUFFIX_CONFIG + +INSTALLER="\$(LIBTOOL) --mode=install cp -p" + +MAKEFILE_CC="\$(LIBTOOL) --mode=compile ${MAKEFILE_CC}" +MAKEFILE_SOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK} -avoid-version" +MAKEFILE_CCLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK}" +MAKEFILE_CXX="\$(LIBTOOL) --mode=compile ${MAKEFILE_CXX}" +MAKEFILE_XSOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK} -avoid-version" +MAKEFILE_CXXLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK}" + +# Configure for shared libraries, static libraries, or both. If both are +# configured, build the utilities and example programs with shared versions. +# +# $o is set to ".o" or ".lo", and is the file suffix used in the Makefile +# instead of .o +if test "$enable_shared" = "no"; then + DEFAULT_LIB="\$(libdb)" + POSTLINK="@true" + o=".o" +fi +if test "$enable_shared" = "yes"; then + DEFAULT_LIB="\$(libso_target)" + POSTLINK="\$(LIBTOOL) --mode=execute true" + o=".lo" +fi +INSTALL_LIBS="$DEFAULT_LIB" + +# Optional C++ API. +if test "$db_cv_cxx" = "yes"; then + if test "$enable_shared" = "no"; then + DEFAULT_LIB_CXX="\$(libcxx)" + fi + if test "$enable_shared" = "yes"; then + DEFAULT_LIB_CXX="\$(libxso_target)" + fi + INSTALL_LIBS="$INSTALL_LIBS $DEFAULT_LIB_CXX" + + # Fill in C++ library for Embedix. + EMBEDIX_ECD_CXX='' +fi + +# Optional Java API. +if test "$db_cv_java" = "yes"; then + # Java requires shared libraries. + if test "$enable_shared" = "no"; then + AC_MSG_ERROR([Java requires shared libraries]) + fi + + AC_PROG_JAVAC + AC_PROG_JAR + AC_JNI_INCLUDE_DIR + + for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS + do + CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR" + done + + ADDITIONAL_LANG="$ADDITIONAL_LANG java" + INSTALL_LIBS="$INSTALL_LIBS \$(libjso_target)" +else + JAVAC=nojavac +fi + +# Optional RPC client/server. +if test "$db_cv_rpc" = "yes"; then + AC_DEFINE(HAVE_RPC) + AH_TEMPLATE(HAVE_RPC, [Define to 1 if building RPC client/server.]) + + RPC_CLIENT_OBJS="\$(RPC_CLIENT_OBJS)" + ADDITIONAL_PROGS="berkeley_db_svc $ADDITIONAL_PROGS" + + EMBEDIX_ECD_RPC="/usr/bin/berkeley_db_svc" + + case "$host_os" in + hpux*) + AC_CHECK_FUNC(svc_run,, + AC_CHECK_LIB(nsl, svc_run, + LIBS="-lnsl $LIBS"; LIBTSO_LIBS="-lnsl $LIBTSO_LIBS"));; + solaris*) + AC_CHECK_FUNC(svc_run,, AC_CHECK_LIB(nsl, svc_run));; + esac +fi + +AM_TCL_LOAD + +# Optional crypto support. +if test -d "$srcdir/../crypto"; then + AC_DEFINE(HAVE_CRYPTO) + AH_TEMPLATE(HAVE_CRYPTO, + [Define to 1 if Berkeley DB release includes strong cryptography.]) + ADDITIONAL_OBJS="aes_method${o} crypto${o} mt19937db${o} rijndael-alg-fst${o} rijndael-api-fst${o} $ADDITIONAL_OBJS" +fi + +# Optional DB 1.85 compatibility API. +if test "$db_cv_compat185" = "yes"; then + ADDITIONAL_INCS="db_185.h $ADDITIONAL_INCS" + ADDITIONAL_OBJS="db185${o} $ADDITIONAL_OBJS" +fi + +# Optional utilities. +if test "$db_cv_dump185" = "yes"; then + ADDITIONAL_PROGS="db_dump185 $ADDITIONAL_PROGS" +fi + +# Checks for compiler characteristics. +AC_C_CONST + +# Checks for include files, structures, C types. +AC_HEADER_STAT +AC_HEADER_TIME +AC_HEADER_DIRENT +AC_CHECK_HEADERS(sys/select.h sys/time.h) +AC_CHECK_MEMBERS([struct stat.st_blksize]) +AM_TYPES + +AC_CACHE_CHECK([for ANSI C exit success/failure values], db_cv_exit_defines, [ +AC_TRY_COMPILE([#include ], return (EXIT_SUCCESS);, + [db_cv_exit_defines=yes], [db_cv_exit_defines=no])]) +if test "$db_cv_exit_defines" = yes; then + AC_DEFINE(HAVE_EXIT_SUCCESS) + AH_TEMPLATE(HAVE_EXIT_SUCCESS, + [Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines.]) +fi + +# Test for various functions/libraries that the test and example programs use: +# sched_yield function +# pthreads, socket and math libraries +AC_CHECK_FUNC(sched_yield,, + AC_SEARCH_LIBS(sched_yield, rt, LOAD_LIBS="$LOAD_LIBS -lrt")) + +# XXX +# 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 +# thread-safe. For that reason we always add -lpthread if we find a pthread +# library. Also 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, LOAD_LIBS="$LOAD_LIBS -lpthread") + +# XXX +# We could be more exact about whether these libraries are needed, but we don't +# bother -- if they exist, we load them. +AC_HAVE_LIBRARY(m, LOAD_LIBS="$LOAD_LIBS -lm") +AC_HAVE_LIBRARY(socket, LOAD_LIBS="$LOAD_LIBS -lsocket") +AC_HAVE_LIBRARY(nsl, LOAD_LIBS="$LOAD_LIBS -lnsl") + +# Check for mutexes. +# We do this here because it changes $LIBS. +AM_DEFINE_MUTEXES + +# 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(snprintf strcasecmp strdup strerror vsnprintf) + +# Check for system functions we optionally use. +AC_CHECK_FUNCS(_fstati64 clock_gettime directio gettimeofday getuid) +AC_CHECK_FUNCS(pstat_getdynamic sched_yield select strtoul sysconf yield) + +# Checks for system functions for which we don't have replacements. +# We require qsort(3). +AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.])) + +# Pread/pwrite. +# HP-UX has pread/pwrite, but it doesn't work with largefile support. +case "$host_os" in +hpux*) + AC_MSG_WARN([pread/pwrite interfaces ignored on $host_os.]);; +*) AC_CHECK_FUNCS(pread pwrite) +esac + +# Check for fcntl(2) to deny child process access to file descriptors. +AC_CACHE_CHECK([for fcntl/F_SETFD], db_cv_fcntl_f_setfd, [ +AC_TRY_LINK([ +#include +#include ], [ + fcntl(1, F_SETFD, 1); +], [db_cv_fcntl_f_setfd=yes], [db_cv_fcntl_f_setfd=no])]) +if test "$db_cv_fcntl_f_setfd" = yes; then + AC_DEFINE(HAVE_FCNTL_F_SETFD) + AH_TEMPLATE(HAVE_FCNTL_F_SETFD, + [Define to 1 if fcntl/F_SETFD denies child access to file descriptors.]) +fi + +# A/UX has a broken getopt(3). +case "$host_os" in +aux*) ADDITIONAL_OBJS="getopt${o} $ADDITIONAL_OBJS";; +esac + +# Linux has the O_DIRECT flag, but you can't actually use it. +AC_CACHE_CHECK([for open/O_DIRECT], db_cv_open_o_direct, [ +echo "test for working open/O_DIRECT" > __o_direct_file +AC_TRY_RUN([ +#include +#include +main() { +int c, fd = open("__o_direct_file", O_RDONLY | O_DIRECT, 0); +exit ((fd == -1) || (read(fd, &c, 1) != 1)); +}], [db_cv_open_o_direct=yes], [db_cv_open_o_direct=no], +AC_TRY_LINK([ +#include +#include ], [ + open("__o_direct_file", O_RDONLY | O_DIRECT, 0); +], [db_cv_open_o_direct=yes], [db_cv_open_o_direct=no])) +rm -f __o_direct_file]) +if test "$db_cv_open_o_direct" = yes; then + AC_DEFINE(HAVE_O_DIRECT) + AH_TEMPLATE(HAVE_O_DIRECT, [Define to 1 if you have the O_DIRECT flag.]) +fi + +# Check for largefile support. +AC_SYS_LARGEFILE + +# 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) + AC_MSG_WARN([mlock(2) interface ignored on BSD/OS 3.X and 4.0.]) + mmap_ok=yes + AC_CHECK_FUNCS(mmap munmap, , mmap_ok=no);; +ultrix*) + AC_MSG_WARN([mmap(2) interface ignored on Ultrix.]);; +*) + mmap_ok=yes + AC_CHECK_FUNCS(mlock munlock) + AC_CHECK_FUNCS(mmap munmap, , mmap_ok=no);; +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*) + AC_MSG_WARN([shmget(2) interface ignored on SunOS.]);; +*) + shmget_ok=yes + AC_CHECK_FUNCS(shmget, , shmget_ok=no);; +esac + +# We require either mmap/munmap(2) or shmget(2). +if test "$mmap_ok" = no -a "$shmget_ok" = no; then + AC_MSG_WARN([Neither mmap/munmap(2) or shmget(2) library functions.]) +fi + +# If we're not doing version name substitution, DB_VERSION_UNIQUE_NAME +# needs to be erased. +if test "$db_cv_uniquename" = "no"; then + DB_VERSION_UNIQUE_NAME="" +fi + +# This is necessary so that .o files in LIBOBJS are also built via +# the ANSI2KNR-filtering rules. +LIB@&t@OBJS=`echo "$LIB@&t@OBJS" | + sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'` +LTLIBOBJS=`echo "$LIB@&t@OBJS" | + sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'` +AC_SUBST(LTLIBOBJS) + +# Initial output file list. +CREATE_LIST="Makefile + db_cxx.h:$srcdir/../dbinc/db_cxx.in + db_int.h:$srcdir/../dbinc/db_int.in + include.tcl:$srcdir/../test/include.tcl" + +# Create the db.h file from a source file, a list of global function +# prototypes, and, if configured for unique names, a list of #defines +# to do DB_VERSION_UNIQUE_NAME substitution. +if test "$db_cv_uniquename" = "yes"; then + CREATE_LIST="$CREATE_LIST + db.h:$srcdir/../dbinc/db.in:$srcdir/../dbinc_auto/rpc_defs.in:$srcdir/../dbinc_auto/ext_def.in:$srcdir/../dbinc_auto/ext_prot.in" +else + CREATE_LIST="$CREATE_LIST + db.h:$srcdir/../dbinc/db.in:$srcdir/../dbinc_auto/rpc_defs.in:$srcdir/../dbinc_auto/ext_prot.in" +fi + +# If configured for unique names, create the db_int_uext.h file (which +# does the DB_VERSION_UNIQUE_NAME substitution), which is included by +# the db_int.h file. +if test "$db_cv_uniquename" = "yes"; then + CREATE_LIST="$CREATE_LIST + db_int_def.h:$srcdir/../dbinc_auto/int_def.in" + db_int_def='#include "db_int_def.h"' +fi + +# Create the db_185.h and db185_int.h files from source files, a list of +# global function prototypes, and, if configured for unique names, a list +# of #defines to do DB_VERSION_UNIQUE_NAME substitution. +if test "$db_cv_compat185" = "yes"; then + if test "$db_cv_uniquename" = "yes"; then + CREATE_LIST="$CREATE_LIST + db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in + db185_int.h:$srcdir/../db185/db185_int.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in" + else + CREATE_LIST="$CREATE_LIST + db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_prot.in + db185_int.h:$srcdir/../db185/db185_int.in:$srcdir/../dbinc_auto/ext_185_prot.in" + fi +fi + +if test "$db_cv_embedix" = "yes"; then + CREATE_LIST="$CREATE_LIST db.ecd:../dist/db.ecd.in" +fi + +if test "$db_cv_rpm" = "yes"; then + CREATE_LIST="$CREATE_LIST db.spec:../dist/db.spec.in" +fi + +AC_CONFIG_FILES($CREATE_LIST) +AC_OUTPUT diff --git a/bdb/dist/configure.in b/bdb/dist/configure.in deleted file mode 100644 index 6656a588a66..00000000000 --- a/bdb/dist/configure.in +++ /dev/null @@ -1,591 +0,0 @@ -dnl $Id: configure.in,v 11.77 2001/01/18 19:05:25 bostic Exp $ -dnl Process this file with autoconf to produce a configure script. - -AC_INIT(../db/db.c) -AC_CONFIG_HEADER(db_config.h:config.hin) - -dnl Configure setup. -AC_PROG_INSTALL() -AC_CANONICAL_HOST -AC_ARG_PROGRAM() - -dnl We cannot build in the top-level directory. -AC_MSG_CHECKING(if building in the top-level directory) -[ test -d db_archive ] && AC_MSG_ERROR([ -Berkeley DB cannot be built in the top-level distribution directory.]) -AC_MSG_RESULT(no) - -dnl Substitution variables. -AC_SUBST(ADDITIONAL_INCS) -AC_SUBST(ADDITIONAL_LANG) -AC_SUBST(ADDITIONAL_LIBS) -AC_SUBST(ADDITIONAL_OBJS) -AC_SUBST(ADDITIONAL_PROGS) -AC_SUBST(CPPFLAGS) -AC_SUBST(CXXFLAGS) -AC_SUBST(DBS_LIBS) -AC_SUBST(DEFAULT_INSTALL) -AC_SUBST(DEFAULT_LIB) -AC_SUBST(INSTALLER) -AC_SUBST(INSTALL_LIBS) -AC_SUBST(JAR) -AC_SUBST(JAVAC) -AC_SUBST(JAVACFLAGS) -AC_SUBST(LDFLAGS) -AC_SUBST(LIBDB_ARGS) -AC_SUBST(LIBJSO_LIBS) -AC_SUBST(LIBS) -AC_SUBST(LIBSO_LIBS) -AC_SUBST(LIBTOOL) -AC_SUBST(LIBTSO_LIBS) -AC_SUBST(LIBXSO_LIBS) -AC_SUBST(MAKEFILE_CC) -AC_SUBST(MAKEFILE_CCLINK) -AC_SUBST(MAKEFILE_CXX) -AC_SUBST(POSTLINK) -AC_SUBST(RPC_OBJS) -AC_SUBST(SOFLAGS) -AC_SUBST(SOLINK) -AC_SUBST(SOSUFFIX) - -dnl $o is set to ".o" or ".lo", and is the file suffix used in the -dnl Makefile instead of .o -AC_SUBST(o) -o=.o -INSTALLER="\$(cp)" -DEFAULT_LIB="\$(libdb)" -DEFAULT_INSTALL="install_static" - -dnl Set the version. -AM_VERSION_SET - -dnl Set the default installation location. -AC_PREFIX_DEFAULT(/usr/local/BerkeleyDB.@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@) - -dnl Process all options before using them. This is necessary because there -dnl are dependencies among them. -AM_OPTIONS_SET - -# This is to determine what compiler is being used and to set options. -# i.e. SCO OpenServer 5.0.X and UnixWare 7.X.X -# option, cache_name, variable -AC_DEFUN(AC_SYS_COMPILER_FLAG, -[ - AC_MSG_CHECKING($1) - OLD_CFLAGS="[$]CFLAGS" - AC_CACHE_VAL(db_cv_option_$2, - [ - CFLAGS="[$]OLD_CFLAGS $1" - AC_TRY_RUN([int main(){exit(0);}],db_cv_option_$2=yes,db_cv_option_$2=no,db_cv_option_$2=no) - ]) - - CFLAGS="[$]OLD_CFLAGS" - - if test x"[$]db_cv_option_$2" = "xyes" ; then - $3="[$]$3 $1" - AC_MSG_RESULT(yes) - $5 - else - AC_MSG_RESULT(no) - $4 - fi -]) - - -# os, option, cache_name, variable -AC_DEFUN(AC_SYS_OS_COMPILER_FLAG, -[ - if test "x$db_cv_sys_os" = "x$1" ; then - AC_SYS_COMPILER_FLAG($2,$3,$4) - fi -]) - -dnl This is where we handle stuff that autoconf can't handle: compiler, -dnl preprocessor and load flags, libraries that the standard tests don't -dnl look for. The default optimization is -O. We would like to set the -dnl default optimization for systems using gcc to -O2, but we can't. By -dnl the time we know we're using gcc, it's too late to set optimization -dnl flags. -dnl -dnl There are additional libraries we need for some compiler/architecture -dnl combinations. -dnl -dnl Some architectures require DB to be compiled with special flags and/or -dnl libraries for threaded applications -dnl -dnl The makefile CC may be different than the CC used in config testing, -dnl because the makefile CC may be set to use $(LIBTOOL). -dnl -dnl XXX -dnl Don't override anything if it's already set from the environment. -optimize_def="-O" -case "$host_os" in -aix4.*) optimize_def="-O2" - CC=${CC-"xlc_r"} - CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS" - LIBTSO_LIBS="\$(LIBS)";; -bsdi3*) CC=${CC-"shlicc2"} - optimize_def="-O2" - LIBS="-lipc $LIBS";; -bsdi*) optimize_def="-O2";; -freebsd*) optimize_def="-O2" - CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS" - LIBS="-pthread";; -hpux*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; -irix*) optimize_def="-O2" - CPPFLAGS="-D_SGI_MP_SOURCE $CPPFLAGS";; -linux*) optimize_def="-O2" - CFLAGS="-D_GNU_SOURCE" - CPPFLAGS="-D_REENTRANT $CPPFLAGS";; -mpeix*) CPPFLAGS="-D_POSIX_SOURCE -D_SOCKET_SOURCE $CPPFLAGS" - LIBS="-lsocket -lsvipc $LIBS";; -osf*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; -*qnx) AC_DEFINE(HAVE_QNX);; -sco3.2v4*) CC=${CC-"cc -belf"} - LIBS="-lsocket -lnsl_s $LIBS";; -sco*) CC=${CC-"cc -belf"} - LIBS="-lsocket -lnsl $LIBS";; -solaris*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; -esac - -dnl Set CFLAGS/CXXFLAGS. We MUST set the flags before we call autoconf -dnl compiler configuration macros, because if we don't, they set CFLAGS -dnl to no optimization and -g, which isn't what we want. -CFLAGS=${CFLAGS-$optimize_def} -CXXFLAGS=${CXXFLAGS-"$CFLAGS"} - -dnl If the user wants a debugging environment, add -g to the CFLAGS value. -dnl -dnl XXX -dnl Some compilers can't mix optimizing and debug flags. The only way to -dnl handle this is to specify CFLAGS in the environment before configuring. -if test "$db_cv_debug" = yes; then - AC_DEFINE(DEBUG) - CFLAGS="$CFLAGS -g" - CXXFLAGS="$CXXFLAGS -g" -fi - -dnl The default compiler is cc (NOT gcc), the default CFLAGS is as specified -dnl above, NOT what is set by AC_PROG_CC, as it won't set optimization flags. -dnl We still call AC_PROG_CC so that we get the other side-effects. -AC_CHECK_PROG(CC, cc, cc) -AC_CHECK_PROG(CC, gcc, gcc) -AC_PROG_CC - -dnl Because of dynamic library building, the ${CC} used for config tests -dnl may be different than the ${CC} we want to put in the Makefile. -dnl The latter is known as ${MAKEFILE_CC} in this script. -MAKEFILE_CC=${CC} -MAKEFILE_CCLINK="\$(CC)" -MAKEFILE_CXX="nocxx" - -dnl Set some #defines based on configuration options. -if test "$db_cv_diagnostic" = yes; then - AC_DEFINE(DIAGNOSTIC) -fi -if test "$db_cv_debug_rop" = yes; then - AC_DEFINE(DEBUG_ROP) -fi -if test "$db_cv_debug_wop" = yes; then - AC_DEFINE(DEBUG_WOP) -fi -if test "$db_cv_umrw" = yes; then - AC_DEFINE(UMRW) -fi -if test "$db_cv_test" = yes; then - AC_DEFINE(CONFIG_TEST) -fi - -dnl See if we need the C++ compiler at all. If so, we'd like to find one that -dnl interoperates with the C compiler we chose. Since we prefered cc over gcc, -dnl we'll also prefer the vendor's compiler over g++/gcc. If we're wrong, the -dnl user can set CC and CXX in their environment before running configure. -dnl -dnl AC_PROG_CXX sets CXX, but it uses $CXX and $CCC (in that order) as its -dnl first choices. -if test "$db_cv_cxx" = "yes"; then - if test "$GCC" != "yes"; then - case "$host_os" in - aix*) AC_CHECK_PROG(CCC, xlC_r, xlC_r);; - hpux*) AC_CHECK_PROG(CCC, aCC, aCC);; - osf*) AC_CHECK_PROG(CCC, cxx, cxx);; - solaris*) AC_CHECK_PROG(CCC, CC, CC);; - esac - fi - AC_PROG_CXX - MAKEFILE_CXX=${CXX} -fi - -dnl XXX -dnl Versions of GCC up to 2.8.0 required -fhandle-exceptions, but it is -dnl renamed as -fexceptions and is the default in versions 2.8.0 and after. -dnl -dnl $GXX may be set as a result of enabling C++ or Java. -if test "$GXX" = "yes"; then - CXXVERSION=`${MAKEFILE_CXX} --version` - case ${CXXVERSION} in - 1.*|2.[[01234567]].*|*-1.*|*-2.[[01234567]].* ) - CXXFLAGS="-fhandle-exceptions $CXXFLAGS";; - * ) CXXFLAGS="-fexceptions $CXXFLAGS";; - esac -fi - -dnl Give the OS a last chance to override CFLAGS and LDFLAGS - -case "$host_os" in -sco3.2v5*) - if test "$GCC" != "yes"; then - CFLAGS="$CFLAGS" - LD='$(CC) $(CFLAGS)' - LIBS="-lsocket -lnsl $LIBS" - CPPFLAGS="-D_THREAD_SAFE -pthread $CPPFLAGS" - case "$CFLAGS" in - *-belf*) - AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[ - case "$LDFLAGS" in - *-belf*) ;; - *) echo "Adding -belf option to ldflags." - LDFLAGS="$LDFLAGS -belf" - ;; - esac - ]) - ;; - *) - AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[ - case "$LDFLAGS" in - *-belf*) ;; - *) - echo "Adding -belf option to ldflags." - LDFLAGS="$LDFLAGS -belf" - ;; - esac - ]) - ;; - esac - else - CC="gcc" - LIBS="-lsocket -lnsl $LIBS" - CPPFLAGS="-D_THREAD_SAFE -pthread $CPPFLAGS" - fi ;; -sysv5uw7*) LIBS="-lsocket -lnsl $LIBS" - if test "$GCC" != "yes"; then - # We are using built-in inline function - CC="cc -belf" - CXX="CC -belf -DNO_CPLUSPLUS_ALLOCA" - CFLAGS="$CFLAGS -Kalloca -Kthread" - LIBS="-Kthread -lsocket -lnsl $LIBS" - else - CFLAGS="$CFLAGS -Kalloca -pthread" - CXX="$CXX -DNO_CPLUSPLUS_ALLOCA" - CPPFLAGS="-D_THREAD_SAFE -pthread $CPPFLAGS" - LIBS="-pthread -lsocket -lnsl $LIBS" - fi - ;; -esac - -dnl Export our compiler preferences for the libtool configuration. -export CC CCC -CCC=CXX - -dnl Dynamic library and libtool configuration; optional, but required for -dnl Tcl or Java support. -LIBDB_ARGS="libdb.a" -LIBTOOL="nolibtool" -POSTLINK="@true" -SOSUFFIX="so" -if test "$db_cv_dynamic" = "yes"; then - SAVE_CC="${MAKEFILE_CC}" - SAVE_CXX="${MAKEFILE_CXX}" - - # Configure libtool. - AC_MSG_CHECKING(libtool configuration) - AC_MSG_RESULT([]) - ${CONFIG_SHELL-/bin/sh} $srcdir/ltconfig \ - --no-verify $srcdir/ltmain.sh \ - --output=./libtool $host_os \ - --disable-static \ - || AC_MSG_ERROR([libtool configure failed]) - - SOSUFFIX=`sed -e '/^library_names_spec=/!d' -e 's/.*\.\([[a-zA-Z0-9_]]*\).*/\1/' ./libtool` - DEFAULT_LIB="\$(libso_target)" - DEFAULT_INSTALL="install_dynamic" - LIBDB_ARGS="\$(libso_linkname)" - LIBTOOL="\$(SHELL) ./libtool" - - MAKEFILE_CC="\$(LIBTOOL) --mode=compile ${SAVE_CC}" - MAKEFILE_CXX="\$(LIBTOOL) --mode=compile ${SAVE_CXX}" - MAKEFILE_CCLINK="\$(LIBTOOL) --mode=link ${SAVE_CC}" - - INSTALLER="\$(LIBTOOL) --mode=install cp" - POSTLINK="\$(LIBTOOL) --mode=execute true" - SOLINK="\$(LIBTOOL) --mode=link ${SAVE_CC} -avoid-version" - SOFLAGS="-rpath \$(libdir)" - o=".lo" -fi - -dnl Optional C++ API. -if test "$db_cv_cxx" = "yes"; then - if test "$db_cv_dynamic" = "yes"; then - ADDITIONAL_LIBS="$ADDITIONAL_LIBS \$(libxso_target)" - DEFAULT_INSTALL="${DEFAULT_INSTALL} install_dynamic_cxx" - else - ADDITIONAL_LIBS="$ADDITIONAL_LIBS \$(libcxx)" - DEFAULT_INSTALL="${DEFAULT_INSTALL} install_static_cxx" - fi -fi - -dnl Optional Java API. -if test "$db_cv_java" = "yes"; then - if test "$db_cv_dynamic" != "yes"; then - AC_MSG_ERROR([--enable-java requires --enable-dynamic]) - fi - - AC_CHECK_PROG(JAVAC, javac, javac, nojavac) - if test "$JAVAC" = "nojavac"; then - AC_MSG_ERROR([no javac compiler in PATH]) - fi - AC_CHECK_PROG(JAR, jar, jar, nojar) - if test "$JAR" = "nojar"; then - AC_MSG_ERROR([no jar utility in PATH]) - fi - AC_PATH_PROG(JAVACABS, javac, nojavac) - ADDITIONAL_LIBS="$ADDITIONAL_LIBS \$(libjso_target)" - ADDITIONAL_LANG="$ADDITIONAL_LANG java" - DEFAULT_INSTALL="${DEFAULT_INSTALL} install_java" - -dnl find the include directory relative to the javac executable - while ls -ld "$JAVACABS" 2>/dev/null | grep " -> " >/dev/null; do - AC_MSG_CHECKING(symlink for $JAVACABS) - JAVACLINK=`ls -ld $JAVACABS | sed 's/.* -> //'` - case "$JAVACLINK" in - /*) JAVACABS="$JAVACLINK";; -dnl 'X' avoids triggering unwanted echo options. - *) JAVACABS=`echo "X$JAVACABS" | sed -e 's/^X//' -e 's:[[^/]]*$::'`"$JAVACLINK";; - esac - AC_MSG_RESULT($JAVACABS) - done - JTOPDIR=`echo "$JAVACABS" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'` - if test -f "$JTOPDIR/include/jni.h"; then - CPPFLAGS="$CPPFLAGSS -I$JTOPDIR/include" - else - JTOPDIR=`echo "$JTOPDIR" | sed -e 's:/[[^/]]*$::'` - if test -f "$JTOPDIR/include/jni.h"; then - CPPFLAGS="$CPPFLAGS -I$JTOPDIR/include" - else - AC_MSG_ERROR([cannot find java include files]) - fi - fi - -dnl get the likely subdirectories for system specific java includes - case "$host_os" in - solaris*) JINCSUBDIRS="solaris";; - linux*) JINCSUBDIRS="linux genunix";; - *) JINCSUBDIRS="genunix";; - esac - - for JINCSUBDIR in $JINCSUBDIRS - do - if test -d "$JTOPDIR/include/$JINCSUBDIR"; then - CPPFLAGS="$CPPFLAGS -I$JTOPDIR/include/$JINCSUBDIR" - fi - done -else - JAVAC=nojavac -fi - -dnl Optional RPC client/server. -if test "$db_cv_rpc" = "yes"; then - AC_DEFINE(HAVE_RPC) - - RPC_OBJS="\$(RPC_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"));; - solaris*) - AC_CHECK_FUNC(svc_run,, AC_CHECK_LIB(nsl, svc_run));; - esac -fi - -AM_TCL_LOAD - -dnl Optional DB 1.85 compatibility API. -if test "$db_cv_compat185" = "yes"; then - ADDITIONAL_INCS="db_185.h $ADDITIONAL_INCS" - ADDITIONAL_OBJS="db185${o} $ADDITIONAL_OBJS" -fi - -dnl Optional utilities. -if test "$db_cv_dump185" = "yes"; then - ADDITIONAL_PROGS="db_dump185 $ADDITIONAL_PROGS" -fi - -dnl Test Server. -dnl Include -lpthread if the library exists. -SCOLIBS=$LIBS -AC_CHECK_LIB(pthread, pthread_create, DBS_LIBS=-lpthread) -case "$host_os" in -sysv5uw7*) LIBS=$SCOLIBS;; -sco3.2v5*) LIBS=$SCOLIBS;; -esac - -dnl Checks for typedefs, structures, and system/compiler characteristics. -AC_C_BIGENDIAN -AC_C_CONST -AC_HEADER_STAT -AC_HEADER_TIME -AC_STRUCT_ST_BLKSIZE -AC_TYPE_MODE_T -AC_TYPE_OFF_T -AC_TYPE_PID_T -AC_TYPE_SIZE_T - -dnl Define any short-hand types we're missing. -AM_SHORTHAND_TYPES - -dnl Checks for header files. -AC_HEADER_DIRENT -AC_CHECK_HEADERS(sys/select.h) -AC_CHECK_HEADERS(sys/time.h) - -dnl Check for mutexes. We do this here because it changes $LIBS. -AM_DEFINE_MUTEXES - -dnl Checks for system functions for which we have replacements. -dnl -dnl XXX -dnl The only portable getcwd call is getcwd(char *, size_t), where the -dnl buffer is non-NULL -- Solaris can't handle a NULL buffer, and they -dnl deleted getwd(). -AC_REPLACE_FUNCS(getcwd getopt memcmp memcpy memmove) -AC_REPLACE_FUNCS(raise snprintf strcasecmp strerror vsnprintf) - -dnl XXX -dnl Nasty hack. AC_REPLACE_FUNCS added entries of the form xxx.o to the -dnl LIBOBJS variable. They have to be xxx.lo if we are building shared -dnl libraries. Use sed, configure already requires it. -tmp="`echo \"$LIBOBJS\" | sed \"s/\.o/${o}/g\"`" -LIBOBJS="$tmp" - -dnl Check for system functions we optionally use. -AC_CHECK_FUNCS(getuid pstat_getdynamic sysconf sched_yield strtoul yield) - -dnl Pread/pwrite. -dnl -dnl HP-UX has pread/pwrite, but it doesn't work with bigfile support. -case "$host_os" in -hpux*) - AC_MSG_WARN([pread/pwrite interfaces ignored on $host_os.]);; -*) AC_CHECK_FUNCS(pread pwrite) -esac - -dnl Check for fcntl(2) to deny child process access to file descriptors. -AC_CACHE_CHECK([for fcntl/F_SETFD], db_cv_fcntl_f_setfd, [dnl -AC_TRY_RUN([ -#include -#include -main(){exit(fcntl(1, F_SETFD, 1) == -1);}], - [db_cv_fcntl_f_setfd=yes], [db_cv_fcntl_f_setfd=no])]) -if test "$db_cv_fcntl_f_setfd" = yes; then - AC_DEFINE(HAVE_FCNTL_F_SETFD) -fi - -dnl A/UX has a broken getopt(3). -case "$host_os" in -aux*) ADDITIONAL_OBJS="getopt${o} $ADDITIONAL_OBJS";; -esac - -dnl Checks for system functions for which we don't have replacements. - -dnl We require qsort(3) and select(2). -AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.])) -AC_CHECK_FUNCS(select, , AC_MSG_ERROR([No select library function.])) - -dnl Some versions of sprintf return a pointer to the first argument instead -dnl of a character count. We assume that the return value of snprintf and -dnl vsprintf etc. will be the same as sprintf, and check the easy one. -AC_CACHE_CHECK([for int type sprintf return value], db_cv_sprintf_count, [dnl -AC_TRY_RUN([main(){char buf[20]; exit(sprintf(buf, "XXX") != 3);}], - [db_cv_sprintf_count=yes], [db_cv_sprintf_count=no])]) -if test "$db_cv_sprintf_count" = no; then - AC_DEFINE(SPRINTF_RET_CHARPNT) -fi - -dnl Vendors are doing 64-bit lseek in different ways. -dnl AIX, HP/UX, Solaris and Linux all use _FILE_OFFSET_BITS -dnl to specify a "big-file" environment. -dnl -dnl You can't build C++ with big-file support on HP-UX, the include files -dnl are wrong. On Solaris 8, included with big-file support -dnl is not compatible with C++. -if test "$db_cv_bigfile" = no; then - case "$host_os" in - solaris2.8|hpux*) - if test "$db_cv_cxx" = "yes"; then - AC_MSG_WARN([Large file and C++ API support are incompatible on HP-UX]) - AC_MSG_WARN([and Solaris 8; large file support has been turned off.]) - else - AC_DEFINE(HAVE_FILE_OFFSET_BITS) - fi;; - aix*|solaris*|linux*) - AC_DEFINE(HAVE_FILE_OFFSET_BITS);; - esac -fi - -dnl Figure out how to create shared regions. -dnl -dnl First, we look for mmap. -dnl -dnl BSD/OS has mlock(2), but it doesn't work until the 4.1 release. -dnl -dnl Nextstep (version 3.3) apparently supports mmap(2) (the mmap symbol -dnl is defined in the C library) but does not support munmap(2). Don't -dnl try to use mmap if we can't find munmap. -dnl -dnl Ultrix has mmap(2), but it doesn't work. -mmap_ok=no -case "$host_os" in -bsdi3*|bsdi4.0) - AC_MSG_WARN([mlock(2) interface ignored on BSD/OS 3.X and 4.0.]) - mmap_ok=yes - AC_CHECK_FUNCS(mmap munmap, , mmap_ok=no);; -ultrix*) - AC_MSG_WARN([mmap(2) interface ignored on Ultrix.]);; -*) - mmap_ok=yes - AC_CHECK_FUNCS(mlock munlock) - AC_CHECK_FUNCS(mmap munmap, , mmap_ok=no);; -esac - -dnl Second, we look for shmget. -dnl -dnl SunOS has the shmget(2) interfaces, but there appears to be a missing -dnl #include file, so we ignore them. -shmget_ok=no -case "$host_os" in -sunos*) - AC_MSG_WARN([shmget(2) interface ignored on SunOS.]);; -*) - shmget_ok=yes - AC_CHECK_FUNCS(shmget, , shmget_ok=no);; -esac - -dnl We require either mmap/munmap(2) or shmget(2). -if test "$mmap_ok" = no -a "$shmget_ok" = no; then - AC_MSG_WARN([Neither mmap/munmap(2) or shmget(2) library functions.]) -fi - -dnl Check for programs used in building and installation. -AM_PROGRAMS_SET - -CREATE_LIST="Makefile - include.tcl:../test/include.tcl - db.h:../include/db.src - db_int.h:../include/db_int.src" -if test "$db_cv_compat185" = "yes"; then - CREATE_LIST="${CREATE_LIST} db_185.h:../include/db_185.h" -fi -AC_OUTPUT(${CREATE_LIST}) diff --git a/bdb/dist/db.ecd.in b/bdb/dist/db.ecd.in new file mode 100644 index 00000000000..92a6a090716 --- /dev/null +++ b/bdb/dist/db.ecd.in @@ -0,0 +1,64 @@ +# Embedix Componenet Description (ECD) file for BerkeleyDB. +# +# $Id: db.ecd.in,v 11.1 2001/04/04 14:06:13 bostic Exp $ + + + + + SRPM=db + + + Berkeley DB is Sleepycat Software's programmatic database toolkit. + + + TYPE=bool + DEFAULT_VALUE=1 + PROMPT=Include BerkeleyDB library? + + /usr/lib/libdb-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.so + /usr/include/db.h + /usr/lib/libdb.so + + + libdb-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.so + + + ld-linux.so.2 + libc.so.6 + + STATIC_SIZE=0 + STARTUP_TIME=0 + + @EMBEDIX_ECD_CXX@ + + + + + + diff --git a/bdb/dist/db.spec.in b/bdb/dist/db.spec.in new file mode 100644 index 00000000000..ef253bcfcf4 --- /dev/null +++ b/bdb/dist/db.spec.in @@ -0,0 +1,52 @@ +# Berkeley DB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@ + +Summary: Sleepycat Berkeley DB database library +Name: db +Version: @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@ +Release: 1 +Copyright: Freely redistributable, see LICENSE for details. +Source: http://www.sleepycat.com/update/@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@/db-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@.tar.gz +URL: http://www.sleepycat.com +Group: System Environment/Libraries +BuildRoot: @CONFIGURATION_PATH@/RPM_INSTALL + +%description +Berkeley DB is a programmatic toolkit that provides fast, reliable, +mission-critical, and scalable built-in database support for software +ranging from embedded applications running on hand-held appliances to +enterprise-scale servers. + +The Berkeley DB access methods include B+tree, Extended Linear Hashing, +Fixed and Variable-length records, and Persistent Queues. Berkeley DB +provides full transactional support, database recovery, online backups, +and separate access to locking, logging and shared memory caching +subsystems. + +Berkeley DB supports C, C++, Java, Tcl, Perl, and Python APIs. The +software is available for Linux, a wide variety of UNIX platforms, +Windows 95/98, Windows/NT, Windows 2000, VxWorks and QNX. + +%prep +%setup + +%build +cd build_unix +CFLAGS="$RPM_OPT_FLAGS" ../dist/configure @CONFIGURATION_ARGS@ +make library_build + +%install +cd build_unix +make prefix=@CONFIGURATION_PATH@/RPM_INSTALL@EMBEDIX_ROOT@ install + +@RPM_POST_INSTALL@ + +@RPM_POST_UNINSTALL@ + +%files +%defattr(-,root,root) +%dir @EMBEDIX_ROOT@/bin +%dir @EMBEDIX_ROOT@/docs +%dir @EMBEDIX_ROOT@/include +%dir @EMBEDIX_ROOT@/lib + +%changelog diff --git a/bdb/dist/gen_inc.awk b/bdb/dist/gen_inc.awk new file mode 100644 index 00000000000..4d245623bee --- /dev/null +++ b/bdb/dist/gen_inc.awk @@ -0,0 +1,73 @@ +# This awk script parses C input files looking for lines marked "PUBLIC:" +# and "EXTERN:". (PUBLIC lines are DB internal function prototypes and +# #defines, EXTERN are DB external function prototypes and #defines.) +# +# 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. +# +# 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 +# #define list for use when creating unique symbol names. +# +# Four arguments: +# e_dfile list of EXTERN #defines +# e_pfile include file that contains EXTERN prototypes +# i_dfile list of internal (PUBLIC) #defines +# i_pfile include file that contains internal (PUBLIC) prototypes +/PUBLIC:/ { + sub("^.*PUBLIC:[ ][ ]*", "") + if ($0 ~ "^#if|^#ifdef|^#ifndef|^#else|^#endif") { + print $0 >> i_pfile + print $0 >> i_dfile + next + } + pline = sprintf("%s %s", pline, $0) + if (pline ~ "));") { + sub("^[ ]*", "", pline) + print pline >> i_pfile + if (pline !~ db_version_unique_name) { + def = gensub("[ ][ ]*__P.*", "", 1, pline) + sub("^.*[ ][*]*", "", def) + printf("#define %s %s@DB_VERSION_UNIQUE_NAME@\n", + def, def) >> i_dfile + } + pline = "" + } +} + +# 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") { + print $0 >> e_pfile + print $0 >> e_dfile + next + } + eline = sprintf("%s %s", eline, $0) + if (eline ~ "));") { + sub("^[ ]*", "", eline) + print eline >> e_pfile + if (eline !~ db_version_unique_name && eline !~ "^int txn_") { + def = gensub("[ ][ ]*__P.*", "", 1, eline) + sub("^.*[ ][*]*", "", def) + printf("#define %s %s@DB_VERSION_UNIQUE_NAME@\n", + def, def) >> e_dfile + } + eline = "" + } +} diff --git a/bdb/dist/gen_rec.awk b/bdb/dist/gen_rec.awk index 5953ee05120..75f2e86ca9e 100644 --- a/bdb/dist/gen_rec.awk +++ b/bdb/dist/gen_rec.awk @@ -2,10 +2,10 @@ # # See the file LICENSE for redistribution information. # -# Copyright (c) 1996, 1997, 1998, 1999, 2000 +# Copyright (c) 1996-2002 # Sleepycat Software. All rights reserved. # -# $Id: gen_rec.awk,v 11.26 2001/01/08 21:06:46 bostic Exp $ +# $Id: gen_rec.awk,v 11.70 2002/08/08 15:44:47 bostic Exp $ # # This awk script generates all the log, print, and read routines for the DB @@ -21,33 +21,51 @@ # (logical types are defined in each subsystem manually) # structures to contain the data unmarshalled from the log. # -# This awk script requires that five variables be set when it is called: +# This awk script requires that four variables be set when it is called: # # source_file -- the C source file being created -# subsystem -- the subsystem prefix, e.g., "db" # header_file -- the C #include file being created # template_file -- the template file being created -# template_dir -- the directory to find the source template # # And stdin must be the input file that defines the recovery setup. +# +# Within each file prefix.src, we use a number of public keywords (documented +# in the reference guide) as well as the following ones which are private to +# DB: +# DBPRIVATE Indicates that a file will be built as part of DB, +# rather than compiled independently, and so can use +# DB-private interfaces (such as DB_NOCOPY). +# DB A DB handle. Logs the dbreg fileid for that handle, +# and makes the *_log interface take a DB * instead of a +# DB_ENV *. +# PGDBT Just like DBT, only we know it stores a page or page +# header, so we can byte-swap it (once we write the +# byte-swapping code, which doesn't exist yet). +# WRLOCK +# WRLOCKNZ An ARG that stores a db_pgno_t, which the getpgnos +# function should acquire a lock on. WRLOCK implies +# that we should always get the lock; WRLOCKNZ implies +# that we should do so if and only if the pgno is non-zero +# (unfortunately, 0 is both PGNO_INVALID and the main +# metadata page number). BEGIN { - if (source_file == "" || subsystem == "" || - header_file == "" || template_file == "" || template_dir == "") { - print "Usage: gen_rec.awk requires five variables to be set:" + if (source_file == "" || + header_file == "" || template_file == "") { + print "Usage: gen_rec.awk requires three variables to be set:" print "\tsource_file\t-- the C source file being created" - print "\tsubsystem\t-- the subsystem prefix, e.g., \"db\"" print "\theader_file\t-- the C #include file being created" print "\ttemplate_file\t-- the template file being created" - print "\ttemplate_dir\t-- the directory to find the source template" exit } FS="[\t ][\t ]*" CFILE=source_file - NAME=subsystem HFILE=header_file TFILE=template_file - TDIR=template_dir + dbprivate = 0 +} +/^[ ]*DBPRIVATE/ { + dbprivate = 1 } /^[ ]*PREFIX/ { prefix = $2 @@ -71,9 +89,9 @@ BEGIN { printf("#include \n") >> TFILE printf("#endif\n\n") >> TFILE printf("#include \"db_int.h\"\n") >> TFILE - printf("#include \"db_page.h\"\n") >> TFILE - printf("#include \"%s.h\"\n", prefix) >> TFILE - printf("#include \"log.h\"\n\n") >> TFILE + printf("#include \"dbinc/db_page.h\"\n") >> TFILE + printf("#include \"dbinc/%s.h\"\n", prefix) >> TFILE + printf("#include \"dbinc/log.h\"\n\n") >> TFILE } /^[ ]*INCLUDE/ { if ($3 == "") @@ -81,26 +99,30 @@ BEGIN { else printf("%s %s\n", $2, $3) >> CFILE } -/^[ ]*(BEGIN|DEPRECATED)/ { +/^[ ]*(BEGIN|IGNORED)/ { if (in_begin) { print "Invalid format: missing END statement" exit } in_begin = 1; is_dbt = 0; - is_deprecated = ($1 == "DEPRECATED"); + has_dbp = 0; + is_uint = 0; + need_log_function = ($1 == "BEGIN"); nvars = 0; + # number of locks that the getpgnos functions will return + nlocks = 0; + thisfunc = $2; funcname = sprintf("%s_%s", prefix, $2); rectype = $3; funcs[num_funcs] = funcname; - funcs_dep[num_funcs] = is_deprecated; ++num_funcs; } -/^[ ]*(ARG|DBT|POINTER)/ { +/^[ ]*(DB|ARG|DBT|PGDBT|POINTER|WRLOCK|WRLOCKNZ)/ { vars[nvars] = $2; types[nvars] = $3; atypes[nvars] = $1; @@ -109,11 +131,16 @@ BEGIN { for (i = 4; i < NF; i++) types[nvars] = sprintf("%s %s", types[nvars], $i); - if ($1 == "ARG") - sizes[nvars] = sprintf("sizeof(%s)", $2); - else if ($1 == "POINTER") + if ($1 == "DB") { + has_dbp = 1; + } + + if ($1 == "DB" || $1 == "ARG" || $1 == "WRLOCK" || $1 == "WRLOCKNZ") { + sizes[nvars] = sprintf("sizeof(u_int32_t)"); + is_uint = 1; + } else if ($1 == "POINTER") sizes[nvars] = sprintf("sizeof(*%s)", $2); - else { # DBT + else { # DBT, PGDBT sizes[nvars] = \ sprintf("sizeof(u_int32_t) + (%s == NULL ? 0 : %s->size)", \ $2, $2); @@ -121,6 +148,17 @@ BEGIN { } nvars++; } +/^[ ]*(WRLOCK|WRLOCKNZ)/ { + nlocks++; + + if ($1 == "WRLOCK") { + lock_if_zero[nlocks] = 1; + } else { + lock_if_zero[nlocks] = 0; + } + + lock_pgnos[nlocks] = $2; +} /^[ ]*END/ { if (!in_begin) { print "Invalid format: missing BEGIN statement" @@ -128,7 +166,7 @@ BEGIN { } # Declare the record type. - printf("\n#define\tDB_%s\t%d\n", funcname, rectype) >> HFILE + printf("#define\tDB_%s\t%d\n", funcname, rectype) >> HFILE # Structure declaration. printf("typedef struct _%s_args {\n", funcname) >> HFILE @@ -146,17 +184,26 @@ BEGIN { } printf("\t%s\t%s;\n", t, vars[i]) >> HFILE } - printf("} __%s_args;\n\n", funcname) >> HFILE + printf("} %s_args;\n\n", funcname) >> HFILE - # Output the log, print and read functions. - if (!is_deprecated) + # Output the log, print, read, and getpgnos functions. + if (need_log_function) { log_function(); + + # The getpgnos function calls DB-private (__rep_*) functions, + # so we only generate it for our own logging functions, + # not application-specific ones. + if (dbprivate) { + getpgnos_function(); + } + } print_function(); read_function(); # Recovery template - cmd = sprintf("sed -e s/PREF/%s/ -e s/FUNC/%s/ < %s/rec_ctemp >> %s", - prefix, thisfunc, TDIR, TFILE) + cmd = sprintf(\ + "sed -e s/PREF/%s/ -e s/FUNC/%s/ < template/rec_ctemp >> %s", + prefix, thisfunc, TFILE) system(cmd); # Done writing stuff, reset and continue. @@ -164,63 +211,141 @@ BEGIN { } END { - # Print initialization routine; function prototype - printf("int __%s_init_print __P((DB_ENV *));\n", prefix) >> HFILE; + # End the conditional for the HFILE + printf("#endif\n") >> HFILE; - # Create the routine to call db_add_recovery(print_fn, id) - printf("int\n__%s_init_print(dbenv)\n", prefix) >> CFILE; - printf("\tDB_ENV *dbenv;\n{\n\tint ret;\n\n") >> CFILE; + # Print initialization routine; function prototype + p[1] = sprintf("int %s_init_print %s%s", prefix, + "__P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, ", + "db_recops, void *), size_t *));"); + p[2] = ""; + proto_format(p); + + # Create the routine to call __db_add_recovery(print_fn, id) + printf("int\n%s_init_print(dbenv, dtabp, dtabsizep)\n", \ + prefix) >> CFILE; + printf("\tDB_ENV *dbenv;\n") >> CFILE;; + printf("\tint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *,") >> CFILE; + printf(" db_recops, void *));\n") >> CFILE; + printf("\tsize_t *dtabsizep;\n{\n") >> CFILE; + # If application-specific, the user will need a prototype for + # __db_add_recovery, since they won't have DB's. + if (!dbprivate) { + printf("\tint __db_add_recovery __P((DB_ENV *,\n") >> CFILE; + printf(\ +"\t int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *),\n") >> CFILE; + printf("\t size_t *,\n") >> CFILE; + printf(\ +"\t int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), u_int32_t));\n") \ + >> CFILE; + } + + printf("\tint ret;\n\n") >> CFILE; for (i = 0; i < num_funcs; i++) { - printf("\tif ((ret = __db_add_recovery(dbenv,\n") >> CFILE; - printf("\t __%s_print, DB_%s)) != 0)\n", \ + printf("\tif ((ret = __db_add_recovery(dbenv, ") >> CFILE; + printf("dtabp, dtabsizep,\n") >> CFILE; + printf("\t %s_print, DB_%s)) != 0)\n", \ + funcs[i], funcs[i]) >> CFILE; + printf("\t\treturn (ret);\n") >> CFILE; + } + printf("\treturn (0);\n}\n\n") >> CFILE; + + # We only want to generate *_init_{getpgnos,recover} functions + # if this is a DB-private, rather than application-specific, + # set of recovery functions. Application-specific recovery functions + # should be dispatched using the DB_ENV->set_app_dispatch callback + # rather than a DB dispatch table ("dtab"). + if (!dbprivate) + exit + + # Page number initialization routine; function prototype + p[1] = sprintf("int %s_init_getpgnos %s%s", prefix, + "__P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, ", + "db_recops, void *), size_t *));"); + p[2] = ""; + proto_format(p); + + # Create the routine to call db_add_recovery(pgno_fn, id) + printf("int\n%s_init_getpgnos(dbenv, dtabp, dtabsizep)\n", \ + prefix) >> CFILE; + printf("\tDB_ENV *dbenv;\n") >> CFILE; + printf("\tint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *,") >> CFILE; + printf(" db_recops, void *));\n") >> CFILE; + printf("\tsize_t *dtabsizep;\n{\n\tint ret;\n\n") >> CFILE; + for (i = 0; i < num_funcs; i++) { + printf("\tif ((ret = __db_add_recovery(dbenv, ") >> CFILE; + printf("dtabp, dtabsizep,\n") >> CFILE; + printf("\t %s_getpgnos, DB_%s)) != 0)\n", \ funcs[i], funcs[i]) >> CFILE; printf("\t\treturn (ret);\n") >> CFILE; } printf("\treturn (0);\n}\n\n") >> CFILE; # Recover initialization routine - printf("int __%s_init_recover __P((DB_ENV *));\n", prefix) >> HFILE; + p[1] = sprintf("int %s_init_recover %s%s", prefix, + "__P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, ", + "db_recops, void *), size_t *));"); + p[2] = ""; + proto_format(p); # Create the routine to call db_add_recovery(func, id) - printf("int\n__%s_init_recover(dbenv)\n", prefix) >> CFILE; - printf("\tDB_ENV *dbenv;\n{\n\tint ret;\n\n") >> CFILE; + printf("int\n%s_init_recover(dbenv, dtabp, dtabsizep)\n", \ + prefix) >> CFILE; + printf("\tDB_ENV *dbenv;\n") >> CFILE; + printf("\tint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *,") >> CFILE; + printf(" db_recops, void *));\n") >> CFILE; + printf("\tsize_t *dtabsizep;\n{\n\tint ret;\n\n") >> CFILE; for (i = 0; i < num_funcs; i++) { - printf("\tif ((ret = __db_add_recovery(dbenv,\n") >> CFILE; - if (funcs_dep[i] == 1) - printf("\t __deprecated_recover, DB_%s)) != 0)\n", \ - funcs[i]) >> CFILE; - else - printf("\t __%s_recover, DB_%s)) != 0)\n", \ - funcs[i], funcs[i]) >> CFILE; + printf("\tif ((ret = __db_add_recovery(dbenv, ") >> CFILE; + printf("dtabp, dtabsizep,\n") >> CFILE; + printf("\t %s_recover, DB_%s)) != 0)\n", \ + funcs[i], funcs[i]) >> CFILE; printf("\t\treturn (ret);\n") >> CFILE; } - printf("\treturn (0);\n}\n\n") >> CFILE; - - # End the conditional for the HFILE - printf("#endif\n") >> HFILE; + printf("\treturn (0);\n}\n") >> CFILE; } function log_function() { # Write the log function; function prototype - printf("int __%s_log __P((", funcname) >> HFILE; - printf("DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t") >> HFILE; - for (i = 0; i < nvars; i++) { - printf(", ") >> HFILE; - if (modes[i] == "DBT") - printf("const ") >> HFILE; - printf("%s", types[i]) >> HFILE; - if (modes[i] == "DBT") - printf(" *") >> HFILE; + pi = 1; + p[pi++] = sprintf("int %s_log", funcname); + p[pi++] = " "; + if (has_dbp == 1) { + p[pi++] = "__P((DB *, DB_TXN *, DB_LSN *, u_int32_t"; + } else { + p[pi++] = "__P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t"; } - printf("));\n") >> HFILE; + for (i = 0; i < nvars; i++) { + if (modes[i] == "DB") + continue; + p[pi++] = ", "; + p[pi++] = sprintf("%s%s%s", + (modes[i] == "DBT" || modes[i] == "PGDBT") ? "const " : "", + types[i], + (modes[i] == "DBT" || modes[i] == "PGDBT") ? " *" : ""); + } + p[pi++] = ""; + p[pi++] = "));"; + p[pi++] = ""; + proto_format(p); # Function declaration - printf("int\n__%s_log(dbenv, txnid, ret_lsnp, flags", \ - funcname) >> CFILE; + if (has_dbp == 1) { + printf("int\n%s_log(dbp, txnid, ret_lsnp, flags", \ + funcname) >> CFILE; + } else { + printf("int\n%s_log(dbenv, txnid, ret_lsnp, flags", \ + funcname) >> CFILE; + } for (i = 0; i < nvars; i++) { + if (modes[i] == "DB") { + # We pass in fileids on the dbp, so if this is one, + # skip it. + continue; + } printf(",") >> CFILE; if ((i % 6) == 0) - printf("\n\t") >> CFILE; + printf("\n ") >> CFILE; else printf(" ") >> CFILE; printf("%s", vars[i]) >> CFILE; @@ -228,65 +353,95 @@ function log_function() { printf(")\n") >> CFILE; # Now print the parameters - printf("\tDB_ENV *dbenv;\n") >> CFILE; + if (has_dbp == 1) { + printf("\tDB *dbp;\n") >> CFILE; + } else { + printf("\tDB_ENV *dbenv;\n") >> CFILE; + } printf("\tDB_TXN *txnid;\n\tDB_LSN *ret_lsnp;\n") >> CFILE; printf("\tu_int32_t flags;\n") >> CFILE; for (i = 0; i < nvars; i++) { - if (modes[i] == "DBT") + # We just skip for modes == DB. + if (modes[i] == "DBT" || modes[i] == "PGDBT") printf("\tconst %s *%s;\n", types[i], vars[i]) >> CFILE; - else + else if (modes[i] != "DB") printf("\t%s %s;\n", types[i], vars[i]) >> CFILE; } # Function body and local decls printf("{\n") >> CFILE; printf("\tDBT logrec;\n") >> CFILE; + if (has_dbp == 1) + printf("\tDB_ENV *dbenv;\n") >> CFILE; printf("\tDB_LSN *lsnp, null_lsn;\n") >> CFILE; if (is_dbt == 1) printf("\tu_int32_t zero;\n") >> CFILE; - printf("\tu_int32_t rectype, txn_num;\n") >> CFILE; + if (is_uint == 1) + printf("\tu_int32_t uinttmp;\n") >> CFILE; + printf("\tu_int32_t npad, rectype, txn_num;\n") >> CFILE; printf("\tint ret;\n") >> CFILE; printf("\tu_int8_t *bp;\n\n") >> CFILE; # Initialization + if (has_dbp == 1) + printf("\tdbenv = dbp->dbenv;\n") >> CFILE; printf("\trectype = DB_%s;\n", funcname) >> CFILE; - printf("\tif (txnid != NULL &&\n") >> CFILE; - printf("\t TAILQ_FIRST(&txnid->kids) != NULL &&\n") >> CFILE; - printf("\t (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)\n")\ - >> CFILE; - printf("\t\treturn (ret);\n") >> CFILE; - printf("\ttxn_num = txnid == NULL ? 0 : txnid->txnid;\n") >> CFILE; + printf("\tnpad = 0;\n\n") >> CFILE; + printf("\tif (txnid == NULL) {\n") >> CFILE; - printf("\t\tZERO_LSN(null_lsn);\n") >> CFILE; + printf("\t\ttxn_num = 0;\n") >> CFILE; + printf("\t\tnull_lsn.file = 0;\n") >> CFILE; + printf("\t\tnull_lsn.offset = 0;\n") >> CFILE; printf("\t\tlsnp = &null_lsn;\n") >> CFILE; - printf("\t} else\n\t\tlsnp = &txnid->last_lsn;\n") >> CFILE; + printf("\t} else {\n") >> CFILE; + if (funcname != "__db_debug" && dbprivate) { + printf(\ + "\t\tif (TAILQ_FIRST(&txnid->kids) != NULL &&\n") >> CFILE; + printf("\t\t (ret = __txn_activekids(") >> CFILE; + printf("dbenv, rectype, txnid)) != 0)\n") >> CFILE; + printf("\t\t\treturn (ret);\n") >> CFILE; + } + printf("\t\ttxn_num = txnid->txnid;\n") >> CFILE; + printf("\t\tlsnp = &txnid->last_lsn;\n") >> CFILE; + printf("\t}\n\n") >> CFILE; # Malloc printf("\tlogrec.size = sizeof(rectype) + ") >> CFILE; printf("sizeof(txn_num) + sizeof(DB_LSN)") >> CFILE; for (i = 0; i < nvars; i++) printf("\n\t + %s", sizes[i]) >> CFILE; - printf(";\n\tif ((ret = ") >> CFILE; - printf(\ - "__os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)\n")\ - >> CFILE; - printf("\t\treturn (ret);\n\n") >> CFILE; + printf(";\n") >> CFILE + if (dbprivate) { + printf("\tif (CRYPTO_ON(dbenv)) {\n") >> CFILE; + printf("\t\tnpad =\n") >> CFILE + printf(\ +"\t\t ((DB_CIPHER *)dbenv->crypto_handle)->adj_size(logrec.size);\n")\ + >> CFILE; + printf("\t\tlogrec.size += npad;\n\t}\n\n") >> CFILE + } + write_malloc("logrec.data", "logrec.size", CFILE) + printf("\tif (npad > 0)\n") >> CFILE; + printf("\t\tmemset((u_int8_t *)logrec.data + logrec.size ") >> CFILE; + printf("- npad, 0, npad);\n\n") >> CFILE; # Copy args into buffer - printf("\tbp = logrec.data;\n") >> CFILE; + printf("\tbp = logrec.data;\n\n") >> CFILE; printf("\tmemcpy(bp, &rectype, sizeof(rectype));\n") >> CFILE; - printf("\tbp += sizeof(rectype);\n") >> CFILE; + printf("\tbp += sizeof(rectype);\n\n") >> CFILE; printf("\tmemcpy(bp, &txn_num, sizeof(txn_num));\n") >> CFILE; - printf("\tbp += sizeof(txn_num);\n") >> CFILE; + printf("\tbp += sizeof(txn_num);\n\n") >> CFILE; printf("\tmemcpy(bp, lsnp, sizeof(DB_LSN));\n") >> CFILE; - printf("\tbp += sizeof(DB_LSN);\n") >> CFILE; + printf("\tbp += sizeof(DB_LSN);\n\n") >> CFILE; for (i = 0; i < nvars; i ++) { - if (modes[i] == "ARG") { - printf("\tmemcpy(bp, &%s, %s);\n", \ - vars[i], sizes[i]) >> CFILE; - printf("\tbp += %s;\n", sizes[i]) >> CFILE; - } else if (modes[i] == "DBT") { + if (modes[i] == "ARG" || modes[i] == "WRLOCK" || \ + modes[i] == "WRLOCKNZ") { + printf("\tuinttmp = (u_int32_t)%s;\n", \ + vars[i]) >> CFILE; + printf("\tmemcpy(bp, &uinttmp, sizeof(uinttmp));\n") \ + >> CFILE; + printf("\tbp += sizeof(uinttmp);\n\n") >> CFILE; + } else if (modes[i] == "DBT" || modes[i] == "PGDBT") { printf("\tif (%s == NULL) {\n", vars[i]) >> CFILE; printf("\t\tzero = 0;\n") >> CFILE; printf("\t\tmemcpy(bp, &zero, sizeof(u_int32_t));\n") \ @@ -299,49 +454,85 @@ function log_function() { >> CFILE; printf("\t\tmemcpy(bp, %s->data, %s->size);\n", \ vars[i], vars[i]) >> CFILE; - printf("\t\tbp += %s->size;\n\t}\n", vars[i]) >> CFILE; + printf("\t\tbp += %s->size;\n\t}\n\n", \ + vars[i]) >> CFILE; + } else if (modes[i] == "DB") { + # We need to log a DB handle. To do this, we + # actually just log its fileid; from that, we'll + # be able to acquire an open handle at recovery time. + printf("\tDB_ASSERT(dbp->log_filename != NULL);\n") \ + >> CFILE; + printf("\tif (dbp->log_filename->id == ") >> CFILE; + printf("DB_LOGFILEID_INVALID &&\n\t ") >> CFILE + printf("(ret = __dbreg_lazy_id(dbp)) != 0)\n") \ + >> CFILE; + printf("\t\treturn (ret);\n\n") >> CFILE; + + printf("\tuinttmp = ") >> CFILE; + printf("(u_int32_t)dbp->log_filename->id;\n") >> CFILE; + printf("\tmemcpy(bp, &uinttmp, sizeof(uinttmp));\n") \ + >> CFILE; + printf("\tbp += sizeof(uinttmp);\n\n") >> CFILE; } else { # POINTER printf("\tif (%s != NULL)\n", vars[i]) >> CFILE; printf("\t\tmemcpy(bp, %s, %s);\n", vars[i], \ sizes[i]) >> CFILE; printf("\telse\n") >> CFILE; printf("\t\tmemset(bp, 0, %s);\n", sizes[i]) >> CFILE; - printf("\tbp += %s;\n", sizes[i]) >> CFILE; + printf("\tbp += %s;\n\n", sizes[i]) >> CFILE; } } - # Error checking - printf("\tDB_ASSERT((u_int32_t)") >> CFILE; - printf("(bp - (u_int8_t *)logrec.data) == logrec.size);\n") >> CFILE; + # Error checking. User code won't have DB_ASSERT available, but + # this is a pretty unlikely assertion anyway, so we just leave it out + # rather than requiring assert.h. + if (dbprivate) { + printf("\tDB_ASSERT((u_int32_t)") >> CFILE; + printf("(bp - (u_int8_t *)logrec.data) <= logrec.size);\n") \ + >> CFILE; + } # Issue log call - # The logging system cannot call the public log_put routine - # due to mutual exclusion constraints. So, if we are - # generating code for the log subsystem, use the internal - # __log_put. - if (prefix == "log") - printf("\tret = __log_put\(dbenv, ret_lsnp, ") >> CFILE; - else - printf("\tret = log_put(dbenv, ret_lsnp, ") >> CFILE; - printf("(DBT *)&logrec, flags);\n") >> CFILE; + # We didn't call the crypto alignment function when we created this + # log record (because we don't have the right header files to find + # the function), so we have to copy the log record to make sure the + # alignment is correct. + printf(\ + "\tret = dbenv->log_put(dbenv,\n\t ret_lsnp, (DBT *)&logrec, ") \ + >> CFILE; + if (dbprivate) { + printf("flags | DB_NOCOPY);\n") >> CFILE; + } else { + printf("flags);\n") >> CFILE; + } # Update the transactions last_lsn - printf("\tif (txnid != NULL)\n") >> CFILE; + printf("\tif (txnid != NULL && ret == 0)\n") >> CFILE; printf("\t\ttxnid->last_lsn = *ret_lsnp;\n") >> CFILE; + # If out of disk space log writes may fail. If we are debugging + # that print out which records did not make it to disk. + 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") >> CFILE + # Free and return - printf("\t__os_free(logrec.data, logrec.size);\n") >> CFILE; + write_free("logrec.data", CFILE) printf("\treturn (ret);\n}\n\n") >> CFILE; } function print_function() { # Write the print function; function prototype - printf("int __%s_print", funcname) >> HFILE; - printf(" __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));\n") \ - >> HFILE; + p[1] = sprintf("int %s_print", funcname); + p[2] = " "; + p[3] = "__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));"; + p[4] = ""; + proto_format(p); # Function declaration - printf("int\n__%s_print(dbenv, ", funcname) >> CFILE; + printf("int\n%s_print(dbenv, ", funcname) >> CFILE; printf("dbtp, lsnp, notused2, notused3)\n") >> CFILE; printf("\tDB_ENV *dbenv;\n") >> CFILE; printf("\tDBT *dbtp;\n") >> CFILE; @@ -349,20 +540,26 @@ function print_function() { printf("\tdb_recops notused2;\n\tvoid *notused3;\n{\n") >> CFILE; # Locals - printf("\t__%s_args *argp;\n", funcname) >> CFILE; - printf("\tu_int32_t i;\n\tu_int ch;\n\tint ret;\n\n") >> CFILE; + printf("\t%s_args *argp;\n", funcname) >> CFILE; + for (i = 0; i < nvars; i ++) + if (modes[i] == "DBT" || modes[i] == "PGDBT") { + printf("\tu_int32_t i;\n") >> CFILE + printf("\tint ch;\n") >> CFILE + break; + } + + printf("\tint ret;\n\n") >> CFILE; # Get rid of complaints about unused parameters. - printf("\ti = 0;\n\tch = 0;\n") >> CFILE; printf("\tnotused2 = DB_TXN_ABORT;\n\tnotused3 = NULL;\n\n") >> CFILE; # Call read routine to initialize structure - printf("\tif ((ret = __%s_read(dbenv, dbtp->data, &argp)) != 0)\n", \ + printf("\tif ((ret = %s_read(dbenv, dbtp->data, &argp)) != 0)\n", \ funcname) >> CFILE; printf("\t\treturn (ret);\n") >> CFILE; # Print values in every record - printf("\tprintf(\"[%%lu][%%lu]%s: ", funcname) >> CFILE; + printf("\t(void)printf(\n\t \"[%%lu][%%lu]%s: ", funcname) >> CFILE; printf("rec: %%lu txnid %%lx ") >> CFILE; printf("prevlsn [%%lu][%%lu]\\n\",\n") >> CFILE; printf("\t (u_long)lsnp->file,\n") >> CFILE; @@ -374,19 +571,17 @@ function print_function() { # Now print fields of argp for (i = 0; i < nvars; i ++) { - printf("\tprintf(\"\\t%s: ", vars[i]) >> CFILE; + printf("\t(void)printf(\"\\t%s: ", vars[i]) >> CFILE; - if (modes[i] == "DBT") { + if (modes[i] == "DBT" || modes[i] == "PGDBT") { printf("\");\n") >> CFILE; printf("\tfor (i = 0; i < ") >> CFILE; printf("argp->%s.size; i++) {\n", vars[i]) >> CFILE; printf("\t\tch = ((u_int8_t *)argp->%s.data)[i];\n", \ vars[i]) >> CFILE; - printf("\t\tif (isprint(ch) || ch == 0xa)\n") >> CFILE; - printf("\t\t\tputchar(ch);\n") >> CFILE; - printf("\t\telse\n") >> CFILE; - printf("\t\t\tprintf(\"%%#x \", ch);\n") >> CFILE; - printf("\t}\n\tprintf(\"\\n\");\n") >> CFILE; + printf("\t\tprintf(isprint(ch) || ch == 0x0a") >> CFILE; + printf(" ? \"%%c\" : \"%%#x \", ch);\n") >> CFILE; + printf("\t}\n\t(void)printf(\"\\n\");\n") >> CFILE; } else if (types[i] == "DB_LSN *") { printf("[%%%s][%%%s]\\n\",\n", \ formats[i], formats[i]) >> CFILE; @@ -405,52 +600,63 @@ function print_function() { printf("argp->%s);\n", vars[i]) >> CFILE; } } - printf("\tprintf(\"\\n\");\n") >> CFILE; - printf("\t__os_free(argp, 0);\n") >> CFILE; + printf("\t(void)printf(\"\\n\");\n") >> CFILE; + write_free("argp", CFILE); printf("\treturn (0);\n") >> CFILE; printf("}\n\n") >> CFILE; } function read_function() { # Write the read function; function prototype - printf("int __%s_read __P((DB_ENV *, void *, ", funcname) >> HFILE; - printf("__%s_args **));\n", funcname) >> HFILE; + p[1] = sprintf("int %s_read __P((DB_ENV *, void *,", funcname); + p[2] = " "; + p[3] = sprintf("%s_args **));", funcname); + p[4] = ""; + proto_format(p); # Function declaration - printf("int\n__%s_read(dbenv, recbuf, argpp)\n", funcname) >> CFILE; + printf("int\n%s_read(dbenv, recbuf, argpp)\n", funcname) >> CFILE; # Now print the parameters printf("\tDB_ENV *dbenv;\n") >> CFILE; printf("\tvoid *recbuf;\n") >> CFILE; - printf("\t__%s_args **argpp;\n", funcname) >> CFILE; + printf("\t%s_args **argpp;\n", funcname) >> CFILE; # Function body and local decls - printf("{\n\t__%s_args *argp;\n", funcname) >> CFILE; + printf("{\n\t%s_args *argp;\n", funcname) >> CFILE; + if (is_uint == 1) + printf("\tu_int32_t uinttmp;\n") >> CFILE; printf("\tu_int8_t *bp;\n") >> CFILE; - printf("\tint ret;\n") >> CFILE; - printf("\n\tret = __os_malloc(dbenv, sizeof(") >> CFILE; - printf("__%s_args) +\n\t sizeof(DB_TXN), NULL, &argp);\n", \ - funcname) >> CFILE; - printf("\tif (ret != 0)\n\t\treturn (ret);\n") >> CFILE; - # Set up the pointers to the txnid and the prev lsn - printf("\targp->txnid = (DB_TXN *)&argp[1];\n") >> CFILE; + if (dbprivate) { + # We only use dbenv and ret in the private malloc case. + printf("\tint ret;\n\n") >> CFILE; + } else { + printf("\t/* Keep the compiler quiet. */\n") >> CFILE; + printf("\n\tdbenv = NULL;\n") >> CFILE; + } + + malloc_size = sprintf("sizeof(%s_args) + sizeof(DB_TXN)", funcname) + write_malloc("argp", malloc_size, CFILE) + + # Set up the pointers to the txnid. + printf("\targp->txnid = (DB_TXN *)&argp[1];\n\n") >> CFILE; # First get the record type, prev_lsn, and txnid fields. printf("\tbp = recbuf;\n") >> CFILE; printf("\tmemcpy(&argp->type, bp, sizeof(argp->type));\n") >> CFILE; - printf("\tbp += 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") >> CFILE; + printf("\tbp += sizeof(argp->txnid->txnid);\n\n") >> CFILE; printf("\tmemcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));\n") >> CFILE; - printf("\tbp += sizeof(DB_LSN);\n") >> CFILE; + printf("\tbp += sizeof(DB_LSN);\n\n") >> CFILE; # Now get rest of data. for (i = 0; i < nvars; i ++) { - if (modes[i] == "DBT") { + if (modes[i] == "DBT" || modes[i] == "PGDBT") { printf("\tmemset(&argp->%s, 0, sizeof(argp->%s));\n", \ vars[i], vars[i]) >> CFILE; printf("\tmemcpy(&argp->%s.size, ", vars[i]) >> CFILE; @@ -458,18 +664,181 @@ function read_function() { printf("\tbp += sizeof(u_int32_t);\n") >> CFILE; printf("\targp->%s.data = bp;\n", vars[i]) >> CFILE; printf("\tbp += argp->%s.size;\n", vars[i]) >> CFILE; - } else if (modes[i] == "ARG") { - printf("\tmemcpy(&argp->%s, bp, %s%s));\n", \ - vars[i], "sizeof(argp->", vars[i]) >> CFILE; - printf("\tbp += sizeof(argp->%s);\n", vars[i]) >> CFILE; + } else if (modes[i] == "ARG" || modes[i] == "WRLOCK" || \ + modes[i] == "WRLOCKNZ" || modes[i] == "DB") { + printf("\tmemcpy(&uinttmp, bp, sizeof(uinttmp));\n") \ + >> CFILE; + printf("\targp->%s = (%s)uinttmp;\n", vars[i], \ + types[i]) >> CFILE; + printf("\tbp += sizeof(uinttmp);\n") >> CFILE; } else { # POINTER printf("\tmemcpy(&argp->%s, bp, ", vars[i]) >> CFILE; printf(" sizeof(argp->%s));\n", vars[i]) >> CFILE; printf("\tbp += sizeof(argp->%s);\n", vars[i]) >> CFILE; } + printf("\n") >> CFILE; } # Free and return printf("\t*argpp = argp;\n") >> CFILE; printf("\treturn (0);\n}\n\n") >> CFILE; } + +function getpgnos_function() { + # Write the getpgnos function; function prototype + p[1] = sprintf("int %s_getpgnos", funcname); + p[2] = " "; + p[3] = "__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));"; + p[4] = ""; + proto_format(p); + + # Function declaration + printf("int\n%s_getpgnos(dbenv, ", funcname) >> CFILE; + printf("rec, lsnp, notused1, summary)\n") >> CFILE; + printf("\tDB_ENV *dbenv;\n") >> CFILE; + printf("\tDBT *rec;\n") >> CFILE; + printf("\tDB_LSN *lsnp;\n") >> CFILE; + printf("\tdb_recops notused1;\n") >> CFILE; + printf("\tvoid *summary;\n{\n") >> CFILE; + + # If there are no locks, return this fact. + if (nlocks == 0) { + printf("\tTXN_RECS *t;\n") >> CFILE; + printf("\tint ret;\n") >> CFILE; + printf("\tCOMPQUIET(rec, NULL);\n") >> CFILE; + printf("\tCOMPQUIET(notused1, DB_TXN_ABORT);\n") >> CFILE; + + printf("\n\tt = (TXN_RECS *)summary;\n") >> CFILE; + printf("\n\tif ((ret = __rep_check_alloc(dbenv, ") >> CFILE; + printf("t, 1)) != 0)\n") >> CFILE; + printf("\t\treturn (ret);\n") >> CFILE; + + printf("\n\tt->array[t->npages].flags = LSN_PAGE_NOLOCK;\n") \ + >> CFILE; + printf("\tt->array[t->npages].lsn = *lsnp;\n") >> CFILE; + printf("\tt->array[t->npages].fid = DB_LOGFILEID_INVALID;\n") \ + >> CFILE; + printf("\tmemset(&t->array[t->npages].pgdesc, 0,\n") >> CFILE; + printf("\t sizeof(t->array[t->npages].pgdesc));\n") >> CFILE; + printf("\n\tt->npages++;\n") >> CFILE; + + printf("\n") >> CFILE; + printf("\treturn (0);\n") >> CFILE; + printf("}\n\n") >> CFILE; + return; + } + + # Locals + printf("\tDB *dbp;\n") >> CFILE; + printf("\tTXN_RECS *t;\n") >> CFILE; + printf("\t%s_args *argp;\n", funcname) >> CFILE; + printf("\tu_int32_t ret;\n\n") >> CFILE; + + # Shut up compiler. + printf("\tCOMPQUIET(notused1, DB_TXN_ABORT);\n\n") >> CFILE; + + printf("\targp = NULL;\n") >> CFILE; + printf("\tt = (TXN_RECS *)summary;\n\n") >> CFILE; + + printf("\tif ((ret = %s_read(dbenv, rec->data, &argp)) != 0)\n", \ + funcname) >> CFILE; + printf("\t\treturn (ret);\n") >> CFILE; + + # Get file ID. + printf("\n\tif ((ret = __dbreg_id_to_db(dbenv,\n\t ") >> CFILE; + printf("argp->txnid, &dbp, argp->fileid, 0)) != 0)\n") >> CFILE; + printf("\t\tgoto err;\n") >> CFILE; + + printf("\n\tif ((ret = __rep_check_alloc(dbenv, t, %d)) != 0)\n", \ + nlocks) >> CFILE; + printf("\t\tgoto err;\n\n") >> CFILE; + + for (i = 1; i <= nlocks; i++) { + if (lock_if_zero[i]) { + indent = "\t"; + } else { + indent = "\t\t"; + printf("\tif (argp->%s != PGNO_INVALID) {\n", \ + lock_pgnos[i]) >> CFILE; + } + printf("%st->array[t->npages].flags = 0;\n", indent) >> CFILE; + printf("%st->array[t->npages].fid = argp->fileid;\n", indent) \ + >> CFILE; + printf("%st->array[t->npages].lsn = *lsnp;\n", indent) >> CFILE; + printf("%st->array[t->npages].pgdesc.pgno = argp->%s;\n", \ + indent, lock_pgnos[i]) >> CFILE; + printf("%st->array[t->npages].pgdesc.type = DB_PAGE_LOCK;\n", \ + indent) >> CFILE; + printf("%smemcpy(t->array[t->npages].pgdesc.fileid, ", indent) \ + >> CFILE; + printf("dbp->fileid,\n%s DB_FILE_ID_LEN);\n", \ + indent, indent) >> CFILE; + printf("%st->npages++;\n", indent) >> CFILE; + if (!lock_if_zero[i]) { + printf("\t}\n") >> CFILE; + } + } + + printf("\nerr:\tif (argp != NULL)\n") >> CFILE; + write_free("argp", CFILE); + + printf("\treturn (ret);\n") >> CFILE; + + printf("}\n\n") >> CFILE; +} + +# proto_format -- +# Pretty-print a function prototype. +function proto_format(p) +{ + printf("/*\n") >> CFILE; + + s = ""; + for (i = 1; i in p; ++i) + s = s p[i]; + + t = " * PUBLIC: " + if (length(s) + length(t) < 80) + printf("%s%s", t, s) >> CFILE; + else { + split(s, p, "__P"); + len = length(t) + length(p[1]); + printf("%s%s", t, p[1]) >> CFILE + + n = split(p[2], comma, ","); + comma[1] = "__P" comma[1]; + for (i = 1; i <= n; i++) { + if (len + length(comma[i]) > 70) { + printf("\n * PUBLIC: ") >> CFILE; + len = 0; + } + printf("%s%s", comma[i], i == n ? "" : ",") >> CFILE; + len += length(comma[i]) + 2; + } + } + printf("\n */\n") >> CFILE; + delete p; +} + +function write_malloc(ptr, size, file) +{ + if (dbprivate) { + printf("\tif ((ret = ") >> file; + printf(\ + "__os_malloc(dbenv,\n\t " size ", &" ptr ")) != 0)\n") \ + >> file + printf("\t\treturn (ret);\n\n") >> file; + } else { + printf("\tif ((" ptr " = malloc(" size ")) == NULL)\n") >> file + printf("\t\treturn (ENOMEM);\n\n") >> file + } +} + +function write_free(ptr, file) +{ + if (dbprivate) { + printf("\t__os_free(dbenv, " ptr ");\n") >> file + } else { + printf("\tfree(" ptr ");\n") >> file + } +} diff --git a/bdb/dist/gen_rpc.awk b/bdb/dist/gen_rpc.awk index 6c3bffc1aa4..03975d7321b 100644 --- a/bdb/dist/gen_rpc.awk +++ b/bdb/dist/gen_rpc.awk @@ -1,5 +1,5 @@ # -# $Id: gen_rpc.awk,v 11.25 2001/01/02 20:04:55 sue Exp $ +# $Id: gen_rpc.awk,v 11.50 2002/07/02 19:26:57 sue Exp $ # Awk script for generating client/server RPC code. # # This awk script generates most of the RPC routines for DB client/server @@ -9,27 +9,30 @@ # # This awk script requires that these variables be set when it is called: # +# major -- Major version number +# minor -- Minor version number +# xidsize -- size of GIDs # client_file -- the C source file being created for client code -# cproto_file -- the header file create for client prototypes # ctmpl_file -- the C template file being created for client code # sed_file -- the sed file created to alter server proc code # server_file -- the C source file being created for server code -# sproto_file -- the header file create for server prototypes # stmpl_file -- the C template file being created for server code # xdr_file -- the XDR message file created # # And stdin must be the input file that defines the RPC setup. BEGIN { - if (client_file == "" || cproto_file == "" || ctmpl_file == "" || + if (major == "" || minor == "" || xidsize == "" || + client_file == "" || ctmpl_file == "" || sed_file == "" || server_file == "" || - sproto_file == "" || stmpl_file == "" || xdr_file == "") { + stmpl_file == "" || xdr_file == "") { print "Usage: gen_rpc.awk requires these variables be set:" + print "\tmajor\t-- Major version number" + print "\tminor\t-- Minor version number" + print "\txidsize\t-- GID size" print "\tclient_file\t-- the client C source file being created" - print "\tcproto_file\t-- the client prototype header created" print "\tctmpl_file\t-- the client template file being created" print "\tsed_file\t-- the sed command file being created" print "\tserver_file\t-- the server C source file being created" - print "\tsproto_file\t-- the server prototype header created" print "\tstmpl_file\t-- the server template file being created" print "\txdr_file\t-- the XDR message file being created" error = 1; exit @@ -40,10 +43,6 @@ BEGIN { printf("/* Do not edit: automatically built by gen_rpc.awk. */\n") \ > CFILE - CHFILE=cproto_file - printf("/* Do not edit: automatically built by gen_rpc.awk. */\n") \ - > CHFILE - TFILE = ctmpl_file printf("/* Do not edit: automatically built by gen_rpc.awk. */\n") \ > TFILE @@ -52,10 +51,6 @@ BEGIN { printf("/* Do not edit: automatically built by gen_rpc.awk. */\n") \ > SFILE - SHFILE=sproto_file - printf("/* Do not edit: automatically built by gen_rpc.awk. */\n") \ - > SHFILE - # Server procedure template and a sed file to massage an existing # template source file to change args. # SEDFILE should be same name as PFILE but .c @@ -74,28 +69,24 @@ BEGIN { END { printf("#endif /* HAVE_RPC */\n") >> CFILE printf("#endif /* HAVE_RPC */\n") >> TFILE - printf("program DB_SERVERPROG {\n") >> XFILE - printf("\tversion DB_SERVERVERS {\n") >> XFILE + printf("program DB_RPC_SERVERPROG {\n") >> XFILE + printf("\tversion DB_RPC_SERVERVERS {\n") >> XFILE for (i = 1; i < nendlist; ++i) printf("\t\t%s;\n", endlist[i]) >> XFILE - printf("\t} = 1;\n") >> XFILE + printf("\t} = %d%03d;\n", major, minor) >> XFILE printf("} = 351457;\n") >> XFILE } /^[ ]*BEGIN/ { name = $2; - msgid = $3; nofunc_code = 0; funcvars = 0; - gen_code = 1; ret_code = 0; - if ($4 == "NOCLNTCODE") - gen_code = 0; - if ($4 == "NOFUNC") + if ($3 == "NOFUNC") nofunc_code = 1; - if ($4 == "RETCODE") + if ($3 == "RETCODE") ret_code = 1; nvars = 0; @@ -131,8 +122,10 @@ END { if (c_type[nvars] == "DB *") { ctp_type[nvars] = "CT_DB"; - db_handle = 1; - db_idx = nvars; + if (db_handle != 1) { + db_handle = 1; + db_idx = nvars; + } } if (c_type[nvars] == "DBC *") { @@ -180,6 +173,78 @@ END { ++rvars; } /^[ ]*END/ { + # + # ===================================================== + # File headers, if necessary. + # + if (first == 0) { + printf("#include \"db_config.h\"\n") >> CFILE + printf("\n") >> CFILE + printf("#ifdef HAVE_RPC\n") >> CFILE + printf("#ifndef NO_SYSTEM_INCLUDES\n") >> CFILE + printf("#include \n\n") >> CFILE + printf("#include \n") >> CFILE + printf("#include \n") >> CFILE + printf("\n") >> CFILE + printf("#include \n") >> CFILE + printf("#endif\n") >> CFILE + printf("\n") >> CFILE + printf("#include \"db_int.h\"\n") >> CFILE + printf("#include \"dbinc/txn.h\"\n") >> CFILE + printf("\n") >> CFILE + printf("#include \"dbinc_auto/db_server.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("#ifdef HAVE_RPC\n") >> TFILE + printf("#ifndef NO_SYSTEM_INCLUDES\n") >> TFILE + printf("#include \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_auto/db_server.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("#include \n") >> SFILE + printf("\n") >> SFILE + printf("#include \n") >> SFILE + printf("#endif\n") >> SFILE + printf("\n") >> SFILE + printf("#include \"db_int.h\"\n") >> SFILE + printf("#include \"dbinc_auto/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("#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_int.h\"\n") >> PFILE + printf("#include \"dbinc_auto/db_server.h\"\n") >> PFILE + printf("#include \"dbinc/db_server_int.h\"\n") >> PFILE + printf("#include \"dbinc_auto/rpc_server_ext.h\"\n") >> PFILE + printf("\n") >> PFILE + + first = 1; + } # # ===================================================== # Generate Client Nofunc code first if necessary @@ -190,50 +255,48 @@ END { # if (nofunc_code == 1) { # - # First time through, put out the general illegal function + # First time through, put out the general no server and + # illegal functions. # if (first_nofunc == 0) { - printf("int __dbcl_rpc_illegal ") >> CHFILE - printf("__P((DB_ENV *, char *));\n") >> CHFILE - printf("int\n__dbcl_rpc_illegal(dbenv, name)\n") \ - >> CFILE + 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,\n") >> CFILE - printf("\t \"%%s method meaningless in RPC") >> CFILE + printf("{\n\t__db_err(dbenv,") >> CFILE + printf(" \"%%s method meaningless in an RPC") >> CFILE printf(" environment\", name);\n") >> CFILE printf("\treturn (__db_eopnotsup(dbenv));\n") >> CFILE printf("}\n\n") >> CFILE + first_nofunc = 1 } # - # If we are doing a list, spit out prototype decl. - # - for (i = 0; i < nvars; i++) { - if (rpc_type[i] != "LIST") - continue; - printf("static int __dbcl_%s_%slist __P((", \ - name, args[i]) >> CFILE - printf("__%s_%slist **, ", name, args[i]) >> CFILE - if (list_type[i] == "STRING") - printf("%s));\n", c_type[i]) >> CFILE - if (list_type[i] == "INT") - printf("u_int32_t));\n") >> CFILE - if (list_type[i] == "ID") - printf("%s));\n", c_type[i]) >> CFILE - printf("static void __dbcl_%s_%sfree __P((", \ - name, args[i]) >> CFILE - printf("__%s_%slist **));\n", name, args[i]) >> CFILE - } - # # Spit out PUBLIC prototypes. # - printf("int __dbcl_%s __P((",name) >> CHFILE - sep = ""; + pi = 1; + p[pi++] = sprintf("int __dbcl_%s __P((", name); + p[pi++] = ""; for (i = 0; i < nvars; ++i) { - printf("%s%s", sep, pr_type[i]) >> CHFILE - sep = ", "; + p[pi++] = pr_type[i]; + p[pi++] = ", "; } - printf("));\n") >> CHFILE + p[pi - 1] = ""; + p[pi++] = "));"; + p[pi] = ""; + proto_format(p, 0, CFILE); + # # Spit out function name/args. # @@ -286,7 +349,8 @@ END { # 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] == "LIST" || rpc_type[i] == "STRING" || + rpc_type[i] == "GID") { printf("\tCOMPQUIET(%s, NULL);\n", args[i]) \ >> CFILE } @@ -313,60 +377,43 @@ END { # XDR messages. # printf("\n") >> XFILE - # - # If there are any lists, generate the structure to contain them. - # - for (i = 0; i < nvars; ++i) { - if (rpc_type[i] == "LIST") { - printf("struct __%s_%slist {\n", name, args[i]) >> XFILE - printf("\topaque ent<>;\n") >> XFILE - printf("\t__%s_%slist *next;\n", name, args[i]) >> XFILE - printf("};\n\n") >> XFILE - } - } printf("struct __%s_msg {\n", name) >> XFILE for (i = 0; i < nvars; ++i) { + if (rpc_type[i] == "LIST") { + if (list_type[i] == "GID") { + printf("\topaque %s<>;\n", args[i]) >> XFILE + } else { + printf("\tunsigned int %s<>;\n", args[i]) >> XFILE + } + } if (rpc_type[i] == "ID") { printf("\tunsigned int %scl_id;\n", args[i]) >> XFILE } if (rpc_type[i] == "STRING") { printf("\tstring %s<>;\n", args[i]) >> XFILE } + if (rpc_type[i] == "GID") { + printf("\topaque %s[%d];\n", args[i], xidsize) >> XFILE + } if (rpc_type[i] == "INT") { printf("\tunsigned int %s;\n", args[i]) >> XFILE } if (rpc_type[i] == "DBT") { printf("\tunsigned int %sdlen;\n", args[i]) >> XFILE printf("\tunsigned int %sdoff;\n", args[i]) >> XFILE + printf("\tunsigned int %sulen;\n", args[i]) >> XFILE printf("\tunsigned int %sflags;\n", args[i]) >> XFILE printf("\topaque %sdata<>;\n", args[i]) >> XFILE } - if (rpc_type[i] == "LIST") { - printf("\t__%s_%slist *%slist;\n", \ - name, args[i], args[i]) >> XFILE - } } printf("};\n") >> XFILE printf("\n") >> XFILE # - # If there are any lists, generate the structure to contain them. - # - for (i = 0; i < rvars; ++i) { - if (ret_type[i] == "LIST") { - printf("struct __%s_%sreplist {\n", \ - name, retargs[i]) >> XFILE - printf("\topaque ent<>;\n") >> XFILE - printf("\t__%s_%sreplist *next;\n", \ - name, retargs[i]) >> XFILE - printf("};\n\n") >> XFILE - } - } - # # Generate the reply message # printf("struct __%s_reply {\n", name) >> XFILE - printf("\tunsigned int status;\n") >> XFILE + printf("\tint status;\n") >> XFILE for (i = 0; i < rvars; ++i) { if (ret_type[i] == "ID") { printf("\tunsigned int %scl_id;\n", retargs[i]) >> XFILE @@ -384,8 +431,11 @@ END { printf("\topaque %sdata<>;\n", retargs[i]) >> XFILE } if (ret_type[i] == "LIST") { - printf("\t__%s_%sreplist *%slist;\n", \ - name, retargs[i], retargs[i]) >> XFILE + if (retlist_type[i] == "GID") { + printf("\topaque %s<>;\n", retargs[i]) >> XFILE + } else { + printf("\tunsigned int %s<>;\n", retargs[i]) >> XFILE + } } } printf("};\n") >> XFILE @@ -394,158 +444,30 @@ END { sprintf("__%s_reply __DB_%s(__%s_msg) = %d", \ name, name, name, nendlist); nendlist++; - - # - # ===================================================== - # File headers, if necessary. - # - if (first == 0) { - printf("#include \"db_config.h\"\n") >> CFILE - printf("\n") >> CFILE - printf("#ifdef HAVE_RPC\n") >> CFILE - printf("#ifndef NO_SYSTEM_INCLUDES\n") >> CFILE - printf("#include \n") >> CFILE - printf("#include \n") >> CFILE - printf("#include \n") >> CFILE - printf("\n") >> CFILE - printf("#include \n") >> CFILE - printf("#include \n") >> CFILE - printf("#endif\n") >> CFILE - printf("#include \"db_server.h\"\n") >> CFILE - printf("\n") >> CFILE - printf("#include \"db_int.h\"\n") >> CFILE - printf("#include \"db_page.h\"\n") >> CFILE - printf("#include \"db_ext.h\"\n") >> CFILE - printf("#include \"mp.h\"\n") >> CFILE - printf("#include \"rpc_client_ext.h\"\n") >> CFILE - printf("#include \"txn.h\"\n") >> CFILE - printf("\n") >> CFILE - n = split(CHFILE, hpieces, "/"); - printf("#include \"%s\"\n", hpieces[n]) >> CFILE - printf("\n") >> CFILE - - printf("#include \"db_config.h\"\n") >> TFILE - printf("\n") >> TFILE - printf("#ifdef HAVE_RPC\n") >> TFILE - printf("#ifndef NO_SYSTEM_INCLUDES\n") >> TFILE - printf("#include \n") >> TFILE - printf("#include \n") >> TFILE - printf("\n") >> TFILE - printf("#include \n") >> TFILE - printf("#include \n") >> TFILE - printf("#endif\n") >> TFILE - printf("#include \"db_server.h\"\n") >> TFILE - printf("\n") >> TFILE - printf("#include \"db_int.h\"\n") >> TFILE - printf("#include \"db_page.h\"\n") >> TFILE - printf("#include \"db_ext.h\"\n") >> TFILE - printf("#include \"txn.h\"\n") >> TFILE - printf("\n") >> TFILE - n = split(CHFILE, hpieces, "/"); - printf("#include \"%s\"\n", hpieces[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("#include \n") >> SFILE - printf("\n") >> SFILE - printf("#include \n") >> SFILE - printf("#include \n") >> SFILE - printf("#endif\n") >> SFILE - printf("#include \"db_server.h\"\n") >> SFILE - printf("\n") >> SFILE - printf("#include \"db_int.h\"\n") >> SFILE - printf("#include \"db_server_int.h\"\n") >> SFILE - printf("#include \"rpc_server_ext.h\"\n") >> SFILE - printf("\n") >> SFILE - n = split(SHFILE, hpieces, "/"); - printf("#include \"%s\"\n", hpieces[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("#include \n") >> PFILE - printf("#include \"db_server.h\"\n") >> PFILE - printf("#endif\n") >> PFILE - printf("\n") >> PFILE - printf("#include \"db_int.h\"\n") >> PFILE - printf("#include \"db_server_int.h\"\n") >> PFILE - printf("#include \"rpc_server_ext.h\"\n") >> PFILE - printf("\n") >> PFILE - n = split(SHFILE, hpieces, "/"); - printf("#include \"%s\"\n", hpieces[n]) >> PFILE - printf("\n") >> PFILE - - first = 1; - } - # # ===================================================== # Server functions. # - # If we are doing a list, send out local list prototypes. - # - for (i = 0; i < nvars; ++i) { - if (rpc_type[i] != "LIST") - continue; - if (list_type[i] != "STRING" && list_type[i] != "INT" && - list_type[i] != "ID") - continue; - printf("int __db_%s_%slist __P((", name, args[i]) >> SFILE - printf("__%s_%slist *, ", name, args[i]) >> SFILE - if (list_type[i] == "STRING") { - printf("char ***));\n") >> SFILE - } - if (list_type[i] == "INT" || list_type[i] == "ID") { - printf("u_int32_t **));\n") >> SFILE - } - printf("void __db_%s_%sfree __P((", name, args[i]) >> SFILE - if (list_type[i] == "STRING") - printf("char **));\n\n") >> SFILE - if (list_type[i] == "INT" || list_type[i] == "ID") - printf("u_int32_t *));\n\n") >> SFILE - - } - # # First spit out PUBLIC prototypes for server functions. # - printf("__%s_reply * __db_%s_%d __P((__%s_msg *));\n", \ - name, name, msgid, name) >> SHFILE + p[1] = sprintf("__%s_reply *__db_%s_%d%03d __P((__%s_msg *, struct svc_req *));", + name, name, major, minor, name); + p[2] = ""; + proto_format(p, 0, SFILE); printf("__%s_reply *\n", name) >> SFILE - printf("__db_%s_%d(req)\n", name, msgid) >> SFILE - printf("\t__%s_msg *req;\n", name) >> SFILE; + printf("__db_%s_%d%03d(msg, req)\n", name, major, minor) >> SFILE + printf("\t__%s_msg *msg;\n", name) >> SFILE; + printf("\tstruct svc_req *req;\n", name) >> SFILE; printf("{\n") >> SFILE - doing_list = 0; - # - # If we are doing a list, decompose it for server proc we'll call. - # - for (i = 0; i < nvars; ++i) { - if (rpc_type[i] != "LIST") - continue; - doing_list = 1; - if (list_type[i] == "STRING") - printf("\tchar **__db_%slist;\n", args[i]) >> SFILE - if (list_type[i] == "ID" || list_type[i] == "INT") - printf("\tu_int32_t *__db_%slist;\n", args[i]) >> SFILE - } - if (doing_list) - printf("\tint ret;\n") >> SFILE printf("\tstatic __%s_reply reply; /* must be static */\n", \ name) >> SFILE if (xdr_free) { printf("\tstatic int __%s_free = 0; /* must be static */\n\n", \ name) >> SFILE + } + printf("\tCOMPQUIET(req, NULL);\n", name) >> SFILE + if (xdr_free) { printf("\tif (__%s_free)\n", name) >> SFILE printf("\t\txdr_free((xdrproc_t)xdr___%s_reply, (void *)&reply);\n", \ name) >> SFILE @@ -553,8 +475,8 @@ END { printf("\n\t/* Reinitialize allocated fields */\n") >> SFILE for (i = 0; i < rvars; ++i) { if (ret_type[i] == "LIST") { - printf("\treply.%slist = NULL;\n", \ - retargs[i]) >> SFILE + printf("\treply.%s.%s_val = NULL;\n", \ + retargs[i], retargs[i]) >> SFILE } if (ret_type[i] == "DBT") { printf("\treply.%sdata.%sdata_val = NULL;\n", \ @@ -564,44 +486,43 @@ END { } need_out = 0; - for (i = 0; i < nvars; ++i) { - if (rpc_type[i] == "LIST") { - printf("\n\tif ((ret = __db_%s_%slist(", \ - name, args[i]) >> SFILE - printf("req->%slist, &__db_%slist)) != 0)\n", \ - args[i], args[i]) >> SFILE - printf("\t\tgoto out;\n") >> SFILE - need_out = 1; - } - } - # # Compose server proc to call. Decompose message components as args. # - printf("\n\t__%s_%d_proc(", name, msgid) >> SFILE + printf("\n\t__%s_proc(", name) >> SFILE sep = ""; for (i = 0; i < nvars; ++i) { + if (rpc_type[i] == "IGNORE") { + continue; + } if (rpc_type[i] == "ID") { - printf("%sreq->%scl_id", sep, args[i]) >> SFILE + printf("%smsg->%scl_id", sep, args[i]) >> SFILE } if (rpc_type[i] == "STRING") { - printf("%s(*req->%s == '\\0') ? NULL : req->%s", \ + printf("%s(*msg->%s == '\\0') ? NULL : msg->%s", \ sep, args[i], args[i]) >> SFILE } + if (rpc_type[i] == "GID") { + printf("%smsg->%s", sep, args[i]) >> SFILE + } if (rpc_type[i] == "INT") { - printf("%sreq->%s", sep, args[i]) >> SFILE + printf("%smsg->%s", sep, args[i]) >> SFILE } if (rpc_type[i] == "LIST") { - printf("%s__db_%slist", sep, args[i]) >> SFILE + printf("%smsg->%s.%s_val", \ + sep, args[i], args[i]) >> SFILE + printf("%smsg->%s.%s_len", \ + sep, args[i], args[i]) >> SFILE } if (rpc_type[i] == "DBT") { - printf("%sreq->%sdlen", sep, args[i]) >> SFILE + printf("%smsg->%sdlen", sep, args[i]) >> SFILE sep = ",\n\t "; - printf("%sreq->%sdoff", sep, args[i]) >> SFILE - printf("%sreq->%sflags", sep, args[i]) >> SFILE - printf("%sreq->%sdata.%sdata_val", \ + printf("%smsg->%sdoff", sep, args[i]) >> SFILE + printf("%smsg->%sulen", sep, args[i]) >> SFILE + printf("%smsg->%sflags", sep, args[i]) >> SFILE + printf("%smsg->%sdata.%sdata_val", \ sep, args[i], args[i]) >> SFILE - printf("%sreq->%sdata.%sdata_len", \ + printf("%smsg->%sdata.%sdata_len", \ sep, args[i], args[i]) >> SFILE } sep = ",\n\t "; @@ -611,205 +532,106 @@ END { printf("%s&__%s_free);\n", sep, name) >> SFILE else printf(");\n\n") >> SFILE - for (i = 0; i < nvars; ++i) { - if (rpc_type[i] == "LIST") { - printf("\t__db_%s_%sfree(__db_%slist);\n", \ - name, args[i], args[i]) >> SFILE - } - } if (need_out) { printf("\nout:\n") >> SFILE } printf("\treturn (&reply);\n") >> SFILE printf("}\n\n") >> SFILE - # - # If we are doing a list, write list functions for this op. - # - for (i = 0; i < nvars; ++i) { - if (rpc_type[i] != "LIST") - continue; - if (list_type[i] != "STRING" && list_type[i] != "INT" && - list_type[i] != "ID") - continue; - printf("int\n") >> SFILE - printf("__db_%s_%slist(locp, ppp)\n", name, args[i]) >> SFILE - printf("\t__%s_%slist *locp;\n", name, args[i]) >> SFILE - if (list_type[i] == "STRING") { - printf("\tchar ***ppp;\n{\n") >> SFILE - printf("\tchar **pp;\n") >> SFILE - } - if (list_type[i] == "INT" || list_type[i] == "ID") { - printf("\tu_int32_t **ppp;\n{\n") >> SFILE - printf("\tu_int32_t *pp;\n") >> SFILE - } - printf("\tint cnt, ret, size;\n") >> SFILE - printf("\t__%s_%slist *nl;\n\n", name, args[i]) >> SFILE - printf("\tfor (cnt = 0, nl = locp;") >> SFILE - printf(" nl != NULL; cnt++, nl = nl->next)\n\t\t;\n\n") >> SFILE - printf("\tif (cnt == 0) {\n") >> SFILE - printf("\t\t*ppp = NULL;\n") >> SFILE - printf("\t\treturn (0);\n\t}\n") >> SFILE - printf("\tsize = sizeof(*pp) * (cnt + 1);\n") >> SFILE - printf("\tif ((ret = __os_malloc(NULL, size, ") >> SFILE - printf("NULL, ppp)) != 0)\n") >> SFILE - printf("\t\treturn (ret);\n") >> SFILE - printf("\tmemset(*ppp, 0, size);\n") >> SFILE - printf("\tfor (pp = *ppp, nl = locp;") >> SFILE - printf(" nl != NULL; nl = nl->next, pp++) {\n") >> SFILE - if (list_type[i] == "STRING") { - printf("\t\tif ((ret = __os_malloc(NULL ,") >> SFILE - printf("nl->ent.ent_len + 1, NULL, pp)) != 0)\n") \ - >> SFILE - printf("\t\t\tgoto out;\n") >> SFILE - printf("\t\tif ((ret = __os_strdup(NULL, ") >> SFILE - printf("(char *)nl->ent.ent_val, pp)) != 0)\n") >> SFILE - printf("\t\t\tgoto out;\n") >> SFILE - } - if (list_type[i] == "INT" || list_type[i] == "ID") - printf("\t\t*pp = *(u_int32_t *)nl->ent.ent_val;\n") \ - >> SFILE - printf("\t}\n") >> SFILE - printf("\treturn (0);\n") >> SFILE - if (list_type[i] == "STRING") { - printf("out:\n") >> SFILE - printf("\t__db_%s_%sfree(*ppp);\n", \ - name, args[i]) >> SFILE - printf("\treturn (ret);\n") >> SFILE - } - printf("}\n\n") >> SFILE - - printf("void\n") >> SFILE - printf("__db_%s_%sfree(pp)\n", name, args[i]) >> SFILE - - if (list_type[i] == "STRING") - printf("\tchar **pp;\n") >> SFILE - if (list_type[i] == "INT" || list_type[i] == "ID") - printf("\tu_int32_t *pp;\n") >> SFILE - - printf("{\n") >> SFILE - printf("\tsize_t size;\n") >> SFILE - - if (list_type[i] == "STRING") - printf("\tchar **p;\n\n") >> SFILE - if (list_type[i] == "INT" || list_type[i] == "ID") - printf("\tu_int32_t *p;\n\n") >> SFILE - - printf("\tif (pp == NULL)\n\t\treturn;\n") >> SFILE - printf("\tsize = sizeof(*p);\n") >> SFILE - printf("\tfor (p = pp; *p != 0; p++) {\n") >> SFILE - printf("\t\tsize += sizeof(*p);\n") >> SFILE - - if (list_type[i] == "STRING") - printf("\t\t__os_free(*p, strlen(*p)+1);\n") >> SFILE - printf("\t}\n") >> SFILE - printf("\t__os_free(pp, size);\n") >> SFILE - printf("}\n\n") >> SFILE - } - # # ===================================================== # Generate Procedure Template Server code # # Produce SED file commands if needed at the same time # - # Start with PUBLIC prototypes + # Spit out comment, prototype, function name and arg list. # - printf("void __%s_%d_proc __P((", name, msgid) >> SHFILE + printf("/^\\/\\* BEGIN __%s_proc/,/^\\/\\* END __%s_proc/c\\\n", \ + name, name) >> SEDFILE + + printf("/* BEGIN __%s_proc */\n", name) >> PFILE + printf("/* BEGIN __%s_proc */\\\n", name) >> SEDFILE + + pi = 1; + p[pi++] = sprintf("void __%s_proc __P((", name); + p[pi++] = ""; + for (i = 0; i < nvars; ++i) { + if (rpc_type[i] == "IGNORE") + continue; + if (rpc_type[i] == "ID") { + p[pi++] = "long"; + p[pi++] = ", "; + } + if (rpc_type[i] == "STRING") { + p[pi++] = "char *"; + p[pi++] = ", "; + } + if (rpc_type[i] == "GID") { + p[pi++] = "u_int8_t *"; + p[pi++] = ", "; + } + if (rpc_type[i] == "INT") { + p[pi++] = "u_int32_t"; + p[pi++] = ", "; + } + if (rpc_type[i] == "LIST" && list_type[i] == "GID") { + p[pi++] = "u_int8_t *"; + p[pi++] = ", "; + p[pi++] = "u_int32_t"; + p[pi++] = ", "; + } + if (rpc_type[i] == "LIST" && list_type[i] == "INT") { + p[pi++] = "u_int32_t *"; + p[pi++] = ", "; + p[pi++] = "u_int32_t"; + p[pi++] = ", "; + } + if (rpc_type[i] == "LIST" && list_type[i] == "ID") { + p[pi++] = "u_int32_t *"; + p[pi++] = ", "; + p[pi++] = "u_int32_t"; + p[pi++] = ", "; + } + if (rpc_type[i] == "DBT") { + p[pi++] = "u_int32_t"; + p[pi++] = ", "; + p[pi++] = "u_int32_t"; + p[pi++] = ", "; + p[pi++] = "u_int32_t"; + p[pi++] = ", "; + p[pi++] = "u_int32_t"; + p[pi++] = ", "; + p[pi++] = "void *"; + p[pi++] = ", "; + p[pi++] = "u_int32_t"; + p[pi++] = ", "; + } + } + p[pi++] = sprintf("__%s_reply *", name); + if (xdr_free) { + p[pi++] = ", "; + p[pi++] = "int *));"; + } else { + p[pi++] = ""; + p[pi++] = "));"; + } + p[pi++] = ""; + proto_format(p, 1, SEDFILE); + + printf("void\n") >> PFILE + printf("void\\\n") >> SEDFILE + printf("__%s_proc(", name) >> PFILE + printf("__%s_proc(", name) >> SEDFILE sep = ""; argcount = 0; for (i = 0; i < nvars; ++i) { argcount++; - split_lines(1); + split_lines(); if (argcount == 0) { sep = ""; } if (rpc_type[i] == "IGNORE") continue; - if (rpc_type[i] == "ID") { - printf("%slong", sep) >> SHFILE - } - if (rpc_type[i] == "STRING") { - printf("%schar *", sep) >> SHFILE - } - if (rpc_type[i] == "INT") { - printf("%su_int32_t", sep) >> SHFILE - } - if (rpc_type[i] == "LIST" && list_type[i] == "STRING") { - printf("%schar **", sep) >> SHFILE - } - if (rpc_type[i] == "LIST" && list_type[i] == "INT") { - printf("%su_int32_t *", sep) >> SHFILE - } - if (rpc_type[i] == "LIST" && list_type[i] == "ID") { - printf("%su_int32_t *", sep) >> SHFILE - } - if (rpc_type[i] == "DBT") { - printf("%su_int32_t", sep) >> SHFILE - sep = ", "; - argcount++; - split_lines(1); - if (argcount == 0) { - sep = ""; - } else { - sep = ", "; - } - printf("%su_int32_t", sep) >> SHFILE - argcount++; - split_lines(1); - if (argcount == 0) { - sep = ""; - } else { - sep = ", "; - } - printf("%su_int32_t", sep) >> SHFILE - argcount++; - split_lines(1); - if (argcount == 0) { - sep = ""; - } else { - sep = ", "; - } - printf("%svoid *", sep) >> SHFILE - argcount++; - split_lines(1); - if (argcount == 0) { - sep = ""; - } else { - sep = ", "; - } - printf("%su_int32_t", sep) >> SHFILE - } - sep = ", "; - } - printf("%s__%s_reply *", sep, name) >> SHFILE - if (xdr_free) { - printf("%sint *));\n", sep) >> SHFILE - } else { - printf("));\n") >> SHFILE - } - # - # Spit out function name and arg list - # - printf("/^\\/\\* BEGIN __%s_%d_proc/,/^\\/\\* END __%s_%d_proc/c\\\n", \ - name, msgid, name, msgid) >> SEDFILE - - printf("/* BEGIN __%s_%d_proc */\n", name, msgid) >> PFILE - printf("/* BEGIN __%s_%d_proc */\\\n", name, msgid) >> SEDFILE - printf("void\n") >> PFILE - printf("void\\\n") >> SEDFILE - printf("__%s_%d_proc(", name, msgid) >> PFILE - printf("__%s_%d_proc(", name, msgid) >> SEDFILE - sep = ""; - argcount = 0; - for (i = 0; i < nvars; ++i) { - argcount++; - split_lines(0); - if (argcount == 0) { - sep = ""; - } - if (rpc_type[i] == "IGNORE") - continue; if (rpc_type[i] == "ID") { printf("%s%scl_id", sep, args[i]) >> PFILE printf("%s%scl_id", sep, args[i]) >> SEDFILE @@ -818,20 +640,33 @@ END { printf("%s%s", sep, args[i]) >> PFILE printf("%s%s", sep, args[i]) >> SEDFILE } + if (rpc_type[i] == "GID") { + printf("%s%s", sep, args[i]) >> PFILE + printf("%s%s", sep, args[i]) >> SEDFILE + } if (rpc_type[i] == "INT") { printf("%s%s", sep, args[i]) >> PFILE printf("%s%s", sep, args[i]) >> SEDFILE } if (rpc_type[i] == "LIST") { - printf("%s%slist", sep, args[i]) >> PFILE - printf("%s%slist", sep, args[i]) >> SEDFILE + printf("%s%s", sep, args[i]) >> PFILE + printf("%s%s", sep, args[i]) >> SEDFILE + argcount++; + split_lines(); + if (argcount == 0) { + sep = ""; + } else { + sep = ", "; + } + printf("%s%slen", sep, args[i]) >> PFILE + printf("%s%slen", sep, args[i]) >> SEDFILE } if (rpc_type[i] == "DBT") { printf("%s%sdlen", sep, args[i]) >> PFILE printf("%s%sdlen", sep, args[i]) >> SEDFILE sep = ", "; argcount++; - split_lines(0); + split_lines(); if (argcount == 0) { sep = ""; } else { @@ -840,7 +675,16 @@ END { printf("%s%sdoff", sep, args[i]) >> PFILE printf("%s%sdoff", sep, args[i]) >> SEDFILE argcount++; - split_lines(0); + split_lines(); + if (argcount == 0) { + sep = ""; + } else { + sep = ", "; + } + printf("%s%sulen", sep, args[i]) >> PFILE + printf("%s%sulen", sep, args[i]) >> SEDFILE + argcount++; + split_lines(); if (argcount == 0) { sep = ""; } else { @@ -849,7 +693,7 @@ END { printf("%s%sflags", sep, args[i]) >> PFILE printf("%s%sflags", sep, args[i]) >> SEDFILE argcount++; - split_lines(0); + split_lines(); if (argcount == 0) { sep = ""; } else { @@ -858,7 +702,7 @@ END { printf("%s%sdata", sep, args[i]) >> PFILE printf("%s%sdata", sep, args[i]) >> SEDFILE argcount++; - split_lines(0); + split_lines(); if (argcount == 0) { sep = ""; } else { @@ -890,22 +734,33 @@ END { printf("\tchar *%s;\n", args[i]) >> PFILE printf("\\\tchar *%s;\\\n", args[i]) >> SEDFILE } + if (rpc_type[i] == "GID") { + printf("\tu_int8_t *%s;\n", args[i]) >> PFILE + printf("\\\tu_int8_t *%s;\\\n", args[i]) >> SEDFILE + } if (rpc_type[i] == "INT") { printf("\tu_int32_t %s;\n", args[i]) >> PFILE printf("\\\tu_int32_t %s;\\\n", args[i]) >> SEDFILE } - if (rpc_type[i] == "LIST" && list_type[i] == "STRING") { - printf("\tchar ** %slist;\n", args[i]) >> PFILE - printf("\\\tchar ** %slist;\\\n", args[i]) >> SEDFILE + if (rpc_type[i] == "LIST" && list_type[i] == "GID") { + printf("\tu_int8_t * %s;\n", args[i]) >> PFILE + printf("\\\tu_int8_t * %s;\\\n", args[i]) >> SEDFILE } if (rpc_type[i] == "LIST" && list_type[i] == "INT") { - printf("\tu_int32_t * %slist;\n", args[i]) >> PFILE - printf("\\\tu_int32_t * %slist;\\\n", \ + printf("\tu_int32_t * %s;\n", args[i]) >> PFILE + printf("\\\tu_int32_t * %s;\\\n", \ args[i]) >> SEDFILE + printf("\tu_int32_t %ssize;\n", args[i]) >> PFILE + printf("\\\tu_int32_t %ssize;\\\n", args[i]) >> SEDFILE } if (rpc_type[i] == "LIST" && list_type[i] == "ID") { - printf("\tu_int32_t * %slist;\n", args[i]) >> PFILE - printf("\\\tu_int32_t * %slist;\\\n", args[i]) \ + printf("\tu_int32_t * %s;\n", args[i]) >> PFILE + printf("\\\tu_int32_t * %s;\\\n", args[i]) \ + >> SEDFILE + } + if (rpc_type[i] == "LIST") { + printf("\tu_int32_t %slen;\n", args[i]) >> PFILE + printf("\\\tu_int32_t %slen;\\\n", args[i]) \ >> SEDFILE } if (rpc_type[i] == "DBT") { @@ -913,6 +768,8 @@ END { printf("\\\tu_int32_t %sdlen;\\\n", args[i]) >> SEDFILE printf("\tu_int32_t %sdoff;\n", args[i]) >> PFILE printf("\\\tu_int32_t %sdoff;\\\n", args[i]) >> SEDFILE + printf("\tu_int32_t %sulen;\n", args[i]) >> PFILE + printf("\\\tu_int32_t %sulen;\\\n", args[i]) >> SEDFILE printf("\tu_int32_t %sflags;\n", args[i]) >> PFILE printf("\\\tu_int32_t %sflags;\\\n", args[i]) >> SEDFILE printf("\tvoid *%sdata;\n", args[i]) >> PFILE @@ -928,8 +785,8 @@ END { printf("\\\tint * freep;\\\n") >> SEDFILE } - printf("/* END __%s_%d_proc */\n", name, msgid) >> PFILE - printf("/* END __%s_%d_proc */\n", name, msgid) >> SEDFILE + printf("/* END __%s_proc */\n", name) >> PFILE + printf("/* END __%s_proc */\n", name) >> SEDFILE # # Function body @@ -956,44 +813,24 @@ END { printf("\treturn;\n") >> PFILE printf("}\n\n") >> PFILE - # - # If we don't want client code generated, go on to next. - # - if (gen_code == 0) - next; - # # ===================================================== # Generate Client code # - # If we are doing a list, spit out prototype decl. - # - for (i = 0; i < nvars; i++) { - if (rpc_type[i] != "LIST") - continue; - printf("static int __dbcl_%s_%slist __P((", \ - name, args[i]) >> CFILE - printf("__%s_%slist **, ", name, args[i]) >> CFILE - if (list_type[i] == "STRING") - printf("%s));\n", c_type[i]) >> CFILE - if (list_type[i] == "INT") - printf("u_int32_t));\n") >> CFILE - if (list_type[i] == "ID") - printf("%s));\n", c_type[i]) >> CFILE - printf("static void __dbcl_%s_%sfree __P((", \ - name, args[i]) >> CFILE - printf("__%s_%slist **));\n", name, args[i]) >> CFILE - } - # # Spit out PUBLIC prototypes. # - printf("int __dbcl_%s __P((",name) >> CHFILE - sep = ""; + pi = 1; + p[pi++] = sprintf("int __dbcl_%s __P((", name); + p[pi++] = ""; for (i = 0; i < nvars; ++i) { - printf("%s%s", sep, pr_type[i]) >> CHFILE - sep = ", "; + p[pi++] = pr_type[i]; + p[pi++] = ", "; } - printf("));\n") >> CHFILE + p[pi - 1] = ""; + p[pi++] = "));"; + p[pi] = ""; + proto_format(p, 0, CFILE); + # # Spit out function name/args. # @@ -1014,16 +851,28 @@ END { printf("{\n") >> CFILE printf("\tCLIENT *cl;\n") >> CFILE - printf("\t__%s_msg req;\n", name) >> CFILE - printf("\tstatic __%s_reply *replyp = NULL;\n", name) >> CFILE; + printf("\t__%s_msg msg;\n", name) >> CFILE + printf("\t__%s_reply *replyp = NULL;\n", name) >> CFILE; printf("\tint ret;\n") >> CFILE if (!env_handle) printf("\tDB_ENV *dbenv;\n") >> CFILE + # + # If we are managing a list, we need a few more vars. + # + for (i = 0; i < nvars; ++i) { + if (rpc_type[i] == "LIST") { + printf("\t%s %sp;\n", c_type[i], args[i]) >> CFILE + printf("\tint %si;\n", args[i]) >> CFILE + if (list_type[i] == "GID") + printf("\tu_int8_t ** %sq;\n", args[i]) >> CFILE + else + printf("\tu_int32_t * %sq;\n", args[i]) >> CFILE + } + } printf("\n") >> CFILE printf("\tret = 0;\n") >> CFILE if (!env_handle) { - printf("\tdbenv = NULL;\n") >> CFILE if (db_handle) printf("\tdbenv = %s->dbenv;\n", args[db_idx]) >> CFILE else if (dbc_handle) @@ -1032,27 +881,19 @@ END { else if (txn_handle) printf("\tdbenv = %s->mgrp->dbenv;\n", \ args[txn_idx]) >> CFILE - printf("\tif (dbenv == NULL || dbenv->cl_handle == NULL) {\n") \ - >> CFILE - printf("\t\t__db_err(dbenv, \"No server environment.\");\n") \ + else + printf("\tdbenv = NULL;\n") >> CFILE + printf("\tif (dbenv == NULL || !RPC_ON(dbenv))\n") \ >> CFILE + printf("\t\treturn (__dbcl_noserver(NULL));\n") >> CFILE } else { - printf("\tif (%s == NULL || %s->cl_handle == NULL) {\n", \ + printf("\tif (%s == NULL || !RPC_ON(%s))\n", \ args[env_idx], args[env_idx]) >> CFILE - printf("\t\t__db_err(%s, \"No server environment.\");\n", \ + printf("\t\treturn (__dbcl_noserver(%s));\n", \ args[env_idx]) >> CFILE } - printf("\t\treturn (DB_NOSERVER);\n") >> CFILE - printf("\t}\n") >> CFILE printf("\n") >> CFILE - # - # Free old reply if there was one. - # - printf("\tif (replyp != NULL) {\n") >> CFILE - printf("\t\txdr_free((xdrproc_t)xdr___%s_reply, (void *)replyp);\n", \ - name) >> CFILE - printf("\t\treplyp = NULL;\n\t}\n") >> CFILE if (!env_handle) printf("\tcl = (CLIENT *)dbenv->cl_handle;\n") >> CFILE else @@ -1068,8 +909,12 @@ END { if (func_arg[i] != 1) continue; printf("\tif (%s != NULL) {\n", args[i]) >> CFILE - printf("\t\t__db_err(%s, ", args[env_idx]) >> CFILE - printf("\"User functions not supported in RPC.\");\n") >> CFILE + if (!env_handle) { + printf("\t\t__db_err(dbenv, ") >> CFILE + } else { + printf("\t\t__db_err(%s, ", args[env_idx]) >> CFILE + } + printf("\"User functions not supported in RPC\");\n") >> CFILE printf("\t\treturn (EINVAL);\n\t}\n") >> CFILE } @@ -1079,49 +924,102 @@ END { for (i = 0; i < nvars; ++i) { if (rpc_type[i] == "ID") { printf("\tif (%s == NULL)\n", args[i]) >> CFILE - printf("\t\treq.%scl_id = 0;\n\telse\n", \ + printf("\t\tmsg.%scl_id = 0;\n\telse\n", \ args[i]) >> CFILE if (c_type[i] == "DB_TXN *") { - printf("\t\treq.%scl_id = %s->txnid;\n", \ + printf("\t\tmsg.%scl_id = %s->txnid;\n", \ args[i], args[i]) >> CFILE } else { - printf("\t\treq.%scl_id = %s->cl_id;\n", \ + printf("\t\tmsg.%scl_id = %s->cl_id;\n", \ args[i], args[i]) >> CFILE } } + if (rpc_type[i] == "GID") { + printf("\tmemcpy(msg.%s, %s, %d);\n", \ + args[i], args[i], xidsize) >> CFILE + } if (rpc_type[i] == "INT") { - printf("\treq.%s = %s;\n", args[i], args[i]) >> CFILE + printf("\tmsg.%s = %s;\n", args[i], args[i]) >> CFILE } if (rpc_type[i] == "STRING") { printf("\tif (%s == NULL)\n", args[i]) >> CFILE - printf("\t\treq.%s = \"\";\n", args[i]) >> CFILE + printf("\t\tmsg.%s = \"\";\n", args[i]) >> CFILE printf("\telse\n") >> CFILE - printf("\t\treq.%s = (char *)%s;\n", \ + printf("\t\tmsg.%s = (char *)%s;\n", \ args[i], args[i]) >> CFILE } if (rpc_type[i] == "DBT") { - printf("\treq.%sdlen = %s->dlen;\n", \ + printf("\tmsg.%sdlen = %s->dlen;\n", \ args[i], args[i]) >> CFILE - printf("\treq.%sdoff = %s->doff;\n", \ + printf("\tmsg.%sdoff = %s->doff;\n", \ args[i], args[i]) >> CFILE - printf("\treq.%sflags = %s->flags;\n", \ + printf("\tmsg.%sulen = %s->ulen;\n", \ args[i], args[i]) >> CFILE - printf("\treq.%sdata.%sdata_val = %s->data;\n", \ + printf("\tmsg.%sflags = %s->flags;\n", \ + args[i], args[i]) >> CFILE + printf("\tmsg.%sdata.%sdata_val = %s->data;\n", \ args[i], args[i], args[i]) >> CFILE - printf("\treq.%sdata.%sdata_len = %s->size;\n", \ + printf("\tmsg.%sdata.%sdata_len = %s->size;\n", \ args[i], args[i], args[i]) >> CFILE } if (rpc_type[i] == "LIST") { - printf("\tif ((ret = __dbcl_%s_%slist(", \ - name, args[i]) >> CFILE - printf("&req.%slist, %s)) != 0)\n", \ + printf("\tfor (%si = 0, %sp = %s; *%sp != 0; ", \ + args[i], args[i], args[i], args[i]) >> CFILE + printf(" %si++, %sp++)\n\t\t;\n", args[i], args[i]) \ + >> CFILE + + # + # If we are an array of ints, *_len is how many + # elements. If we are a GID, *_len is total bytes. + # + printf("\tmsg.%s.%s_len = %si",args[i], args[i], \ + args[i]) >> CFILE + if (list_type[i] == "GID") + printf(" * %d;\n", xidsize) >> CFILE + else + printf(";\n") >> CFILE + printf("\tif ((ret = __os_calloc(") >> CFILE + if (!env_handle) + printf("dbenv,\n") >> CFILE + else + printf("%s,\n", args[env_idx]) >> CFILE + printf("\t msg.%s.%s_len,", \ args[i], args[i]) >> CFILE - printf("\t\tgoto out;\n") >> CFILE + if (list_type[i] == "GID") + printf(" 1,") >> CFILE + else + printf(" sizeof(u_int32_t),") >> CFILE + printf(" &msg.%s.%s_val)) != 0)\n",\ + args[i], args[i], args[i], args[i]) >> CFILE + printf("\t\treturn (ret);\n") >> CFILE + printf("\tfor (%sq = msg.%s.%s_val, %sp = %s; ", \ + args[i], args[i], args[i], \ + args[i], args[i]) >> CFILE + printf("%si--; %sq++, %sp++)\n", \ + args[i], args[i], args[i]) >> CFILE + printf("\t\t*%sq = ", args[i]) >> CFILE + if (list_type[i] == "GID") + printf("*%sp;\n", args[i]) >> CFILE + if (list_type[i] == "ID") + printf("(*%sp)->cl_id;\n", args[i]) >> CFILE + if (list_type[i] == "INT") + printf("*%sp;\n", args[i]) >> CFILE } } printf("\n") >> CFILE - printf("\treplyp = __db_%s_%d(&req, cl);\n", name, msgid) >> CFILE + printf("\treplyp = __db_%s_%d%03d(&msg, cl);\n", name, major, minor) \ + >> CFILE + for (i = 0; i < nvars; ++i) { + if (rpc_type[i] == "LIST") { + printf("\t__os_free(") >> CFILE + if (!env_handle) + printf("dbenv, ") >> CFILE + else + printf("%s, ", args[env_idx]) >> CFILE + printf("msg.%s.%s_val);\n", args[i], args[i]) >> CFILE + } + } printf("\tif (replyp == NULL) {\n") >> CFILE if (!env_handle) { printf("\t\t__db_err(dbenv, ") >> CFILE @@ -1137,112 +1035,24 @@ END { if (ret_code == 0) { printf("\tret = replyp->status;\n") >> CFILE } else { - for (i = 0; i < nvars; ++i) { - if (rpc_type[i] == "LIST") { - printf("\t__dbcl_%s_%sfree(&req.%slist);\n", \ - name, args[i], args[i]) >> CFILE - } - } - printf("\treturn (__dbcl_%s_ret(", name) >> CFILE + printf("\tret = __dbcl_%s_ret(", name) >> CFILE sep = ""; for (i = 0; i < nvars; ++i) { printf("%s%s", sep, args[i]) >> CFILE sep = ", "; } - printf("%sreplyp));\n", sep) >> CFILE + printf("%sreplyp);\n", sep) >> CFILE } printf("out:\n") >> CFILE - for (i = 0; i < nvars; ++i) { - if (rpc_type[i] == "LIST") { - printf("\t__dbcl_%s_%sfree(&req.%slist);\n", \ - name, args[i], args[i]) >> CFILE - } - } + # + # Free reply if there was one. + # + printf("\tif (replyp != NULL)\n") >> CFILE + printf("\t\txdr_free((xdrproc_t)xdr___%s_reply,",name) >> CFILE + printf(" (void *)replyp);\n") >> CFILE printf("\treturn (ret);\n") >> CFILE printf("}\n\n") >> CFILE - # - # If we are doing a list, write list functions for op. - # - for (i = 0; i < nvars; i++) { - if (rpc_type[i] != "LIST") - continue; - printf("int\n__dbcl_%s_%slist(locp, pp)\n", \ - name, args[i]) >> CFILE - printf("\t__%s_%slist **locp;\n", name, args[i]) >> CFILE - if (list_type[i] == "STRING") - printf("\t%s pp;\n{\n\t%s p;\n", \ - c_type[i], c_type[i]) >> CFILE - if (list_type[i] == "INT") - printf("\tu_int32_t *pp;\n{\n\tu_int32_t *p, *q;\n") \ - >> CFILE - if (list_type[i] == "ID") - printf("\t%s pp;\n{\n\t%s p;\n\tu_int32_t *q;\n", \ - c_type[i], c_type[i]) >> CFILE - - printf("\tint ret;\n") >> CFILE - printf("\t__%s_%slist *nl, **nlp;\n\n", name, args[i]) >> CFILE - printf("\t*locp = NULL;\n") >> CFILE - printf("\tif (pp == NULL)\n\t\treturn (0);\n") >> CFILE - printf("\tnlp = locp;\n") >> CFILE - printf("\tfor (p = pp; *p != 0; p++) {\n") >> CFILE - printf("\t\tif ((ret = __os_malloc(NULL, ") >> CFILE - printf("sizeof(*nl), NULL, nlp)) != 0)\n") >> CFILE - printf("\t\t\tgoto out;\n") >> CFILE - printf("\t\tnl = *nlp;\n") >> CFILE - printf("\t\tnl->next = NULL;\n") >> CFILE - printf("\t\tnl->ent.ent_val = NULL;\n") >> CFILE - printf("\t\tnl->ent.ent_len = 0;\n") >> CFILE - if (list_type[i] == "STRING") { - printf("\t\tif ((ret = __os_strdup(NULL, ") >> CFILE - printf("*p, &nl->ent.ent_val)) != 0)\n") >> CFILE - printf("\t\t\tgoto out;\n") >> CFILE - printf("\t\tnl->ent.ent_len = strlen(*p)+1;\n") >> CFILE - } - if (list_type[i] == "INT") { - printf("\t\tif ((ret = __os_malloc(NULL, ") >> CFILE - printf("sizeof(%s), NULL, &nl->ent.ent_val)) != 0)\n", \ - c_type[i]) >> CFILE - printf("\t\t\tgoto out;\n") >> CFILE - printf("\t\tq = (u_int32_t *)nl->ent.ent_val;\n") \ - >> CFILE - printf("\t\t*q = *p;\n") >> CFILE - printf("\t\tnl->ent.ent_len = sizeof(%s);\n", \ - c_type[i]) >> CFILE - } - if (list_type[i] == "ID") { - printf("\t\tif ((ret = __os_malloc(NULL, ") >> CFILE - printf("sizeof(u_int32_t),") >> CFILE - printf(" NULL, &nl->ent.ent_val)) != 0)\n") >> CFILE - printf("\t\t\tgoto out;\n") >> CFILE - printf("\t\tq = (u_int32_t *)nl->ent.ent_val;\n") \ - >> CFILE - printf("\t\t*q = (*p)->cl_id;\n") >> CFILE - printf("\t\tnl->ent.ent_len = sizeof(u_int32_t);\n") \ - >> CFILE - } - printf("\t\tnlp = &nl->next;\n") >> CFILE - printf("\t}\n") >> CFILE - printf("\treturn (0);\n") >> CFILE - printf("out:\n") >> CFILE - printf("\t__dbcl_%s_%sfree(locp);\n", name, args[i]) >> CFILE - printf("\treturn (ret);\n") >> CFILE - - printf("}\n\n") >> CFILE - - printf("void\n__dbcl_%s_%sfree(locp)\n", name, args[i]) >> CFILE - printf("\t__%s_%slist **locp;\n", name, args[i]) >> CFILE - printf("{\n") >> CFILE - printf("\t__%s_%slist *nl, *nl1;\n\n", name, args[i]) >> CFILE - printf("\tif (locp == NULL)\n\t\treturn;\n") >> CFILE - printf("\tfor (nl = *locp; nl != NULL; nl = nl1) {\n") >> CFILE - printf("\t\tnl1 = nl->next;\n") >> CFILE - printf("\t\tif (nl->ent.ent_val)\n") >> CFILE - printf("\t\t\t__os_free(nl->ent.ent_val, nl->ent.ent_len);\n") \ - >> CFILE - printf("\t\t__os_free(nl, sizeof(*nl));\n") >> CFILE - printf("\t}\n}\n\n") >> CFILE - } # # Generate Client Template code # @@ -1250,38 +1060,16 @@ END { # # If we are doing a list, write prototypes # - for (i = 0; i < rvars; ++i) { - if (ret_type[i] != "LIST") - continue; - if (retlist_type[i] != "STRING" && - retlist_type[i] != "INT" && list_type[i] != "ID") - continue; - printf("int __db_%s_%sreplist __P((", \ - name, retargs[i]) >> TFILE - printf("__%s_%sreplist, ", \ - name, retargs[i]) >> TFILE - if (retlist_type[i] == "STRING") { - printf("char ***));\n") >> TFILE - } - if (retlist_type[i] == "INT" || - retlist_type[i] == "ID") { - printf("u_int32_t **));\n") >> TFILE - } - printf("void __db_%s_%sfree __P((", \ - name, retargs[i]) >> TFILE - if (retlist_type[i] == "STRING") - printf("char **));\n") >> TFILE - if (retlist_type[i] == "INT" || retlist_type[i] == "ID") - printf("u_int32_t *));\n\n") >> TFILE - } - - printf("int __dbcl_%s_ret __P((", name) >> CHFILE - sep = ""; + pi = 1; + p[pi++] = sprintf("int __dbcl_%s_ret __P((", name); + p[pi++] = ""; for (i = 0; i < nvars; ++i) { - printf("%s%s", sep, pr_type[i]) >> CHFILE - sep = ", "; + p[pi++] = pr_type[i]; + p[pi++] = ", "; } - printf("%s__%s_reply *));\n", sep, name) >> CHFILE + p[pi++] = sprintf("__%s_reply *));", name); + p[pi++] = ""; + proto_format(p, 0, TFILE); printf("int\n") >> TFILE printf("__dbcl_%s_ret(", name) >> TFILE @@ -1310,12 +1098,12 @@ END { printf("\t%s %s;\n", \ retc_type[i], retargs[i]) >> TFILE } else if (ret_type[i] == "LIST") { - if (retlist_type[i] == "STRING") - printf("\tchar **__db_%slist;\n", \ + if (retlist_type[i] == "GID") + printf("\tu_int8_t *__db_%s;\n", \ retargs[i]) >> TFILE if (retlist_type[i] == "ID" || retlist_type[i] == "INT") - printf("\tu_int32_t *__db_%slist;\n", \ + printf("\tu_int32_t *__db_%s;\n", \ retargs[i]) >> TFILE } else { printf("\t/* %s %s; */\n", \ @@ -1347,16 +1135,9 @@ END { printf("\t%s = replyp->%s;\n", \ retargs[i], varname) >> TFILE } else if (ret_type[i] == "LIST") { - printf("\n\tif ((ret = __db_%s_%slist(", \ - name, retargs[i]) >> TFILE - printf("replyp->%slist, &__db_%slist)) != 0)", \ - retargs[i], retargs[i]) >> TFILE - printf("\n\t\treturn (ret);\n") >> TFILE printf("\n\t/*\n") >> TFILE printf("\t * XXX Handle list\n") >> TFILE printf("\t */\n\n") >> TFILE - printf("\t__db_%s_%sfree(__db_%slist);\n", \ - name, retargs[i], retargs[i]) >> TFILE } else { printf("\t/* Handle replyp->%s; */\n", \ varname) >> TFILE @@ -1365,118 +1146,69 @@ END { printf("\n\t/*\n\t * XXX Code goes here\n\t */\n\n") >> TFILE printf("\treturn (replyp->status);\n") >> TFILE printf("}\n\n") >> TFILE - # - # If we are doing a list, write list functions for this op. - # - for (i = 0; i < rvars; ++i) { - if (ret_type[i] != "LIST") - continue; - if (retlist_type[i] != "STRING" && - retlist_type[i] != "INT" && list_type[i] != "ID") - continue; - printf("int\n") >> TFILE - printf("__db_%s_%sreplist(locp, ppp)\n", \ - name, retargs[i]) >> TFILE - printf("\t__%s_%sreplist *locp;\n", \ - name, retargs[i]) >> TFILE - if (retlist_type[i] == "STRING") { - printf("\tchar ***ppp;\n{\n") >> TFILE - printf("\tchar **pp;\n") >> TFILE - } - if (retlist_type[i] == "INT" || - retlist_type[i] == "ID") { - printf("\tu_int32_t **ppp;\n{\n") >> TFILE - printf("\tu_int32_t *pp;\n") >> TFILE - } - - printf("\tint cnt, ret, size;\n") >> TFILE - printf("\t__%s_%sreplist *nl;\n\n", \ - name, retargs[i]) >> TFILE - printf("\tfor (cnt = 0, nl = locp; ") >> TFILE - printf("nl != NULL; cnt++, nl = nl->next)\n\t\t;\n\n") \ - >> TFILE - printf("\tif (cnt == 0) {\n") >> TFILE - printf("\t\t*ppp = NULL;\n") >> TFILE - printf("\t\treturn (0);\n\t}\n") >> TFILE - printf("\tsize = sizeof(*pp) * cnt;\n") >> TFILE - printf("\tif ((ret = __os_malloc(NULL, ") >> TFILE - printf("size, NULL, ppp)) != 0)\n") >> TFILE - printf("\t\treturn (ret);\n") >> TFILE - printf("\tmemset(*ppp, 0, size);\n") >> TFILE - printf("\tfor (pp = *ppp, nl = locp; ") >> TFILE - printf("nl != NULL; nl = nl->next, pp++) {\n") >> TFILE - if (retlist_type[i] == "STRING") { - printf("\t\tif ((ret = __os_malloc(NULL, ") \ - >> TFILE - printf("nl->ent.ent_len + 1, NULL,") >> TFILE - printf(" pp)) != 0)\n") >> TFILE - printf("\t\t\tgoto out;\n") >> TFILE - printf("\t\tif ((ret = __os_strdup(") >> TFILE - printf("NULL, (char *)nl->ent.ent_val,") \ - >> TFILE - printf(" pp)) != 0)\n") >> TFILE - printf("\t\t\tgoto out;\n") >> TFILE - } - if (retlist_type[i] == "INT" || - retlist_type[i] == "ID") { - printf("\t\t*pp = *(u_int32_t *)") >> TFILE - printf("nl->ent.ent_val;\n") >> TFILE - } - printf("\t}\n") >> TFILE - printf("\treturn (0);\n") >> TFILE - printf("out:\n") >> TFILE - printf("\t__db_%s_%sfree(*ppp);\n", \ - name, retargs[i]) >> TFILE - printf("\treturn (ret);\n") >> TFILE - printf("}\n\n") >> TFILE - - printf("void\n") >> TFILE - printf("__db_%s_%sfree(pp)\n", \ - name, retargs[i]) >> TFILE - - if (retlist_type[i] == "STRING") - printf("\tchar **pp;\n") >> TFILE - if (retlist_type[i] == "INT" || retlist_type[i] == "ID") - printf("\tu_int32_t *pp;\n") >> TFILE - - printf("{\n") >> TFILE - printf("\tsize_t size;\n") >> TFILE - - if (retlist_type[i] == "STRING") - printf("\tchar **p;\n\n") >> TFILE - if (retlist_type[i] == "INT" || retlist_type[i] == "ID") - printf("\tu_int32_t *p;\n\n") >> TFILE - - printf("\tif (pp == NULL)\n\t\treturn;\n") >> TFILE - printf("\tsize = sizeof(*p);\n") >> TFILE - printf("\tfor (p = pp; *p != 0; p++) {\n") >> TFILE - printf("\t\tsize += sizeof(*p);\n") >> TFILE - - if (retlist_type[i] == "STRING") - printf("\t\t__os_free(*p, strlen(*p)+1);\n") \ - >> TFILE - printf("\t}\n") >> TFILE - printf("\t__os_free(pp, size);\n") >> TFILE - printf("}\n\n") >> TFILE - } } } # # split_lines -- # Add line separators to pretty-print the output. -function split_lines(is_public) { +function split_lines() { if (argcount > 3) { # Reset the counter, remove any trailing whitespace from # the separator. argcount = 0; sub("[ ]$", "", sep) - if (is_public) { - printf("%s\n\t", sep) >> SHFILE - } else { - printf("%s\n\t\t", sep) >> PFILE - printf("%s\\\n\\\t\\\t", sep) >> SEDFILE - } + printf("%s\n\t\t", sep) >> PFILE + printf("%s\\\n\\\t\\\t", sep) >> SEDFILE } } + +# proto_format -- +# Pretty-print a function prototype. +function proto_format(p, sedfile, OUTPUT) +{ + if (sedfile) + printf("/*\\\n") >> OUTPUT; + else + printf("/*\n") >> OUTPUT; + + s = ""; + for (i = 1; i in p; ++i) + s = s p[i]; + + if (sedfile) + t = "\\ * PUBLIC: " + else + t = " * PUBLIC: " + if (length(s) + length(t) < 80) + if (sedfile) + printf("%s%s", t, s) >> OUTPUT; + else + printf("%s%s", t, s) >> OUTPUT; + else { + split(s, p, "__P"); + len = length(t) + length(p[1]); + printf("%s%s", t, p[1]) >> OUTPUT + + n = split(p[2], comma, ","); + comma[1] = "__P" comma[1]; + for (i = 1; i <= n; i++) { + if (len + length(comma[i]) > 75) { + if (sedfile) + printf(\ + "\\\n\\ * PUBLIC: ") >> OUTPUT; + else + printf("\n * PUBLIC: ") >> OUTPUT; + len = 0; + } + printf("%s%s", comma[i], i == n ? "" : ",") >> OUTPUT; + len += length(comma[i]); + } + } + if (sedfile) + printf("\\\n\\ */\\\n") >> OUTPUT; + else + printf("\n */\n") >> OUTPUT; + delete p; +} diff --git a/bdb/dist/install-sh b/bdb/dist/install-sh new file mode 100755 index 00000000000..b41a2459161 --- /dev/null +++ b/bdb/dist/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=$mkdirprog + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' + ' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/bdb/dist/ltconfig b/bdb/dist/ltconfig deleted file mode 100644 index f78afda0e1f..00000000000 --- a/bdb/dist/ltconfig +++ /dev/null @@ -1,3136 +0,0 @@ -#! /bin/sh - -# ltconfig - Create a system-specific libtool. -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# 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 -# 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. - -# A lot of this script is taken from autoconf-2.10. - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} -echo=echo -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec "$SHELL" "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`} - case X$UNAME in - *-DOS) PATH_SEPARATOR=';' ;; - *) PATH_SEPARATOR=':' ;; - esac -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -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`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || - test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running ltconfig again with it. - ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf "%s\n"' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - # Cool, printf works - : - elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# The name of this program. -progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` - -# Constants: -PROGRAM=ltconfig -PACKAGE=libtool -VERSION=1.3.5 -TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -rm="rm -f" - -help="Try \`$progname --help' for more information." - -# Global variables: -default_ofile=libtool -can_build_shared=yes -enable_shared=yes -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -enable_static=yes -enable_fast_install=yes -enable_dlopen=unknown -enable_win32_dll=no -ltmain= -silent= -srcdir= -ac_config_guess= -ac_config_sub= -host= -nonopt= -ofile="$default_ofile" -verify_host=yes -with_gcc=no -with_gnu_ld=no -need_locks=yes -ac_ext=c -objext=o -libext=a -exeext= -cache_file= - -old_AR="$AR" -old_CC="$CC" -old_CFLAGS="$CFLAGS" -old_CPPFLAGS="$CPPFLAGS" -old_LDFLAGS="$LDFLAGS" -old_LD="$LD" -old_LN_S="$LN_S" -old_LIBS="$LIBS" -old_NM="$NM" -old_RANLIB="$RANLIB" -old_DLLTOOL="$DLLTOOL" -old_OBJDUMP="$OBJDUMP" -old_AS="$AS" - -# Parse the command line options. -args= -prev= -for option -do - case "$option" in - -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - eval "$prev=\$option" - prev= - continue - fi - - case "$option" in - --help) cat <&2 - echo "$help" 1>&2 - exit 1 - ;; - - *) - if test -z "$ltmain"; then - ltmain="$option" - elif test -z "$host"; then -# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 -# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then -# echo "$progname: warning \`$option' is not a valid host type" 1>&2 -# fi - host="$option" - else - echo "$progname: too many arguments" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac -done - -if test -z "$ltmain"; then - echo "$progname: you must specify a LTMAIN file" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -if test ! -f "$ltmain"; then - echo "$progname: \`$ltmain' does not exist" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -# Quote any args containing shell metacharacters. -ltconfig_args= -for arg -do - case "$arg" in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ltconfig_args="$ltconfig_args '$arg'" ;; - *) ltconfig_args="$ltconfig_args $arg" ;; - esac -done - -# A relevant subset of AC_INIT. - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 5 compiler messages saved in config.log -# 6 checking for... messages and results -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>>./config.log - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi -if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi - -if test -n "$cache_file" && test -r "$cache_file"; then - echo "loading cache $cache_file within ltconfig" - . $cache_file -fi - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - -if test -z "$srcdir"; then - # Assume the source directory is the same one as the path to LTMAIN. - srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` - test "$srcdir" = "$ltmain" && srcdir=. -fi - -trap "$rm conftest*; exit 1" 1 2 15 -if test "$verify_host" = yes; then - # Check for config.guess and config.sub. - ac_aux_dir= - for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/config.guess; then - ac_aux_dir=$ac_dir - break - fi - done - if test -z "$ac_aux_dir"; then - echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 - echo "$help" 1>&2 - exit 1 - fi - ac_config_guess=$ac_aux_dir/config.guess - ac_config_sub=$ac_aux_dir/config.sub - - # Make sure we can run config.sub. - if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : - else - echo "$progname: cannot run $ac_config_sub" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - echo $ac_n "checking host system type""... $ac_c" 1>&6 - - host_alias=$host - case "$host_alias" in - "") - if host_alias=`$SHELL $ac_config_guess`; then : - else - echo "$progname: cannot guess host type; you must specify one" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac - host=`$SHELL $ac_config_sub $host_alias` - echo "$ac_t$host" 1>&6 - - # Make sure the host verified. - test -z "$host" && exit 1 - -elif test -z "$host"; then - echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 - echo "$help" 1>&2 - exit 1 -else - host_alias=$host -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case "$host_os" in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -case "$host_os" in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR cru $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -# Set a sane default for `AR'. -test -z "$AR" && AR=ar - -# Set a sane default for `OBJDUMP'. -test -z "$OBJDUMP" && OBJDUMP=objdump - -# If RANLIB is not set, then run the test. -if test "${RANLIB+set}" != "set"; then - result=no - - echo $ac_n "checking for ranlib... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then - RANLIB="ranlib" - result="ranlib" - break - fi - done - IFS="$save_ifs" - - echo "$ac_t$result" 1>&6 -fi - -if test -n "$RANLIB"; then - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi - -# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$AS" && AS=as - -# Check to see if we are using GCC. -if test "$with_gcc" != yes || test -z "$CC"; then - # If CC is not set, then try to find GCC or a usable CC. - if test -z "$CC"; then - echo $ac_n "checking for gcc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then - CC="gcc" - break - fi - done - IFS="$save_ifs" - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - fi - - # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". - if test -z "$CC"; then - echo $ac_n "checking for cc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - cc_rejected=no - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/cc || test -f $dir/cc$ac_exeext; then - if test "$dir/cc" = "/usr/ucb/cc"; then - cc_rejected=yes - continue - fi - CC="cc" - break - fi - done - IFS="$save_ifs" - if test $cc_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same name, so the bogon will be chosen - # first if we set CC to just the name; use the full file name. - shift - set dummy "$dir/cc" "$@" - shift - CC="$@" - fi - fi - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$CC"; then - echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 - exit 1 - fi - fi - - # Now see if the compiler is really GCC. - with_gcc=no - echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 - echo "$progname:581: checking whether we are using GNU C" >&5 - - $rm conftest.c - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - with_gcc=yes - fi - $rm conftest.c - echo "$ac_t$with_gcc" 1>&6 -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="$2" - -echo $ac_n "checking for object suffix... $ac_c" 1>&6 -$rm conftest* -echo 'int i = 1;' > conftest.c -echo "$progname:603: checking for object suffix" >& 5 -if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - cat conftest.err 1>&5 - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 -fi -$rm conftest* -echo "$ac_t$objext" 1>&6 - -echo $ac_n "checking for executable suffix... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_exeext="no" - $rm conftest* - echo 'main () { return 0; }' > conftest.c - echo "$progname:629: checking for executable suffix" >& 5 - if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - for ac_file in conftest.*; do - case $ac_file in - *.c | *.err | *.$objext ) ;; - *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; - esac - done - else - cat conftest.err 1>&5 - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - $rm conftest* -fi -if test "X$ac_cv_exeext" = Xno; then - exeext="" -else - exeext="$ac_cv_exeext" -fi -echo "$ac_t$ac_cv_exeext" 1>&6 - -echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 -pic_flag= -special_shlib_compile_flags= -wl= -link_static_flag= -no_builtin_flag= - -if test "$with_gcc" = yes; then - wl='-Wl,' - link_static_flag='-static' - - case "$host_os" in - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # we not sure about C++ programs. - link_static_flag="$link_static_flag ${wl}-lC" - ;; - cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - 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'. - pic_flag='-m68020 -resident32 -malways-restore-a4' - ;; - sysv4*MP*) - if test -d /usr/nec; then - pic_flag=-Kconform_pic - fi - ;; - *) - pic_flag='-fPIC' - ;; - esac -else - # PORTME Check for PIC flags for the system compiler. - case "$host_os" in - aix3* | aix4*) - # All AIX code is PIC. - link_static_flag='-bnso -bI:/lib/syscalls.exp' - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better link_static_flag that works with the bundled CC? - wl='-Wl,' - link_static_flag="${wl}-a ${wl}archive" - pic_flag='+Z' - ;; - - irix5* | irix6*) - wl='-Wl,' - link_static_flag='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - wl='-Wl,' - link_static_flag='-non_shared' - ;; - - sco3.2v5*) - pic_flag='-Kpic' - link_static_flag='-dn' - special_shlib_compile_flags='-belf' - ;; - - solaris*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - sunos4*) - pic_flag='-PIC' - link_static_flag='-Bstatic' - wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - uts4*) - pic_flag='-pic' - link_static_flag='-Bstatic' - ;; - sysv4*MP*) - if test -d /usr/nec ;then - pic_flag='-Kconform_pic' - link_static_flag='-Bstatic' - fi - ;; - *) - can_build_shared=no - ;; - esac -fi - -if test -n "$pic_flag"; then - echo "$ac_t$pic_flag" 1>&6 - - # Check to make sure the pic_flag actually works. - echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $pic_flag -DPIC" - echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 - if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - case "$host_os" in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then they - # create non-PIC objects. So, if there were any warnings, we assume that - # PIC is not supported. - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - can_build_shared=no - pic_flag= - else - echo "$ac_t"yes 1>&6 - pic_flag=" $pic_flag" - fi - ;; - *) - echo "$ac_t"yes 1>&6 - pic_flag=" $pic_flag" - ;; - esac - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - can_build_shared=no - pic_flag= - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - echo "$ac_t"none 1>&6 -fi - -# Check to see if options -o and -c are simultaneously supported by compiler -echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -$rm conftest* -echo "int some_variable = 0;" > conftest.c -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.o" -echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 -if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; 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 "$ac_t"no 1>&6 - compiler_c_o=no - else - echo "$ac_t"yes 1>&6 - compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&5 - compiler_c_o=no - echo "$ac_t"no 1>&6 -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 -if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; 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 - echo "$ac_t"no 1>&6 - compiler_o_lo=no - else - echo "$ac_t"yes 1>&6 - compiler_o_lo=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_o_lo=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - compiler_o_lo=no -fi - -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&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 "$ac_t$hard_links" 1>&6 - $rm conftest* - if test "$hard_links" = no; then - echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 - need_locks=warn - fi -else - need_locks=no -fi - -if test "$with_gcc" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" - echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; 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 - echo "$ac_t"no 1>&6 - compiler_rtti_exceptions=no - else - echo "$ac_t"yes 1>&6 - compiler_rtti_exceptions=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_rtti_exceptions=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi - -fi - -# Check for any special shared library compilation flags. -if test -n "$special_shlib_compile_flags"; then - echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : - else - echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 - can_build_shared=no - fi -fi - -echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 -$rm conftest* -echo 'main(){return(0);}' > conftest.c -save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS $link_static_flag" -echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 -if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - echo "$ac_t$link_static_flag" 1>&6 -else - echo "$ac_t"none 1>&6 - link_static_flag= -fi -LDFLAGS="$save_LDFLAGS" -$rm conftest* - -if test -z "$LN_S"; then - # Check to see if we can use ln -s, or we need hard links. - echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 - $rm conftest.dat - if ln -s X conftest.dat 2>/dev/null; then - $rm conftest.dat - LN_S="ln -s" - else - LN_S=ln - fi - if test "$LN_S" = "ln -s"; then - echo "$ac_t"yes 1>&6 - else - echo "$ac_t"no 1>&6 - fi -fi - -# Make sure LD is an absolute path. -if test -z "$LD"; then - ac_prog=ld - if test "$with_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 - echo "$progname:991: checking for ld used by GCC" >&5 - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we are not using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac - elif test "$with_gnu_ld" = yes; then - echo $ac_n "checking for GNU ld... $ac_c" 1>&6 - echo "$progname:1015: checking for GNU ld" >&5 - else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 - echo "$progname:1018: checking for non-GNU ld" >&5 - fi - - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - 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. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" - fi - - if test -n "$LD"; then - echo "$ac_t$LD" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$LD"; then - echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 - exit 1 - fi -fi - -# Check to see if it really is or is not GNU ld. -echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 -# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - with_gnu_ld=yes -else - with_gnu_ld=no -fi -echo "$ac_t$with_gnu_ld" 1>&6 - -# See if the linker supports building shared libraries. -echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -always_export_symbols=no -export_symbols_cmds='$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= -# exclude_expsyms can be an egrep regular expression 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="_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. - -case "$host_os" in -cygwin* | mingw*) - # 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 "$with_gcc" != yes; then - with_gnu_ld=no - fi - ;; - -esac - -ld_shlibs=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*) - # On AIX, the GNU linker is very broken - ld_shlibs=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. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=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 use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left by newer dlltools. - export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ - test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ - $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' - - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \$# in - 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; - *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done~ - test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ - test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ - $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ - $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ - $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' - - old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' - # can we support soname and/or expsyms with a.out? -oliva - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** 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. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - 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' - case $host_os in - cygwin* | mingw*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case "$host_os" in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$with_gcc" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4*) - hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' - hardcode_libdir_separator=':' - if test "$with_gcc" = yes; then - 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=yes - else - # We have old collect2 - hardcode_direct=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=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - shared_flag='-shared' - else - shared_flag='${wl}-bM:SRE' - hardcode_direct=yes - fi - allow_undefined_flag=' ${wl}-berok' - archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' - archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' - #### local change for Sleepycat DB: - # On AIX 4.3.2 (at least), -bexpall exports too much, - # causing symbol conflicts. This was: - # case "$host_os" in aix4.[01]|aix4.[01].*) - case "$host_os" in aix4.*) - # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on - always_export_symbols=yes ;; - esac - ;; - - amigaos*) - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw*) - # 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=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $linkopts `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='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs' - fix_srcfile_path='`cygpath -w $srcfile`' - ;; - - freebsd1*) - ld_shlibs=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='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case "$host_os" in - hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$with_gcc" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF - fi - hardcode_libdir_flag_spec='${wl}-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - openbsd*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' - ;; - - osf3*) - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # As osf3* with the addition of the -msym flag - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - rhapsody*) - archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flags_spec='-L$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - 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 $linkopts' - 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 $linkopts~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - 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' ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - 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='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' - else - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - 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 $linkopts' - 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 $linkopts~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - unixware7*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi -echo "$ac_t$ld_shlibs" 1>&6 -test "$ld_shlibs" = no && can_build_shared=no - -if test -z "$NM"; then - echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 - case "$NM" in - [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/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 - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -p" - break - else - NM=${NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$NM" && NM=nm - ;; - esac - echo "$ac_t$NM" 1>&6 -fi - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -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 -global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case "$host_os" in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - symcode='[BCDEGRST]' - ;; -solaris*) - symcode='[BDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[ABCDGISTW]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - $rm conftest* - cat > conftest.c <&5 - if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then - # Now try to grab the symbols. - nlist=conftest.nm - if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then - - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.c -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' - - cat <> conftest.c -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c - cat <<\EOF >> conftest.c - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$objext conftstm.$objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - pipe_works=yes - else - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - LIBS="$save_LIBS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - $rm conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - global_symbol_pipe= - fi -done -if test "$pipe_works" = yes; then - echo "${ac_t}ok" 1>&6 -else - echo "${ac_t}failed" 1>&6 -fi - -if test -z "$global_symbol_pipe"; then - global_symbol_to_cdecl= -fi - -# Check hardcoding attributes. -echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != 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 "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$ac_t$hardcode_action" 1>&6 - - -reload_flag= -reload_cmds='$LD$reload_flag -o $output$reload_objs' -echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 -# PORTME Some linkers may need a different reload flag. -reload_flag='-r' -echo "$ac_t$reload_flag" 1>&6 -test -n "$reload_flag" && reload_flag=" $reload_flag" - -# PORTME Fill in your ld.so characteristics -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -file_magic_cmd= -file_magic_test_file= -deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [regex]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. -echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 -case "$host_os" in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4*) - version_type=linux - # AIX has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - # We preserve .a as extension for shared libraries though AIX4.2 - # and later linker supports .so - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' - shlibpath_var=LIBPATH - deplibs_check_method=pass_all - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - deplibs_check_method=pass_all - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - file_magic_cmd=/usr/bin/file - file_magic_test_file=/shlib/libc.so - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw*) - version_type=windows - need_version=no - need_lib_prefix=no - if test "$with_gcc" = yes; then - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' - else - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - fi - dynamic_linker='Win32 ld.exe' - deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - file_magic_cmd='${OBJDUMP} -f' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case "$version_type" in - freebsd-elf*) - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /usr/lib/libc.so*` - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - deplibs_check_method=unknown - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case "$host_os" in - freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - - #### local change for Sleepycat DB: [#1990] - # The following 3 lines added, otherwise dependent libraries are not allowed - # on HP. We use dependent libraries in a very straightforward way, to - # incorporate -lnsl into libtcl.sl, and for testing only. - deplibs_check_method='file_magic PA-RISC[1-9][0-9.]* shared library' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.sl*` - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so.$major' - library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' - case "$host_os" in - irix5*) - libsuff= shlibsuff= - # this will be overridden with pass_all, but let us keep it just in case - deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case "$LD" in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib${libsuff}/libc.so*` - deplibs_check_method='pass_all' - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - deplibs_check_method=pass_all - - if test -f /lib/ld.so.1; then - dynamic_linker='GNU ld.so' - else - # Only the GNU ld.so supports shared libraries on MkLinux. - case "$host_cpu" in - powerpc*) dynamic_linker=no ;; - *) dynamic_linker='Linux ld.so' ;; - esac - fi - ;; - -netbsd*) - version_type=sunos - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - ;; - -openbsd*) - version_type=sunos - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - need_version=no - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - # this will be overridden with pass_all, but let us keep it just in case - deplibs_check_method='file_magic COFF format alpha shared library' - file_magic_cmd=/usr/bin/file - file_magic_test_file=/shlib/libc.so - deplibs_check_method='pass_all' - 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" - ;; - -rhapsody*) - version_type=sunos - library_names_spec='${libname}.so' - soname_spec='${libname}.so' - shlibpath_var=DYLD_LIBRARY_PATH - deplibs_check_method=pass_all - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - #### local change for Sleepycat DB: - # The following line added, otherwise dependent libraries are not allowed - # on SCO. We use dependent libraries in a very straightforward way. - deplibs_check_method='pass_all' - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" - file_magic_cmd=/usr/bin/file - file_magic_test_file=/lib/libc.so - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$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}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case "$host_vendor" in - sequent) - file_magic_cmd='/bin/file' - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - ncr) - deplibs_check_method='pass_all' - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - 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]' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -#### local change for Sleepycat DB: -# Add in the QNX support from QNX. -nto-qnx) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - deplibs_check_method='pass_all' - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$ac_t$dynamic_linker" 1>&6 -test "$dynamic_linker" = no && can_build_shared=no - -# Report the final consequences. -echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 - -# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in -# configure.in, otherwise build static only libraries. -case "$host_os" in -cygwin* | mingw* | os2*) - if test x$can_build_shared = xyes; then - test x$enable_win32_dll = xno && can_build_shared=no - echo "checking if package supports dlls... $can_build_shared" 1>&6 - fi -;; -esac - -if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then - case "$deplibs_check_method" in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac -fi - -echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&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 -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*) - test "$enable_shared" = yes && enable_static=no - ;; -esac - -echo "$ac_t$enable_shared" 1>&6 - -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes - -echo "checking whether to build static libraries... $enable_static" 1>&6 - -if test "$hardcode_action" = 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 - -echo $ac_n "checking for objdir... $ac_c" 1>&6 -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -echo "$ac_t$objdir" 1>&6 - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else -if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then - lt_cv_dlopen=no lt_cv_dlopen_libs= -echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2248: checking for dlopen in -ldl" >&5 -ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:2288: checking for dlopen" >&5 -if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen(); - -int main() { - -/* 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 -dlopen(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_dlopen=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_dlopen=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2335: checking for dld_link in -ldld" >&5 -ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2375: checking for shl_load" >&5 -if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load(); - -int main() { - -/* 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 -shl_load(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_shl_load=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shl_load=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:2423: checking for shl_load in -ldld" >&5 -ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -fi - - -fi - - -fi - - -fi - - -fi - -fi - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - fi - - case "$lt_cv_dlopen" in - dlopen) -for ac_hdr in dlfcn.h; do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:2488: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int fnord = 0; -EOF -ac_try="$ac_compile >/dev/null 2>conftest.out" -{ (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi -done - - if test "x$ac_cv_header_dlfcn_h" = xyes; then - CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - fi - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2526: checking whether a program can dlopen itself" >&5 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self=cross - else - cat > conftest.c < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self" 1>&6 - - if test "$lt_cv_dlopen_self" = yes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self_static=cross - else - cat > conftest.c < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self_static=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self_static=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 -fi - ;; - esac - - case "$lt_cv_dlopen_self" in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - 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 - -# Copy echo and quote the copy, instead of the original, because it is -# used later. -ltecho="$echo" -if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ltecho="$CONFIG_SHELL \$0 --fallback-echo" -fi -LTSHELL="$SHELL" - -LTCONFIG_VERSION="$VERSION" - -# Only quote variables if we're using ltmain.sh. -case "$ltmain" in -*.sh) - # Now quote all the things that may contain metacharacters. - for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ - old_LD old_LDFLAGS old_LIBS \ - old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ - AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ - file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case "$var" in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case "$ltecho" in - *'\$0 --fallback-echo"') - ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - - trap "$rm \"$ofile\"; exit 1" 1 2 15 - echo "creating $ofile" - $rm "$ofile" - cat < "$ofile" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. -# -# Copyright (C) 1996-1999 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. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -### BEGIN LIBTOOL CONFIG -EOF - cfgfile="$ofile" - ;; - -*) - # Double-quote the variables that need it (for aesthetics). - for var in old_CC old_CFLAGS old_CPPFLAGS \ - old_LD old_LDFLAGS old_LIBS \ - old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do - eval "$var=\\\"\$var\\\"" - done - - # Just create a config file. - cfgfile="$ofile.cfg" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - echo "creating $cfgfile" - $rm "$cfgfile" - cat < "$cfgfile" -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -EOF - ;; -esac - -cat <> "$cfgfile" -# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ -# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ -# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ -# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ -# $0$ltconfig_args -# -# Compiler and other test output produced by $progname, useful for -# debugging $progname, is in ./config.log if it exists. - -# The version of $progname that generated this script. -LTCONFIG_VERSION=$LTCONFIG_VERSION - -# Shell to use when invoking shell scripts. -SHELL=$LTSHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$ltecho - -# The archiver. -AR=$AR - -# The default C compiler. -CC=$CC - -# The linker used to build libraries. -LD=$LD - -# Whether we need hard or soft links. -LN_S=$LN_S - -# A BSD-compatible nm program. -NM=$NM - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$reload_flag -reload_cmds=$reload_cmds - -# How to pass a linker flag through the compiler. -wl=$wl - -# Object file suffix (normally "o"). -objext="$objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$pic_flag - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$need_locks - -# 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=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$libname_spec - -# 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=$library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$RANLIB -old_archive_cmds=$old_archive_cmds -old_postinstall_cmds=$old_postinstall_cmds -old_postuninstall_cmds=$old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$old_archive_from_new_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$archive_cmds -archive_expsym_cmds=$archive_expsym_cmds -postinstall_cmds=$postinstall_cmds -postuninstall_cmds=$postuninstall_cmds - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$global_symbol_to_cdecl - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$include_expsyms - -EOF - -case "$ltmain" in -*.sh) - echo '### END LIBTOOL CONFIG' >> "$ofile" - echo >> "$ofile" - case "$host_os" in - aix3*) - cat <<\EOF >> "$ofile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # Append the ltmain.sh script. - sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - - chmod +x "$ofile" - ;; - -*) - # Compile the libtool program. - echo "FIXME: would compile $ltmain" - ;; -esac - -test -n "$cache_file" || exit 0 - -# AC_CACHE_SAVE -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# 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. -# 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. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -#! /bin/bash diff --git a/bdb/dist/ltmain.sh b/bdb/dist/ltmain.sh index 4feadbfb759..f07d424527d 100644 --- a/bdb/dist/ltmain.sh +++ b/bdb/dist/ltmain.sh @@ -1,7 +1,8 @@ # ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun ltconfig. +# NOTE: Changing this file will not affect anything until you rerun configure. # -# Copyright (C) 1996-1999 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify @@ -54,8 +55,8 @@ modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.3.5 -TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" +VERSION=1.4.2 +TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)" default_mode= help="Try \`$progname --help' for more information." @@ -83,11 +84,8 @@ if test "${LANG+set}" = set; then save_LANG="$LANG"; LANG=C; export LANG fi -if test "$LTCONFIG_VERSION" != "$VERSION"; then - echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi +# Make sure IFS has a sensible default +: ${IFS=" "} if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then echo "$modename: not configured to build any kind of library" 1>&2 @@ -113,16 +111,16 @@ do arg="$1" shift - case "$arg" in + case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then - case "$prev" in + case $prev in execute_dlfiles) - eval "$prev=\"\$$prev \$arg\"" + execute_dlfiles="$execute_dlfiles $arg" ;; *) eval "$prev=\$arg" @@ -135,7 +133,7 @@ do fi # Have we seen a non-optional argument yet? - case "$arg" in + case $arg in --help) show_help=yes ;; @@ -146,7 +144,7 @@ do ;; --config) - sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 + sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; @@ -207,16 +205,21 @@ if test -n "$prevopt"; then exit 1 fi +# 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. +exec_cmd= + if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then - case "$nonopt" in + case $nonopt in *cc | *++ | gcc* | *-gcc*) mode=link for arg do - case "$arg" in + case $arg in -c) mode=compile break @@ -261,12 +264,13 @@ if test -z "$show_help"; then help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. - case "$mode" in + case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= + prev= lastarg= srcfile="$nonopt" suppress_output= @@ -274,8 +278,34 @@ if test -z "$show_help"; then user_target=no for arg do + case $prev in + "") ;; + xcompiler) + # Aesthetically quote the previous argument. + prev= + lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + + case $arg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + + # Add the previous argument to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; + esac + # Accept any command-line options. - case "$arg" in + case $arg in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 @@ -288,9 +318,53 @@ if test -z "$show_help"; then build_old_libs=yes continue ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; esac - case "$user_target" in + case $user_target in next) # The next one is the -o target name user_target=yes @@ -316,10 +390,10 @@ if test -z "$show_help"; then lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly in scan - # sets, so we specify it separately. - case "$lastarg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $lastarg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac @@ -332,7 +406,7 @@ if test -z "$show_help"; then fi done - case "$user_target" in + case $user_target in set) ;; no) @@ -348,7 +422,7 @@ if test -z "$show_help"; then # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' - case "$libobj" in + case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; @@ -363,7 +437,7 @@ if test -z "$show_help"; then libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - case "$libobj" in + case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 @@ -387,10 +461,21 @@ if test -z "$show_help"; then $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 @@ -402,7 +487,7 @@ if test -z "$show_help"; then # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then - until ln "$0" "$lockfile" 2>/dev/null; do + until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done @@ -434,8 +519,13 @@ compiler." # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile - # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $srcfile $pic_flag -DPIC" + if test "$pic_mode" != no; then + # All platforms use -DPIC, to notify preprocessed assembler code. + command="$base_compile $srcfile $pic_flag -DPIC" + else + # Don't build PIC code + command="$base_compile $srcfile" + fi if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` @@ -506,7 +596,8 @@ compiler." fi # If we have no pic_flag, then copy the object into place and finish. - if test -z "$pic_flag" && test "$build_old_libs" = yes; then + if (test -z "$pic_flag" || test "$pic_mode" != default) && + test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj @@ -532,6 +623,10 @@ compiler." # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + $run $rm "$lockfile" + fi exit 0 else error=$? @@ -546,7 +641,13 @@ compiler." # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then - command="$base_compile $srcfile" + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $srcfile" + else + # All platforms use -DPIC, to notify preprocessed assembler code. + command="$base_compile $srcfile $pic_flag -DPIC" + fi if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" @@ -612,17 +713,17 @@ compiler." # Unlock the critical section if it was locked if test "$need_locks" != no; then - $rm "$lockfile" + $run $rm "$lockfile" fi exit 0 ;; # libtool link mode - link) + link | relink) modename="$modename: link" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra @@ -635,179 +736,12 @@ compiler." # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes - - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# 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. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (!dll) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then - case "$prev" in + case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac - case "$prev" in + case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -905,7 +840,7 @@ compiler." finalize_command="$finalize_command @SYMFILE@" preload=yes fi - case "$arg" in + case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then @@ -934,6 +869,7 @@ compiler." dlprefiles="$dlprefiles $arg" fi prev= + continue ;; esac ;; @@ -958,7 +894,7 @@ compiler." ;; rpath | xrpath) # We need an absolute path. - case "$arg" in + case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 @@ -979,17 +915,32 @@ compiler." prev= continue ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac - fi + fi # test -n $prev prevarg="$arg" - case "$arg" in + case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" @@ -1026,7 +977,7 @@ compiler." -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: not more than one -exported-symbols argument allowed" + $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then @@ -1037,58 +988,76 @@ compiler." continue ;; + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. - case "$dir" in + case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - absdir="$dir" + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + exit 1 fi dir="$absdir" ;; esac - case " $deplibs " in - *" $arg "*) ;; - *) deplibs="$deplibs $arg";; + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; esac - case " $lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir";; - esac - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - case ":$dllsearchpath:" in - ::) dllsearchpath="$dllsearchdir";; - *":$dllsearchdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dllsearchdir";; + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac + continue ;; -l*) - if test "$arg" = "-lc"; then - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) - # These systems don't actually have c library (as such) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) continue ;; + *-*-mingw* | *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; esac - elif test "$arg" = "-lm"; then - case "$host" in - *-*-cygwin* | *-*-beos*) - # These systems don't actually have math library (as such) + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd*) + # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" + continue ;; -module) @@ -1096,6 +1065,32 @@ compiler." continue ;; + #### Local change for Sleepycat's Berkeley DB [#6117]: + -jnimodule) + module=yes + jnimodule=yes + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + -no-undefined) allow_undefined=no continue @@ -1121,7 +1116,7 @@ compiler." -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. - case "$dir" in + case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 @@ -1136,11 +1131,11 @@ compiler." ;; -static) - # If we have no pic_flag, then this is the same as -all-static. - if test -z "$pic_flag" && test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. continue ;; @@ -1154,28 +1149,71 @@ compiler." continue ;; + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + # Some other compiler flag. -* | +*) # 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 - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; - *.o | *.obj | *.a | *.lib) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A library object. + *.lo | *.$objext) + # A library or standard object. if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then + # This file was specified with -dlopen. + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $arg" prev= continue else @@ -1188,300 +1226,35 @@ compiler." # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= + else + case $arg in + *.lo) libobjs="$libobjs $arg" ;; + *) objs="$objs $arg" ;; + esac fi - libobjs="$libobjs $arg" + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue ;; *.la) # A libtool-controlled library. - dlname= - libdir= - library_names= - old_library= - - # Check to see that this really is a libtool archive. - if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 - exit 1 - fi - - # If the library was installed with an old release of libtool, - # it will not redefine variable installed. - installed=yes - - # Read the .la file - # If there is no directory component, then add one. - case "$arg" in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 - exit 1 - fi - - # Find the relevant object directory and library name. - name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` - - if test "X$installed" = Xyes; then - dir="$libdir" - else - dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$arg"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - fi - - if test -n "$dependency_libs"; then - # Extract -R and -L from dependency_libs - temp_deplibs= - for deplib in $dependency_libs; do - case "$deplib" in - -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - case " $rpath $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - -L*) case "$compile_command $temp_deplibs " in - *" $deplib "*) ;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac - temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` - case " $lib_search_path " in - *" $temp_dir "*) ;; - *) lib_search_path="$lib_search_path $temp_dir";; - esac - ;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac - done - dependency_libs="$temp_deplibs" - fi - - if test -z "$libdir"; then - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$deplibs$dependency_libs" - compile_command="$compile_command $dir/$old_library$dependency_libs" - finalize_command="$finalize_command $dir/$old_library$dependency_libs" - continue - fi - - # This library was specified with -dlopen. if test "$prev" = dlfiles; then + # This library was specified with -dlopen. dlfiles="$dlfiles $arg" - if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking statically, - # we need to preload. - prev=dlprefiles - else - # We should not create a dependency on this library, but we - # may need any libraries it requires. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" - prev= - continue - fi - fi - - # The library was specified with -dlpreopen. - if test "$prev" = dlprefiles; then - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - dlprefiles="$dlprefiles $dir/$old_library" - else - dlprefiles="$dlprefiles $dir/$linklib" - fi prev= - fi - - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - link_against_libtool_libs="$link_against_libtool_libs $arg" - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - - # We need an absolute path. - case "$dir" in - [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - absdir="$dir" - fi - ;; - esac - - # This is the magic to use -rpath. - # Skip directories that are in the system default run-time - # search path, unless they have been requested with -R. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - - lib_linked=yes - case "$hardcode_action" in - immediate | unsupported) - if test "$hardcode_direct" = no; then - compile_command="$compile_command $dir/$linklib" - deplibs="$deplibs $dir/$linklib" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - if test -n "$dllsearchpath"; then - dllsearchpath="$dllsearchpath:$dllsearchdir" - else - dllsearchpath="$dllsearchdir" - fi - ;; - esac - elif test "$hardcode_minus_L" = no; then - case "$host" in - *-*-sunos*) - compile_shlibpath="$compile_shlibpath$dir:" - ;; - esac - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$dir -l$name" - elif test "$hardcode_shlibpath_var" = no; then - case ":$compile_shlibpath:" in - *":$dir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$dir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - relink) - if test "$hardcode_direct" = yes; then - compile_command="$compile_command $absdir/$linklib" - deplibs="$deplibs $absdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$compile_command " in - *" -L$absdir "*) ;; - *) compile_command="$compile_command -L$absdir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$absdir -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$compile_shlibpath:" in - *":$absdir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$absdir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - *) - lib_linked=no - ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 - fi - - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - finalize_command="$finalize_command $libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$finalize_command " in - *" -L$libdir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$finalize_shlibpath:" in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:";; - esac - finalize_command="$finalize_command -l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - fi + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= else - # Transform directly to old archives if we don't build new libraries. - if test -n "$pic_flag" && test -z "$old_library"; then - $echo "$modename: cannot find static library for \`$arg'" 1>&2 - exit 1 - fi - - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_command="$compile_command $dir/$linklib" - finalize_command="$finalize_command $dir/$linklib" - else - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$dir";; - esac - finalize_command="$finalize_command -l$name" - fi + deplibs="$deplibs $arg" fi - - # Add in any libraries that this one depends upon. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" continue ;; @@ -1490,20 +1263,20 @@ compiler." # 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 - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; - esac + esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi - done + done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 @@ -1517,28 +1290,826 @@ compiler." finalize_command="$finalize_command $arg" fi - oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" - case "$output" in + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + 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 + fi + fi + + # Determine the type of output + case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac - *.a | *.lib) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 - exit 1 + specialdeplibs= + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + libs="$libs $deplib" + done + deplibs= + newdependency_libs= + 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" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit 1 + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test $linkmode = prog; then + # Determine which files to process + case $pass in + dlopen) + libs="$dlfiles" + save_deplibs="$deplibs" # Collect dlpreopened libraries + deplibs= + ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -l*) + if test $linkmode = oldlib && test $linkmode = obj; then + $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 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 + # Search the libtool library + lib="$searchdir/lib${name}.la" + if test -f "$lib"; then + found=yes + break + fi + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test $pass = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test $pass = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test $pass = scan; then + deplibs="$deplib $deplibs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test $pass = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test $pass = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + if test "$deplibs_check_method" != pass_all; then + echo + echo "*** Warning: This library needs some functionality provided by $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + else + echo + echo "*** Warning: Linking the shared library $output against the" + echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test $pass != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test $found = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib'" 1>&2 + exit 1 + fi - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + # Check to see that this really is a libtool archive. + if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variable installed. + installed=yes + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test $linkmode = oldlib && test $linkmode = obj; }; then + # Add dl[pre]opened files of deplib + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test $pass = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done + elif test $linkmode != prog && test $linkmode != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit 1 + fi + continue + fi # $pass = conv + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + + # This library was specified with -dlopen. + if test $pass = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. + dlprefiles="$dlprefiles $lib" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test $pass = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test $linkmode = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" + fi + continue + fi + + if test $linkmode = prog && test $pass != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test $linkalldeplibs = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + link_static=no # Whether the deplib will be linked statically + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # Link against this shared library + + if test "$linkmode,$pass" = "prog,link" || + { test $linkmode = lib && test $hardcode_into_libs = yes; }; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + if test $linkmode = prog; then + # We need to hardcode the library path + if test -n "$shlibpath_var"; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $dir" ;; + esac + fi + fi + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`echo $soroot | sed -e 's/^.*\///'` + newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + eval cmds=\"$extract_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + eval cmds=\"$old_archive_from_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n $old_archive_from_expsyms_cmds + + if test $linkmode = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit 1 + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test $linkmode = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test $linkmode = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + add="-l$name" + fi + + if test $linkmode = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test $linkmode = prog; then + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + + # Try to link the static library + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + echo "*** Warning: This library needs some functionality provided by $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** Therefore, libtool will create a static module, that should work " + echo "*** as long as the dlopening application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test $linkmode = lib; then + if test -n "$dependency_libs" && + { test $hardcode_into_libs != yes || test $build_old_libs = yes || + test $link_static = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done + + if test $link_all_deplibs != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="-L$absdir/$objdir" + else + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="-L$absdir" + fi + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$deplibs $path" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test $pass = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done fi + if test $pass != dlopen; then + test $pass != scan && dependency_libs="$newdependency_libs" + if test $pass != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + *) + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + if test "$pass" = "conv" && + { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then + libs="$deplibs" # reset libs + deplibs= + fi + done # for pass + if test $linkmode = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi @@ -1566,11 +2137,12 @@ compiler." # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" + objs="$objs$old_deplibs" ;; - *.la) + lib) # Make sure we only generate libraries of the form `libNAME.la'. - case "$outputname" in + case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" @@ -1591,26 +2163,20 @@ compiler." ;; esac - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - if test -n "$objs"; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 - exit 1 + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit 1 + else + echo + echo "*** Warning: Linking the shared library $output against the non-libtool" + echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi fi - # How the heck are we supposed to write a wrapper for a shared library? - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 - exit 1 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath @@ -1628,7 +2194,6 @@ compiler." build_libtool_libs=convenience build_old_libs=yes fi - dependency_libs="$deplibs" if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 @@ -1640,7 +2205,7 @@ compiler." else # Parse the version information argument. - IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' + save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" @@ -1655,8 +2220,8 @@ compiler." age="$4" # Check that each of the things are valid numbers. - case "$current" in - 0 | [1-9] | [1-9][0-9]*) ;; + case $current in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 @@ -1664,8 +2229,8 @@ compiler." ;; esac - case "$revision" in - 0 | [1-9] | [1-9][0-9]*) ;; + case $revision in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 @@ -1673,8 +2238,8 @@ compiler." ;; esac - case "$age" in - 0 | [1-9] | [1-9][0-9]*) ;; + case $age in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 @@ -1692,12 +2257,31 @@ compiler." major= versuffix= verstring= - case "$version_type" in + case $version_type in none) ;; + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + irix) major=`expr $current - $age + 1` - versuffix="$major.$revision" verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. @@ -1707,6 +2291,10 @@ compiler." loop=`expr $loop - 1` verstring="sgi$major.$iface:$verstring" done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" ;; linux) @@ -1736,21 +2324,11 @@ compiler." versuffix=".$current.$revision" ;; - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - windows) - # Like Linux, but with '-' rather than '.', since we only - # want one extension on Windows 95. + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. major=`expr $current - $age` - versuffix="-$major-$age-$revision" + versuffix="-$major" ;; *) @@ -1764,6 +2342,16 @@ compiler." if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring="" + ;; + *) + verstring="0.0" + ;; + esac if test "$need_version" = no; then versuffix= else @@ -1777,7 +2365,7 @@ compiler." versuffix= verstring="" fi - + # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then @@ -1789,38 +2377,12 @@ compiler." # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi - - dependency_libs="$deplibs" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - - #### local change for Sleepycat DB: [#2380] - # The following case is added, since the linker's -pthread - # option implicitly controls use of -lc or -lc_r. - *freebsd*) - # defer to whether the user wants -lc, or -lc_r - ;; - - *) - # Add libc to deplibs on all other systems. - deplibs="$deplibs -lc" - ;; - esac fi - # Create the output directory, or remove our outputs if we need to. - if test -d $output_objdir; then + if test "$mode" != relink; then + # Remove our outputs. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - else - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi fi # Now set the variables for building old libraries. @@ -1831,7 +2393,80 @@ compiler." oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi + # 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'` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test $hardcode_into_libs != yes || test $build_old_libs = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd*) + # Do not include libc due to us having libc/libc_r. + ;; + #### Local change for Sleepycat's Berkeley DB [#2380]: + # FreeBSD, like OpenBSD, uses libc/libc_r and should not + # link against libc/c_r explicitly; the -pthread linker flag + # implicitly controls use of -lc and -lc_r. + *-*-freebsd*) + # Do not include libc due to us having libc/libc_r. + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test $build_libtool_need_lc = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname @@ -1846,7 +2481,7 @@ compiler." major="" newdeplibs= droppeddeps=no - case "$deplibs_check_method" in + case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check @@ -1871,7 +2506,7 @@ EOF for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" ; then + if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches @@ -1896,7 +2531,7 @@ EOF for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" ; then + if test -n "$name" && test "$name" != "0"; then $rm conftest $CC -o conftest conftest.c $i # Did it work? @@ -1932,19 +2567,19 @@ EOF ;; file_magic*) set dummy $deplibs_check_method - file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`" + file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" ; then + if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path; do + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then - continue + continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. @@ -1954,7 +2589,7 @@ EOF potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case "$potliblink" in + case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac @@ -1982,6 +2617,40 @@ EOF fi done # Gone through all deplibs. ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + if eval echo \"$potent_lib\" 2>/dev/null \ + | sed 10q \ + | egrep "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ @@ -2004,6 +2673,13 @@ EOF libname=$libname_save name=$name_save + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + if test "$droppeddeps" = yes; then if test "$module" = yes; then echo @@ -2029,6 +2705,21 @@ EOF echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." + + if test $allow_undefined = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi fi fi # Done checking deplibs! @@ -2039,9 +2730,64 @@ EOF library_names= old_library= dlname= - + # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then + if test $hardcode_into_libs = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names @@ -2053,6 +2799,7 @@ EOF else soname="$realname" fi + test -z "$dlname" && dlname=$soname lib="$output_objdir/$realname" for link @@ -2087,7 +2834,7 @@ EOF export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" @@ -2124,7 +2871,7 @@ EOF for xlib in $convenience; do # Extract the objects. - case "$xlib" in + case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac @@ -2149,7 +2896,12 @@ EOF if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - linkopts="$linkopts $flag" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. @@ -2158,7 +2910,7 @@ EOF else eval cmds=\"$archive_cmds\" fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" @@ -2166,6 +2918,12 @@ EOF 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 $? + exit 0 + fi + # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then @@ -2182,12 +2940,7 @@ EOF fi ;; - *.lo | *.o | *.obj) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 - exit 1 - fi - + obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi @@ -2212,9 +2965,9 @@ EOF $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi - case "$output" in + case $output in *.lo) - if test -n "$objs"; then + if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi @@ -2238,7 +2991,7 @@ EOF gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec - wl= + wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then @@ -2257,7 +3010,7 @@ EOF for xlib in $convenience; do # Extract the objects. - case "$xlib" in + case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac @@ -2281,11 +3034,11 @@ EOF fi # Create the old-style object. - reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" @@ -2316,12 +3069,12 @@ EOF exit 0 fi - if test -n "$pic_flag"; then + if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" @@ -2352,8 +3105,10 @@ EOF exit 0 ;; - # Anything else should be a program. - *) + prog) + case $host in + *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; + esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi @@ -2363,20 +3118,27 @@ EOF fi if test "$preload" = yes; then - if test "$dlopen" = unknown && test "$dlopen_self" = unknown && + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi + fi fi - + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. - case "$compile_rpath " in - *" $libdir "*) ;; - *) compile_rpath="$compile_rpath $libdir" ;; - esac case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; @@ -2394,7 +3156,7 @@ EOF hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) @@ -2412,6 +3174,14 @@ EOF *) perm_rpath="$perm_rpath $libdir" ;; esac fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + ;; + esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && @@ -2430,7 +3200,7 @@ EOF hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) @@ -2457,23 +3227,6 @@ EOF fi finalize_rpath="$rpath" - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - - # Create the binary in the object directory, then wrap it. - 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 - fi - fi - if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` @@ -2490,7 +3243,7 @@ EOF fi if test -n "$dlsyms"; then - case "$dlsyms" in + case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. @@ -2522,7 +3275,7 @@ extern \"C\" { test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" @@ -2532,7 +3285,7 @@ extern \"C\" { $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi - + if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' @@ -2584,27 +3337,25 @@ extern \"C\" { #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * +# define lt_ptr void * #else -# define lt_ptr_t char * +# define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; - lt_ptr_t address; + lt_ptr address; } lt_preloaded_symbols[] = {\ " - sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ - -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ - < "$nlist" >> "$output_objdir/$dlsyms" + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr_t) 0} + {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ @@ -2621,7 +3372,7 @@ static const void *lt_preloaded_setup() { fi pic_flag_for_symtable= - case "$host" in + case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use @@ -2666,7 +3417,7 @@ static const void *lt_preloaded_setup() { finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi - if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then + if test $need_relink = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" @@ -2675,7 +3426,7 @@ static const void *lt_preloaded_setup() { $show "$link_command" $run eval "$link_command" status=$? - + # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" @@ -2689,7 +3440,7 @@ static const void *lt_preloaded_setup() { # We should set the shlibpath_var rpath= for dir in $temp_rpath; do - case "$dir" in + case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" @@ -2731,11 +3482,24 @@ static const void *lt_preloaded_setup() { fi fi + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit 0 + fi + if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" - + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else @@ -2755,7 +3519,7 @@ static const void *lt_preloaded_setup() { # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - + # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname @@ -2767,12 +3531,24 @@ static const void *lt_preloaded_setup() { # Quote the relink command for shipping. if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="cd `pwd`; $relink_command" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case "$0" in + case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac @@ -2788,6 +3564,11 @@ static const void *lt_preloaded_setup() { case $output in *.exe) output=`echo $output|sed 's,.exe$,,'` ;; esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) exeext=.exe ;; + *) exeext= ;; + esac $rm $output trap "$rm $output; exit 1" 1 2 15 @@ -2817,7 +3598,7 @@ relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: - link_against_libtool_libs='$link_against_libtool_libs' + notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then @@ -2850,7 +3631,7 @@ else # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi @@ -2866,9 +3647,9 @@ else if test "$fast_install" = yes; then echo >> $output "\ - program=lt-'$outputname' + program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" - + if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then @@ -2885,8 +3666,9 @@ else # relink executable if necessary if test -n \"\$relink_command\"; then - if (cd \"\$thisdir\" && eval \$relink_command); then : + if relink_command_output=\`eval \$relink_command 2>&1\`; then : else + $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi @@ -2935,9 +3717,9 @@ else # Run the actual program with our arguments. " case $host in - # win32 systems need to use the prog path for dll - # lookup to work - *-*-cygwin*) + # win32 systems need to use the prog path for dll + # lookup to work + *-*-cygwin* | *-*-pw32*) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " @@ -2991,7 +3773,7 @@ fi\ oldobjs="$libobjs_save" build_libtool_libs=no else - oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` + oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi @@ -3007,11 +3789,11 @@ fi\ exit $status fi generated="$generated $gentop" - + # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. - case "$xlib" in + case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac @@ -3057,7 +3839,7 @@ fi\ eval cmds=\"$old_archive_cmds\" fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" @@ -3072,19 +3854,26 @@ fi\ fi # Now create the libtool archive. - case "$output" in + case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" - if test -n "$xrpath"; then - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - done - dependency_libs="$temp_xrpath $dependency_libs" - fi + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. if test -z "$run"; then @@ -3094,8 +3883,52 @@ fi\ break fi output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" fi $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP @@ -3104,7 +3937,7 @@ fi\ # It is necessary for linking the library. # The name that we can dlopen(3). -dlname='$dlname' +dlname='$tdlname' # Names of this library. library_names='$library_names' @@ -3123,16 +3956,23 @@ revision=$revision # Is this an already installed library? installed=$installed +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + # Directory that this library needs to be installed in: -libdir='$install_libdir'\ -" +libdir='$install_libdir'" + if test "$installed" = no && test $need_relink = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 @@ -3144,10 +3984,12 @@ libdir='$install_libdir'\ # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then + 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 # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case "$arg" in + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; @@ -3163,7 +4005,7 @@ libdir='$install_libdir'\ # 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 + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; @@ -3186,7 +4028,7 @@ libdir='$install_libdir'\ continue fi - case "$arg" in + case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; @@ -3211,7 +4053,7 @@ libdir='$install_libdir'\ # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in + case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; @@ -3262,11 +4104,11 @@ libdir='$install_libdir'\ exit 1 fi fi - case "$destdir" in + case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do - case "$file" in + case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 @@ -3288,8 +4130,8 @@ libdir='$install_libdir'\ for file in $files; do # Do each installation. - case "$file" in - *.a | *.lib) + case $file in + *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; @@ -3305,8 +4147,9 @@ libdir='$install_libdir'\ library_names= old_library= + relink_command= # If there is no directory component, then add one. - case "$file" in + case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac @@ -3325,10 +4168,20 @@ libdir='$install_libdir'\ esac fi - dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" + if test -n "$relink_command"; then + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + continue + fi + fi + # See the names of the shared library. set dummy $library_names if test -n "$2"; then @@ -3336,9 +4189,16 @@ libdir='$install_libdir'\ shift shift + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + # Install the shared library and build the symlinks. - $show "$install_prog $dir/$realname $destdir/$realname" - $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi if test $# -gt 0; then # Delete the old symlinks, and create new ones. @@ -3354,7 +4214,7 @@ libdir='$install_libdir'\ # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" @@ -3385,11 +4245,11 @@ libdir='$install_libdir'\ fi # Deduce the name of the destination old-style object file. - case "$destfile" in + case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; - *.o | *.obj) + *.$objext) staticdest="$destfile" destfile= ;; @@ -3428,39 +4288,46 @@ libdir='$install_libdir'\ # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - link_against_libtool_libs= + notinst_deplibs= relink_command= # If there is no directory component, then add one. - case "$file" in + case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Check the variables that should have been set. - if test -z "$link_against_libtool_libs"; then + if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes - for lib in $link_against_libtool_libs; do + for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. - case "$lib" in + case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi - libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then @@ -3472,6 +4339,7 @@ libdir='$install_libdir'\ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi + file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` @@ -3493,6 +4361,23 @@ libdir='$install_libdir'\ fi fi + # remove .exe since cygwin /usr/bin/install will append another + # one anyways + case $install_prog,$host in + /usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`echo $destfile | sed -e 's,.exe$,,'` + ;; + esac + ;; + esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" @@ -3509,9 +4394,14 @@ libdir='$install_libdir'\ $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" @@ -3527,11 +4417,10 @@ libdir='$install_libdir'\ if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" - exec $SHELL $0 --finish$current_libdirs - exit 1 + exec_cmd='$SHELL $0 --finish$current_libdirs' + else + exit 0 fi - - exit 0 ;; # libtool finish mode @@ -3550,7 +4439,7 @@ libdir='$install_libdir'\ if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" @@ -3569,7 +4458,7 @@ libdir='$install_libdir'\ fi # Exit here if they wanted silent mode. - test "$show" = : && exit 0 + test "$show" = ":" && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" @@ -3579,7 +4468,7 @@ libdir='$install_libdir'\ echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use \`-LLIBDIR'" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" @@ -3629,7 +4518,7 @@ libdir='$install_libdir'\ fi dir= - case "$file" in + case $file in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : @@ -3644,7 +4533,7 @@ libdir='$install_libdir'\ library_names= # If there is no directory component, then add one. - case "$file" in + case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac @@ -3699,13 +4588,13 @@ libdir='$install_libdir'\ args= for file do - case "$file" in + case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. - case "$file" in + case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac @@ -3722,8 +4611,8 @@ libdir='$install_libdir'\ if test -z "$run"; then if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" + # Export the shlibpath_var. + eval "export $shlibpath_var" fi # Restore saved enviroment variables @@ -3734,31 +4623,35 @@ libdir='$install_libdir'\ LANG="$save_LANG"; export LANG fi - # Now actually exec the command. - eval "exec \$cmd$args" - - $echo "$modename: cannot exec \$cmd$args" - exit 1 + # Now prepare to actually exec the command. + exec_cmd='"$cmd"$args' else # Display what would be done. if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; - # libtool uninstall mode - uninstall) - modename="$modename: uninstall" + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" rm="$nonopt" files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" for arg do - case "$arg" in + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac @@ -3770,14 +4663,42 @@ libdir='$install_libdir'\ exit 1 fi + rmdirs= + for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. + if test "X$dir" = "X$file"; then + dir=. + objdir="$objdir" + else + objdir="$dir/$objdir" + fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test $mode = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test $mode = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi rmfiles="$file" - case "$name" in + case $name in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then @@ -3785,38 +4706,43 @@ libdir='$install_libdir'\ # Delete the libtool libraries and symlinks. for n in $library_names; do - rmfiles="$rmfiles $dir/$n" + rmfiles="$rmfiles $objdir/$n" done - test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - $show "$rm $rmfiles" - $run $rm $rmfiles - - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + if test $mode = uninstall; then + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + eval cmds=\"$postuninstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test $? != 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" - fi + fi - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + eval cmds=\"$old_postuninstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test $? != 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. fi - - # FIXME: should reinstall the best remaining shared library. fi ;; @@ -3825,17 +4751,35 @@ libdir='$install_libdir'\ oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi - $show "$rm $rmfiles" - $run $rm $rmfiles ;; *) - $show "$rm $rmfiles" - $run $rm $rmfiles + # Do a test to see if this is a libtool program. + if test $mode = clean && + (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$file + + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + fi ;; esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 done - exit 0 + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status ;; "") @@ -3845,13 +4789,20 @@ libdir='$install_libdir'\ ;; esac - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + fi fi # test -z "$show_help" +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit 1 +fi + # We need to display help for each of the modes. -case "$mode" in +case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... @@ -3870,6 +4821,7 @@ Provide generalized library-building support services. MODE must be one of the following: + clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries @@ -3882,6 +4834,20 @@ a more detailed description of MODE." exit 0 ;; +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE @@ -3891,6 +4857,8 @@ Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file @@ -3969,7 +4937,10 @@ The following components of LINK-COMMAND are treated specially: try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME + -jnimodule build a library that can dlopened via Java JNI -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information @@ -4026,4 +4997,3 @@ exit 0 # mode:shell-script # sh-indentation:2 # End: -#! /bin/bash diff --git a/bdb/dist/pubdef.in b/bdb/dist/pubdef.in new file mode 100644 index 00000000000..f42363022cd --- /dev/null +++ b/bdb/dist/pubdef.in @@ -0,0 +1,350 @@ +# Name +# D == documentation +# I == include file +# C == Java case value (declared and initialized) +# J == Java constant (declared only) +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_IN_RENAME * 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_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_AUTO_COMMIT D I J +DB_BEFORE D I J +DB_BTREE D I C +DB_BTREEMAGIC * I * +DB_BTREEOLDVER * I * +DB_BTREEVERSION * I * +DB_CACHED_COUNTS * I J +DB_CDB_ALLDB D I J +DB_CHKSUM_SHA1 D I J +DB_CLIENT D I J +DB_COMMIT * 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 J +DB_DBM_HSEARCH * I * +DB_DBT_APPMALLOC D I * +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 J +DB_DBT_USERMEM D I J +DB_DELETED * I * +DB_DIRECT D I J +DB_DIRECT_DB D I J +DB_DIRECT_LOG D I J +DB_DIRTY_READ D I J +DB_DONOTINDEX D I C +DB_DUP D I J +DB_DUPSORT D I J +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_FATAL * I * +DB_ENV_LOCKDOWN * 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_REP_CLIENT * I * +DB_ENV_REP_LOGSONLY * I * +DB_ENV_REP_MASTER * I * +DB_ENV_RPCCLIENT * I * +DB_ENV_RPCCLIENT_GIVEN * I * +DB_ENV_SYSTEM_MEM * I * +DB_ENV_THREAD * 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 C +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_TXN D I J +DB_JAVA_CALLBACK * I * +DB_JOINENV D I J +DB_JOIN_ITEM D I J +DB_JOIN_NOSORT D I J +DB_KEYEMPTY D I C +DB_KEYEXIST D I C +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_DEADLOCK D I C +DB_LOCK_DEFAULT D I J +DB_LOCK_DIRTY * I * +DB_LOCK_DUMP * I * +DB_LOCK_EXPIRE D I J +DB_LOCK_FREE_LOCKER * I * +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_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 C +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_DISK * I * +DB_LOG_LOCKED * I * +DB_LOG_SILENT_ERR * I * +DB_LSTAT_ABORTED * I * +DB_LSTAT_ERR * 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_LAST D I * +DB_MPOOL_NEW D I * +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_NOCOPY * I * +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 C +DB_NOSERVER_HOME D I C +DB_NOSERVER_ID D I C +DB_NOSYNC D I J +DB_NOTFOUND D I C +DB_ODDFILESIZE D I J +DB_OK_BTREE * I * +DB_OK_HASH * I * +DB_OK_QUEUE * I * +DB_OK_RECNO * I * +DB_OLD_VERSION D I C +DB_OPFLAGS_MASK * I * +DB_ORDERCHKONLY D I J +DB_OVERWRITE D I J +DB_PAGE_LOCK * I * +DB_PAGE_NOTFOUND D I C +DB_PANIC_ENVIRONMENT D I J +DB_PERMANENT * I * +DB_POSITION D I J +DB_POSITIONI * I * +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 C +DB_RDONLY D I J +DB_RDWRMASTER * I * +DB_RECNO D I C +DB_RECNUM D I J +DB_RECORDCOUNT * 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_RENAMEMAGIC * I * +DB_RENUMBER D I J +DB_REP_CLIENT D I J +DB_REP_DUPMASTER D I C +DB_REP_HOLDELECTION D I C +DB_REP_LOGSONLY D I J +DB_REP_MASTER D I J +DB_REP_NEWMASTER D I C +DB_REP_NEWSITE D I C +DB_REP_OUTDATED D I C +DB_REP_PERMANENT D I J +DB_REP_UNAVAIL D I J +DB_REVSPLITOFF D I J +DB_RMW D I J +DB_RUNRECOVERY D I C +DB_SALVAGE D I J +DB_SECONDARY_BAD D I C +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_NOW * I * +DB_SET_TXN_TIMEOUT D I J +DB_SNAPSHOT D I J +DB_STAT_CLEAR D I J +DB_SURPRISE_KID * I * +DB_SWAPBYTES * I * +DB_SYSTEM_MEM D I J +DB_TEST_ELECTINIT * I * +DB_TEST_ELECTSEND * I * +DB_TEST_ELECTVOTE1 * I * +DB_TEST_ELECTVOTE2 * I * +DB_TEST_ELECTWAIT1 * I * +DB_TEST_ELECTWAIT2 * 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_TRUNCATE D I J +DB_TXNVERSION * I * +DB_TXN_ABORT D I C +DB_TXN_APPLY D I C +DB_TXN_BACKWARD_ALLOC * I * +DB_TXN_BACKWARD_ROLL D I C +DB_TXN_CKP * I * +DB_TXN_FORWARD_ROLL D I C +DB_TXN_GETPGNOS * I * +DB_TXN_LOCK * I * +DB_TXN_NOSYNC D I J +DB_TXN_NOWAIT D I J +DB_TXN_OPENFILES * I * +DB_TXN_POPENFILES * I * +DB_TXN_PRINT D I C +DB_TXN_SYNC D I J +DB_TXN_WRITE_NOSYNC D I J +DB_UNDO * I * +DB_UNKNOWN D I C +DB_UPDATE_SECONDARY * I * +DB_UPGRADE D I J +DB_USE_ENVIRON D I J +DB_USE_ENVIRON_ROOT D I J +DB_VERB_CHKPOINT 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 C +DB_VERIFY_FATAL * I * +DB_VERSION_MAJOR * I J +DB_VERSION_MINOR * I J +DB_VERSION_PATCH * I J +DB_VERSION_STRING * I * +DB_WRITECURSOR D I J +DB_WRITELOCK * I * +DB_WRITEOPEN * I * +DB_WRNOSYNC * I * +DB_XA_CREATE D I J +DB_XIDDATASIZE D I J +DB_YIELDCPU D I J diff --git a/bdb/dist/s_all b/bdb/dist/s_all index dab6c75913b..c0e3ac72f3a 100644 --- a/bdb/dist/s_all +++ b/bdb/dist/s_all @@ -1,16 +1,21 @@ #!/bin/sh - -# $Id: s_all,v 1.7 2000/12/22 15:35:32 bostic Exp $ +# $Id: s_all,v 1.10 2001/08/04 14:01:44 bostic Exp $ sh s_perm # permissions. sh s_symlink # symbolic links. -sh s_config # autoconf. sh s_readme # db/README file. + +# +# The following order is important, s_include must run last. +# +sh s_config # autoconf. 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_vxworks # VxWorks include files. sh s_java # Java support. -sh s_tcl # Tcl support. +sh s_test # Test suite support. sh s_tags # Tags files. diff --git a/bdb/dist/s_config b/bdb/dist/s_config index 870109c38f9..3e033da81ab 100755 --- a/bdb/dist/s_config +++ b/bdb/dist/s_config @@ -1,15 +1,16 @@ #!/bin/sh - -# $Id: s_config,v 1.3 2000/07/13 18:38:46 bostic Exp $ +# $Id: s_config,v 1.9 2002/05/20 19:18:13 bostic Exp $ # # Build the autoconfiguration files. -msgm4="dnl DO NOT EDIT: automatically built by dist/s_config." +trap 'rm -f aclocal.m4 ; exit 0' 0 1 2 3 13 15 + +msgac="# DO NOT EDIT: automatically built by dist/s_config." . ./RELEASE echo "Building aclocal.m4" -rm -f aclocal.m4 -(echo "$msgm4" && +(echo "$msgac" && echo "AC_DEFUN(AM_VERSION_SET, [" && echo "AC_SUBST(DB_VERSION_MAJOR)" && echo "DB_VERSION_MAJOR=$DB_VERSION_MAJOR" && @@ -17,21 +18,28 @@ rm -f aclocal.m4 echo "DB_VERSION_MINOR=$DB_VERSION_MINOR" && echo "AC_SUBST(DB_VERSION_PATCH)" && echo "DB_VERSION_PATCH=$DB_VERSION_PATCH" && + echo "AC_SUBST(DB_VERSION_UNIQUE_NAME)" && + echo "DB_VERSION_UNIQUE_NAME=$DB_VERSION_UNIQUE_NAME" && echo "AC_SUBST(DB_VERSION_STRING)" && echo "DB_VERSION_STRING=\"\\\"$DB_VERSION_STRING\\\"\"" && - echo "])dnl" && - cat aclocal/*.m4) > aclocal.m4 -chmod 444 aclocal.m4 + echo "])" && + cat aclocal/*.ac aclocal_java/*.ac) > aclocal.m4 +echo "Running autoheader to build config.hin" rm -f config.hin -echo "Building config.hin (autoheader)" -(autoheader configure.in > config.hin) 2>&1 | \ - sed '/warning: AC_TRY_RUN called without default/d' +autoheader chmod 444 config.hin +echo "Running autoconf to build configure" rm -f configure -echo "Building configure (autoconf)" -autoconf 2>&1 | sed '/warning: AC_TRY_RUN called without default/d' +autoconf -chmod 555 configure config.guess config.sub install-sh -rm -f aclocal.m4 +# Edit version information we couldn't pre-compute. +(echo "1,\$s/__EDIT_DB_VERSION__/$DB_VERSION/g" && + echo "w" && + echo "q") | ed configure + +rm -rf autom4te.cache +chmod 555 configure + +chmod 555 config.guess config.sub install-sh diff --git a/bdb/dist/s_crypto b/bdb/dist/s_crypto new file mode 100644 index 00000000000..be7e5de0474 --- /dev/null +++ b/bdb/dist/s_crypto @@ -0,0 +1,57 @@ +#!/bin/sh - +# $Id: s_crypto,v 11.5 2002/09/13 13:14:14 bostic Exp $ + +# Remove crypto from the DB source tree. + +d=.. + +t=/tmp/__db_a +trap 'rm -f $t ; exit 0' 0 +trap 'rm -f $t ; exit 1' 1 2 3 13 15 + +if ! test -d $d/crypto; then + echo "s_crypto: no crypto sources found in the source tree." + exit 1 +fi + +# Remove the crypto. +rm -rf $d/crypto + +# Update the docs. +f=$d/docs/ref/env/encrypt.html +chmod 664 $f +(echo '/DOES/' && + echo 's/DOES/DOES NOT/' && + echo 'w' && + echo 'q') | ed $f + +# Win/32. +f=win_config.in +chmod 664 $f +(echo '/#define.HAVE_CRYPTO/' && + echo 'c' && + echo '/* #undef HAVE_CRYPTO */' + echo '.' && + echo 'w' && + echo 'q') | ed $f + +f=srcfiles.in +chmod 664 $f +(echo 'g/^crypto\//d' && + echo 'w' && + echo 'q') | ed $f + + sh ./s_win32 + sh ./s_win32_dsp + +# VxWorks +f=vx_config.in +chmod 664 $f +(echo '/#define.HAVE_CRYPTO/' && + echo 'c' && + echo '/* #undef HAVE_CRYPTO */' + echo '.' && + echo 'w' && + echo 'q') | ed $f + + sh ./s_vxworks diff --git a/bdb/dist/s_include b/bdb/dist/s_include index fee6e50330f..44bfce30ee7 100755 --- a/bdb/dist/s_include +++ b/bdb/dist/s_include @@ -1,33 +1,160 @@ #!/bin/sh - -# $Id: s_include,v 1.7 2000/07/13 18:38:46 bostic Exp $ +# $Id: s_include,v 1.19 2002/03/27 04:31:50 bostic Exp $ # # Build the automatically generated function prototype files. msgc="/* DO NOT EDIT: automatically built by dist/s_include. */" -cxx_if="#if defined(__cplusplus)" -cxx_head="extern \"C\" {" -cxx_foot="}" -cxx_endif="#endif" -tmp=/tmp/__db_inc.$$ -trap 'rm -f $tmp ; exit 0' 0 1 2 3 13 15 +. ./RELEASE -for i in db btree clib common env hash \ - lock log mp mutex os qam rpc_client rpc_server tcl txn xa; do - f=../include/${i}_ext.h - (echo "$msgc" && - echo "#ifndef _${i}_ext_h_" && - echo "#define _${i}_ext_h_" && - echo "$cxx_if" && - echo "$cxx_head" && - echo "$cxx_endif" && - sed -n "s/^ \* PUBLIC:[ ]\(.*\)/\1/p" ../$i/*.c; - [ $i = os ] && - sed -n "s/^ \* PUBLIC:[ ]\(.*\)/\1/p" ../os_win32/*.c; - echo "$cxx_if" && - echo "$cxx_foot" && - echo "$cxx_endif" && - echo "#endif /* _${i}_ext_h_ */") > $tmp - cmp $tmp $f > /dev/null 2>&1 || - (echo "Building $f" && rm -f $f && cp $tmp $f && chmod 444 $f) +head() +{ + defonly=0 + while : + do case "$1" in + space) + echo ""; shift;; + defonly) + defonly=1; shift;; + *) + name="$1"; break;; + esac + done + + echo "$msgc" + echo "#ifndef $name" + echo "#define $name" + echo "" + if [ $defonly -eq 0 ]; then + echo "#if defined(__cplusplus)" + echo "extern \"C\" {" + echo "#endif" + echo "" + fi +} + +tail() +{ + defonly=0 + while : + do case "$1" in + defonly) + defonly=1; shift;; + *) + name="$1"; break;; + esac + done + + echo "" + if [ $defonly -eq 0 ]; then + echo "#if defined(__cplusplus)" + echo "}" + echo "#endif" + fi + echo "#endif /* !$name */" +} + +# We are building several files: +# 1 external #define file +# 1 external prototype file +# 1 internal #define file +# N internal prototype files +e_dfile=/tmp/__db_c.$$ +e_pfile=/tmp/__db_a.$$ +i_dfile=/tmp/__db_d.$$ +i_pfile=/tmp/__db_b.$$ +trap 'rm -f $e_dfile $e_pfile $i_dfile $i_pfile; exit 0' 0 1 2 3 13 15 + +head defonly space _DB_EXT_DEF_IN_ > $e_dfile +head space _DB_EXT_PROT_IN_ > $e_pfile +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 tcl txn xa; do + head "_${i}_ext_h_" > $i_pfile + + f="../$i/*.c" + [ $i = os ] && f="$f ../os_win32/*.c" + [ $i = rpc_server ] && f="../$i/c/*.c" + [ $i = crypto ] && f="../$i/*.c ../$i/*/*.c" + awk -f gen_inc.awk \ + -v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \ + -v e_dfile=$e_dfile \ + -v e_pfile=$e_pfile \ + -v i_dfile=$i_dfile \ + -v i_pfile=$i_pfile $f + + tail "_${i}_ext_h_" >> $i_pfile + + f=../dbinc_auto/${i}_ext.h + cmp $i_pfile $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $i_pfile $f && chmod 444 $f) done + +# Process directories which only add to the external prototype and #define +# files. +for i in dbm hsearch; do + f="../$i/*.c" + awk -f gen_inc.awk \ + -v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \ + -v e_dfile=$e_dfile \ + -v e_pfile=$e_pfile \ + -v i_dfile="" \ + -v i_pfile="" $f +done + +# RPC uses rpcgen to generate a header file; post-process it to add more +# interfaces to the internal #define file. +sed -e '/extern bool_t xdr___/{' \ + -e 's/.* //' \ + -e 's/();//' \ + -e 's/.*/#define & &@DB_VERSION_UNIQUE_NAME@/' \ + -e 'p' \ + -e '}' \ + -e d < ../dbinc_auto/db_server.h >> $i_dfile + +# 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 + +# Wrap up the external #defines/prototypes, and internal #defines. +tail defonly _DB_EXT_DEF_IN_ >> $e_dfile +f=../dbinc_auto/ext_def.in +cmp $e_dfile $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $e_dfile $f && chmod 444 $f) + +tail _DB_EXT_PROT_IN_ >> $e_pfile +f=../dbinc_auto/ext_prot.in +cmp $e_pfile $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $e_pfile $f && chmod 444 $f) + +tail defonly _DB_INT_DEF_IN_ >> $i_dfile +f=../dbinc_auto/int_def.in +cmp $i_dfile $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $i_dfile $f && chmod 444 $f) + +# DB185 compatibility support. +head space defonly _DB_EXT_185_DEF_IN_ > $e_dfile +head space _DB_EXT_185_PROT_IN_ > $e_pfile + +f="../db185/*.c" +awk -f gen_inc.awk \ + -v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \ + -v e_dfile=$e_dfile \ + -v e_pfile=$e_pfile \ + -v i_dfile="" \ + -v i_pfile="" $f + +tail defonly _DB_EXT_185_DEF_IN_ >> $e_dfile +f=../dbinc_auto/ext_185_def.in +cmp $e_dfile $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $e_dfile $f && chmod 444 $f) + +tail _DB_EXT_185_PROT_IN_ >> $e_pfile +f=../dbinc_auto/ext_185_prot.in +cmp $e_pfile $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $e_pfile $f && chmod 444 $f) diff --git a/bdb/dist/s_java b/bdb/dist/s_java index f324678abaa..2a65da60a73 100755 --- a/bdb/dist/s_java +++ b/bdb/dist/s_java @@ -1,31 +1,273 @@ #!/bin/sh - -# $Id: s_java,v 1.3 2000/07/13 18:38:46 bostic Exp $ +# $Id: s_java,v 1.13 2002/09/09 20:47:30 bostic Exp $ # # Build the Java files. -msgcxx="// DO NOT EDIT: automatically built by dist/s_java." +msgjava="/* DO NOT EDIT: automatically built by dist/s_java. */" . RELEASE -f=../java/src/com/sleepycat/db/DbConstants.java -echo "Building $f" -rm -f $f -(echo "$msgcxx" && \ +t=/tmp/__java +c=/tmp/__javajnic +h=/tmp/__javajnih +trap 'rm -f $t $c $h; exit 0' 0 1 2 3 13 15 + +# Build DbConstants.java. +(echo "$msgjava" && echo && echo 'package com.sleepycat.db;' && echo && - echo 'public class DbConstants' && + echo 'class DbConstants' && echo '{' && - egrep '^#define.DB_' ../include/db.src | \ - sed -e '/"/d' \ - -e '/@DB_VERSION_/d' \ - -e '/DB_REDO/d' \ - -e '/DB_UNDO/d' \ - -e 's/[()]/ /g' \ + for i in `egrep '^DB_.*J$' pubdef.in | awk '{print $1}'`; do \ + egrep -w "^#define[ ]$i|^[ ][ ]*$i" ../dbinc/db.in; \ + done | + sed -e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/" \ + -e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/" \ + -e "s/@DB_VERSION_PATCH@/$DB_VERSION_PATCH/" \ + -e 's/^#define[ ][ ]*//' \ + -e 's/[()=,]/ /g' \ -e 's/\/\*/ /' | \ - awk '{ print "\tpublic static final int " $2 " = " $3 ";" }' && - echo " public static final int DB_VERSION_MAJOR = $DB_VERSION_MAJOR;" && - echo " public static final int DB_VERSION_MINOR = $DB_VERSION_MINOR;" && - echo " public static final int DB_VERSION_PATCH = $DB_VERSION_PATCH;" && - echo '}') > $f -chmod 444 $f + awk '{ print " static final int " $1 " = " $2 ";" }' && + echo '}' && + echo && + echo '// end of DbConstants.java') > $t + +f=../java/src/com/sleepycat/db/DbConstants.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build Db.java. +f=../java/src/com/sleepycat/db/Db.java +sed '/BEGIN-JAVA-SPECIAL-CONSTANTS/q' < $f > $t +(echo " $msgjava" && + for i in `egrep '^DB_.*C$' pubdef.in | awk '{print $1}'`; do \ + egrep -w "^#define[ ]$i|^[ ][ ]*$i" ../dbinc/db.in; \ + done | + sed -e 's/^#define[ ][ ]*//' \ + -e 's/[()=,]/ /g' | + awk '{ print " public static final int " $1 " = " $2 ";" }') >> $t +(for i in `egrep '^DB_.*J$' pubdef.in | awk '{print $1}'`; do \ + egrep -w "^#define[ ]$i|^[ ][ ]*$i" ../dbinc/db.in; \ + done | + sed -e 's/^#define[ ][ ]*//' \ + -e 's/[()=,]/ /g' | + awk '{ print " public static final int " $1 ";" }') >> $t +sed -n \ + '/END-JAVA-SPECIAL-CONSTANTS/,/BEGIN-JAVA-CONSTANT-INITIALIZATION/p' \ + < $f >> $t +(echo " $msgjava" && + for i in `egrep '^DB_.*J$' pubdef.in | awk '{print $1}'`; do \ + egrep -w "^#define[ ]$i|^[ ][ ]*$i" ../dbinc/db.in; \ + done | + sed -e 's/^#define[ ][ ]*//' \ + -e 's/[()=,]/ /g' \ + -e 's/\/\*/ /' | \ + awk '{ print " " $1 " = DbConstants." $1 ";" }') >> $t +sed -n '/END-JAVA-CONSTANT-INITIALIZATION/,$p' < $f >> $t + +f=../java/src/com/sleepycat/db/Db.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Script to convert DB C structure declarations into Java declarations. +jclass() +{ + cat ../dbinc/db.in | + sed -n \ + -e "/struct $1 {/,/^}/{" \ + -e "/$1/d" \ + -e '/;/!d' \ + -e '/^}/d' \ + -e '/char[ ]*\*/{' \ + -e "s/^[ ]*[^\*]*\*[ ]*\([^;]*\).*/$2 public String \1;/p"\ + -e 'd' \ + -e '}' \ + -e '/time_t/{' \ + -e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/$2 public long \1;/p" \ + -e 'd' \ + -e '}' \ + -e '/DB_LSN[ ]*/{' \ + -e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/$2 public DbLsn \1;/p"\ + -e 'd' \ + -e '}' \ + -e '/DB_TXN_ACTIVE[ ]*\*/{' \ + -e "s/^[ ]*[^\*]*\*[ ]*\([^;]*\).*/$2 public Active \1[];/p"\ + -e 'd' \ + -e '}' \ + -e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/$2 public int \1;/p" \ + -e '}' +} + +# Script to convert DB C structure declarations into Java declarations. +jclass_jni() +{ + c=$3 + h=$4 + echo "extern int $2(JNIEnv *jnienv, jclass cl, jobject jobj, struct $1 *statp);" >> $h + echo "int $2(JNIEnv *jnienv, jclass cl," >> $c + echo " jobject jobj, struct $1 *statp) {" >> $c + cat ../dbinc/db.in | + sed -n \ + -e "/struct $1 {/,/^}/{" \ + -e "/$1/d" \ + -e '/;/!d' \ + -e '/^}/d' \ + -e '/char[ ]*\*/{' \ + -e "s/^[ ]*[^\*]*\*[ ]*\([^;]*\).*/ JAVADB_STAT_STRING(jnienv, cl, jobj, statp, \1);/p"\ + -e 'd' \ + -e '}' \ + -e '/time_t/{' \ + -e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/ JAVADB_STAT_LONG(jnienv, cl, jobj, statp, \1);/p" \ + -e 'd' \ + -e '}' \ + -e '/DB_LSN[ ]*/{' \ + -e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/ JAVADB_STAT_LSN(jnienv, cl, jobj, statp, \1);/p"\ + -e 'd' \ + -e '}' \ + -e '/DB_TXN_ACTIVE[ ]*\*/{' \ + -e "s/^[ ]*[^\*]*\*[ ]*\([^;]*\).*/ JAVADB_STAT_ACTIVE(jnienv, cl, jobj, statp, \1);/p"\ + -e 'd' \ + -e '}' \ + -e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/ JAVADB_STAT_INT(jnienv, cl, jobj, statp, \1);/p" \ + -e '}' >> $c + echo ' return (0);' >> $c + echo '}' >> $c +} + +echo "$msgjava" >> $c +echo "$msgjava" >> $h +echo '#include "java_util.h"' >> $c + +# Build DbBtreeStat.java +(echo "$msgjava" && + echo && + echo 'package com.sleepycat.db;' && + echo && + echo "public class DbBtreeStat" + echo '{' + jclass __db_bt_stat && + echo '}' && + echo '// end of DbBtreeStat.java') > $t +jclass_jni __db_bt_stat __jv_fill_bt_stat $c $h +f=../java/src/com/sleepycat/db/DbBtreeStat.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build DbHashStat.java +(echo "$msgjava" && + echo && + echo 'package com.sleepycat.db;' && + echo && + echo "public class DbHashStat" + echo '{' + jclass __db_h_stat && + echo '}' && + echo '// end of DbHashStat.java') > $t +jclass_jni __db_h_stat __jv_fill_h_stat $c $h +f=../java/src/com/sleepycat/db/DbHashStat.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build DbLockStat.java +(echo "$msgjava" && + echo && + echo 'package com.sleepycat.db;' && + echo && + echo "public class DbLockStat" + echo '{' + jclass __db_lock_stat && + echo '}' && + echo '// end of DbLockStat.java') > $t +jclass_jni __db_lock_stat __jv_fill_lock_stat $c $h +f=../java/src/com/sleepycat/db/DbLockStat.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build DbLogStat.java +(echo "$msgjava" && + echo && + echo 'package com.sleepycat.db;' && + echo && + echo "public class DbLogStat" + echo '{' + jclass __db_log_stat && + echo '}' && + echo '// end of DbLogStat.java') > $t +jclass_jni __db_log_stat __jv_fill_log_stat $c $h +f=../java/src/com/sleepycat/db/DbLogStat.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build DbMpoolFStat.java +(echo "$msgjava" && + echo && + echo 'package com.sleepycat.db;' && + echo && + echo "public class DbMpoolFStat" + echo '{' + jclass __db_mpool_fstat && + echo '}' && + echo '// end of DbMpoolFStat.java') > $t +jclass_jni __db_mpool_stat __jv_fill_mpool_stat $c $h +f=../java/src/com/sleepycat/db/DbMpoolFStat.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build DbQueueStat.java +(echo "$msgjava" && + echo && + echo 'package com.sleepycat.db;' && + echo && + echo "public class DbQueueStat" + echo '{' + jclass __db_qam_stat && + echo '}' && + echo '// end of DbQueueStat.java') > $t +jclass_jni __db_qam_stat __jv_fill_qam_stat $c $h +f=../java/src/com/sleepycat/db/DbQueueStat.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build DbRepStat.java +(echo "$msgjava" && + echo && + echo 'package com.sleepycat.db;' && + echo && + echo "public class DbRepStat" + echo '{' + jclass __db_rep_stat && + echo '}' && + echo '// end of DbRepStat.java') > $t +jclass_jni __db_rep_stat __jv_fill_rep_stat $c $h +f=../java/src/com/sleepycat/db/DbRepStat.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build DbTxnStat.java +(echo "$msgjava" && + echo && + echo 'package com.sleepycat.db;' && + echo && + echo "public class DbTxnStat" + echo '{' + echo " public static class Active {" + jclass __db_txn_active " " && + echo ' };' && + jclass __db_txn_stat && + echo '}' && + echo '// end of DbTxnStat.java') > $t +jclass_jni __db_txn_stat __jv_fill_txn_stat $c $h +f=../java/src/com/sleepycat/db/DbTxnStat.java +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +mv $c $t +f=../libdb_java/java_stat_auto.c +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +mv $h $t +f=../libdb_java/java_stat_auto.h +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) diff --git a/bdb/dist/s_javah b/bdb/dist/s_javah new file mode 100755 index 00000000000..480856e4b5c --- /dev/null +++ b/bdb/dist/s_javah @@ -0,0 +1,55 @@ +#!/bin/sh - +# $Id: s_javah,v 1.1 2002/08/14 17:14:24 dda Exp $ +# +# Use javah to build the libdb_java/com_*.h header files. +# +# To run this, you will need a javac and javah in your PATH. +# If possible, install tools with a recent vintage, JDK 1.3 or higher is good. +# Using Sun's JDK rather than some other installation ensures +# that the header files will not be constantly changed. + +. RELEASE + +JAVAC=javac +JAVAH=javah +export CLASSPATH +CLASSPATH= + +# CLASSES are only those classes for which we have native methods. +D=com.sleepycat.db +CLASSES="$D.Dbc $D.DbEnv $D.Db $D.DbLock $D.DbLogc $D.DbLsn $D.Dbt $D.DbTxn $D.xa.DbXAResource" + +d=/tmp/__javah +c=$d/classes +trap 'rm -rf $d; exit 0' 0 1 2 3 13 15 + +rm -rf $d +mkdir $d || exit 1 +mkdir $c || exit 1 + +# Make skeleton versions of XA classes and interfaces +# We only need to compile them, not run them. +pkg="package javax.transaction.xa" +echo "$pkg; public interface XAResource {}" > $d/XAResource.java +echo "$pkg; public interface Xid {}" > $d/Xid.java +echo "$pkg; public class XAException extends Exception {}" \ + > $d/XAException.java + + +# Create the .class files and use them with javah to create the .h files +${JAVAC} -d $c $d/*.java \ + ../java/src/com/sleepycat/db/*.java \ + ../java/src/com/sleepycat/db/xa/*.java || exit 1 +${JAVAH} -classpath $c -d $d ${CLASSES} || exit 1 + +for cl in ${CLASSES}; do + h=`echo $cl | sed -e 's/\./_/g'`.h + t=$d/$h + f=../libdb_java/$h + if [ ! -f $t ]; then + echo "ERROR: $t does not exist" + exit 1 + fi + cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) +done diff --git a/bdb/dist/s_perm b/bdb/dist/s_perm index 4b0997f2f55..03cc4a35a8a 100755 --- a/bdb/dist/s_perm +++ b/bdb/dist/s_perm @@ -1,37 +1,47 @@ #!/bin/sh - -# $Id: s_perm,v 1.9 2001/01/24 15:55:38 bostic Exp $ +# $Id: s_perm,v 1.23 2002/09/09 15:03:06 bostic Exp $ +d=.. echo 'Updating Berkeley DB source tree permissions...' run() { echo " $1 ($2)" - if [ -f "../$1" ]; then - chmod "$2" "../$1" + if [ -f "$d/$1" ]; then + chmod "$2" "$d/$1" else - echo "$1: no such file or directory" + echo "$d/$1: no such file or directory" exit 1 fi } -run dist/build/chk.def 0555 -run dist/build/chk.define 0555 -run dist/build/chk.offt 0555 -run dist/build/chk.srcfiles 0555 -run dist/build/chk.tags 0555 -run dist/config.guess 0555 -run dist/config.sub 0555 -run dist/configure 0555 -run dist/install-sh 0555 -run dist/s_config 0555 -run dist/s_include 0555 -run dist/s_java 0555 -run dist/s_perm 0555 -run dist/s_readme 0555 -run dist/s_recover 0555 -run dist/s_symlink 0555 -run dist/s_tags 0555 -run dist/s_tcl 0555 -run dist/s_win32 0555 -run perl.BerkeleyDB/dbinfo 0555 -run perl.BerkeleyDB/mkpod 0555 +run build_win32/include.tcl 664 +run dist/config.guess 555 +run dist/config.sub 555 +run dist/configure 555 +run dist/install-sh 555 +run dist/s_all 555 +run dist/s_config 555 +run dist/s_include 555 +run dist/s_java 555 +run dist/s_javah 555 +run dist/s_perm 555 +run dist/s_readme 555 +run dist/s_recover 555 +run dist/s_rpc 555 +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/vx_buildcd 555 + +run perl/BerkeleyDB/dbinfo 555 +run perl/BerkeleyDB/mkpod 555 + +for i in `cd $d && find build_vxworks \ + -name '*.wsp' -o -name '*.cdf' -o -name '*.wpj'`; do + echo " $i (775)" + chmod 775 $d/$i +done diff --git a/bdb/dist/s_readme b/bdb/dist/s_readme index 9ff8a69bc88..229a152b8a9 100755 --- a/bdb/dist/s_readme +++ b/bdb/dist/s_readme @@ -1,18 +1,23 @@ #!/bin/sh - -# $Id: s_readme,v 1.2 2000/01/27 21:42:18 bostic Exp $ +# $Id: s_readme,v 1.6 2002/02/14 02:50:26 bostic Exp $ # # Build the README. +d=.. + +t=/tmp/__t +trap 'rm -f $t; exit 0' 0 1 2 3 13 15 + . RELEASE +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 +the release and installation documentation, load the distribution file +docs/index.html into your web browser. +END_OF_README + f=../README -echo "Building $f" -rm -f $f -(echo "$DB_VERSION_STRING" && - echo "" && - echo -n "This is version " && - echo -n "$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH" && - echo " of Berkeley DB from Sleepycat Software. To view" && - echo "the release and installation documentation, load the distribution file" && - echo "docs/index.html into your web browser.") > $f -chmod 444 $f +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) diff --git a/bdb/dist/s_recover b/bdb/dist/s_recover index b0593cfc052..331ae623d3f 100755 --- a/bdb/dist/s_recover +++ b/bdb/dist/s_recover @@ -1,23 +1,18 @@ #!/bin/sh - -# $Id: s_recover,v 1.3 2000/03/30 05:24:36 krinsky Exp $ +# $Id: s_recover,v 1.14 2002/03/27 04:31:51 bostic Exp $ # # Build the automatically generated logging/recovery files. -DIR="db btree hash log qam txn" +tmp=/tmp/__db_a +loglist=/tmp/__db_b +source=/tmp/__db_c +header=/tmp/__db_d +template=/tmp/__db_e -t=/tmp/__db_$$ -loglist=../test/logtrack.list -rm -f $t -rm -f $loglist +trap 'rm -f $tmp $loglist $source $header $template; exit 1' 1 2 3 13 15 +trap 'rm -f $tmp $loglist $source $header $template; exit 0' 0 -trap 'rm -f $t; exit 1' 1 2 3 13 15 - -# Use the standard -k option if it works; -# otherwise fall back on the traditional notation. -if sort -k 1,1 /dev/null -then sort_2_etc='-k 2' -else sort_2_etc='+1' -fi +DIR="db dbreg btree hash qam txn" # Check to make sure we haven't duplicated a log record entry, and build # the list of log record types that the test suite uses. @@ -27,38 +22,46 @@ for i in $DIR; do # Grab the PREFIX; there should only be one per file, and # so it's okay to just take the first. grep '^PREFIX' $f | sed q - egrep '^DEPRECATED[ ]|^BEGIN[ ]' $f | \ + egrep '^BEGIN[ ]|^IGNORED[ ]|^DEPRECATED[ ]' $f | awk '{print $1 "\t" $2 "\t" $3}' done done > $loglist -grep -v '^PREFIX' $loglist | awk '{print $2 "\t" $3}' | \ - sort $sort_2_etc -n | \ - uniq -d -f 1 > $t -[ -s $t ] && { +grep -v '^PREFIX' $loglist | + awk '{print $2 "\t" $3}' | sort -n -k 2 | uniq -d -f 1 > $tmp +[ -s $tmp ] && { echo "DUPLICATE LOG VALUES:" - cat $t - rm -f $t + cat $tmp + rm -f $tmp exit 1 } -rm -f $t +f=../test/logtrack.list +cmp $loglist $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $loglist $f && chmod 444 $f) -for i in db btree hash log qam txn; do +# Build DB's recovery routines. +for i in db dbreg btree fileops hash qam txn; do for f in ../$i/*.src; do subsystem=`basename $f .src` - header_file=../include/${subsystem}_auto.h - source_file=../$i/${subsystem}_auto.c - template_file=template/rec_${subsystem} - template_source=. - - echo "Building $source_file, $header_file, $template_file" - rm -f $header_file $source_file $template_file awk -f gen_rec.awk \ - -v subsystem=$subsystem \ - -v source_file=$source_file \ - -v header_file=$header_file \ - -v template_file=$template_file \ - -v template_dir=. < $f - chmod 444 $header_file $source_file $template_file + -v source_file=$source \ + -v header_file=$header \ + -v template_file=$template < $f + + f=../dbinc_auto/${subsystem}_auto.h + cmp $header $f > /dev/null 2>&1 || + (echo "Building $f" && + rm -f $f && cp $header $f && chmod 444 $f) + f=../$i/${subsystem}_auto.c + cmp $source $f > /dev/null 2>&1 || + (echo "Building $f" && + rm -f $f && cp $source $f && chmod 444 $f) + f=template/rec_${subsystem} + cmp $template $f > /dev/null 2>&1 || + (echo "Building $f" && + rm -f $f && cp $template $f && chmod 444 $f) done done + +# Build the example application's recovery routines. +(cd ../examples_c/ex_apprec && sh auto_rebuild) diff --git a/bdb/dist/s_rpc b/bdb/dist/s_rpc index f7d9cf4eb1c..302930068ca 100644 --- a/bdb/dist/s_rpc +++ b/bdb/dist/s_rpc @@ -1,45 +1,58 @@ #!/bin/sh - -# $Id: s_rpc,v 11.6 2000/04/26 19:15:51 sue Exp $ +# $Id: s_rpc,v 11.18 2002/08/15 15:22:09 bostic Exp $ # # Build the automatically generated RPC files echo "Building RPC client/server files" +. ./RELEASE + +t=/tmp/__db_a +trap 'rm -f $t ; exit 0' 0 +trap 'rm -f $t ; exit 1' 1 2 3 13 15 + client_file=../rpc_client/gen_client.c -cproto_file=../include/gen_client_ext.h ctmpl_file=./template/gen_client_ret -header_file=../include/db_server.h +dbinc_file=../dbinc/db.in +defs_file=../dbinc_auto/rpc_defs.in +header_file=../dbinc_auto/db_server.h +proc_file=../rpc_server/c/db_server_proc.c rpcclnt_file=../rpc_client/db_server_clnt.c -rpcsvc_file=../rpc_server/db_server_svc.c -rpcxdr_file=../rpc_server/db_server_xdr.c -sed_file=../rpc_server/db_server_proc.sed -server_file=../rpc_server/gen_db_server.c -sproto_file=../include/gen_server_ext.h +rpcsvc_file=../rpc_server/c/db_server_svc.c +rpcxdr_file=../rpc_server/c/db_server_xdr.c +sed_file=../rpc_server/c/db_server_proc.sed +server_file=../rpc_server/c/gen_db_server.c stmpl_file=./template/db_server_proc xdr_file=../rpc_server/db_server.x # -# NOTE: We do NOT want to remove proc_file. It is what we apply -# sed_file to, but we do not want to remove it. -# -proc_file=../rpc_server/db_server_proc.c -svrsed_file=../rpc_server/db_server_svc.sed -rpcsed_file=../rpc_server/db_server.sed - -rm -f $client_file $cproto_file $ctmpl_file $header_file $rpcsvc_file \ - $rpcclnt_file $rpcxdr_file $sed_file $server_file $sproto_file \ - $stmpl_file $xdr_file +# NOTE: We do NOT want to remove proc_file. It is what we apply $sed_file +# to, but we do not want to remove it, it does not get built in place. +rm -f $client_file \ + $ctmpl_file \ + $header_file \ + $rpcclnt_file \ + $rpcsvc_file \ + $rpcxdr_file \ + $sed_file \ + $server_file \ + $stmpl_file \ + $xdr_file # # Generate client/server/XDR code # +xidsize=\ +`awk '/^#define/ { if ($2 == "DB_XIDDATASIZE") { print $3 }}' $dbinc_file` + awk -f gen_rpc.awk \ + -v major=$DB_VERSION_MAJOR \ + -v minor=$DB_VERSION_MINOR \ + -v xidsize=$xidsize \ -v client_file=$client_file \ - -v cproto_file=$cproto_file \ -v ctmpl_file=$ctmpl_file \ -v sed_file=$sed_file \ -v server_file=$server_file \ - -v sproto_file=$sproto_file \ -v stmpl_file=$stmpl_file \ -v xdr_file=$xdr_file < ../rpc_server/rpc.src chmod 444 $client_file $server_file @@ -52,31 +65,73 @@ rpcgen -l $xdr_file > $rpcclnt_file rpcgen -s tcp $xdr_file > $rpcsvc_file rpcgen -c $xdr_file > $rpcxdr_file -# Run server files through sed -sed -f $svrsed_file $rpcsvc_file > ${rpcsvc_file}.new +# +# Run various server files through sed. +# +cat <$t +s/^#include[ ]"db_server.h"/#include "db_config.h"\\ +\\ +\\#ifndef NO_SYSTEM_INCLUDES\\ +\\#include \\ +\\#include / +/^#include /a\\ +\\#endif\\ +\\ +\\#include "db_int.h"\\ +\\#include "dbinc_auto/db_server.h"\\ +\\#include "dbinc/db_server_int.h"\\ +\\#include "dbinc_auto/rpc_server_ext.h" +/^ return;/i\\ +\\ __dbsrv_timeout(0); +s/svc_sendreply(transp, xdr_void,/svc_sendreply(transp, (xdrproc_t)xdr_void,/ +s/svc_getargs(transp, xdr_argument, &argument)/svc_getargs(transp, (xdrproc_t)xdr_argument, (char *)\&argument)/ +s/svc_sendreply(transp, xdr_result, result)/svc_sendreply(transp, (xdrproc_t)xdr_result, result)/ +s/svc_freeargs(transp, xdr_argument, &argument)/svc_freeargs(transp, (xdrproc_t)xdr_argument, (char *)\&argument)/ +s/^main/void __dbsrv_main/ +ENDOFSEDTEXT +sed -f $t $rpcsvc_file > ${rpcsvc_file}.new mv ${rpcsvc_file}.new $rpcsvc_file -# -# This is a hack to handle the $proc_file special case. Since it -# is both a source file and a generated file, we have to dance a -# bit to get it to work with 'bk get', not just with 'bk edit'. -# This still isn't perfect (I don't know what perfect would be in -# this case), but it seems to work for now. -# -#sed -f $sed_file $proc_file > ${proc_file}.new -#mv ${proc_file}.new $proc_file -# -mv $proc_file ${proc_file}.old -sed -f $sed_file ${proc_file}.old > $proc_file -test -w ${proc_file}.old || chmod a-w $proc_file -rm -f ${proc_file}.old -# Run rpcgen files through sed to add HAVE_RPC ifdef -sed -f $rpcsed_file $rpcsvc_file > ${rpcsvc_file}.new -mv ${rpcsvc_file}.new $rpcsvc_file -sed -f $rpcsed_file $rpcxdr_file > ${rpcxdr_file}.new +sed -f $sed_file $proc_file > ${proc_file}.new +mv ${proc_file}.new $proc_file + +# Run rpcgen files through sed to add HAVE_RPC ifdef and appropriate +# includes. +cat <$t +1i\\ +\\#include "db_config.h"\\ +\\ +\\#ifdef HAVE_RPC +/^#include "db_server.h"/c\\ +\\#ifndef NO_SYSTEM_INCLUDES\\ +\\#include \\ +\\ +\\#include \\ +\\#endif\\ +\\ +\\#include "db_int.h"\\ +\\#include "dbinc_auto/db_server.h" +\$a\\ +\\#endif /* HAVE_RPC */ +ENDOFSEDTEXT + +sed -f $t $rpcxdr_file > ${rpcxdr_file}.new mv ${rpcxdr_file}.new $rpcxdr_file -sed -f $rpcsed_file $rpcclnt_file > ${rpcclnt_file}.new +sed -f $t $rpcclnt_file > ${rpcclnt_file}.new mv ${rpcclnt_file}.new $rpcclnt_file -chmod 444 $header_file $rpcclnt_file $rpcsvc_file $rpcxdr_file +# Copy the DB_RPC SERVER #defines into a separate file so +# they can be part of db.h. +msgc="/* DO NOT EDIT: automatically built by dist/s_rpc. */" +(echo "" && echo "$msgc" && + sed -n -e "/DB_RPC_SERVER/p" $header_file) > $defs_file +# Fix up the header file: +# Remove the DB_RPC_SERVER #defines. +# Remove the include, it needs to be included earlier +# than that. +sed -e "/DB_RPC_SERVER/d"\ + -e "/^#include.*/d" $header_file > ${header_file}.new +mv ${header_file}.new $header_file + +chmod 444 $header_file $rpcclnt_file $rpcsvc_file $rpcxdr_file diff --git a/bdb/dist/s_symlink b/bdb/dist/s_symlink index 70efa445521..e69bb57dc46 100755 --- a/bdb/dist/s_symlink +++ b/bdb/dist/s_symlink @@ -1,5 +1,5 @@ #!/bin/sh - -# $Id: s_symlink,v 1.9 2000/09/05 21:27:04 bostic Exp $ +# $Id: s_symlink,v 1.28 2002/08/18 21:15:45 bostic Exp $ echo 'Creating Berkeley DB source tree symbolic links...' @@ -13,6 +13,7 @@ build btree/tags ../dist/tags build build_unix/tags ../dist/tags build clib/tags ../dist/tags build common/tags ../dist/tags +build crypto/tags ../dist/tags build cxx/tags ../dist/tags build db/tags ../dist/tags build db185/tags ../dist/tags @@ -27,54 +28,18 @@ build db_recover/tags ../dist/tags build db_stat/tags ../dist/tags build db_upgrade/tags ../dist/tags build db_verify/tags ../dist/tags +build dbinc/tags ../dist/tags +build dbinc_auto/tags ../dist/tags build dbm/tags ../dist/tags -build docs_src/api_cxx/Makefile ../api_c/Makefile -build docs_src/api_cxx/m4.seealso ../api_c/m4.seealso -build docs_src/api_cxx/spell.ok ../api_c/spell.ok -build docs_src/api_java/Makefile ../api_c/Makefile -build docs_src/api_java/java_index.so ../api_cxx/cxx_index.so -build docs_src/api_java/m4.seealso ../api_c/m4.seealso -build docs_src/api_java/spell.ok ../api_c/spell.ok -build docs_src/api_tcl/spell.ok ../api_c/spell.ok -build docs_src/ref/am/spell.ok ../spell.ok -build docs_src/ref/am_conf/spell.ok ../spell.ok -build docs_src/ref/arch/spell.ok ../spell.ok -build docs_src/ref/build_unix/spell.ok ../spell.ok -build docs_src/ref/build_vxworks/spell.ok ../spell.ok -build docs_src/ref/build_win/spell.ok ../spell.ok -build docs_src/ref/cam/spell.ok ../spell.ok -build docs_src/ref/debug/spell.ok ../spell.ok -build docs_src/ref/distrib/spell.ok ../spell.ok -build docs_src/ref/dumpload/spell.ok ../spell.ok -build docs_src/ref/env/spell.ok ../spell.ok -build docs_src/ref/install/spell.ok ../spell.ok -build docs_src/ref/intro/spell.ok ../spell.ok -build docs_src/ref/java/spell.ok ../spell.ok -build docs_src/ref/lock/spell.ok ../spell.ok -build docs_src/ref/log/spell.ok ../spell.ok -build docs_src/ref/mp/spell.ok ../spell.ok -build docs_src/ref/perl/spell.ok ../spell.ok -build docs_src/ref/program/spell.ok ../spell.ok -build docs_src/ref/refs/spell.ok ../spell.ok -build docs_src/ref/rpc/spell.ok ../spell.ok -build docs_src/ref/sendmail/spell.ok ../spell.ok -build docs_src/ref/simple_tut/spell.ok ../spell.ok -build docs_src/ref/tcl/spell.ok ../spell.ok -build docs_src/ref/test/spell.ok ../spell.ok -build docs_src/ref/transapp/spell.ok ../spell.ok -build docs_src/ref/txn/spell.ok ../spell.ok -build docs_src/ref/upgrade.2.0/spell.ok ../spell.ok -build docs_src/ref/upgrade.3.0/spell.ok ../spell.ok -build docs_src/ref/upgrade.3.1/spell.ok ../spell.ok -build docs_src/ref/upgrade.3.2/spell.ok ../spell.ok -build docs_src/ref/xa/spell.ok ../spell.ok +build dbreg/tags ../dist/tags build env/tags ../dist/tags build examples_c/tags ../dist/tags build examples_cxx/tags ../dist/tags build examples_java java/src/com/sleepycat/examples +build fileops/tags ../dist/tags build hash/tags ../dist/tags +build hmac/tags ../dist/tags build hsearch/tags ../dist/tags -build include/tags ../dist/tags build libdb_java/tags ../dist/tags build lock/tags ../dist/tags build log/tags ../dist/tags @@ -84,8 +49,10 @@ build os/tags ../dist/tags build os_vxworks/tags ../dist/tags build os_win32/tags ../dist/tags build qam/tags ../dist/tags +build rep/tags ../dist/tags build rpc_client/tags ../dist/tags build rpc_server/tags ../dist/tags build tcl/tags ../dist/tags +build test_server/tags ../dist/tags build txn/tags ../dist/tags build xa/tags ../dist/tags diff --git a/bdb/dist/s_tags b/bdb/dist/s_tags index 834600b9fb1..1c0be7b9e0f 100755 --- a/bdb/dist/s_tags +++ b/bdb/dist/s_tags @@ -1,31 +1,39 @@ #!/bin/sh - -# $Id: s_tags,v 1.5 2000/09/05 21:27:04 bostic Exp $ +# $Id: s_tags,v 1.16 2002/03/28 20:13:07 krinsky Exp $ # # Build tags files. -files="../include/*.h \ - ../include/*.src \ +files="../dbinc/*.h \ + ../dbinc/*.in \ ../btree/*.[ch] \ ../clib/*.[ch] \ ../common/*.[ch] \ + ../crypto/*.[ch] \ + ../crypto/mersenne/*.[ch] \ + ../crypto/rijndael/*.[ch] \ ../db/*.[ch] \ ../db185/*.[ch] \ ../dbm/*.[ch] \ + ../dbreg/*.[ch] \ ../env/*.[ch] \ + ../fileops/*.[ch] \ ../hash/*.[ch] \ + ../hmac/*.[ch] \ ../hsearch/*.[ch] \ - ../libdb_java/*.[ch] \ ../lock/*.[ch] \ ../log/*.[ch] \ ../mp/*.[ch] \ ../mutex/*.[ch] \ ../os/*.[ch] \ ../qam/*.[ch] \ + ../rep/*.[ch] \ ../rpc_client/*.[ch] \ - ../rpc_server/*.[ch] \ + ../rpc_server/c/*.[ch] \ ../tcl/*.[ch] \ ../txn/*.[ch] \ - ../xa/*.[ch]" + ../xa/*.[ch] \ + ../cxx/*.cpp \ + ../libdb_java/*.[ch]" f=tags echo "Building $f" @@ -45,3 +53,8 @@ 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 diff --git a/bdb/dist/s_tcl b/bdb/dist/s_tcl deleted file mode 100755 index 7350e9a49e9..00000000000 --- a/bdb/dist/s_tcl +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# $Id: s_tcl,v 1.14 2000/11/09 19:24:07 sue Exp $ -# -# Build the Tcl test files. - -msgshb="# DO NOT EDIT BELOW THIS LINE: automatically built by dist/s_tcl." - -. RELEASE - -f=../test/include.tcl -echo "Building $f" -rm -f $f -(echo "set tclsh_path @TCL_TCLSH@" && \ - echo "set tcllib .libs/libdb_tcl-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@SOSUFFIX@" && \ - echo "set rpc_server localhost" && \ - echo "set rpc_path ." && \ - echo "set test_path @srcdir@/../test" && \ - echo "" && \ - echo "set KILL \"@db_cv_path_kill@\"" && \ - echo "" && \ - echo "$msgshb" && \ - echo "" && \ - echo "global dict" && \ - echo "global testdir" && \ - echo "global util_path" && \ - echo "set testdir ./TESTDIR" && \ - echo "set rpc_testdir \$rpc_path/TESTDIR" && \ - echo "" && \ - echo "global is_hp_test" && \ - echo "global is_qnx_test" && \ - echo "global is_windows_test") > $f -chmod 444 $f - -f=../build_win32/include.tcl -echo "Building $f" -rm -f $f -(echo "set tclsh_path SET_YOUR_TCLSH_PATH" && \ - echo "set test_path ../test" && \ - echo "set tcllib ./Debug/libdb_tcl${DB_VERSION_MAJOR}${DB_VERSION_MINOR}d.dll" && \ - echo "" && \ - echo "set KILL ./dbkill.exe" && \ - echo "" && \ - echo "$msgshb" && \ - echo "" && \ - echo "global dict" && \ - echo "global testdir" && \ - echo "global util_path" && \ - echo "set testdir ./TESTDIR" && \ - echo "" && \ - echo "global is_hp_test" && \ - echo "global is_qnx_test" && \ - echo "global is_windows_test") > $f -chmod 444 $f diff --git a/bdb/dist/s_test b/bdb/dist/s_test new file mode 100755 index 00000000000..266f27a743f --- /dev/null +++ b/bdb/dist/s_test @@ -0,0 +1,92 @@ +#!/bin/sh - +# $Id: s_test,v 1.24 2002/08/09 02:24:58 bostic Exp $ +# +# Build the Tcl test files. + +msg1="# Automatically built by dist/s_test; may require local editing." +msg2="# Automatically built by dist/s_test; may require local editing." + +t=/tmp/__t +trap 'rm -f $t; exit 0' 0 1 2 3 13 15 + +. RELEASE + +(echo "$msg1" && \ + echo "" && \ + echo "set tclsh_path @TCL_TCLSH@" && \ + echo "set tcllib .libs/libdb_tcl-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@MODSUFFIX@" && \ + echo "" && \ + echo "set rpc_server localhost" && \ + echo "set rpc_path ." && \ + echo "set rpc_testdir \$rpc_path/TESTDIR" && \ + echo "" && \ + echo "set src_root @srcdir@/.." && \ + echo "set test_path @srcdir@/../test" && \ + echo "" && \ + echo "global testdir" && \ + echo "set testdir ./TESTDIR" && \ + echo "" && \ + echo "global dict" && \ + echo "global util_path" && \ + echo "" && \ + echo "global is_hp_test" && \ + echo "global is_qnx_test" && \ + echo "global is_windows_test" && \ + echo "" && \ + echo "set KILL \"@db_cv_path_kill@\"") > $t + +f=../test/include.tcl +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +(echo "$msg1" && \ + echo "" && \ + echo "set tclsh_path SET_YOUR_TCLSH_PATH" && \ + echo "set tcllib ./Debug/libdb_tcl${DB_VERSION_MAJOR}${DB_VERSION_MINOR}d.dll" && \ + echo "" && \ + echo "set src_root .." && \ + echo "set test_path ../test" && \ + echo "" && \ + echo "global testdir" && \ + echo "set testdir ./TESTDIR" && \ + echo "" && \ + echo "global dict" && \ + echo "global util_path" && \ + echo "" && \ + echo "global is_hp_test" && \ + echo "global is_qnx_test" && \ + echo "global is_windows_test" && \ + echo "" && \ + echo "set KILL ./dbkill.exe") > $t + +f=../build_win32/include.tcl +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build the test directory TESTS file. +(echo $msg2; +cat `egrep -l '^#[ ][ ]*TEST' ../test/*.tcl` | +sed -e '/^#[ ][ ]*TEST/!{' \ + -e 's/.*//' \ + -e '}' | +cat -s | +sed -e '/TEST/{' \ + -e 's/^#[ ][ ]*TEST[ ]*//' \ + -e 's/^ //' \ + -e 'H' \ + -e 'd' \ + -e '}' \ + -e 's/.*//' \ + -e x \ + -e 's/\n/__LINEBREAK__/g' | +sort | +sed -e 's/__LINEBREAK__/\ +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\ +/' \ + -e 's/__LINEBREAK__/\ + /g' | +sed -e 's/^[ ][ ]*$//') > $t + +f=../test/TESTS +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) diff --git a/bdb/dist/s_vxworks b/bdb/dist/s_vxworks index edf058df7ee..b7cf785f78b 100644 --- a/bdb/dist/s_vxworks +++ b/bdb/dist/s_vxworks @@ -1,5 +1,5 @@ #!/bin/sh - -# $Id: s_vxworks,v 1.3 2000/07/13 18:38:46 bostic Exp $ +# $Id: s_vxworks,v 1.37 2002/08/19 21:27:06 bostic Exp $ # # Build the VxWorks files. @@ -7,15 +7,26 @@ msgc="/* DO NOT EDIT: automatically built by dist/s_vxworks. */" . RELEASE -t=/tmp/__db_$$ -rm -f $t +s=/tmp/__db_a +t=/tmp/__db_b +vxfilelist=/tmp/__db_c -trap 'rm -f $t ; exit 1' 1 2 3 13 15 +trap 'rm -f $s $t $vxfilelist ; exit 0' 0 +trap 'rm -f $s $t $vxfilelist ; exit 1' 1 2 3 13 15 +# Build the VxWorks automatically generated files. f=../build_vxworks/db.h -echo "Building $f" -rm -f $f -cat < $t +cat < $s +/extern "C" {/{ +n +n +i\\ +\\ +/* Tornado 2 does not provide a standard C pre-processor #define. */\\ +#ifndef __vxworks\\ +#define __vxworks\\ +#endif +} s/@u_int8_decl@/typedef unsigned char u_int8_t;/ s/@u_int16_decl@/typedef unsigned short u_int16_t;/ s/@u_int32_decl@/typedef unsigned int u_int32_t;/ @@ -30,19 +41,284 @@ 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@// ENDOFSEDTEXT -(echo "$msgc" && sed -f $t ../include/db.src) > $f -chmod 444 $f +(echo "$msgc" && + sed -f $s ../dbinc/db.in && + cat ../dbinc_auto/rpc_defs.in && + cat ../dbinc_auto/ext_prot.in) > $t +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) f=../build_vxworks/db_int.h -echo "Building $f" -rm -f $f -cat < $t +cat < $s s/\(PATH_SEPARATOR[^"]*"\)\/"/\1\/\\\\\\\\\\"/ s/@db_align_t_decl@/typedef unsigned long db_align_t;/ s/@db_alignp_t_decl@/typedef unsigned long db_alignp_t;/ +s/@db_int_def@// ENDOFSEDTEXT -(echo "$msgc" && sed -f $t ../include/db_int.src) > $f -chmod 444 $f +(echo "$msgc" && sed -f $s ../dbinc/db_int.in) > $t +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) -rm -f $t +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 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build a sed script that will change a "standard" DB utility into +# VxWorks-compatible code. +transform() +{ + # Build a sed script that will add argument parsing support and + # rename all of the functions to be private to this file. +cat <\\ +#define ERROR_RETURN ERROR\\ +\\ +int\\ +$1_main(argc, argv) +d +} +/^ while ((ch = getopt/i\\ +\\ __db_getopt_reset = 1; +/^[ ]*extern int optind;/s/;/, __db_getopt_reset;/ +ENDOFSEDTEXT + + # Replace all function names with VxWorks safe names. + # Function names are: + # Tokens starting at the beginning of the line, immediately + # followed by an opening parenthesis. + # Replace: + # Matches preceded by a non-C-token character and immediately + # followed by an opening parenthesis. + # Matches preceded by a non-C-token character and immediately + # followed by " __P". + # Matches starting at the beginning of the line, immediately + # followed by an opening parenthesis. + for k in `sed -e 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)(.*$/\1/p' -e d $2`; do + echo "s/\([^a-zA-Z0-9_]\)\($k(\)/\1$1_\2/g" + echo "s/\([^a-zA-Z0-9_]\)\($k[ ]__P\)/\1$1_\2/g" + echo "s/^\($k(\)/$1_\1/g" + done + + # There is a special case the rules above don't catch: + # a txn_compare function used as an argument to qsort(3). + # a print_app_record function used as argument to + # dbenv->set_app_dispatch). + echo "s/, txn_compare);/, db_stat_txn_compare);/" + echo "s/, print_app_record)) /, db_printlog_print_app_record)) /" + + # We convert the ex_access sample into dbdemo for VxWorks. + echo 's/progname = "ex_access";/progname = "dbdemo";/' + + # The example programs have to load db_int.h, not db.h -- else + # they won't have the right Berkeley DB prototypes for getopt + # and friends. + echo '/#include.*db.h/c\' + echo '#include \' + 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" + +# Build VxWorks versions of the utilities. +for i in $PROGRAM_LIST; do + if [ $i = "ex_access" ]; then + target=dbdemo + dir=../examples_c + else + target=$i + dir=../$i + fi + + transform $target $dir/$i.c > $s + sed -f $s < $dir/$i.c > $t + + f=../build_vxworks/$target/$target.c + cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) +done + +# 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 + f=../build_vxworks/$target/$target.wpj + cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) +done + +# Build the list of files VxWorks knows about. +sed -e '/^$/d' -e '/^[ #]/d' srcfiles.in | + egrep -w vx | + sed 's/[ ].*//' > $vxfilelist + +# Build VxWorks Tornado 2.0 project files for the library itself. +(cat vx_2.0/BerkeleyDB.wpj +for i in `cat $vxfilelist`; do + o=" FILE_\$(PRJ_DIR)/../$i" + echo "${o}_dependDone" + echo "TRUE" + echo "" + echo + echo "${o}_dependencies" + echo "\$(PRJ_DIR)/db_config.h \\" + echo " \$(PRJ_DIR)/db_int.h \\" + echo " \$(PRJ_DIR)/db.h" + 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" +sed -e '$!s/$/ \\/' \ + -e 's/^/$(PRJ_DIR)\/..\//' \ + -e '1!s/^/ /' < $vxfilelist +echo "" +echo +echo " userComments" +echo "BerkeleyDB" +echo "") > $t +f=../build_vxworks/BerkeleyDB.wpj +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +# Build VxWorks Tornado 3.1 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 + + cp vx_3.1/Makefile.custom $t + f=../build_vxworks/$target/$target/Makefile.custom + cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + + for j in component.cdf component.wpj; do + # + # Some parts of the component files needs to have the + # name in all capitals. Sigh. + # + z=`echo $target | tr "a-z" "A-Z"` + sed -e "s/__DB_APPLICATION_NAME__/$target/g" \ + -e "s/__DB_CAPAPPL_NAME__/$z/g" < vx_3.1/$j > $t + f=../build_vxworks/$target/$target/$j + cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + done +done + +# Build VxWorks Tornado 3.1 project files for the library itself. +cp vx_3.1/Makefile.custom $t +f=../build_vxworks/BerkeleyDB/Makefile.custom +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +(cat vx_3.1/cdf.1 +echo -n " MODULES" +for i in `cat $vxfilelist`; do + echo " `basename $i .c`.o" +done | sort | sed -e '$!s/$/ \\/' +cat vx_3.1/cdf.2 +for i in `cat $vxfilelist`; do + b="`basename $i .c`.o" + echo "Module $b {" + echo + echo " NAME $b" + echo " SRC_PATH_NAME \$(PRJ_DIR)/../../$i" + echo "}" + echo +done +cat vx_3.1/cdf.3)> $t +f=../build_vxworks/BerkeleyDB/component.cdf +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +(cat vx_3.1/wpj.1 +for i in `cat $vxfilelist`; do + o=" BUILD_PENTIUM2gnu.debug_FILE_\$(PRJ_DIR)/../../$i" + echo "${o}_infoTags" + echo "toolMacro objects" + echo "" + echo + echo "${o}_objects" + echo "`basename $i .c`.o" + echo "" + echo + echo "${o}_toolMacro" + echo "CC" + echo "" + echo +done +cat vx_3.1/wpj.2 +for i in `cat $vxfilelist`; do + o=" BUILD_PENTIUM2gnu.release_FILE_\$(PRJ_DIR)/../../$i" + echo "${o}_infoTags" + echo "toolMacro objects" + echo "" + echo + echo "${o}_objects" + echo "`basename $i .c`.o" + echo "" + echo + echo "${o}_toolMacro" + echo "CC" + echo "" + echo +done +cat vx_3.1/wpj.3 +for i in `cat $vxfilelist`; do + o=" BUILD_PENTIUMgnu.debug_FILE_\$(PRJ_DIR)/../../$i" + echo "${o}_infoTags" + echo "toolMacro objects" + echo "" + echo + echo "${o}_objects" + echo "`basename $i .c`.o" + echo "" + echo + echo "${o}_toolMacro" + echo "CC" + echo "" + echo +done +cat vx_3.1/wpj.4 +sort $vxfilelist | +sed -e 's/^/$(PRJ_DIR)\/..\/..\//' \ + -e '1!s/^/ /' \ + -e '$!s/$/ \\/' +cat vx_3.1/wpj.5) > $t +f=../build_vxworks/BerkeleyDB/component.wpj +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) diff --git a/bdb/dist/s_win32 b/bdb/dist/s_win32 index f989a615e48..78814ababa1 100755 --- a/bdb/dist/s_win32 +++ b/bdb/dist/s_win32 @@ -1,21 +1,22 @@ #!/bin/sh - -# $Id: s_win32,v 1.9 2000/09/20 15:29:54 bostic Exp $ +# $Id: s_win32,v 1.25 2002/05/20 19:18:14 bostic Exp $ # # Build Windows/32 include files. msgc="/* DO NOT EDIT: automatically built by dist/s_win32. */" +msgw="; DO NOT EDIT: automatically built by dist/s_win32." . RELEASE -t=/tmp/__db_$$ -rm -f $t +s=/tmp/__db_a$$ +t=/tmp/__db_b$$ +rm -f $s $t -trap 'rm -f $t ; exit 1' 1 2 3 13 15 +trap 'rm -f $s $t ; exit 1' 1 2 3 13 15 +# Build the Win32 automatically generated files. f=../build_win32/db.h -echo "Building $f" -rm -f $f -cat < $t +cat < $s 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;/ @@ -23,7 +24,7 @@ s/@int32_decl@/typedef int int32_t;/ s/@u_int32_decl@/typedef unsigned int u_int32_t;/ /@u_char_decl@/{ i\\ - #if !defined(_WINSOCKAPI_) +#if !defined(_WINSOCKAPI_) s/@u_char_decl@/typedef unsigned char u_char;/ } s/@u_short_decl@/typedef unsigned short u_short;/ @@ -31,37 +32,77 @@ s/@u_int_decl@/typedef unsigned int u_int;/ /@u_long_decl@/{ s/@u_long_decl@/typedef unsigned long u_long;/ a\\ - #endif +#endif +} +/@ssize_t_decl@/{ + i\\ +#if defined(_WIN64)\\ +typedef __int64 ssize_t;\\ +#else\\ +typedef int ssize_t;\\ +#endif + d } -s/@ssize_t_decl@/typedef int ssize_t;/ 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@// ENDOFSEDTEXT -(echo "$msgc" && sed -f $t ../include/db.src) > $f -chmod 444 $f +(echo "$msgc" && + sed -f $s ../dbinc/db.in && + cat ../dbinc_auto/rpc_defs.in && + cat ../dbinc_auto/ext_prot.in) > $t +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +f=../build_win32/db_cxx.h +cat < $s +s/@cxx_have_stdheaders@/#define HAVE_CXX_STDHEADERS 1/ +ENDOFSEDTEXT +(echo "$msgc" && sed -f $s ../dbinc/db_cxx.in) > $t +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) f=../build_win32/db_int.h -echo "Building $f" -rm -f $f -cat < $t +cat < $s s/\(PATH_SEPARATOR[^"]*"\)\/"/\1\\\\\\\\\\/:\"/ s/@db_align_t_decl@/typedef unsigned long db_align_t;/ s/@db_alignp_t_decl@/typedef unsigned long db_alignp_t;/ +s/@db_int_def@// ENDOFSEDTEXT -(echo "$msgc" && sed -f $t ../include/db_int.src) > $f -chmod 444 $f +(echo "$msgc" && sed -f $s ../dbinc/db_int.in) > $t +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) + +f=../build_win32/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_win32/libdb.rc -echo "Building $f" -rm -f $f -cat < $t +cat < $s s/%MAJOR%/$DB_VERSION_MAJOR/ s/%MINOR%/$DB_VERSION_MINOR/ s/%PATCH%/$DB_VERSION_PATCH/ ENDOFSEDTEXT -sed -f $t ../build_win32/libdbrc.src > $f -chmod 444 $f +sed -f $s ../build_win32/libdbrc.src > $t +cmp $t $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) -rm -f $t +f=../build_win32/libdb.def +(echo $msgw && + echo && + echo \ + "DESCRIPTION 'Berkeley DB $DB_VERSION_MAJOR.$DB_VERSION_MINOR Library'" && + 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) + +rm -f $s $t diff --git a/bdb/dist/s_win32_dsp b/bdb/dist/s_win32_dsp index 8abee7c1a61..3b0bef831ba 100644 --- a/bdb/dist/s_win32_dsp +++ b/bdb/dist/s_win32_dsp @@ -1,5 +1,5 @@ #!/bin/sh - -# $Id: s_win32_dsp,v 1.3 2000/12/02 04:36:47 dda Exp $ +# $Id: s_win32_dsp,v 1.8 2002/03/26 23:37:55 bostic Exp $ # # Build Windows/32 .dsp files. @@ -18,7 +18,6 @@ create_dsp() dspoutput=$BUILDDIR/$projname.dsp - echo "Building $dspoutput" rm -f $dspoutput.insert for srcpath in `egrep "$match" $sources | sed -e 's/[ ].*//'` do @@ -42,22 +41,26 @@ create_dsp() -e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \ -e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" \ < $dsptemplate > $dspoutput.new - rm -f $dspoutput $dspoutput.insert - mv $dspoutput.new $dspoutput + + # 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/swin32dsp$$a -trap "rm -f $TMPA; exit 1" 1 2 3 15 +trap "rm -f $TMPA; exit 1" 1 2 3 15 -# create a copy of the srcfiles with comments and 'skip' lines removed. +# 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 "/ skip$/d" \ + -e "/[ ]/!d" \ -e "s/$/ /" < $SRCFILES > $TMPA # get a list of all modules mentioned @@ -80,6 +83,10 @@ do create_dsp db_tcl " $module " $TMPA \ $BUILDDIR/tcl_dsp.src $BUILDDIR/srcfile_dsp.src ;; + testutil ) + create_dsp db_test " $module " $TMPA \ + $BUILDDIR/db_test.src $BUILDDIR/srcfile_dsp.src + ;; static ) create_dsp db_static " $module " $TMPA \ $BUILDDIR/static_dsp.src $BUILDDIR/srcfile_dsp.src @@ -89,6 +96,8 @@ do create_dsp $appname " $module " $TMPA \ $BUILDDIR/app_dsp.src $BUILDDIR/srcfile_dsp.src ;; + vx ) + ;; * ) echo "s_win32_dsp: module name $module in $SRCFILES is unknown type" ;; diff --git a/bdb/dist/srcfiles.in b/bdb/dist/srcfiles.in index bfc564e13bb..54aeea0c1bc 100644 --- a/bdb/dist/srcfiles.in +++ b/bdb/dist/srcfiles.in @@ -1,8 +1,8 @@ -# $Id: srcfiles.in,v 1.7 2000/11/30 18:42:21 dda Exp $ +# $Id: srcfiles.in,v 1.59 2002/08/29 14:22:21 margo Exp $ # -# This is an input file for the s_win32_dsp script. It describes every -# source files used by Windows, and lists those that aren't as well, -# as a completeness sanity check. +# This is an input file for the s_win32_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. # # Please keep this list sorted alphabetically! # @@ -11,259 +11,322 @@ # # The possible modules, including the name of the project (.dsp) file: # -# app=NAME this is linked into application NAME.exe (db_NAME.dsp) -# dynamic file appears in the DLL (db_dll.dsp) -# java file appears in the java DLL (db_java.dsp) -# skip this file is not used by Windows -# static file appears in the static library (db_static.dsp) -# tcl file appears in the tcl DLL (db_tcl.dsp) +# app=NAME Linked into application NAME.exe (db_NAME.dsp) +# dynamic File is in the Windows DLL (db_dll.dsp) +# java File is in the Windows Java DLL (db_java.dsp) +# static File is in the Windows static library (db_static.dsp) +# tcl File is in the Windows tcl DLL (db_tcl.dsp) +# testutil File is used for Windows testing (db_test.dsp) +# vx File is in the VxWorks library. -btree/bt_compare.c dynamic static -btree/bt_conv.c dynamic static -btree/bt_curadj.c dynamic static -btree/bt_cursor.c dynamic static -btree/bt_delete.c dynamic static -btree/bt_method.c dynamic static -btree/bt_open.c dynamic static -btree/bt_put.c dynamic static -btree/bt_rec.c dynamic static -btree/bt_reclaim.c dynamic static -btree/bt_recno.c dynamic static -btree/bt_rsearch.c dynamic static -btree/bt_search.c dynamic static -btree/bt_split.c dynamic static -btree/bt_stat.c dynamic static -btree/bt_upgrade.c dynamic static -btree/bt_verify.c dynamic static -btree/btree_auto.c dynamic static -build_win32/dbkill.cpp skip -build_win32/dllmain.c dynamic -build_win32/libdb.def dynamic -build_win32/libdb.rc dynamic -build_win32/libdb_tcl.def tcl -clib/getcwd.c skip -clib/getopt.c skip # must be linked into each app -clib/memcmp.c skip -clib/memmove.c skip -clib/raise.c skip -clib/snprintf.c skip -clib/strcasecmp.c dynamic static -clib/strerror.c skip -clib/vsnprintf.c skip -common/db_byteorder.c dynamic static -common/db_err.c dynamic static -common/db_getlong.c dynamic static -common/db_log2.c dynamic static -common/util_log.c dynamic static -common/util_sig.c dynamic static -cxx/cxx_app.cpp dynamic static -cxx/cxx_except.cpp dynamic static -cxx/cxx_lock.cpp dynamic static -cxx/cxx_log.cpp dynamic static -cxx/cxx_mpool.cpp dynamic static -cxx/cxx_table.cpp dynamic static -cxx/cxx_txn.cpp dynamic static -db/crdel_auto.c dynamic static -db/crdel_rec.c dynamic static -db/db.c dynamic static -db/db_am.c dynamic static -db/db_auto.c dynamic static -db/db_cam.c dynamic static -db/db_conv.c dynamic static -db/db_dispatch.c dynamic static -db/db_dup.c dynamic static -db/db_iface.c dynamic static -db/db_join.c dynamic static -db/db_meta.c dynamic static -db/db_method.c dynamic static -db/db_overflow.c dynamic static -db/db_pr.c dynamic static -db/db_rec.c dynamic static -db/db_reclaim.c dynamic static -db/db_ret.c dynamic static -db/db_upg.c dynamic static -db/db_upg_opd.c dynamic static -db/db_vrfy.c dynamic static -db/db_vrfyutil.c dynamic static -db185/db185.c skip -db_archive/db_archive.c app=db_archive -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 skip -db_load/db_load.c app=db_load -db_printlog/db_printlog.c app=db_printlog -db_recover/db_recover.c app=db_recover -db_stat/db_stat.c app=db_stat -db_upgrade/db_upgrade.c app=db_upgrade -db_verify/db_verify.c app=db_verify -dbm/dbm.c dynamic static -env/db_salloc.c dynamic static -env/db_shash.c dynamic static -env/env_method.c dynamic static -env/env_open.c dynamic static -env/env_recover.c dynamic static -env/env_region.c dynamic static -examples_c/ex_access.c app=ex_access -examples_c/ex_btrec.c app=ex_btrec -examples_c/ex_dbclient.c skip -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_thread.c skip -examples_c/ex_tpcb.c app=ex_tpcb -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/TpcbExample.cpp app=excxx_tpcb -hash/hash.c dynamic static -hash/hash_auto.c dynamic static -hash/hash_conv.c dynamic static -hash/hash_dup.c dynamic static -hash/hash_func.c dynamic static -hash/hash_meta.c dynamic static -hash/hash_method.c dynamic static -hash/hash_page.c dynamic static -hash/hash_rec.c dynamic static -hash/hash_reclaim.c dynamic static -hash/hash_stat.c dynamic static -hash/hash_upgrade.c dynamic static -hash/hash_verify.c dynamic static -hsearch/hsearch.c dynamic static -libdb_java/java_Db.c java -libdb_java/java_DbEnv.c java -libdb_java/java_DbLock.c java -libdb_java/java_DbLsn.c java -libdb_java/java_DbTxn.c java -libdb_java/java_Dbc.c java -libdb_java/java_Dbt.c java -libdb_java/java_info.c java -libdb_java/java_locked.c java -libdb_java/java_util.c java -lock/lock.c dynamic static -lock/lock_conflict.c dynamic static -lock/lock_deadlock.c dynamic static -lock/lock_method.c dynamic static -lock/lock_region.c dynamic static -lock/lock_stat.c dynamic static -lock/lock_util.c dynamic static -log/log.c dynamic static -log/log_archive.c dynamic static -log/log_auto.c dynamic static -log/log_compare.c dynamic static -log/log_findckp.c dynamic static -log/log_get.c dynamic static -log/log_method.c dynamic static -log/log_put.c dynamic static -log/log_rec.c dynamic static -log/log_register.c dynamic static -mp/mp_alloc.c dynamic static -mp/mp_bh.c dynamic static -mp/mp_fget.c dynamic static -mp/mp_fopen.c dynamic static -mp/mp_fput.c dynamic static -mp/mp_fset.c dynamic static -mp/mp_method.c dynamic static -mp/mp_region.c dynamic static -mp/mp_register.c dynamic static -mp/mp_stat.c dynamic static -mp/mp_sync.c dynamic static -mp/mp_trickle.c dynamic static -mutex/mut_fcntl.c skip -mutex/mut_pthread.c skip -mutex/mut_tas.c dynamic static -mutex/mutex.c dynamic static -os/os_abs.c skip -os/os_alloc.c dynamic static -os/os_dir.c skip -os/os_errno.c skip -os/os_fid.c skip -os/os_finit.c skip -os/os_fsync.c dynamic static -os/os_handle.c dynamic static -os/os_map.c skip -os/os_method.c dynamic static -os/os_oflags.c dynamic static -os/os_open.c skip -os/os_region.c dynamic static -os/os_rename.c skip -os/os_root.c dynamic static -os/os_rpath.c dynamic static -os/os_rw.c dynamic static -os/os_seek.c skip -os/os_sleep.c skip -os/os_spin.c skip -os/os_stat.c dynamic static -os/os_tmpdir.c dynamic static -os/os_unlink.c dynamic static -os_vxworks/os_abs.c skip -os_vxworks/os_finit.c skip -os_vxworks/os_map.c skip -os_win32/os_abs.c dynamic static -os_win32/os_dir.c dynamic static -os_win32/os_errno.c dynamic static -os_win32/os_fid.c dynamic static -os_win32/os_finit.c dynamic static -os_win32/os_map.c dynamic static -os_win32/os_open.c dynamic static -os_win32/os_rename.c dynamic static -os_win32/os_seek.c dynamic static -os_win32/os_sleep.c dynamic static -os_win32/os_spin.c dynamic static -os_win32/os_type.c dynamic static -qam/qam.c dynamic static -qam/qam_auto.c dynamic static -qam/qam_conv.c dynamic static -qam/qam_files.c dynamic static -qam/qam_method.c dynamic static -qam/qam_open.c dynamic static -qam/qam_rec.c dynamic static -qam/qam_stat.c dynamic static -qam/qam_upgrade.c dynamic static -qam/qam_verify.c dynamic static -rpc_client/client.c skip -rpc_client/db_server_clnt.c skip -rpc_client/gen_client.c skip -rpc_client/gen_client_ret.c skip -rpc_server/db_server_proc.c skip -rpc_server/db_server_svc.c skip -rpc_server/db_server_util.c skip -rpc_server/db_server_xdr.c skip -rpc_server/gen_db_server.c skip -tcl/tcl_compat.c tcl -tcl/tcl_db.c tcl -tcl/tcl_db_pkg.c tcl -tcl/tcl_dbcursor.c tcl -tcl/tcl_env.c tcl -tcl/tcl_internal.c tcl -tcl/tcl_lock.c tcl -tcl/tcl_log.c tcl -tcl/tcl_mp.c tcl -tcl/tcl_txn.c tcl -test_server/dbs.c skip -test_server/dbs_am.c skip -test_server/dbs_checkpoint.c skip -test_server/dbs_debug.c skip -test_server/dbs_handles.c skip -test_server/dbs_log.c skip -test_server/dbs_qam.c skip -test_server/dbs_spawn.c skip -test_server/dbs_trickle.c skip -test_server/dbs_util.c skip -test_server/dbs_yield.c skip -test_thread/lock.c skip -test_thread/log.c skip -test_thread/mpool.c skip -test_thread/mutex.c skip -test_vxworks/vx_mutex.c skip -test_vxworks/vxtpcb_files.c skip -test_vxworks/vxtpcb_onefile.c skip -txn/txn.c dynamic static -txn/txn_auto.c dynamic static -txn/txn_rec.c dynamic static -txn/txn_region.c dynamic static -xa/xa.c dynamic static -xa/xa_db.c dynamic static -xa/xa_map.c dynamic static +btree/bt_compare.c dynamic static vx +btree/bt_conv.c dynamic static vx +btree/bt_curadj.c dynamic static vx +btree/bt_cursor.c dynamic static vx +btree/bt_delete.c dynamic static vx +btree/bt_method.c dynamic static vx +btree/bt_open.c dynamic static vx +btree/bt_put.c dynamic static vx +btree/bt_rec.c dynamic static vx +btree/bt_reclaim.c dynamic static vx +btree/bt_recno.c dynamic static vx +btree/bt_rsearch.c dynamic static vx +btree/bt_search.c dynamic static vx +btree/bt_split.c dynamic static vx +btree/bt_stat.c dynamic static vx +btree/bt_upgrade.c dynamic static vx +btree/bt_verify.c dynamic static vx +btree/btree_auto.c dynamic static vx +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_load/db_load.c +build_vxworks/db_printlog/db_printlog.c +build_vxworks/db_recover/db_recover.c +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/dllmain.c dynamic +build_win32/libdb.def dynamic +build_win32/libdb.rc dynamic +build_win32/libdb_tcl.def tcl +clib/getcwd.c +clib/getopt.c vx +clib/memcmp.c +clib/memmove.c +clib/raise.c +clib/snprintf.c vx +clib/strcasecmp.c dynamic static vx +clib/strdup.c vx +clib/strerror.c +clib/vsnprintf.c vx +common/db_byteorder.c dynamic static vx +common/db_err.c dynamic static vx +common/db_getlong.c dynamic static vx +common/db_idspace.c dynamic static vx +common/db_log2.c dynamic static vx +common/util_arg.c vx +common/util_cache.c dynamic static vx +common/util_log.c dynamic static vx +common/util_sig.c dynamic static vx +cxx/cxx_db.cpp dynamic static +cxx/cxx_dbc.cpp dynamic static +cxx/cxx_dbt.cpp dynamic static +cxx/cxx_env.cpp dynamic static +cxx/cxx_except.cpp dynamic static +cxx/cxx_lock.cpp dynamic static +cxx/cxx_logc.cpp dynamic static +cxx/cxx_mpool.cpp dynamic static +cxx/cxx_txn.cpp dynamic static +db/crdel_auto.c dynamic static vx +db/crdel_rec.c dynamic static vx +db/db.c dynamic static vx +db/db_am.c dynamic static vx +db/db_auto.c dynamic static vx +db/db_cam.c dynamic static vx +db/db_conv.c dynamic static vx +db/db_dispatch.c dynamic static vx +db/db_dup.c dynamic static vx +db/db_iface.c dynamic static vx +db/db_join.c dynamic static vx +db/db_meta.c dynamic static vx +db/db_method.c dynamic static vx +db/db_open.c dynamic static vx +db/db_overflow.c dynamic static vx +db/db_pr.c dynamic static vx +db/db_rec.c dynamic static vx +db/db_reclaim.c dynamic static vx +db/db_remove.c dynamic static vx +db/db_rename.c dynamic static vx +db/db_ret.c dynamic static vx +db/db_truncate.c dynamic static vx +db/db_upg.c dynamic static vx +db/db_upg_opd.c dynamic static vx +db/db_vrfy.c dynamic static vx +db/db_vrfyutil.c dynamic static vx +db185/db185.c +db_archive/db_archive.c app=db_archive +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_load/db_load.c app=db_load +db_printlog/db_printlog.c app=db_printlog +db_recover/db_recover.c app=db_recover +db_stat/db_stat.c app=db_stat +db_upgrade/db_upgrade.c app=db_upgrade +db_verify/db_verify.c app=db_verify +dbm/dbm.c dynamic static +dbreg/dbreg.c dynamic static vx +dbreg/dbreg_auto.c dynamic static vx +dbreg/dbreg_rec.c dynamic static vx +dbreg/dbreg_util.c dynamic static vx +env/db_salloc.c dynamic static vx +env/db_shash.c dynamic static vx +env/env_file.c dynamic static vx +env/env_method.c dynamic static vx +env/env_open.c dynamic static vx +env/env_recover.c dynamic static vx +env/env_region.c dynamic static vx +examples_c/bench_001.c +examples_c/ex_access.c app=ex_access +examples_c/ex_apprec/ex_apprec.c +examples_c/ex_apprec/ex_apprec_auto.c +examples_c/ex_apprec/ex_apprec_rec.c +examples_c/ex_btrec.c app=ex_btrec +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 +examples_c/ex_repquote/ex_rq_main.c +examples_c/ex_repquote/ex_rq_master.c +examples_c/ex_repquote/ex_rq_net.c +examples_c/ex_repquote/ex_rq_util.c +examples_c/ex_thread.c +examples_c/ex_tpcb.c app=ex_tpcb +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/TpcbExample.cpp app=excxx_tpcb +fileops/fileops_auto.c dynamic static vx +fileops/fop_basic.c dynamic static vx +fileops/fop_rec.c dynamic static vx +fileops/fop_util.c dynamic static vx +hash/hash.c dynamic static vx +hash/hash_auto.c dynamic static vx +hash/hash_conv.c dynamic static vx +hash/hash_dup.c dynamic static vx +hash/hash_func.c dynamic static vx +hash/hash_meta.c dynamic static vx +hash/hash_method.c dynamic static vx +hash/hash_open.c dynamic static vx +hash/hash_page.c dynamic static vx +hash/hash_rec.c dynamic static vx +hash/hash_reclaim.c dynamic static vx +hash/hash_stat.c dynamic static vx +hash/hash_upgrade.c dynamic static vx +hash/hash_verify.c dynamic static vx +hmac/hmac.c dynamic static vx +hmac/sha1.c dynamic static vx +hsearch/hsearch.c dynamic static vx +libdb_java/java_Db.c java +libdb_java/java_DbEnv.c java +libdb_java/java_DbLock.c java +libdb_java/java_DbLogc.c java +libdb_java/java_DbLsn.c java +libdb_java/java_DbTxn.c java +libdb_java/java_DbUtil.c java +libdb_java/java_Dbc.c java +libdb_java/java_Dbt.c java +libdb_java/java_info.c java +libdb_java/java_locked.c java +libdb_java/java_stat_auto.c java +libdb_java/java_util.c java +lock/lock.c dynamic static vx +lock/lock_deadlock.c dynamic static vx +lock/lock_method.c dynamic static vx +lock/lock_region.c dynamic static vx +lock/lock_stat.c dynamic static vx +lock/lock_util.c dynamic static vx +log/log.c dynamic static vx +log/log_archive.c dynamic static vx +log/log_compare.c dynamic static vx +log/log_get.c dynamic static vx +log/log_method.c dynamic static vx +log/log_put.c dynamic static vx +mp/mp_alloc.c dynamic static vx +mp/mp_bh.c dynamic static vx +mp/mp_fget.c dynamic static vx +mp/mp_fopen.c dynamic static vx +mp/mp_fput.c dynamic static vx +mp/mp_fset.c dynamic static vx +mp/mp_method.c dynamic static vx +mp/mp_region.c dynamic static vx +mp/mp_register.c dynamic static vx +mp/mp_stat.c dynamic static vx +mp/mp_sync.c dynamic static vx +mp/mp_trickle.c dynamic static vx +mutex/mut_fcntl.c +mutex/mut_pthread.c +mutex/mut_tas.c vx +mutex/mut_win32.c dynamic static +mutex/mutex.c dynamic static vx +mutex/tm.c +os/os_abs.c +os/os_alloc.c dynamic static vx +os/os_clock.c vx +os/os_config.c +os/os_dir.c vx +os/os_errno.c vx +os/os_fid.c vx +os/os_fsync.c vx +os/os_handle.c vx +os/os_id.c dynamic static vx +os/os_map.c +os/os_method.c dynamic static vx +os/os_oflags.c dynamic static vx +os/os_open.c vx +os/os_region.c dynamic static vx +os/os_rename.c vx +os/os_root.c dynamic static vx +os/os_rpath.c dynamic static vx +os/os_rw.c vx +os/os_seek.c vx +os/os_sleep.c vx +os/os_spin.c vx +os/os_stat.c vx +os/os_tmpdir.c dynamic static vx +os/os_unlink.c dynamic static vx +os_vxworks/os_vx_abs.c vx +os_vxworks/os_vx_config.c vx +os_vxworks/os_vx_map.c vx +os_win32/os_abs.c dynamic static +os_win32/os_clock.c dynamic static +os_win32/os_config.c dynamic static +os_win32/os_dir.c dynamic static +os_win32/os_errno.c dynamic static +os_win32/os_fid.c dynamic static +os_win32/os_fsync.c dynamic static +os_win32/os_handle.c dynamic static +os_win32/os_map.c dynamic static +os_win32/os_open.c dynamic static +os_win32/os_rename.c dynamic static +os_win32/os_rw.c dynamic static +os_win32/os_seek.c dynamic static +os_win32/os_sleep.c dynamic static +os_win32/os_spin.c dynamic static +os_win32/os_stat.c dynamic static +os_win32/os_type.c dynamic static +qam/qam.c dynamic static vx +qam/qam_auto.c dynamic static vx +qam/qam_conv.c dynamic static vx +qam/qam_files.c dynamic static vx +qam/qam_method.c dynamic static vx +qam/qam_open.c dynamic static vx +qam/qam_rec.c dynamic static vx +qam/qam_stat.c dynamic static vx +qam/qam_upgrade.c dynamic static vx +qam/qam_verify.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_util.c dynamic static vx +rpc_client/client.c vx +rpc_client/db_server_clnt.c vx +rpc_client/gen_client.c vx +rpc_client/gen_client_ret.c vx +rpc_server/c/db_server_proc.c +rpc_server/c/db_server_svc.c +rpc_server/c/db_server_util.c +rpc_server/c/db_server_xdr.c vx +rpc_server/c/gen_db_server.c +rpc_server/cxx/db_server_cxxproc.cpp +rpc_server/cxx/db_server_cxxutil.cpp +tcl/tcl_compat.c tcl +tcl/tcl_db.c tcl +tcl/tcl_db_pkg.c tcl +tcl/tcl_dbcursor.c tcl +tcl/tcl_env.c tcl +tcl/tcl_internal.c tcl +tcl/tcl_lock.c tcl +tcl/tcl_log.c tcl +tcl/tcl_mp.c tcl +tcl/tcl_rep.c tcl +tcl/tcl_txn.c tcl +tcl/tcl_util.c tcl +test_perf/db_perf.c app=db_perf +test_perf/perf_cache_check.c app=db_perf +test_perf/perf_checkpoint.c app=db_perf +test_perf/perf_config.c app=db_perf +test_perf/perf_dbs.c app=db_perf +test_perf/perf_debug.c app=db_perf +test_perf/perf_file.c app=db_perf +test_perf/perf_key.c app=db_perf +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_spawn.c app=db_perf +test_perf/perf_thread.c app=db_perf +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 +txn/txn.c dynamic static vx +txn/txn_auto.c dynamic static vx +txn/txn_method.c dynamic static vx +txn/txn_rec.c dynamic static vx +txn/txn_recover.c dynamic static vx +txn/txn_region.c dynamic static vx +txn/txn_stat.c dynamic static vx +txn/txn_util.c dynamic static vx +xa/xa.c dynamic static vx +xa/xa_db.c dynamic static vx +xa/xa_map.c dynamic static vx diff --git a/bdb/dist/template/.IGNORE_ME b/bdb/dist/template/.IGNORE_ME deleted file mode 100644 index 558fd496f0c..00000000000 --- a/bdb/dist/template/.IGNORE_ME +++ /dev/null @@ -1,3 +0,0 @@ -Some combinations of the gzip and tar archive exploders found -on Linux systems ignore directories that don't have any files -(other than symbolic links) in them. So, here's a file. diff --git a/bdb/dist/rec_ctemp b/bdb/dist/template/rec_ctemp similarity index 73% rename from bdb/dist/rec_ctemp rename to bdb/dist/template/rec_ctemp index 6be6d3166b8..2951189c5bd 100644 --- a/bdb/dist/rec_ctemp +++ b/bdb/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/bdb/dist/template/rec_dbreg b/bdb/dist/template/rec_dbreg new file mode 100644 index 00000000000..bbdf19d5ffc --- /dev/null +++ b/bdb/dist/template/rec_dbreg @@ -0,0 +1,75 @@ +#include "db_config.h" + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include +#endif + +#include "db_int.h" +#include "dbinc/db_page.h" +#include "dbinc/__dbreg.h" +#include "dbinc/log.h" + +/* + * __dbreg_register_recover -- + * Recovery function for register. + * + * PUBLIC: int __dbreg_register_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__dbreg_register_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + __dbreg_register_args *argp; + DB *file_dbp; + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *pagep; + int cmp_n, cmp_p, modified, ret; + + REC_PRINT(__dbreg_register_print); + REC_INTRO(__dbreg_register_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/bdb/dist/template/rec_fileops b/bdb/dist/template/rec_fileops new file mode 100644 index 00000000000..c1487835ea9 --- /dev/null +++ b/bdb/dist/template/rec_fileops @@ -0,0 +1,323 @@ +#include "db_config.h" + +#ifndef NO_SYSTEM_INCLUDES +#include + +#include +#endif + +#include "db_int.h" +#include "dbinc/db_page.h" +#include "dbinc/__fop.h" +#include "dbinc/log.h" + +/* + * __fop_create_recover -- + * Recovery function for create. + * + * PUBLIC: int __fop_create_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__fop_create_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + __fop_create_args *argp; + DB *file_dbp; + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *pagep; + int cmp_n, cmp_p, modified, ret; + + REC_PRINT(__fop_create_print); + REC_INTRO(__fop_create_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; +} + +/* + * __fop_remove_recover -- + * Recovery function for remove. + * + * PUBLIC: int __fop_remove_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__fop_remove_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + __fop_remove_args *argp; + DB *file_dbp; + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *pagep; + int cmp_n, cmp_p, modified, ret; + + REC_PRINT(__fop_remove_print); + REC_INTRO(__fop_remove_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; +} + +/* + * __fop_write_recover -- + * Recovery function for write. + * + * PUBLIC: int __fop_write_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__fop_write_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + __fop_write_args *argp; + DB *file_dbp; + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *pagep; + int cmp_n, cmp_p, modified, ret; + + REC_PRINT(__fop_write_print); + REC_INTRO(__fop_write_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; +} + +/* + * __fop_rename_recover -- + * Recovery function for rename. + * + * PUBLIC: int __fop_rename_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__fop_rename_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + __fop_rename_args *argp; + DB *file_dbp; + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *pagep; + int cmp_n, cmp_p, modified, ret; + + REC_PRINT(__fop_rename_print); + REC_INTRO(__fop_rename_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; +} + +/* + * __fop_file_remove_recover -- + * Recovery function for file_remove. + * + * PUBLIC: int __fop_file_remove_recover + * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); + */ +int +__fop_file_remove_recover(dbenv, dbtp, lsnp, op, info) + DB_ENV *dbenv; + DBT *dbtp; + DB_LSN *lsnp; + db_recops op; + void *info; +{ + __fop_file_remove_args *argp; + DB *file_dbp; + DBC *dbc; + DB_MPOOLFILE *mpf; + PAGE *pagep; + int cmp_n, cmp_p, modified, ret; + + REC_PRINT(__fop_file_remove_print); + REC_INTRO(__fop_file_remove_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/bdb/dist/vx_2.0/BerkeleyDB.wpj b/bdb/dist/vx_2.0/BerkeleyDB.wpj new file mode 100644 index 00000000000..78684d90067 --- /dev/null +++ b/bdb/dist/vx_2.0/BerkeleyDB.wpj @@ -0,0 +1,251 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUM_debug_BUILDRULE +BerkeleyDB.out + + + BUILD_PENTIUM_debug_MACRO_AR +ar386 + + + BUILD_PENTIUM_debug_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/BerkeleyDB_sim.a + + + BUILD_PENTIUM_debug_MACRO_AS +cc386 + + + BUILD_PENTIUM_debug_MACRO_CC +cc386 + + + BUILD_PENTIUM_debug_MACRO_CFLAGS +-g \ + -mpentium \ + -ansi \ + -nostdinc \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -fvolatile \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM \ + -O0 \ + -I$(PRJ_DIR) \ + -I$(PRJ_DIR)/.. \ + -DDIAGNOSTIC \ + -DDEBUG + + + BUILD_PENTIUM_debug_MACRO_CFLAGS_AS +-g \ + -mpentium \ + -ansi \ + -nostdinc \ + -fvolatile \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUM_debug_MACRO_CPP +cc386 -E -P -xc + + + BUILD_PENTIUM_debug_MACRO_LD +ld386 + + + BUILD_PENTIUM_debug_MACRO_LDFLAGS +-X -N + + + BUILD_PENTIUM_debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM_debug_MACRO_NM +nm386 -g + + + BUILD_PENTIUM_debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM_debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM_debug_MACRO_POST_BUILD_RULE + + + + BUILD_PENTIUM_debug_MACRO_PRJ_LIBS + + + + BUILD_PENTIUM_debug_MACRO_SIZE +size386 + + + BUILD_PENTIUM_debug_RO_DEPEND_PATH +{$(WIND_BASE)/target/h/} \ + {$(WIND_BASE)/target/src/} \ + {$(WIND_BASE)/target/config/} + + + BUILD_PENTIUM_debug_TC +::tc_PENTIUMgnu + + + BUILD_PENTIUM_release_BUILDRULE +BerkeleyDB.out + + + BUILD_PENTIUM_release_MACRO_AR +ar386 + + + BUILD_PENTIUM_release_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/BerkeleyDB_sim.a + + + BUILD_PENTIUM_release_MACRO_AS +cc386 + + + BUILD_PENTIUM_release_MACRO_CC +cc386 + + + BUILD_PENTIUM_release_MACRO_CFLAGS +-mpentium \ + -ansi \ + -nostdinc \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -fvolatile \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM \ + -O2 \ + -I$(PRJ_DIR) \ + -I$(PRJ_DIR)/.. + + + BUILD_PENTIUM_release_MACRO_CFLAGS_AS +-g \ + -mpentium \ + -ansi \ + -nostdinc \ + -fvolatile \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUM_release_MACRO_CPP +cc386 -E -P -xc + + + BUILD_PENTIUM_release_MACRO_LD +ld386 + + + BUILD_PENTIUM_release_MACRO_LDDEPS + + + + BUILD_PENTIUM_release_MACRO_LDFLAGS +-X -N + + + BUILD_PENTIUM_release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM_release_MACRO_NM +nm386 -g + + + BUILD_PENTIUM_release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM_release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM_release_MACRO_POST_BUILD_RULE + + + + BUILD_PENTIUM_release_MACRO_PRJ_LIBS + + + + BUILD_PENTIUM_release_MACRO_SIZE +size386 + + + BUILD_PENTIUM_release_RO_DEPEND_PATH +{$(WIND_BASE)/target/h/} \ + {$(WIND_BASE)/target/src/} \ + {$(WIND_BASE)/target/config/} + + + BUILD_PENTIUM_release_TC +::tc_PENTIUMgnu + + + BUILD_RULE_BerkeleyDB.out + + + + BUILD_RULE_BerkeleyDB_sim.out + + + + BUILD_RULE_archive + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUM_debug + + + BUILD__LIST +PENTIUM_release PENTIUM_debug + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + diff --git a/bdb/dist/vx_2.0/wpj.in b/bdb/dist/vx_2.0/wpj.in new file mode 100644 index 00000000000..2b942bb562c --- /dev/null +++ b/bdb/dist/vx_2.0/wpj.in @@ -0,0 +1,160 @@ +Document file - DO NOT EDIT + + BUILD_PENTIUMgnu_BUILDRULE +__DB_APPLICATION_NAME__.out + + + BUILD_PENTIUMgnu_MACRO_AR +ar386 + + + BUILD_PENTIUMgnu_MACRO_ARCHIVE +$(PRJ_DIR)/PENTIUMgnu/__DB_APPLICATION_NAME__.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_APPLICATION_NAME__.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PENTIUMgnu + + + BUILD__LIST +PENTIUMgnu + + + CORE_INFO_TYPE +::prj_vxApp + + + 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/bdb/dist/vx_3.1/Makefile.custom b/bdb/dist/vx_3.1/Makefile.custom new file mode 100644 index 00000000000..ca781f7b251 --- /dev/null +++ b/bdb/dist/vx_3.1/Makefile.custom @@ -0,0 +1,51 @@ +# +# Custom Makefile shell +# +# This file may be edited freely, since it will not be regenerated +# by the project manager. +# +# Use this makefile to define rules to make external binaries +# and deposit them in the $(EXTERNAL_BINARIES_DIR) directory. +# +# If you have specified external modules during your component +# creation, you will find make rules already in place below. +# You will likely have to edit these to suit your individual +# build setup. +# +# You may wish to use the CPU, BUILD_SPEC or TOOL make variables in +# your Makefile to support builds for different architectures. Use +# the FORCE_EXTERNAL_MAKE phony target to ensure that your external +# make always runs. +# +# The example below assumes that your custom makefile is in the +# mySourceTree directory, and that the binary file it produces +# is placed into the $(BUILD_SPEC) sub-directory. +# +# EXTERNAL_SOURCE_BASE = /folk/me/mySourceTree +# EXTERNAL_MODULE = myLibrary.o +# EXTERNAL_MAKE = make +# +# $(EXTERNAL_BINARIES_DIR)/$(EXTERNAL_MODULE) : FORCE_EXTERNAL_MAKE +# $(EXTERNAL_MAKE) -C $(EXTERNAL_SOURCE_BASE) \ +# -f $(EXTERNAL_SOURCE_BASE)/Makefile \ +# CPU=$(CPU) BUILD_SPEC=$(BUILD_SPEC) $(@F) +# $(CP) $(subst /,$(DIRCHAR),$(EXTERNAL_SOURCE_BASE)/$(BUILD_SPEC)/$(@F) $@) +# +# If you are not adding your external modules from the component wizard, +# you will have to include them in your component yourself: +# +# From the GUI, you can do this with the Component's 'Add external module' +# dialog. +# +# If you are using the command line, add the module(s) by editing the +# MODULES line in component.cdf file, e.g. +# +# Component INCLUDE_MYCOMPONENT { +# +# MODULES foo.o goo.o \ +# myLibrary.o +# + + +# rules to build custom libraries + diff --git a/bdb/dist/vx_3.1/cdf.1 b/bdb/dist/vx_3.1/cdf.1 new file mode 100644 index 00000000000..17db06f7e61 --- /dev/null +++ b/bdb/dist/vx_3.1/cdf.1 @@ -0,0 +1,12 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE_BERKELEYDB { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS diff --git a/bdb/dist/vx_3.1/cdf.2 b/bdb/dist/vx_3.1/cdf.2 new file mode 100644 index 00000000000..76f123af9fb --- /dev/null +++ b/bdb/dist/vx_3.1/cdf.2 @@ -0,0 +1,9 @@ + NAME BerkeleyDB + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + diff --git a/bdb/dist/vx_3.1/cdf.3 b/bdb/dist/vx_3.1/cdf.3 new file mode 100644 index 00000000000..a3146ced95a --- /dev/null +++ b/bdb/dist/vx_3.1/cdf.3 @@ -0,0 +1,2 @@ +/* Parameter information */ + diff --git a/bdb/dist/vx_3.1/component.cdf b/bdb/dist/vx_3.1/component.cdf new file mode 100644 index 00000000000..91edaa87853 --- /dev/null +++ b/bdb/dist/vx_3.1/component.cdf @@ -0,0 +1,30 @@ +/* component.cdf - dynamically updated configuration */ + +/* + * NOTE: you may edit this file to alter the configuration + * But all non-configuration information, including comments, + * will be lost upon rebuilding this project. + */ + +/* Component information */ + +Component INCLUDE___DB_CAPAPPL_NAME__ { + ENTRY_POINTS ALL_GLOBAL_SYMBOLS + MODULES __DB_APPLICATION_NAME__.o + NAME __DB_APPLICATION_NAME__ + PREF_DOMAIN ANY + _INIT_ORDER usrComponentsInit +} + +/* EntryPoint information */ + +/* Module information */ + +Module __DB_APPLICATION_NAME__.o { + + NAME __DB_APPLICATION_NAME__.o + SRC_PATH_NAME $PRJ_DIR/../__DB_APPLICATION_NAME__.c +} + +/* Parameter information */ + diff --git a/bdb/dist/vx_3.1/component.wpj b/bdb/dist/vx_3.1/component.wpj new file mode 100644 index 00000000000..01c51c1b97f --- /dev/null +++ b/bdb/dist/vx_3.1/component.wpj @@ -0,0 +1,475 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.1 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_objects +__DB_APPLICATION_NAME__.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_objects +__DB_APPLICATION_NAME__.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_objects +__DB_APPLICATION_NAME__.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_objects +__DB_APPLICATION_NAME__.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR)/../.. \ + -I$(PRJ_DIR)/../../.. \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug + + + PROJECT_FILES +$(PRJ_DIR)/../__DB_APPLICATION_NAME__.c \ + $(PRJ_DIR)/compConfig.c + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUM2gnu.debug + + + WCC__LIST +PENTIUM2gnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/dist/vx_3.1/wpj.1 b/bdb/dist/vx_3.1/wpj.1 new file mode 100644 index 00000000000..414b4e8fa35 --- /dev/null +++ b/bdb/dist/vx_3.1/wpj.1 @@ -0,0 +1,22 @@ +Document file - DO NOT EDIT + + CORE_INFO_TYPE +::prj_component + + + CORE_INFO_VERSION +AE1.0 + + + BUILD__CURRENT +PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.debug_CURRENT_TARGET +default + + + BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU +0 + + diff --git a/bdb/dist/vx_3.1/wpj.2 b/bdb/dist/vx_3.1/wpj.2 new file mode 100644 index 00000000000..0294f763ef7 --- /dev/null +++ b/bdb/dist/vx_3.1/wpj.2 @@ -0,0 +1,130 @@ + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 \ + -I$(PRJ_DIR)/.. \ + -I$(PRJ_DIR)/../.. \ + -DDEBUG \ + -DDIAGNOSTIC + + + BUILD_PENTIUM2gnu.debug_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.debug_RELEASE +0 + + + BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.debug_TC +::tc_PENTIUM2gnu.debug + + + BUILD_PENTIUM2gnu.release_DEFAULTFORCPU +0 + + diff --git a/bdb/dist/vx_3.1/wpj.3 b/bdb/dist/vx_3.1/wpj.3 new file mode 100644 index 00000000000..f06e6253923 --- /dev/null +++ b/bdb/dist/vx_3.1/wpj.3 @@ -0,0 +1,128 @@ + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUM2gnu.release_MACRO_AR +arpentium + + + BUILD_PENTIUM2gnu.release_MACRO_AS +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CC +ccpentium + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 \ + -I$(PRJ_DIR)/.. \ + -I$(PRJ_DIR)/../.. + + + BUILD_PENTIUM2gnu.release_MACRO_CFLAGS_AS +-mcpu=pentiumpro \ + -march=pentiumpro \ + -ansi \ + -O2 \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM2 + + + BUILD_PENTIUM2gnu.release_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUM2gnu.release_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUM2gnu.release_MACRO_LD +ldpentium + + + BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS +-X + + + BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUM2gnu.release_MACRO_NM +nmpentium -g + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUM2gnu.release_MACRO_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_MACRO_SIZE +sizepentium + + + BUILD_PENTIUM2gnu.release_RELEASE +1 + + + BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUM2gnu.release_TC +::tc_PENTIUM2gnu.release + + + BUILD_PENTIUMgnu.debug_DEFAULTFORCPU +1 + + diff --git a/bdb/dist/vx_3.1/wpj.4 b/bdb/dist/vx_3.1/wpj.4 new file mode 100644 index 00000000000..84de6ebf359 --- /dev/null +++ b/bdb/dist/vx_3.1/wpj.4 @@ -0,0 +1,135 @@ + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags +toolMacro objects + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects +compConfig.o + + + BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro +CC + + + BUILD_PENTIUMgnu.debug_MACRO_AR +arpentium + + + BUILD_PENTIUMgnu.debug_MACRO_AS +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CC +ccpentium + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -MD \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM \ + -I$(PRJ_DIR)/.. \ + -I$(PRJ_DIR)/../.. \ + -DDEBUG \ + -DDIAGNOSTIC + + + BUILD_PENTIUMgnu.debug_MACRO_CFLAGS_AS +-mcpu=pentium \ + -march=pentium \ + -ansi \ + -g \ + -nostdlib \ + -fno-builtin \ + -fno-defer-pop \ + -P \ + -x \ + assembler-with-cpp \ + -Wall \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PENTIUM + + + BUILD_PENTIUMgnu.debug_MACRO_CPP +ccpentium -E -P + + + BUILD_PENTIUMgnu.debug_MACRO_CPPFILT +c++filtpentium --strip-underscores + + + BUILD_PENTIUMgnu.debug_MACRO_LD +ldpentium + + + BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS +-X + + + BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL +ccpentium \ + -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \ + -nostdlib \ + -r \ + -Wl,-X + + + BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PENTIUMgnu.debug_MACRO_NM +nmpentium -g + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE +-MD + + + BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PENTIUMgnu.debug_MACRO_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_MACRO_SIZE +sizepentium + + + BUILD_PENTIUMgnu.debug_RELEASE +0 + + + BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH +$(WIND_BASE)/target/h/ + + + BUILD_PENTIUMgnu.debug_TC +::tc_PENTIUMgnu.debug + + + BUILD__LIST +PENTIUMgnu.debug PENTIUM2gnu.debug PENTIUM2gnu.release + + + COMPONENT_COM_TYPE + + + + PROJECT_FILES diff --git a/bdb/dist/vx_3.1/wpj.5 b/bdb/dist/vx_3.1/wpj.5 new file mode 100644 index 00000000000..f4056e7e22a --- /dev/null +++ b/bdb/dist/vx_3.1/wpj.5 @@ -0,0 +1,22 @@ + + + WCC__CDF_PATH +$(PRJ_DIR) + + + WCC__CURRENT +PENTIUMgnu.debug + + + WCC__LIST +PENTIUMgnu.debug + + + WCC__MXR_LIBS +lib$(CPU)$(TOOL)vx.a + + + WCC__OBJS_PATH +$(WIND_BASE)/target/lib/obj$CPU$TOOLvx + + diff --git a/bdb/dist/vx_buildcd b/bdb/dist/vx_buildcd new file mode 100755 index 00000000000..a94d78db974 --- /dev/null +++ b/bdb/dist/vx_buildcd @@ -0,0 +1,119 @@ +#!/bin/sh +# $Id: vx_buildcd,v 1.6 2001/11/05 21:05:58 sue Exp $ +# +# Build the Setup SDK CD image on the VxWorks host machine. + +. ./RELEASE + +B=`pwd` +B=$B/.. +D=$B/dist/vx_setup +C=$D/db.CD +Q=/export/home/sue/SetupSDK +S=$Q/resource/mfg/setup +W=sun4-solaris2 + +symdoc=$D/docs/BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH +symdb=$D/windlink/sleepycat/BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH +rm -rf $D/docs $D/windlink +mkdir $D/docs $D/windlink $D/windlink/sleepycat +ln -s $B/docs $symdoc +ln -s $B $symdb + +s=/tmp/__db_a +t=/tmp/__db_b + +# +# Remove the old CD directory if it is there. +if test -d $C; then + echo "$C cannot exist." + echo "As root, execute 'rm -rf $C'" + echo "and then rerun the script" + exit 1 +fi + +# +# Check for absolute pathnames in the project files. +# That is bad, but Tornado insists on putting them in +# whenever you add new files. +# +rm -f $t +f=`find $B/build_vxworks -name \*.wpj -print` +for i in $f; do + grep -l -- "$B" $i >> $t +done +if test -s $t; then + echo "The following files contain absolute pathnames." + echo "They must be fixed before building the CD image:" + cat $t + exit 1 +fi + +# +# NOTE: We reuse the same sed script over several files. +# +cat < $s +s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g +s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g +s/@DB_VERSION_PATCH@/$DB_VERSION_PATCH/g +s#@DB_SETUP_DIR@#$D#g +ENDOFSEDTEXT + +f=$D/setup.pool +(sed -f $s $D/vx_setup.in) > $t + (echo "Building $f" && rm -f $f && cp $t $f) + +f=$D/README.TXT +(sed -f $s $D/README.in) > $t + (echo "Building $f" && rm -f $f && cp $t $f) + +f=$D/CONFIG.TCL +(sed -f $s $D/CONFIG.in) > $t + (echo "Building $f" && rm -f $f && cp $t $f) + +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. +(cd $D && cp README.TXT $S) +(cd $D && cp LICENSE.TXT $S) +(cd $D && cp CONFIG.TCL $S/RESOURCE/TCL) +(cd $D && cp SETUP.BMP $S/RESOURCE/BITMAPS) + +# +# NOTE: The contents of LIB must be on one, long, single line. +# Even preserving it with a \ doesn't work for htmlBook. +# +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} {} {} {} +ENDOFLIBTEXT + +# +# Start generating the file list. +f=$D/filelist.all + +# +# Just put everything into the image. But we only want to find regular +# files; we cannot have all the directories listed too. +# +# NOTE: This find is overly aggressive in getting files, particularly +# for the 'windlink/sleepycat' files. We actually end up with 3 sets of the +# documentation, the "real" ones in 'docs/BerkeleyDB*', the set found +# via 'windlink/sleepycat/Berk*/docs' and the one found via our symlink in +# 'windlink/sleepycat/Berk*/dist/vx_setup/docs/Berk*'. +# +# However, we waste a little disk space so that the expression below +# is trivial and we don't have to maintain it as new files/directories +# are added to DB. +# +(cd $D && find docs/BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH/ -follow -name \* -type f -print) > $t +(cd $D && find windlink/sleepycat/BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH/ -follow -name docs -prune -o -type f -print) >> $t +(echo "Building $f" && rm -f $f && cp $t $f) +# +# Finally build the CD image! +# +env PATH=$Q/$W/bin:$PATH QMS_BASE=$Q WIND_HOST_TYPE=$W \ +pool mfg -d $C -v -nokey BerkeleyDB.$DB_VERSION_MAJOR.$DB_VERSION_MINOR < $D/setup.pool diff --git a/bdb/dist/vx_config.in b/bdb/dist/vx_config.in new file mode 100644 index 00000000000..43fc8eb71f3 --- /dev/null +++ b/bdb/dist/vx_config.in @@ -0,0 +1,381 @@ +/* !!! + * The CONFIG_TEST option may be added using the Tornado project build. + * DO NOT modify it here. + */ +/* Define to 1 if you want to build a version for running the test suite. */ +/* #undef CONFIG_TEST */ + +/* !!! + * The DEBUG option may be added using the Tornado project build. + * DO NOT modify it here. + */ +/* Define to 1 if you want a debugging version. */ +/* #undef DEBUG */ + +/* 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 */ + +/* !!! + * The DIAGNOSTIC option may be added using the Tornado project build. + * DO NOT modify it here. + */ +/* Define to 1 if you want a version with run-time diagnostic checking. */ +/* #undef DIAGNOSTIC */ + +/* 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 `directio' function. */ +/* #undef HAVE_DIRECTIO */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* 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 fcntl/F_SETFD denies child access to file descriptors. */ +/* #undef HAVE_FCNTL_F_SETFD */ + +/* Define to 1 if allocated filesystem blocks are not zeroed. */ +#define HAVE_FILESYSTEM_NOTZERO 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getopt' function. */ +/* #undef HAVE_GETOPT */ + +/* 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 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 `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 `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 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 msem_XXX mutexes on systems other than HP-UX. */ +/* #undef HAVE_MUTEX_MSEM_INIT */ + +/* Define to 1 to use the GCC compiler and Apple PowerPC assembly language. */ +/* #undef HAVE_MUTEX_PPC_APPLE_GCC_ASSEMBLY */ + +/* Define to 1 to use the GCC compiler and generic PowerPC assembly language. + */ +/* #undef HAVE_MUTEX_PPC_GENERIC_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 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. */ +#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 */ + +/* 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. */ +#define HAVE_MUTEX_VXWORKS 1 + +/* Define to 1 to use Windows mutexes. */ +/* #undef HAVE_MUTEX_WIN32 */ + +/* 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 `pstat_getdynamic' function. */ +/* #undef HAVE_PSTAT_GETDYNAMIC */ + +/* 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 you have the `qsort' function. */ +#define HAVE_QSORT 1 + +/* Define to 1 if you have the `raise' function. */ +#define HAVE_RAISE 1 + +/* Define to 1 if building RPC client/server. */ +/* #undef HAVE_RPC */ + +/* Define to 1 if you have the `sched_yield' function. */ +#define HAVE_SCHED_YIELD 1 + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `shmget' function. */ +/* #undef HAVE_SHMGET */ + +/* Define to 1 if you have the `snprintf' function. */ +/* #undef HAVE_SNPRINTF */ + +/* 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 `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 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 `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if `st_blksize' is member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 + +/* 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, 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. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TIME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TYPES_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if unlink of file with open file descriptors will fail. */ +#define HAVE_UNLINK_WITH_OPEN_FAILURE 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define to 1 if building VxWorks. */ +#define HAVE_VXWORKS 1 + +/* Define to 1 if you have the `yield' function. */ +/* #undef HAVE_YIELD */ + +/* Define to 1 if you have the `_fstati64' function. */ +/* #undef HAVE__FSTATI64 */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "support@sleepycat.com" + +/* 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 __EDIT_DB_VERSION__" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "db-__EDIT_DB_VERSION__" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "__EDIT_DB_VERSION__" + +/* 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 unitialized 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 */ + +/* + * 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 "vxWorks.h" diff --git a/bdb/dist/vx_setup/CONFIG.in b/bdb/dist/vx_setup/CONFIG.in new file mode 100644 index 00000000000..6ccceee7034 --- /dev/null +++ b/bdb/dist/vx_setup/CONFIG.in @@ -0,0 +1,10 @@ +# +# Install configuration file. +# +# Note: This file may be modified during the pool manufacturing process to +# add additional configuration statements. This file is sourced by +# INSTW32.TCL. +# + +cdromDescSet "Berkeley DB @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@DB_VERSION_PATCH@" + diff --git a/bdb/dist/vx_setup/LICENSE.TXT b/bdb/dist/vx_setup/LICENSE.TXT new file mode 100644 index 00000000000..7814c679cd7 --- /dev/null +++ b/bdb/dist/vx_setup/LICENSE.TXT @@ -0,0 +1,3 @@ +Copyright (c) 1996-2002 + Sleepycat Software. All rights reserved. +See the file LICENSE for redistribution information. diff --git a/bdb/dist/vx_setup/MESSAGES.TCL b/bdb/dist/vx_setup/MESSAGES.TCL new file mode 100644 index 00000000000..718a67fbc50 --- /dev/null +++ b/bdb/dist/vx_setup/MESSAGES.TCL @@ -0,0 +1,651 @@ +# MESSAGES.TCL - All setup strings. + +# modification history +# -------------------- +# 03q,20apr99,bjl added release notes message for backward compatibility +# page. +# 03p,12apr99,wmd Add word about simulator in message about the drivers +# object product. +# 03o,03mar99,tcy Adjust setup directory size based on platform (fix for +# SPR 25228) +# 03n,24feb99,tcy modified DLL update messages +# 03m,22feb99,tcy modified to align messages +# 03l,17feb99,tcy modified message in the finish page for program group +# installation +# 03k,11feb99,tcy added messages for backward compatibility page +# 03j,25jan99,tcy added messages from INSTW32.TCL +# 03i,25jan99,wmd Reword the message for 5010_DRIVERS_INFO. +# 03h,09dec98,bjl added messages about manufacturers updating patches. +# 03g,01dec98,wmd Fix typos. +# 03f,23nov98,tcy warn user to disable virus protection on Welcome screen +# 03e,19nov98,wmd fixed minor nits in wording. +# 03d,19nov98,bjl added web site locations for patchinfo. +# 03c,18nov98,bjl added formatted patch messages for patchinfo file. +# 03b,12nov98,tcy added message for not saving installation key +# 03a,10nov98,tcy added warning message for space in destination directory +# removed message for checking temporary disk space +# 02z,27oct98,bjl added recommended patch messages, modified required msg. +# 02y,26oct98,tcy added message for checking temporary disk space +# 02x,22oct98,wmd fix messages for clarity. +# 02w,21oct98,wmd fix message for drv/obj. +# 02v,20oct98,tcy added message for updating system and changed dcom message +# 02u,20oct98,bjl added tornado registry name entry message. +# 02t,19oct98,bjl added tornado registry description message. +# 02s,16oct98,wmd add new message for driver product warning. +# 02r,16oct98,wmd fixed README.TXT description. +# 02q,12oct98,tcy removed extraneous "the" from messages +# 02p,06oct98,tcy added CD description to Welcome page +# 02o,29sep98,bjl added required patches message 5000_PATCHES_TEXT. +# 02n,29sep98,wmd add text for readme page +# 02m,29sep98,tcy refined DLL registration page text +# 02l,29sep98,tcy changed message for DCOM +# 02k,26sep98,tcy added messages for DLL and DCOM pages +# 02j,24sep98,tcy removed "following" from 1080_WARN_4 message. +# 02i,17sep98,tcy added comment on size of SETUP files to 1140_COMP_SELECT. +# 02h,17sep98,wmd reword message 1080_WARN_4. +# 02g,14sep98,tcy changed 1210_FINISH and 1550_USAGE messages +# 02f,08sep98,tcy warn user library update may take several minutes +# 02e,01sep98,wmd reword message for installing over tree. +# added new messages for license agreement pages. +# 02d,20aug98,wmd added message for license agreeement. +# 02c,18aug98,tcy added message for zip-file dialog box +# 02d,04aug98,wmd added newer/older duplicate file warnings. +# 02c,24jul98,tcy added system check messages +# 02b,16jul98,wmd add new messages for T-2. +# 02a,22jul98,tcy moved license messages to LICW32.TCL; +# removed portMapper messages +# 01n,09feb98,pdn updated string 1080_WARN_4 +# 01m,08apr97,pdn added new string for remote icon installing +# fixed spr#8334 +# 01l,08mar97,tcy fixed language in string id 3340 +# 01k,07mar97,tcy added string id 3340 +# 01j,10feb97,pdn added more license messages. +# 01i,09feb97,pdn implemented variable argument list for strTableGet(), +# clean up. +# 01h,17jan97,jmo fixed language in strings +# 01g,12dec96,tcy merged in TEXT-only strings +# 01f,12dec96,pdn added 1080_WARN_4 string warning that CD-ROM +# revision is older than expected. +# 01e,27nov96,sj added string for warning against installing in +# the root of windows drive. +# 01d,18nov96,tcy added strings for text-based installation script +# 01c,14nov96,pdn substituted function for some global variables +# 01b,14nov96,sj added strings from Windows installation script +# 01a,11nov96,pdn written + +proc strTableGet {strId args} { + global strTable + global setupVals + global current_file + + if [regexp {^format.*$} $strTable($strId) junk] { + return [eval $strTable($strId)] + } { + return $strTable($strId) + } +} + +set strTable(1000_WELCOME_CD) \ + "format %s \"[cdNameGet description]\"" + +set strTable(1000_WELCOME1) \ + "format %s \"Welcome to the SETUP program. This program will\ + install \[cdromDescGet\] on your computer.\"" + +set strTable(1010_WELCOME2) \ + "It is strongly recommended that you exit all programs and disable virus\ + protection before running this SETUP program." + +set strTable(1020_WELCOME3) \ + "At any time, you can quit the SETUP program by clicking the \ + button. You also can go back to previous dialog boxes by clicking the\ + button. To accept the current settings for a dialog box and go on\ + with the installation process, click the button." + +set strTable(3020_WELCOME3) \ + "format %s \"At any prompt, you can cancel installation \[cdromDescGet\]\ + by typing \'exit\'. You can also go to the previous question\ + by typing \'-\'. To accept current settings and go on with\ + the installation process, press .\"" + +set strTable(1030_WELCOME4) \ + "WARNING: This program is protected by copyright law and international\ + treaties." + +set strTable(1040_WELCOME5) \ + "Unauthorized reproduction or distribution of this program, or any portion\ + of it, may result in severe civil and criminal penalties, and will be\ + prosecuted to the maximum extent possible under law." + +set strTable(1050_ROOT_WARN) \ + "format %s \"Installing \[cdromDescGet\] as \[setupId effective user\] is not\ + recommended. We suggest that you logoff and logon as a normal\ + user before running this program.\ + \n\nClick Next to continue with SETUP anyway.\"" + +set strTable(3050_ROOT_WARN) \ + "format %s \"Installing \[cdromDescGet\] as \[setupId effective user\]\ + is not recommended. We suggest that you logoff and \ + logon as a normal user before running this program.\ + \n\nPress to continue with SETUP anyway.\"" + +set strTable(1051_ROOT_WARN) \ + "format %s \"Installing \[cdromDescGet\] without System Administrator\ + privileges is not recommended. Under your present privileges,\ + SETUP will not offer certain installation options, such as \ + the installation of some services, etc. Also, the software\ + will be installed as a personal copy and will not be visible\ + to other users on this machine.\ + \n\nTo install \[cdromDescGet\] with access to all its\ + installation features and options, we suggest that you exit\ + the installation now and rerun it later with System\ + Administrator\'s privileges.\n\nClick to continue with\ + SETUP anyway.\"" + +set strTable(1060_REGISTRATION) \ + "Below, type your name, the name of your company." + +set strTable(1070_WARN_1) \ + "The installation key you entered is invalid. Please enter a valid\ + installation key." + +set strTable(1071_WARN_1) \ + "Please enter the requested information." + +set strTable(1080_WARN_2) \ + "You entered a key that was not created for this CD-ROM. Please verify\ + that you are using the appropriate key. If this problem persists, contact\ + Wind River Systems Sales department for help." + +set strTable(1080_WARN_3) \ + "The installation key you entered is meant for other vendor's CD-ROM.\ + Please contact the vendor who issued the CD-ROM for a proper key." + +set strTable(1085_WARN_4) \ + "This CD-ROM does not require an installation key. Click the \"Next\"\ + button to continue the installation." + +set strTable(1090_WARN_3) \ + "format %s \"Can\'t initiate SETUP: \[lindex \$args 0\]. Please correct\ + the problem then run SETUP again.\"" + +set strTable(1095_WARN_NO_TCPIP) \ + "SETUP has detected that your system does not have TCP-IP installed.\ + To correct the problem, please contact your administrator and then\ + run SETUP again.\nAborting setup." + +set strTable(1097_WARN_NO_LONGFILENAME_SUP) \ + "SETUP has detected that your system does not have long filename\ + support. To correct the problem, please contact your administrator\ + and then run SETUP again.\nAborting setup." + +set strTable(1105_FULL_INSTALL) \ + "Installs the Tornado products, tools, compilers, and other optional\ + components that you may have purchased." + +set strTable(1107_PROGRAM_GROUP) \ +"Installs only the Tornado program group and tools icons for access to\ + Tornado tools installed on a remote server." + +set strTable(1100_DEST_DIR) \ + "format %s \"Please type the name of the directory where you want SETUP to\ + install \[cdromDescGet\].\ + \n\nClick the button to choose the directory\ + interactively.\"" + +set strTable(1100_REMOTE_DIR) \ + "format %s \"Please type the name of the directory where Tornado has\ + already been installed.\ + \n\nClick the button to choose the directory\ + interactively.\"" + +set strTable(3100_DEST_DIR) \ + "format %s \"Please type the name of the directory where you want SETUP\ + to install \[cdromDescGet\].\"" + +set strTable(1110_DEST_DIR_WARN) \ + "The installation directory you entered does not exist.\ + \nDo you want to create it now?" + +set strTable(3110_DEST_DIR_WARN) \ + "The installation directory you entered does not exist." + +set strTable(3115_DEST_DIR_QUESTION) \ + "Do you want to create it now? \[y\]" + +set strTable(1111_DEST_DIR_WARN) \ + "format %s \"Installing \[cdromDescGet\] in the root directory is not\ + recommended.\nClick to select another directory.\"" + +set strTable(1120_DEST_DIR_WARN2) \ + "format %s \"Creating \[destDirGet\] failed: file exists.\"" + +set strTable(1121_DEST_DIR_WARN2) \ + "format %s \"Installing in \[destDirGet\] is not recommended.\ + \nDo you want to change the installation directory?\"" + +set strTable(1122_DEST_DIR_WARN2) \ + "format %s \"Unable to create \[destDirGet\].\"" + +set strTable(1130_DEST_DIR_WARN3) \ + "You do not have permission to write files into the installation directory\ + you entered.\ + \n\nPlease choose a writable directory." + +set strTable(1135_DEST_DIR_WARN4) \ + "format %s \"The installation directory you entered contains white\ + space(s). Please select another directory.\"" + +set strTable(1137_DUP_PRODUCT_WARN) \ + "format %s \"Reinstalling products may potentially destroy any\ + modifications you may have made to previously installed files.\ + Do you wish to continue with the installation or go back to the\ + '\[strTableGet 1450_TITLE_OPTION\]' page to reconsider your choices?\"" + +set strTable(3155_COMP_SELECT_QUESTION) \ + "Do you want to go back and specify a directory on a bigger partition?\ + \[y\]" + +set strTable(1140_COMP_SELECT) \ + "format %s \"In the option list below, please check all items you wish\ + to install. SETUP files will be copied to your selected directory and\ + take up \[setupSizeGet\] MB of disk space.\n\"" + +set strTable(3140_COMP_SELECT) \ + "In the option list below, select the item(s) you want to install." + +set strTable(3145_COMP_SELECT_CHANGE) \ + "Press to accept the setting. To change the setting, enter a\ + list of item numbers separated by spaces." + +set strTable(3145_COMP_SELECT_CHANGE_INVALID) \ + "The item number(s) you entered is not valid." + +set strTable(1150_COMP_SELECT_WARN) \ + "There is not enough disk space to install the selected component(s).\ + \n\nDo you want to go back and specify a directory on a bigger disk or\ + partition?" + +set strTable(3150_COMP_SELECT_WARN) \ + "There is not enough space to install the selected component(s)." + +set strTable(1151_COMP_SELECT_WARN) \ + "At least one component must be selected to continue installation." + +set strTable(1160_PERMISSION) \ + "SETUP is about to install the component(s) you have requested.\ + \n\nThe selected button(s) below indicate the file permissions which\ + will be set during the installation process.\ + \n\nPlease adjust these to suit your site requirements." + +set strTable(3160_PERMISSION) \ + "SETUP is about to install the component(s) you have requested." + +set strTable(3162_PERMISSION) \ + "The list below indicates the file permissions which will be set during\ + the installation process. Please adjust these to suit your site\ + requirements." + +set strTable(3165_PERMISSION_QUESTION) \ + "Press to accept the setting. To change the setting, enter a\ + list of item numbers separated by spaces." + +set strTable(1161_FOLDER_SELECT) \ + "SETUP will add program icons to the Program Folder listed below. You may\ + type a new folder name, or select one from the existing Folders list." + +set strTable(1162_FOLDER_SELECT) \ + "Please enter a valid folder name." + +set strTable(1170_FILE_COPY) \ + "format %s \"SETUP is copying the selected component(s) to the directory\ + \[destDirGet\].\"" + +set strTable(1171_FILE_COPY) \ + "format %s \"SETUP cannot read \[setupFileNameGet 0\] from the CD-ROM.\ + Please ensure that the CD-ROM is properly mounted.\"" + +set strTable(1180_LIB_UPDATE) \ + "SETUP is updating the VxWorks libraries. We recommend that you let\ + SETUP finish this step, or the libraries will be in an inconsistent\ + state. Please be patient as the process may take several minutes. \ + If you want to quit the SETUP program, click and run\ + the SETUP program again at a later time." + +set strTable(3180_LIB_UPDATE) \ + "SETUP is updating the VxWorks libraries." + +set strTable(1190_REGISTRY_HOST) \ + "The Tornado Registry is a daemon that keeps track of all available\ + targets by name. Only one registry is required on your network, \ + and it can run on any networked host.\ + \n\nPlease enter the name of the host where the Tornado Registry will\ + be running." + +set strTable(1191_REGISTRY_DESC) \ + "The Tornado Registry is a daemon that keeps track of all available\ + targets by name. Only one registry is required on your network, \ + and it can run on any networked host." + +set strTable(1192_REGISTRY_NAME) \ + "Please enter the name of the host where the Tornado Registry will\ + be running." + +set strTable(1200_FINISH_WARN) \ + "format %s \"However, there were \[errorCountGet\] error(s) which occured\ + during the process. Please review the log file\ + \[destDirDispGet\]/setup.log for more information.\"" + +set strTable(1210_FINISH) \ + "format %s \"SETUP has completed installing the selected product(s).\"" + +set strTable(1212_FINISH) \ + "SETUP has completed installing the program folders and icons." + +set strTable(1213_FINISH) \ + "Terminating SETUP program." + +set strTable(1360_QUIT_CALLBACK) \ + "format %s \"SETUP is not complete. If you quit the SETUP program now,\ + \[cdromDescGet\] will not be installed.\n\nYou may run\ + the SETUP program at a later time to complete the\ + installation.\ + \n\nTo continue installing the program, click . \ + To quit the SETUP program, click .\"" + +set strTable(3360_QUIT_CALLBACK) \ + "format %s \"SETUP is not complete. If you quit the SETUP program now,\ + \[cdromDescGet\] will not be installed.\n\nYou may run the\ + SETUP program at a later time to complete the installation.\ + \n\nTo continue installing the program, Press . \ + To quit the SETUP program, type \'exit\'.\"" + +set strTable(1370_FILE_ACCESS_ERROR) \ + "format %s \"SETUP cannot create/update file \[lindex \$args 0\]:\ + \[lindex \$args 1\]\"" + +set strTable(1380_DEFLATE_ERROR) \ + "format %s \"SETUP isn\'t able to deflate \[setupFileNameGet 0\]\ + \n\nPlease select one of the following options\ + to continue with the SETUP process.\"" + +set strTable(1390_MEMORY_LOW) \ + "The system is running out of memory. To continue, close applications\ + or increase the system swap space." + +set strTable(1400_DISK_FULL) \ + "No disk space left. To continue, free up some disk space." + +set strTable(1550_USAGE) \ + "Usage: SETUP /I\[con\]\]\t\n\ + /I : Add standard Tornado icons \n\ + from a remote installation" + +set strTable(1410_TITLE_WELCOME) "Welcome" +set strTable(1420_TITLE_WARNING) "Warning" +set strTable(1430_TITLE_REGISTRATION) "User Registration" +set strTable(1440_TITLE_DESTDIR) "Select Directory" +set strTable(1450_TITLE_OPTION) "Select Products" +set strTable(1460_TITLE_PERMISSION) "Permission" +set strTable(1470_TITLE_FILECOPY) "Copying Files" +set strTable(1480_TITLE_LIBUPDATE) "Update Libraries" +set strTable(1490_TITLE_REGISTRY_HOST) "Tornado Registry" +set strTable(1495_TITLE_BACKWARD_COMPATIBILITY) "Backward Compatibility" +set strTable(1500_TITLE_FINISH) "Finish" +set strTable(1560_TITLE_FOLDER) "Select Folder" +set strTable(1563_TITLE_DLL_REG) "Software Registration" +set strTable(1567_TITLE_DCOM) "DCOM Installation" + +set strTable(1570_OPTION_SELECT) \ + "Choose one of the options listed below, then click the\ + button to continue the installation." + +set strTable(1576_OPTION_MANUAL) \ + "Install Tornado Registry manually" + +set strTable(1577_OPTION_STARTUP) \ + "Install Tornado Registry locally in the Startup Group" + +set strTable(1578_OPTION_SERVICE) \ + "Install Tornado Registry locally as a Service" + +set strTable(1579_OPTION_REMOTE) \ + "Configure to use a remote Tornado Registry" + +set strTable(1580_OPTION_DESC) \ + "If you plan on running Tornado in a non-networked environment, we\ + recommend that you install the registry in your Startup Group or as an\ + NT Service. For more information, consult your Tornado User\'s Guide." + +set strTable(1581_OPTION_DESC) \ + "If you plan on running Tornado in a non-networked environment, we\ + recommend that you install the registry in your Startup Group. For more\ + information, consult your Tornado User\'s Guide." + +set strTable(3000_RETURN_QUESTION) \ + "Press to continue" + +set strTable(3055_EXIT_QUESTION) \ + "Type \'exit\' to quit the program or press to continue" + +set strTable(3370_BACK_CALLBACK) \ + "Cannot go back further." + +set strTable(1080_WARN_4) \ + "The installation key you entered attempted to unlock one or more \ + products that may have been removed from our product line. \ + Please compare the unlocked product list on the\ + \"[strTableGet 1450_TITLE_OPTION]\" screen with your purchased order\ + list, and contact us if you discover any differences." + +set strTable(4000_BASE_INSTALL_WARN) \ + "format %s \"Warning! Re-installing Tornado over an existing \ + tree will overwrite any installed patches. \ + If you proceed with the installation, please \ + re-install patches if any.\"" + +set strTable(4000_BASE_INSTALL_WARN_1) \ + "Select to overwrite existing Tornado installation,\ + or choose