Merge akishkin@work.mysql.com:/home/bk/mysql-4.1

into mysql.com:/home/walrus/bk/41
This commit is contained in:
unknown 2002-11-05 00:09:54 +05:00
commit 9cd8bd657e
1273 changed files with 174064 additions and 59872 deletions

View file

@ -75,6 +75,7 @@ Makefile.in'
PENDING/*
TAGS
aclocal.m4
autom4te.cache/*
bdb/README
bdb/btree/btree_auto.c
bdb/build_unix/*
@ -192,6 +193,7 @@ config.h.in
config.log
config.status
configure
configure.lineno
core
db-*.*.*
dbug/user.t
@ -209,10 +211,13 @@ include/my_config.h
include/my_global.h
include/mysql_version.h
include/widec.h
innobase/autom4te.cache/*
innobase/configure.lineno
innobase/conftest.s1
innobase/conftest.subs
innobase/ib_config.h
innobase/ib_config.h.in
innobase/stamp-h1
isam/isamchk
isam/isamlog
isam/pack_isam
@ -302,6 +307,7 @@ libmysqld/sql_db.cc
libmysqld/sql_delete.cc
libmysqld/sql_do.cc
libmysqld/sql_handler.cc
libmysqld/sql_help.cc
libmysqld/sql_insert.cc
libmysqld/sql_lex.cc
libmysqld/sql_list.cc
@ -361,6 +367,8 @@ myisam/myisamchk
myisam/myisamlog
myisam/myisampack
myisam/rt_test
myisam/rt_test.MYD
myisam/rt_test.MYI
myisam/sp_test
myisam/test1.MYD
myisam/test1.MYI
@ -405,6 +413,8 @@ repl-tests/test-repl/foo-dump-slave.master.
repl-tests/test-repl/sum-wlen-slave.master.
repl-tests/test-repl/sum-wlen-slave.master.re
repl-tests/test-repl/sum-wlen-slave.master.reje
scripts/fill_func_tables
scripts/fill_func_tables.sql
scripts/make_binary_distribution
scripts/msql2mysql
scripts/mysql_config
@ -474,8 +484,11 @@ sql/sql_select.cc.orig
sql/sql_yacc.cc
sql/sql_yacc.h
sql/sql_yacc.yy.orig
sql_error.cc
sql_prepare.cc
stamp-h
stamp-h.in
stamp-h1
strings/conf_to_src
strings/ctype_autoconf.c
strings/ctype_extra_sources.c
@ -503,13 +516,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
sql_error.cc
sql_prepare.cc
autom4te.cache/*
innobase/autom4te.cache/*
configure.lineno
innobase/configure.lineno
innobase/stamp-h1
myisam/rt_test.MYD
myisam/rt_test.MYI
stamp-h1

View file

@ -14,8 +14,7 @@ $make -k clean || true
/bin/rm -f */.deps/*.P config.cache innobase/config.cache bdb/build_unix/config.cache
aclocal && autoheader && aclocal && automake && autoconf
# TODO: remove when DBD will be OK
#(cd bdb/dist && sh s_all)
(cd bdb/dist && sh s_all)
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
if [ -d gemini ]
then

View file

@ -69,4 +69,5 @@ pager:
hours:
[serg:]checkout:get
[arjen:]checkout:get
[nick:]checkout:get
checkout:edit

View file

@ -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], [

View file

@ -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

View file

@ -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)));
}
/*

View file

@ -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);
}

View file

@ -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);
}

File diff suppressed because it is too large Load diff

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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(&copy, 0, sizeof(copy));
if ((ret = __db_goff(dbp, &copy, 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);
}

View file

@ -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(&copy_lsn, &LSN(argp->header.data), sizeof(DB_LSN));
cmp_n = log_compare(lsnp, &LSN(pagep));
cmp_p = log_compare(&LSN(pagep), &copy_lsn);
CHECK_LSN(op, cmp_p, &LSN(pagep), &copy_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(&copy_lsn, &LSN(argp->pgdbt.data), sizeof(DB_LSN));
(void)__ua_memcpy(&copy_lsn, &LSN(argp->pgdbt.data), sizeof(DB_LSN));
cmp_n = log_compare(lsnp, &LSN(pagep));
cmp_p = log_compare(&LSN(pagep), &copy_lsn);
CHECK_LSN(op, cmp_p, &LSN(pagep), &copy_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;

View file

@ -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);
}

View file

@ -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 <sys/types.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#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;

View file

@ -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;
}

View file

@ -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;

View file

@ -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);
}

View file

@ -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;

View file

@ -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;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -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 <sys/types.h>
INCLUDE
INCLUDE #include <ctype.h>
INCLUDE #include <errno.h>
INCLUDE #include <string.h>
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. */

File diff suppressed because it is too large Load diff

View file

@ -10,12 +10,17 @@ Workspace
<BEGIN> 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
<END>
<BEGIN> userComments

View file

@ -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

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -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 <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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 <stdio.h>
#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);
}

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_archive.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_archive.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_archive.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_archive.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_archive.c_dependencies
<END>
<BEGIN> FILE_db_archive.c_objects
db_archive.o
<END>
<BEGIN> FILE_db_archive.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_archive.c
<END>
<BEGIN> userComments
db_archive
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_objects
db_archive.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_objects
db_archive.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_archive.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_archive.c_objects
db_archive.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_archive.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_objects
db_archive.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_archive.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_archive.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

View file

@ -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 <sys/types.h>
#if TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <time.h>
#endif
#endif
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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 <stdio.h>
#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);
}

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_checkpoint.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_checkpoint.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_checkpoint.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_checkpoint.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_checkpoint.c_dependencies
<END>
<BEGIN> FILE_db_checkpoint.c_objects
db_checkpoint.o
<END>
<BEGIN> FILE_db_checkpoint.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_checkpoint.c
<END>
<BEGIN> userComments
db_checkpoint
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_objects
db_checkpoint.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_objects
db_checkpoint.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_checkpoint.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_checkpoint.c_objects
db_checkpoint.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_checkpoint.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_objects
db_checkpoint.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_checkpoint.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_checkpoint.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

View file

@ -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 <sys/types.h> doesn't define. */
/* #undef mode_t */
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Define if the `S_IS*' macros in <sys/stat.h> 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 <sys/time.h> and <time.h>. */
/* #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 <dirent.h> header file. */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define if you have the <sys/dir.h> 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 <sys/ndir.h> 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 <sys/select.h> 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 <sys/time.h> 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 <inttypes.h> 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 <memory.h> 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 <ndir.h> 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 <stdint.h> header file. */
/* #undef HAVE_STDINT_H */
/* Define to 1 if you have the <stdlib.h> 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 <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> 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 <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
/* #undef HAVE_SYS_STAT_H */
/* Define to 1 if you have the <sys/time.h> header file. */
/* #undef HAVE_SYS_TIME_H */
/* Define to 1 if you have the <sys/types.h> header file. */
/* #undef HAVE_SYS_TYPES_H */
/* Define to 1 if you have the <unistd.h> 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 <sys/stat.h> 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 <sys/time.h> and <time.h>. */
/* #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"

View file

@ -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 <sys/types.h>
#if TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <time.h>
#endif
#endif
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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 <stdio.h>
#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);
}

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_deadlock.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_deadlock.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_deadlock.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_deadlock.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_deadlock.c_dependencies
<END>
<BEGIN> FILE_db_deadlock.c_objects
db_deadlock.o
<END>
<BEGIN> FILE_db_deadlock.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_deadlock.c
<END>
<BEGIN> userComments
db_deadlock
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_objects
db_deadlock.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_objects
db_deadlock.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_deadlock.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_deadlock.c_objects
db_deadlock.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_deadlock.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_objects
db_deadlock.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_deadlock.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_deadlock.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

View file

@ -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 <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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 <stdio.h>
#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);
}

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_dump.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_dump.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_dump.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_dump.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_dump.c_dependencies
<END>
<BEGIN> FILE_db_dump.c_objects
db_dump.o
<END>
<BEGIN> FILE_db_dump.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_dump.c
<END>
<BEGIN> userComments
db_dump
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_objects
db_dump.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_objects
db_dump.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_dump.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_dump.c_objects
db_dump.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_dump.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_objects
db_dump.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_dump.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_dump.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_load.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_load.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_load.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_load.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_load.c_dependencies
<END>
<BEGIN> FILE_db_load.c_objects
db_load.o
<END>
<BEGIN> FILE_db_load.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_load.c
<END>
<BEGIN> userComments
db_load
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_objects
db_load.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_objects
db_load.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_load.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_load.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_load.c_objects
db_load.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_load.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_load.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_load.c_objects
db_load.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_load.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_load.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

View file

@ -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 <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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 <stdio.h>
#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);
}

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_printlog.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_printlog.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_printlog.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_printlog.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_printlog.c_dependencies
<END>
<BEGIN> FILE_db_printlog.c_objects
db_printlog.o
<END>
<BEGIN> FILE_db_printlog.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_printlog.c
<END>
<BEGIN> userComments
db_printlog
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_objects
db_printlog.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_objects
db_printlog.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_printlog.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_printlog.c_objects
db_printlog.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_printlog.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_objects
db_printlog.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_printlog.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_printlog.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

View file

@ -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 <sys/types.h>
#if TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <time.h>
#endif
#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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 <stdio.h>
#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, &timestamp)) != 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, &timestamp)) != 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);
}

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_recover.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_recover.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_recover.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_recover.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_recover.c_dependencies
<END>
<BEGIN> FILE_db_recover.c_objects
db_recover.o
<END>
<BEGIN> FILE_db_recover.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_recover.c
<END>
<BEGIN> userComments
db_recover
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_objects
db_recover.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_objects
db_recover.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_recover.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_recover.c_objects
db_recover.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_recover.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_objects
db_recover.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_recover.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_recover.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_stat.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_stat.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_stat.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_stat.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_stat.c_dependencies
<END>
<BEGIN> FILE_db_stat.c_objects
db_stat.o
<END>
<BEGIN> FILE_db_stat.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_stat.c
<END>
<BEGIN> userComments
db_stat
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_objects
db_stat.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_objects
db_stat.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_stat.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_stat.c_objects
db_stat.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_stat.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_objects
db_stat.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_stat.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_stat.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

View file

@ -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 <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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 <stdio.h>
#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);
}

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_upgrade.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_upgrade.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_upgrade.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_upgrade.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_upgrade.c_dependencies
<END>
<BEGIN> FILE_db_upgrade.c_objects
db_upgrade.o
<END>
<BEGIN> FILE_db_upgrade.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_upgrade.c
<END>
<BEGIN> userComments
db_upgrade
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_objects
db_upgrade.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_objects
db_upgrade.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_upgrade.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_upgrade.c_objects
db_upgrade.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_upgrade.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_objects
db_upgrade.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_upgrade.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_upgrade.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

View file

@ -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 <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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 <stdio.h>
#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);
}

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_verify.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_verify.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_verify.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_verify.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_verify.c_dependencies
<END>
<BEGIN> FILE_db_verify.c_objects
db_verify.o
<END>
<BEGIN> FILE_db_verify.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_verify.c
<END>
<BEGIN> userComments
db_verify
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_objects
db_verify.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_objects
db_verify.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_verify.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_verify.c_objects
db_verify.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../db_verify.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_objects
db_verify.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../db_verify.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../db_verify.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

View file

@ -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 "<pathname>/<dbname>"
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.

View file

@ -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 <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
extern int getopt(int, char * const *, const char *);
#else
#include <unistd.h>
#endif
#include <db_config.h>
#include <db_int.h>
#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 <stdio.h>
#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);
}

View file

@ -0,0 +1,160 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
dbdemo.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/dbdemo.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_dbdemo.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_dbdemo.c_dependDone
FALSE
<END>
<BEGIN> FILE_dbdemo.c_dependencies
<END>
<BEGIN> FILE_dbdemo.c_objects
dbdemo.o
<END>
<BEGIN> FILE_dbdemo.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/dbdemo.c
<END>
<BEGIN> userComments
dbdemo
<END>

View file

@ -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

View file

@ -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 */

View file

@ -0,0 +1,475 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
::prj_component
<END>
<BEGIN> CORE_INFO_VERSION
AE1.1
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_CURRENT_TARGET
default
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_objects
dbdemo.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_objects
dbdemo.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.debug_TC
::tc_PENTIUM2gnu.debug
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_DEFAULTFORCPU
0
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../dbdemo.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../dbdemo.c_objects
dbdemo.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/../dbdemo.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RELEASE
1
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUM2gnu.release_TC
::tc_PENTIUM2gnu.release
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_DEFAULTFORCPU
1
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_objects
dbdemo.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/../dbdemo.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_infoTags
toolMacro objects
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_objects
compConfig.o
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_FILE_$(PRJ_DIR)/compConfig.c_toolMacro
CC
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CC
ccpentium
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_CPPFILT
c++filtpentium --strip-underscores
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDFLAGS
-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LDPARTIAL
ccpentium \
-B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ \
-nostdlib \
-r \
-Wl,-X
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RELEASE
0
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_RO_DEPEND_PATH
$(WIND_BASE)/target/h/
<END>
<BEGIN> BUILD_PENTIUMgnu.debug_TC
::tc_PENTIUMgnu.debug
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu.debug PENTIUM2gnu.release PENTIUMgnu.debug
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../dbdemo.c \
$(PRJ_DIR)/compConfig.c
<END>
<BEGIN> WCC__CDF_PATH
$(PRJ_DIR)
<END>
<BEGIN> WCC__CURRENT
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__LIST
PENTIUM2gnu.debug
<END>
<BEGIN> WCC__MXR_LIBS
lib$(CPU)$(TOOL)vx.a
<END>
<BEGIN> WCC__OBJS_PATH
$(WIND_BASE)/target/lib/obj$CPU$TOOLvx
<END>

View file

@ -1,244 +0,0 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/ex_access.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_ex_access.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_BUILDRULE
ex_access.out
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AR
arsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE
$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_access.a
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AS
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CC
ccsimso
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS
-g \
-ansi \
-nostdinc \
-fvolatile \
-fno-builtin \
-P \
-x \
assembler-with-cpp \
-I. \
-I$(WIND_BASE)/target/h \
-DCPU=SIMSPARCSOLARIS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CPP
ccsimso -E -P -xc
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS
-N
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS
-nostdlib -r
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_NM
nmsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE
sizesimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_TC
::tc_SIMSPARCSOLARISgnu
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
SIMSPARCSOLARISgnu PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_access.c_dependDone
TRUE
<END>
<BEGIN> 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
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_access.c_objects
ex_access.o
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_access.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
/export/home/db/examples_c/ex_access.c
<END>
<BEGIN> userComments
ex_access
<END>

View file

@ -1,250 +0,0 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/ex_btrec.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_ex_btrec.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_BUILDRULE
ex_btrec.out
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AR
arsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE
$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_btrec.a
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AS
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CC
ccsimso
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS
-g \
-ansi \
-nostdinc \
-fvolatile \
-fno-builtin \
-P \
-x \
assembler-with-cpp \
-I. \
-I$(WIND_BASE)/target/h \
-DCPU=SIMSPARCSOLARIS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CPP
ccsimso -E -P -xc
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS
-N
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS
-nostdlib -r
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_NM
nmsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE
sizesimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_TC
::tc_SIMSPARCSOLARISgnu
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
SIMSPARCSOLARISgnu PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_btrec.c_dependDone
TRUE
<END>
<BEGIN> 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
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_btrec.c_objects
ex_btrec.o
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_btrec.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
/export/home/db/examples_c/ex_btrec.c
<END>
<BEGIN> userComments
ex_btrec
<END>

View file

@ -1,266 +0,0 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
ex_dbclient.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/ex_dbclient.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_ex_dbclient.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_BUILDRULE
ex_dbclient.out
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AR
arsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE
$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_dbclient.a
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AS
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CC
ccsimso
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS
-g \
-ansi \
-nostdinc \
-fvolatile \
-fno-builtin \
-P \
-x \
assembler-with-cpp \
-I. \
-I$(WIND_BASE)/target/h \
-DCPU=SIMSPARCSOLARIS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CPP
ccsimso -E -P -xc
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS
-N
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS
-nostdlib -r
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_NM
nmsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE
sizesimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_TC
::tc_SIMSPARCSOLARISgnu
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
SIMSPARCSOLARISgnu PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_dbclient.c_dependDone
TRUE
<END>
<BEGIN> 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
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_dbclient.c_objects
ex_dbclient.o
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_dbclient.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
/export/home/db/examples_c/ex_dbclient.c
<END>
<BEGIN> userComments
RPC Client example
<END>

View file

@ -1,248 +0,0 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/ex_env.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_ex_env.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_BUILDRULE
ex_env.out
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AR
arsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE
$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_env.a
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AS
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CC
ccsimso
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS
-g \
-ansi \
-nostdinc \
-fvolatile \
-fno-builtin \
-P \
-x \
assembler-with-cpp \
-I. \
-I$(WIND_BASE)/target/h \
-DCPU=SIMSPARCSOLARIS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CPP
ccsimso -E -P -xc
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS
-N
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS
-nostdlib -r
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_NM
nmsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE
sizesimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_TC
::tc_SIMSPARCSOLARISgnu
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
SIMSPARCSOLARISgnu PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_env.c_dependDone
TRUE
<END>
<BEGIN> 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
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_env.c_objects
ex_env.o
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_env.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
/export/home/db/examples_c/ex_env.c
<END>
<BEGIN> userComments
ex_env
<END>

View file

@ -1,248 +0,0 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/ex_mpool.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_ex_mpool.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_BUILDRULE
ex_mpool.out
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AR
arsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE
$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_mpool.a
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AS
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CC
ccsimso
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS
-g \
-ansi \
-nostdinc \
-fvolatile \
-fno-builtin \
-P \
-x \
assembler-with-cpp \
-I. \
-I$(WIND_BASE)/target/h \
-DCPU=SIMSPARCSOLARIS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CPP
ccsimso -E -P -xc
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS
-N
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS
-nostdlib -r
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_NM
nmsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE
sizesimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_TC
::tc_SIMSPARCSOLARISgnu
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
SIMSPARCSOLARISgnu PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_mpool.c_dependDone
TRUE
<END>
<BEGIN> 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
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_mpool.c_objects
ex_mpool.o
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_mpool.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
/export/home/db/examples_c/ex_mpool.c
<END>
<BEGIN> userComments
ex_mpool
<END>

View file

@ -1,261 +0,0 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
ex_tpcb.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/ex_tpcb.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> 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
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_ex_tpcb.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_BUILDRULE
ex_tpcb.out
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AR
arsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_ARCHIVE
$(PRJ_DIR)/SIMSPARCSOLARISgnu/ex_tpcb.a
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_AS
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CC
ccsimso
<END>
<BEGIN> 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
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CFLAGS_AS
-g \
-ansi \
-nostdinc \
-fvolatile \
-fno-builtin \
-P \
-x \
assembler-with-cpp \
-I. \
-I$(WIND_BASE)/target/h \
-DCPU=SIMSPARCSOLARIS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_CPP
ccsimso -E -P -xc
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD
ccsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LDFLAGS
-N
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_LD_PARTIAL_FLAGS
-nostdlib -r
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_NM
nmsimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_MACRO_SIZE
sizesimso
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_SIMSPARCSOLARISgnu_TC
::tc_SIMSPARCSOLARISgnu
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
SIMSPARCSOLARISgnu PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_tpcb.c_dependDone
TRUE
<END>
<BEGIN> 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
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_tpcb.c_objects
ex_tpcb.o
<END>
<BEGIN> FILE_/export/home/db/examples_c/ex_tpcb.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
/export/home/db/examples_c/ex_tpcb.c
<END>
<BEGIN> userComments
ex_tpcb
<END>

View file

@ -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
}}}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 <sys/types.h> doesn't define. */
/* #undef mode_t */
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Define if the `S_IS*' macros in <sys/stat.h> 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 <sys/time.h> and <time.h>. */
/* #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 <dirent.h> header file. */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_DIRENT_H */
/* Define if you have the <ndir.h> header file. */
/* Define to 1 if you have the <dlfcn.h> 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 <inttypes.h> 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 <memory.h> 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 <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define if you have the <sys/dir.h> 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 <stdint.h> header file. */
/* #undef HAVE_STDINT_H */
/* Define to 1 if you have the <stdlib.h> 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 <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> 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 <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define if you have the <sys/ndir.h> header file. */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/select.h> header file. */
/* Define to 1 if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
/* Define if you have the <sys/time.h> header file. */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> 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 <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> 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 <sys/stat.h> 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 <sys/time.h> and <time.h>. */
/* #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 <sys/types.h>
#include <sys/stat.h>
@ -214,10 +380,6 @@
#include <time.h>
#include <errno.h>
#if defined(__cplusplus)
#include <iostream.h>
#endif
/*
* To build Tcl interface libraries, the include path must be configured to
* use the directory containing <tcl.h>, usually the include directory in
@ -231,9 +393,14 @@
#include <windows.h>
/*
* 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

796
bdb/build_win32/db_cxx.h Normal file
View file

@ -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 <stdarg.h>
#define HAVE_CXX_STDHEADERS 1
#ifdef HAVE_CXX_STDHEADERS
#include <iostream>
#define __DB_OSTREAMCLASS std::ostream
#else
#include <iostream.h>
#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 <winnt.h>
//
// 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_ */

View file

@ -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

View file

@ -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

View file

@ -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

Some files were not shown because too many files have changed in this diff Show more