mirror of
https://github.com/MariaDB/server.git
synced 2026-05-01 12:45:41 +02:00
Import changeset
This commit is contained in:
parent
87d70fb598
commit
ec6ae09161
1442 changed files with 324740 additions and 0 deletions
999
bdb/dist/Makefile.in
vendored
Normal file
999
bdb/dist/Makefile.in
vendored
Normal file
|
|
@ -0,0 +1,999 @@
|
|||
# $Id: Makefile.in,v 11.66 2000/11/27 16:27:51 bostic Exp $
|
||||
|
||||
srcdir= @srcdir@/..
|
||||
builddir=.
|
||||
|
||||
##################################################
|
||||
# C, C++
|
||||
##################################################
|
||||
CPPFLAGS= -I$(builddir) -I$(srcdir)/include @CPPFLAGS@
|
||||
CFLAGS= -c $(CPPFLAGS) @CFLAGS@
|
||||
CXXFLAGS= -c $(CPPFLAGS) @CXXFLAGS@
|
||||
|
||||
CC= @MAKEFILE_CC@
|
||||
CCLINK= @MAKEFILE_CCLINK@
|
||||
CXX= @MAKEFILE_CXX@
|
||||
|
||||
INSTALLER= @INSTALLER@
|
||||
|
||||
LDFLAGS= @LDFLAGS@
|
||||
LIBDB_ARGS= @LIBDB_ARGS@
|
||||
LIBJSO_LIBS= @LIBJSO_LIBS@
|
||||
LIBS= @LIBS@
|
||||
LIBSO_LIBS= @LIBSO_LIBS@
|
||||
LIBTOOL= @LIBTOOL@
|
||||
LIBTSO_LIBS= @LIBTSO_LIBS@
|
||||
LIBXSO_LIBS= @LIBXSO_LIBS@
|
||||
|
||||
POSTLINK= @POSTLINK@
|
||||
SOLINK= @SOLINK@
|
||||
SOFLAGS= @SOFLAGS@
|
||||
SOMAJOR= @DB_VERSION_MAJOR@
|
||||
SOVERSION= @DB_VERSION_MAJOR@.@DB_VERSION_MINOR@
|
||||
|
||||
libdb= libdb.a
|
||||
|
||||
libso_base= libdb
|
||||
libso_linkname= $(libso_base)-$(SOVERSION).la
|
||||
libso= $(libso_base)-$(SOVERSION).@SOSUFFIX@
|
||||
libso_target= $(libso_base)-$(SOVERSION).la
|
||||
libso_default= $(libso_base).@SOSUFFIX@
|
||||
libso_major= $(libso_base)-$(SOMAJOR).@SOSUFFIX@
|
||||
|
||||
##################################################
|
||||
# C++
|
||||
#
|
||||
# C++ support is optional, and it can be used with or without shared libraries.
|
||||
# You must configure it using:
|
||||
# --enable-cxx
|
||||
##################################################
|
||||
libcxx= libdb_cxx.a
|
||||
libxso_base= libdb_cxx
|
||||
libxso= $(libxso_base)-$(SOVERSION).@SOSUFFIX@
|
||||
libxso_target= $(libxso_base)-$(SOVERSION).la
|
||||
libxso_default= $(libxso_base).@SOSUFFIX@
|
||||
libxso_major= $(libxso_base)-$(SOMAJOR).@SOSUFFIX@
|
||||
|
||||
##################################################
|
||||
# JAVA
|
||||
#
|
||||
# Java support is optional and requires shared librarires.
|
||||
# You must configure it using:
|
||||
# --enable-java --enable-dynamic
|
||||
##################################################
|
||||
CLASSPATH= $(JAVA_CLASSTOP)
|
||||
JAR= @JAR@
|
||||
JAVAC= env CLASSPATH=$(CLASSPATH) @JAVAC@
|
||||
JAVACFLAGS= @JAVACFLAGS@
|
||||
JAVA_BUILTFILE= .javabuilt
|
||||
JAVA_CLASSTOP= $(srcdir)/java/classes
|
||||
JAVA_SRCDIR= $(srcdir)/java/src
|
||||
JAVA_DBREL= com/sleepycat/db
|
||||
JAVA_DBDIR= $(JAVA_SRCDIR)/$(JAVA_DBREL)
|
||||
JAVA_EXDIR= $(JAVA_SRCDIR)/com/sleepycat/examples
|
||||
|
||||
libj_jarfile= db.jar
|
||||
libjso_base= libdb_java
|
||||
libjso= $(libjso_base)-$(SOVERSION).@SOSUFFIX@
|
||||
libjso_target= $(libjso_base)-$(SOVERSION).la
|
||||
libjso_default= $(libjso_base).@SOSUFFIX@
|
||||
libjso_major= $(libjso_base)-$(SOMAJOR).@SOSUFFIX@
|
||||
libjso_g= $(libjso_base)-$(SOVERSION)_g.@SOSUFFIX@
|
||||
|
||||
##################################################
|
||||
# TCL
|
||||
#
|
||||
# Tcl support is optional and requires shared libraries.
|
||||
# You must configure it using:
|
||||
# --enable-tcl --with-tcl=DIR --enable-dynamic
|
||||
##################################################
|
||||
TCFLAGS= @TCFLAGS@
|
||||
libtso_base= libdb_tcl
|
||||
libtso= $(libtso_base)-$(SOVERSION).@SOSUFFIX@
|
||||
libtso_target= $(libtso_base)-$(SOVERSION).la
|
||||
libtso_default= $(libtso_base).@SOSUFFIX@
|
||||
libtso_major= $(libtso_base)-$(SOMAJOR).@SOSUFFIX@
|
||||
|
||||
##################################################
|
||||
# DB_DUMP185 UTILITY
|
||||
#
|
||||
# The db_dump185 application should be compiled using the system's db.h file
|
||||
# (which should be a DB 1.85/1.86 include file), and the system's 1.85/1.86
|
||||
# object library. To include the right db.h, don't include -I$(builddir) on
|
||||
# the compile line. You may also need to add a local include directory and
|
||||
# local libraries, for example. Do that by adding -I options to the DB185INC
|
||||
# line, and -l options to the DB185LIB line.
|
||||
##################################################
|
||||
DB185INC= -c @CFLAGS@ -I$(srcdir)/include @CPPFLAGS@
|
||||
DB185LIB=
|
||||
|
||||
##################################################
|
||||
# INSTALLATION DIRECTORIES AND PERMISSIONS
|
||||
##################################################
|
||||
prefix= @prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
bindir= @bindir@
|
||||
includedir=@includedir@
|
||||
libdir= @libdir@
|
||||
docdir= $(prefix)/docs
|
||||
|
||||
dmode= 755
|
||||
emode= 555
|
||||
fmode= 444
|
||||
|
||||
transform=@program_transform_name@
|
||||
|
||||
##################################################
|
||||
# PATHS FOR STANDARD USER-LEVEL COMMANDS
|
||||
##################################################
|
||||
SHELL= @db_cv_path_sh@
|
||||
ar= @db_cv_path_ar@ cr
|
||||
chmod= @db_cv_path_chmod@
|
||||
cp= @db_cv_path_cp@
|
||||
ln= @db_cv_path_ln@
|
||||
mkdir= @db_cv_path_mkdir@
|
||||
ranlib= @db_cv_path_ranlib@
|
||||
rm= @db_cv_path_rm@
|
||||
strip= @db_cv_path_strip@
|
||||
|
||||
##################################################
|
||||
# NOTHING BELOW THIS LINE SHOULD EVER NEED TO BE MODIFIED.
|
||||
##################################################
|
||||
OBJS= @ADDITIONAL_OBJS@ @LIBOBJS@ @RPC_OBJS@ bt_compare@o@ bt_conv@o@ \
|
||||
bt_curadj@o@ bt_cursor@o@ bt_delete@o@ bt_method@o@ bt_open@o@ \
|
||||
bt_put@o@ bt_rec@o@ bt_reclaim@o@ bt_recno@o@ bt_rsearch@o@ \
|
||||
bt_search@o@ bt_split@o@ bt_stat@o@ bt_upgrade@o@ bt_verify@o@ \
|
||||
btree_auto@o@ crdel_auto@o@ crdel_rec@o@ db@o@ db_am@o@ db_auto@o@ \
|
||||
db_byteorder@o@ db_cam@o@ db_conv@o@ db_dispatch@o@ db_dup@o@ \
|
||||
db_err@o@ db_getlong@o@ db_iface@o@ db_join@o@ db_log2@o@ \
|
||||
db_meta@o@ db_method@o@ db_overflow@o@ db_pr@o@ db_rec@o@ \
|
||||
db_reclaim@o@ db_ret@o@ db_salloc@o@ db_shash@o@ db_upg@o@ \
|
||||
db_upg_opd@o@ db_vrfy@o@ db_vrfyutil@o@ dbm@o@ env_method@o@ \
|
||||
env_open@o@ env_recover@o@ env_region@o@ hash@o@ hash_auto@o@ \
|
||||
hash_conv@o@ hash_dup@o@ hash_func@o@ hash_meta@o@ hash_method@o@ \
|
||||
hash_page@o@ hash_rec@o@ hash_reclaim@o@ hash_stat@o@ hash_upgrade@o@ \
|
||||
hash_verify@o@ hsearch@o@ lock@o@ lock_conflict@o@ \
|
||||
lock_deadlock@o@ lock_method@o@ lock_region@o@ lock_stat@o@ \
|
||||
lock_util@o@ log@o@ log_archive@o@ log_auto@o@ log_compare@o@ \
|
||||
log_findckp@o@ log_get@o@ log_method@o@ log_put@o@ log_rec@o@ \
|
||||
log_register@o@ mp_alloc@o@ mp_bh@o@ mp_fget@o@ mp_fopen@o@ \
|
||||
mp_fput@o@ mp_fset@o@ mp_method@o@ mp_region@o@ mp_register@o@ \
|
||||
mp_stat@o@ mp_sync@o@ mp_trickle@o@ mutex@o@ os_abs@o@ \
|
||||
os_alloc@o@ os_dir@o@ os_errno@o@ os_fid@o@ os_finit@o@ \
|
||||
os_fsync@o@ os_handle@o@ os_map@o@ os_method@o@ os_oflags@o@ \
|
||||
os_open@o@ os_region@o@ os_rename@o@ os_root@o@ os_rpath@o@ \
|
||||
os_rw@o@ os_seek@o@ os_sleep@o@ os_spin@o@ os_stat@o@ \
|
||||
os_tmpdir@o@ os_unlink@o@ qam@o@ qam_auto@o@ qam_conv@o@ qam_files@o@ \
|
||||
qam_method@o@ qam_open@o@ qam_rec@o@ qam_stat@o@ qam_upgrade@o@ \
|
||||
qam_verify@o@ txn@o@ txn_auto@o@ txn_rec@o@ txn_region@o@ xa@o@ \
|
||||
xa_db@o@ xa_map@o@
|
||||
|
||||
COBJS= cxx_app@o@ cxx_except@o@ cxx_lock@o@ cxx_log@o@ cxx_mpool@o@ \
|
||||
cxx_table@o@ cxx_txn@o@
|
||||
|
||||
DBSOBJS=dbs@o@ dbs_am@o@ dbs_checkpoint@o@ dbs_debug@o@ dbs_handles@o@ \
|
||||
dbs_log@o@ dbs_qam@o@ dbs_spawn@o@ dbs_trickle@o@ dbs_util@o@ \
|
||||
dbs_yield@o@
|
||||
|
||||
EOBJS= ex_access@o@ ex_btrec@o@ ex_dbclient@o@ ex_env@o@ ex_lock@o@ \
|
||||
ex_mpool@o@ ex_thread@o@ ex_tpcb@o@
|
||||
|
||||
JOBJS= java_Db@o@ java_DbEnv@o@ java_DbLock@o@ java_DbLsn@o@ java_DbTxn@o@ \
|
||||
java_Dbc@o@ java_Dbt@o@ java_info@o@ java_locked@o@ java_util@o@
|
||||
|
||||
RPC_OBJS=client@o@ db_server_clnt@o@ db_server_xdr@o@ gen_client@o@ \
|
||||
gen_client_ret@o@
|
||||
RPC_SRV=db_server_proc@o@ db_server_svc@o@ db_server_util@o@ gen_db_server@o@
|
||||
|
||||
TOBJS= tcl_compat@o@ tcl_db@o@ tcl_db_pkg@o@ tcl_dbcursor@o@ tcl_env@o@ \
|
||||
tcl_internal@o@ tcl_lock@o@ tcl_log@o@ tcl_mp@o@ tcl_txn@o@
|
||||
|
||||
UOBJS= db_archive@o@ db_checkpoint@o@ db_deadlock@o@ db_dump185@o@ \
|
||||
db_dump@o@ db_load@o@ db_printlog@o@ db_recover@o@ db_stat@o@ \
|
||||
db_upgrade@o@ db_verify@o@ util_log@o@ util_sig@o@
|
||||
|
||||
PROGS= @ADDITIONAL_PROGS@ db_archive db_checkpoint db_deadlock \
|
||||
db_dump db_load db_printlog db_recover db_stat db_upgrade db_verify
|
||||
|
||||
JAVA_DBSRCS=\
|
||||
$(JAVA_DBDIR)/Db.java $(JAVA_DBDIR)/DbAppendRecno.java \
|
||||
$(JAVA_DBDIR)/DbBtreeCompare.java \
|
||||
$(JAVA_DBDIR)/DbBtreePrefix.java $(JAVA_DBDIR)/DbBtreeStat.java \
|
||||
$(JAVA_DBDIR)/DbConstants.java $(JAVA_DBDIR)/DbDeadlockException.java \
|
||||
$(JAVA_DBDIR)/DbDupCompare.java $(JAVA_DBDIR)/DbEnv.java \
|
||||
$(JAVA_DBDIR)/DbEnvFeedback.java $(JAVA_DBDIR)/DbErrcall.java \
|
||||
$(JAVA_DBDIR)/DbException.java $(JAVA_DBDIR)/DbFeedback.java \
|
||||
$(JAVA_DBDIR)/DbHash.java $(JAVA_DBDIR)/DbHashStat.java \
|
||||
$(JAVA_DBDIR)/DbKeyRange.java $(JAVA_DBDIR)/DbLock.java \
|
||||
$(JAVA_DBDIR)/DbLockStat.java $(JAVA_DBDIR)/DbLogStat.java \
|
||||
$(JAVA_DBDIR)/DbLsn.java $(JAVA_DBDIR)/DbMemoryException.java \
|
||||
$(JAVA_DBDIR)/DbMpoolFStat.java $(JAVA_DBDIR)/DbMpoolStat.java \
|
||||
$(JAVA_DBDIR)/DbOutputStreamErrcall.java \
|
||||
$(JAVA_DBDIR)/DbQueueStat.java $(JAVA_DBDIR)/DbRecoveryInit.java \
|
||||
$(JAVA_DBDIR)/DbRunRecoveryException.java $(JAVA_DBDIR)/DbTxn.java \
|
||||
$(JAVA_DBDIR)/DbTxnRecover.java $(JAVA_DBDIR)/DbTxnStat.java \
|
||||
$(JAVA_DBDIR)/Dbc.java $(JAVA_DBDIR)/Dbt.java
|
||||
|
||||
JAVA_EXSRCS=\
|
||||
$(JAVA_EXDIR)/AccessExample.java \
|
||||
$(JAVA_EXDIR)/BtRecExample.java \
|
||||
$(JAVA_EXDIR)/EnvExample.java \
|
||||
$(JAVA_EXDIR)/LockExample.java \
|
||||
$(JAVA_EXDIR)/TpcbExample.java
|
||||
|
||||
##################################################
|
||||
# Note: Berkeley DB Makefiles are configured to build either a static or
|
||||
# a dynamic library. You should not attempt to build both library types
|
||||
# in the same directory, as they have incompatible object file formats.
|
||||
# To build both static and dynamic libraries, create two separate build
|
||||
# directories, and configure and build them separately.
|
||||
##################################################
|
||||
all: @DEFAULT_LIB@ @ADDITIONAL_LIBS@ @ADDITIONAL_LANG@ $(PROGS)
|
||||
|
||||
$(libdb): $(OBJS)
|
||||
$(ar) $@ $(OBJS)
|
||||
test ! -f $(ranlib) || $(ranlib) $@
|
||||
|
||||
$(libcxx): $(COBJS) $(OBJS)
|
||||
$(ar) $@ $(COBJS) $(OBJS)
|
||||
test ! -f $(ranlib) || $(ranlib) $@
|
||||
|
||||
$(libso_target): $(OBJS)
|
||||
$(SOLINK) $(SOFLAGS) -o $(libso_target) \
|
||||
$(OBJS) $(LDFLAGS) $(LIBSO_LIBS)
|
||||
|
||||
$(libxso_target): $(COBJS) $(OBJS)
|
||||
$(SOLINK) $(SOFLAGS) -o $(libxso_target) \
|
||||
$(COBJS) $(OBJS) $(LDFLAGS) $(LIBXSO_LIBS)
|
||||
|
||||
$(libjso_target): $(JOBJS) $(OBJS)
|
||||
$(SOLINK) $(SOFLAGS) -o $(libjso_target) \
|
||||
$(JOBJS) $(OBJS) $(LDFLAGS) $(LIBJSO_LIBS)
|
||||
|
||||
$(libtso_target): $(TOBJS) $(OBJS)
|
||||
$(SOLINK) $(SOFLAGS) -o $(libtso_target) \
|
||||
$(TOBJS) $(OBJS) $(LDFLAGS) $(LIBTSO_LIBS)
|
||||
|
||||
##################################################
|
||||
# Creating individual dependencies and actions for building class
|
||||
# files is possible, but it is very messy and error prone.
|
||||
##################################################
|
||||
java: $(JAVA_CLASSTOP) $(JAVA_BUILTFILE)
|
||||
|
||||
$(JAVA_BUILTFILE): $(JAVA_DBSRCS) $(JAVA_EXSRCS)
|
||||
@test -f $(rm) || (echo 'rm not found.'; exit 1)
|
||||
@test -f $(cp) || (echo 'cp not found.'; exit 1)
|
||||
$(JAVAC) -d $(JAVA_CLASSTOP) $(JAVACFLAGS) $(JAVA_DBSRCS)
|
||||
@cd $(JAVA_CLASSTOP) && $(JAR) cf $(libj_jarfile) $(JAVA_DBREL)
|
||||
$(JAVAC) -d $(JAVA_CLASSTOP) $(JAVACFLAGS) $(JAVA_EXSRCS)
|
||||
@echo This file helps with building java using make > $(JAVA_BUILTFILE)
|
||||
|
||||
$(JAVA_CLASSTOP):
|
||||
@test -f $(mkdir) || (echo 'mkdir not found.'; exit 1)
|
||||
$(mkdir) $(JAVA_CLASSTOP)
|
||||
|
||||
##################################################
|
||||
# Utilities
|
||||
##################################################
|
||||
berkeley_db_svc: $(RPC_SRV) util_log@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) $(RPC_SRV) util_log@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_archive: db_archive@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) \
|
||||
db_archive@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_checkpoint: db_checkpoint@o@ util_log@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) \
|
||||
db_checkpoint@o@ util_log@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_deadlock: db_deadlock@o@ util_log@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) \
|
||||
db_deadlock@o@ util_log@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_dump: db_dump@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) db_dump@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_dump185: db_dump185@o@ @LIBOBJS@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) db_dump185@o@ @LIBOBJS@ $(DB185LIB)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_load: db_load@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) db_load@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_printlog: db_printlog@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) \
|
||||
db_printlog@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_recover: db_recover@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) \
|
||||
db_recover@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_stat: db_stat@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) db_stat@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_upgrade: db_upgrade@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) \
|
||||
db_upgrade@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
db_verify: db_verify@o@ util_sig@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) \
|
||||
db_verify@o@ util_sig@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
##################################################
|
||||
# Example programs
|
||||
##################################################
|
||||
ex_access: ex_access@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) ex_access@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
ex_btrec: ex_btrec@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) ex_btrec@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
ex_dbclient: ex_dbclient@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) ex_dbclient@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
ex_env: ex_env@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) ex_env@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
ex_lock: ex_lock@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) ex_lock@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
ex_mpool: ex_mpool@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) ex_mpool@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
ex_thread: ex_thread@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) ex_thread@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
ex_tpcb: ex_tpcb@o@ @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) ex_tpcb@o@ $(LIBDB_ARGS) $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
##################################################
|
||||
# Multi-threaded tester.
|
||||
##################################################
|
||||
dbs: $(DBSOBJS) @DEFAULT_LIB@
|
||||
$(CCLINK) -o $@ $(LDFLAGS) $(DBSOBJS) $(LIBDB_ARGS) @DBS_LIBS@ $(LIBS)
|
||||
$(POSTLINK) $@
|
||||
|
||||
##################################################
|
||||
# Standard Makefile targets.
|
||||
##################################################
|
||||
RMLIST= berkeley_db_svc db_dump185 dbs ex_access ex_btrec ex_dbclient \
|
||||
ex_env ex_lock ex_mpool ex_thread ex_tpcb
|
||||
clean:
|
||||
$(rm) -f $(OBJS)
|
||||
$(rm) -f $(COBJS) $(DBSOBJS) $(EOBJS) $(CEOBJS) $(JOBJS)
|
||||
$(rm) -f $(TOBJS) $(UOBJS) $(RPC_OBJS) $(RPC_SRV)
|
||||
$(rm) -f $(PROGS) $(RMLIST)
|
||||
$(rm) -f *@o@ *.o *.lo core *.core
|
||||
$(rm) -rf ALL.OUT TESTDIR
|
||||
$(rm) -rf .libs $(libdb) $(libcxx)
|
||||
$(rm) -rf $(libso_target) $(libso) $(libso_default) $(libso_major)
|
||||
$(rm) -rf $(libxso_target) $(libxso) $(libxso_default) $(libxso_major)
|
||||
$(rm) -rf $(libtso_target) $(libtso) $(libtso_default) $(libtso_major)
|
||||
$(rm) -rf $(libjso_target) $(libjso) $(libjso_default) $(libjso_major)
|
||||
|
||||
depend obj:
|
||||
|
||||
realclean distclean: clean
|
||||
$(rm) -f Makefile config.cache config.log config.status db_config.h
|
||||
$(rm) -f confdefs.h db.h db_int.h db_185.h include.tcl libtool
|
||||
|
||||
install: all install_setup \
|
||||
install_include install_lib install_utilities install_docs
|
||||
|
||||
uninstall: uninstall_utilities uninstall_include uninstall_lib uninstall_docs
|
||||
|
||||
install_setup:
|
||||
@test -f $(chmod) || (echo 'chmod not found.'; exit 1)
|
||||
@test -f $(cp) || (echo 'cp not found.'; exit 1)
|
||||
@test -f $(mkdir) || (echo 'mkdir not found.'; exit 1)
|
||||
@test -f $(rm) || (echo 'rm not found.'; exit 1)
|
||||
|
||||
install_include:
|
||||
@echo "Installing DB include files: $(includedir) ..."
|
||||
@test -d $(includedir) || \
|
||||
($(mkdir) -p $(includedir) && $(chmod) $(dmode) $(includedir))
|
||||
@cd $(includedir) && $(rm) -f db.h db_185.h db_cxx.h
|
||||
@$(cp) -p db.h \
|
||||
$(srcdir)/include/db_cxx.h @ADDITIONAL_INCS@ $(includedir)
|
||||
@cd $(includedir) && $(chmod) $(fmode) db.h db_cxx.h @ADDITIONAL_INCS@
|
||||
|
||||
uninstall_include:
|
||||
-cd $(includedir) && $(rm) -f db.h db_185.h db_cxx.h
|
||||
|
||||
install_lib: @DEFAULT_INSTALL@
|
||||
|
||||
uninstall_lib:
|
||||
-cd $(libdir) && $(rm) -f $(libdb) $(libcxx) \
|
||||
$(libso_target) $(libso) $(libso_default) $(libso_major) \
|
||||
$(libxso_target) $(libxso) $(libxso_default) $(libxso_major) \
|
||||
$(libtso_target) $(libtso) $(libtso_default) $(libtso_major) \
|
||||
$(libjso_target) $(libjso) $(libjso_default) $(libjso_major) \
|
||||
$(libj_jarfile)
|
||||
|
||||
install_static:
|
||||
@echo "Installing DB library: $(libdir) ..."
|
||||
@test -d $(libdir) || \
|
||||
($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir))
|
||||
@cd $(libdir) && $(rm) -f $(libdb)
|
||||
@$(cp) -p $(libdb) $(libdir)
|
||||
@cd $(libdir) && $(chmod) $(fmode) $(libdb)
|
||||
|
||||
install_static_cxx:
|
||||
@echo "Installing DB C++ static library: $(libdir) ..."
|
||||
@test -d $(libdir) || \
|
||||
($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir))
|
||||
@cd $(libdir) && $(rm) -f $(libcxx)
|
||||
@$(cp) -p $(libcxx) $(libdir)
|
||||
@cd $(libdir) && $(chmod) $(fmode) $(libcxx)
|
||||
|
||||
install_dynamic:
|
||||
@echo "Installing DB library: $(libdir) ..."
|
||||
@test -d $(libdir) || \
|
||||
($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir))
|
||||
@cd $(libdir) && $(rm) -f \
|
||||
$(libso_target) $(libso) $(libso_default) $(libso_major)
|
||||
@$(INSTALLER) $(libso_target) $(libdir)
|
||||
@cd $(libdir) && $(ln) -s $(libso) $(libso_default)
|
||||
@cd $(libdir) && $(ln) -s $(libso) $(libso_major)
|
||||
@$(LIBTOOL) --mode=finish $(libdir)
|
||||
|
||||
install_dynamic_cxx:
|
||||
@echo "Installing DB C++ library: $(libdir) ..."
|
||||
@test -d $(libdir) || \
|
||||
($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir))
|
||||
@cd $(libdir) && $(rm) -f \
|
||||
$(libxso_target) $(libxso) $(libxso_default) $(libxso_major)
|
||||
@$(INSTALLER) $(libxso_target) $(libdir)
|
||||
@cd $(libdir) && $(ln) -s $(libxso) $(libxso_default)
|
||||
@cd $(libdir) && $(ln) -s $(libxso) $(libxso_major)
|
||||
|
||||
install_tcl:
|
||||
@echo "Installing DB Tcl library: $(libdir) ..."
|
||||
@test -d $(libdir) || \
|
||||
($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir))
|
||||
@cd $(libdir) && $(rm) -f \
|
||||
$(libtso_target) $(libtso) $(libtso_default) $(libtso_major)
|
||||
@$(INSTALLER) $(libtso_target) $(libdir)
|
||||
@cd $(libdir) && $(ln) -s $(libtso) $(libtso_default)
|
||||
@cd $(libdir) && $(ln) -s $(libtso) $(libtso_major)
|
||||
|
||||
install_java:
|
||||
@echo "Installing DB Java library: $(libdir) ..."
|
||||
@test -d $(libdir) || \
|
||||
($(mkdir) -p $(libdir) && $(chmod) $(dmode) $(libdir))
|
||||
@cd $(libdir) && $(rm) -f \
|
||||
$(libjso_target) $(libjso) $(libjso_default) $(libjso_major)
|
||||
@$(INSTALLER) $(libjso_target) $(libdir)
|
||||
@cd $(libdir) && $(ln) -s $(libjso) $(libjso_default)
|
||||
@cd $(libdir) && $(ln) -s $(libjso) $(libjso_major)
|
||||
@cd $(libdir) && $(ln) -s $(libjso) $(libjso_g)
|
||||
@$(cp) $(JAVA_CLASSTOP)/$(libj_jarfile) $(libdir)
|
||||
|
||||
install_utilities:
|
||||
@echo "Installing DB utilities: $(bindir) ..."
|
||||
@test -d $(bindir) || \
|
||||
($(mkdir) -p $(bindir) && $(chmod) $(dmode) $(bindir))
|
||||
@cd $(bindir) && $(rm) -f $(PROGS)
|
||||
@$(INSTALLER) -fp $(PROGS) $(bindir)
|
||||
@cd $(bindir) && (test ! -f $(strip) || $(strip) $(PROGS))
|
||||
@cd $(bindir) && $(chmod) $(emode) $(PROGS)
|
||||
|
||||
uninstall_utilities:
|
||||
-cd $(bindir) && $(rm) -f $(PROGS)
|
||||
|
||||
install_docs:
|
||||
@echo "Installing documentation: $(docdir) ..."
|
||||
@test -d $(docdir) || \
|
||||
($(mkdir) -p $(docdir) && $(chmod) $(dmode) $(docdir))
|
||||
@cd $(docdir) && $(rm) -rf *
|
||||
@cd $(srcdir)/docs && $(cp) -pr * $(docdir)/
|
||||
|
||||
uninstall_docs:
|
||||
-cd $(docdir) && $(rm) -rf *
|
||||
|
||||
##################################################
|
||||
# Object build rules.
|
||||
##################################################
|
||||
# Utilities
|
||||
db_archive@o@: $(srcdir)/db_archive/db_archive.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_checkpoint@o@: $(srcdir)/db_checkpoint/db_checkpoint.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_deadlock@o@: $(srcdir)/db_deadlock/db_deadlock.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_dump@o@: $(srcdir)/db_dump/db_dump.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_dump185@o@: $(srcdir)/db_dump185/db_dump185.c
|
||||
$(CC) $(DB185INC) $?
|
||||
db_load@o@: $(srcdir)/db_load/db_load.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_printlog@o@: $(srcdir)/db_printlog/db_printlog.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_recover@o@: $(srcdir)/db_recover/db_recover.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_stat@o@: $(srcdir)/db_stat/db_stat.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_upgrade@o@: $(srcdir)/db_upgrade/db_upgrade.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_verify@o@: $(srcdir)/db_verify/db_verify.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Examples
|
||||
ex_access@o@: $(srcdir)/examples_c/ex_access.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
ex_btrec@o@: $(srcdir)/examples_c/ex_btrec.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
ex_dbclient@o@: $(srcdir)/examples_c/ex_dbclient.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
ex_env@o@: $(srcdir)/examples_c/ex_env.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
ex_lock@o@: $(srcdir)/examples_c/ex_lock.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
ex_mpool@o@: $(srcdir)/examples_c/ex_mpool.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
ex_thread@o@: $(srcdir)/examples_c/ex_thread.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
ex_tpcb@o@: $(srcdir)/examples_c/ex_tpcb.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# DB files
|
||||
crdel_auto@o@: $(srcdir)/db/crdel_auto.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
crdel_rec@o@: $(srcdir)/db/crdel_rec.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db@o@: $(srcdir)/db/db.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_am@o@: $(srcdir)/db/db_am.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_auto@o@: $(srcdir)/db/db_auto.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_cam@o@: $(srcdir)/db/db_cam.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_conv@o@: $(srcdir)/db/db_conv.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_dispatch@o@: $(srcdir)/db/db_dispatch.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_dup@o@: $(srcdir)/db/db_dup.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_iface@o@: $(srcdir)/db/db_iface.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_join@o@: $(srcdir)/db/db_join.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_meta@o@: $(srcdir)/db/db_meta.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_method@o@: $(srcdir)/db/db_method.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_overflow@o@: $(srcdir)/db/db_overflow.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_pr@o@: $(srcdir)/db/db_pr.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_rec@o@: $(srcdir)/db/db_rec.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_reclaim@o@: $(srcdir)/db/db_reclaim.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_ret@o@: $(srcdir)/db/db_ret.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_upg@o@: $(srcdir)/db/db_upg.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_upg_opd@o@: $(srcdir)/db/db_upg_opd.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_vrfy@o@: $(srcdir)/db/db_vrfy.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_vrfyutil@o@: $(srcdir)/db/db_vrfyutil.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Environment files
|
||||
db_salloc@o@: $(srcdir)/env/db_salloc.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_shash@o@: $(srcdir)/env/db_shash.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
env_method@o@: $(srcdir)/env/env_method.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
env_open@o@: $(srcdir)/env/env_open.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
env_recover@o@: $(srcdir)/env/env_recover.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
env_region@o@: $(srcdir)/env/env_region.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Common files
|
||||
db_byteorder@o@: $(srcdir)/common/db_byteorder.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_err@o@: $(srcdir)/common/db_err.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_getlong@o@: $(srcdir)/common/db_getlong.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_log2@o@: $(srcdir)/common/db_log2.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
util_log@o@: $(srcdir)/common/util_log.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
util_sig@o@: $(srcdir)/common/util_sig.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Btree files
|
||||
bt_compare@o@: $(srcdir)/btree/bt_compare.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_conv@o@: $(srcdir)/btree/bt_conv.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_curadj@o@: $(srcdir)/btree/bt_curadj.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_cursor@o@: $(srcdir)/btree/bt_cursor.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_delete@o@: $(srcdir)/btree/bt_delete.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_method@o@: $(srcdir)/btree/bt_method.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_open@o@: $(srcdir)/btree/bt_open.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_put@o@: $(srcdir)/btree/bt_put.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_rec@o@: $(srcdir)/btree/bt_rec.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_reclaim@o@: $(srcdir)/btree/bt_reclaim.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_recno@o@: $(srcdir)/btree/bt_recno.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_rsearch@o@: $(srcdir)/btree/bt_rsearch.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_search@o@: $(srcdir)/btree/bt_search.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_split@o@: $(srcdir)/btree/bt_split.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_stack@o@: $(srcdir)/btree/bt_stack.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_stat@o@: $(srcdir)/btree/bt_stat.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_upgrade@o@: $(srcdir)/btree/bt_upgrade.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
bt_verify@o@: $(srcdir)/btree/bt_verify.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
btree_auto@o@: $(srcdir)/btree/btree_auto.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Queue files
|
||||
qam@o@: $(srcdir)/qam/qam.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
qam_auto@o@: $(srcdir)/qam/qam_auto.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
qam_conv@o@: $(srcdir)/qam/qam_conv.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
qam_files@o@: $(srcdir)/qam/qam_files.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
qam_method@o@: $(srcdir)/qam/qam_method.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
qam_open@o@: $(srcdir)/qam/qam_open.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
qam_rec@o@: $(srcdir)/qam/qam_rec.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
qam_stat@o@: $(srcdir)/qam/qam_stat.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
qam_upgrade@o@: $(srcdir)/qam/qam_upgrade.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
qam_verify@o@: $(srcdir)/qam/qam_verify.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# C++ files
|
||||
cxx_app@o@: $(srcdir)/cxx/cxx_app.cpp
|
||||
$(CXX) $(CXXFLAGS) $?
|
||||
cxx_except@o@: $(srcdir)/cxx/cxx_except.cpp
|
||||
$(CXX) $(CXXFLAGS) $?
|
||||
cxx_lock@o@: $(srcdir)/cxx/cxx_lock.cpp
|
||||
$(CXX) $(CXXFLAGS) $?
|
||||
cxx_log@o@: $(srcdir)/cxx/cxx_log.cpp
|
||||
$(CXX) $(CXXFLAGS) $?
|
||||
cxx_mpool@o@: $(srcdir)/cxx/cxx_mpool.cpp
|
||||
$(CXX) $(CXXFLAGS) $?
|
||||
cxx_table@o@: $(srcdir)/cxx/cxx_table.cpp
|
||||
$(CXX) $(CXXFLAGS) $?
|
||||
cxx_txn@o@: $(srcdir)/cxx/cxx_txn.cpp
|
||||
$(CXX) $(CXXFLAGS) $?
|
||||
|
||||
# Java files
|
||||
java_Db@o@::$(srcdir)/libdb_java/java_Db.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
java_DbEnv@o@: $(srcdir)/libdb_java/java_DbEnv.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
java_DbLock@o@: $(srcdir)/libdb_java/java_DbLock.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
java_DbLsn@o@: $(srcdir)/libdb_java/java_DbLsn.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
java_DbTxn@o@: $(srcdir)/libdb_java/java_DbTxn.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
java_Dbc@o@: $(srcdir)/libdb_java/java_Dbc.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
java_Dbt@o@: $(srcdir)/libdb_java/java_Dbt.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
java_info@o@: $(srcdir)/libdb_java/java_info.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
java_locked@o@: $(srcdir)/libdb_java/java_locked.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
java_util@o@: $(srcdir)/libdb_java/java_util.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Tcl files
|
||||
tcl_compat@o@: $(srcdir)/tcl/tcl_compat.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
tcl_db@o@: $(srcdir)/tcl/tcl_db.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
tcl_db_pkg@o@: $(srcdir)/tcl/tcl_db_pkg.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
tcl_dbcursor@o@: $(srcdir)/tcl/tcl_dbcursor.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
tcl_env@o@: $(srcdir)/tcl/tcl_env.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
tcl_internal@o@: $(srcdir)/tcl/tcl_internal.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
tcl_lock@o@: $(srcdir)/tcl/tcl_lock.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
tcl_log@o@: $(srcdir)/tcl/tcl_log.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
tcl_mp@o@: $(srcdir)/tcl/tcl_mp.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
tcl_txn@o@: $(srcdir)/tcl/tcl_txn.c
|
||||
$(CC) $(CFLAGS) $(TCFLAGS) $?
|
||||
|
||||
# Hash files
|
||||
hash_auto@o@: $(srcdir)/hash/hash_auto.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash@o@: $(srcdir)/hash/hash.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_conv@o@: $(srcdir)/hash/hash_conv.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_dup@o@: $(srcdir)/hash/hash_dup.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_func@o@: $(srcdir)/hash/hash_func.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_meta@o@: $(srcdir)/hash/hash_meta.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_method@o@: $(srcdir)/hash/hash_method.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_page@o@: $(srcdir)/hash/hash_page.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_rec@o@: $(srcdir)/hash/hash_rec.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_reclaim@o@: $(srcdir)/hash/hash_reclaim.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_stat@o@: $(srcdir)/hash/hash_stat.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_upgrade@o@: $(srcdir)/hash/hash_upgrade.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hash_verify@o@: $(srcdir)/hash/hash_verify.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Lock files
|
||||
lock@o@: $(srcdir)/lock/lock.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
lock_conflict@o@:$(srcdir)/lock/lock_conflict.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
lock_deadlock@o@:$(srcdir)/lock/lock_deadlock.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
lock_method@o@:$(srcdir)/lock/lock_method.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
lock_region@o@:$(srcdir)/lock/lock_region.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
lock_stat@o@:$(srcdir)/lock/lock_stat.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
lock_util@o@:$(srcdir)/lock/lock_util.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Log files
|
||||
log@o@: $(srcdir)/log/log.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
log_archive@o@: $(srcdir)/log/log_archive.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
log_auto@o@: $(srcdir)/log/log_auto.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
log_compare@o@: $(srcdir)/log/log_compare.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
log_findckp@o@: $(srcdir)/log/log_findckp.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
log_get@o@: $(srcdir)/log/log_get.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
log_method@o@: $(srcdir)/log/log_method.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
log_put@o@: $(srcdir)/log/log_put.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
log_rec@o@: $(srcdir)/log/log_rec.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
log_register@o@: $(srcdir)/log/log_register.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Mpool files
|
||||
mp_alloc@o@: $(srcdir)/mp/mp_alloc.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_bh@o@: $(srcdir)/mp/mp_bh.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_fget@o@: $(srcdir)/mp/mp_fget.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_fopen@o@: $(srcdir)/mp/mp_fopen.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_fput@o@: $(srcdir)/mp/mp_fput.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_fset@o@: $(srcdir)/mp/mp_fset.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_method@o@: $(srcdir)/mp/mp_method.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_region@o@: $(srcdir)/mp/mp_region.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_register@o@: $(srcdir)/mp/mp_register.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_stat@o@: $(srcdir)/mp/mp_stat.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_sync@o@: $(srcdir)/mp/mp_sync.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mp_trickle@o@: $(srcdir)/mp/mp_trickle.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Mutex files
|
||||
mutex@o@: $(srcdir)/mutex/mutex.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mut_fcntl@o@: $(srcdir)/mutex/mut_fcntl.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mut_pthread@o@: $(srcdir)/mutex/mut_pthread.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
mut_tas@o@: $(srcdir)/mutex/mut_tas.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
# UTS4 spinlock assembly.
|
||||
uts4_cc@o@: $(srcdir)/mutex/uts4_cc.s
|
||||
$(AS) $(ASFLAGS) -o $@ $?
|
||||
|
||||
# Transaction files
|
||||
txn@o@: $(srcdir)/txn/txn.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
txn_auto@o@: $(srcdir)/txn/txn_auto.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
txn_rec@o@: $(srcdir)/txn/txn_rec.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
txn_region@o@: $(srcdir)/txn/txn_region.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# XA files
|
||||
xa@o@: $(srcdir)/xa/xa.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
xa_db@o@: $(srcdir)/xa/xa_db.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
xa_map@o@: $(srcdir)/xa/xa_map.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# RPC client files
|
||||
client@o@: $(srcdir)/rpc_client/client.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_server_clnt@o@: $(srcdir)/rpc_client/db_server_clnt.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
gen_client@o@: $(srcdir)/rpc_client/gen_client.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
gen_client_ret@o@: $(srcdir)/rpc_client/gen_client_ret.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# RPC server files
|
||||
db_server_proc@o@: $(srcdir)/rpc_server/db_server_proc.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_server_svc@o@: $(srcdir)/rpc_server/db_server_svc.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_server_util@o@: $(srcdir)/rpc_server/db_server_util.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
db_server_xdr@o@: $(srcdir)/rpc_server/db_server_xdr.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
gen_db_server@o@: $(srcdir)/rpc_server/gen_db_server.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Historic compatibility files
|
||||
db185@o@: $(srcdir)/db185/db185.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
dbm@o@: $(srcdir)/dbm/dbm.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
hsearch@o@: $(srcdir)/hsearch/hsearch.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# OS specific files
|
||||
os_abs@o@: $(srcdir)/os/os_abs.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_alloc@o@: $(srcdir)/os/os_alloc.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_dir@o@: $(srcdir)/os/os_dir.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_errno@o@: $(srcdir)/os/os_errno.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_fid@o@: $(srcdir)/os/os_fid.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_finit@o@: $(srcdir)/os/os_finit.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_fsync@o@: $(srcdir)/os/os_fsync.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_handle@o@: $(srcdir)/os/os_handle.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_map@o@: $(srcdir)/os/os_map.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_method@o@: $(srcdir)/os/os_method.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_oflags@o@: $(srcdir)/os/os_oflags.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_open@o@: $(srcdir)/os/os_open.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_region@o@: $(srcdir)/os/os_region.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_rename@o@: $(srcdir)/os/os_rename.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_root@o@: $(srcdir)/os/os_root.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_rpath@o@: $(srcdir)/os/os_rpath.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_rw@o@: $(srcdir)/os/os_rw.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_seek@o@: $(srcdir)/os/os_seek.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_sleep@o@: $(srcdir)/os/os_sleep.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_spin@o@: $(srcdir)/os/os_spin.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_stat@o@: $(srcdir)/os/os_stat.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_tmpdir@o@: $(srcdir)/os/os_tmpdir.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
os_unlink@o@: $(srcdir)/os/os_unlink.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# Dbs.
|
||||
dbs@o@: $(srcdir)/test_server/dbs.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_am@o@: $(srcdir)/test_server/dbs_am.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_checkpoint@o@: $(srcdir)/test_server/dbs_checkpoint.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_debug@o@: $(srcdir)/test_server/dbs_debug.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_handles@o@: $(srcdir)/test_server/dbs_handles.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_log@o@: $(srcdir)/test_server/dbs_log.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_qam@o@: $(srcdir)/test_server/dbs_qam.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_spawn@o@: $(srcdir)/test_server/dbs_spawn.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_trickle@o@: $(srcdir)/test_server/dbs_trickle.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_util@o@: $(srcdir)/test_server/dbs_util.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
dbs_yield@o@: $(srcdir)/test_server/dbs_yield.c
|
||||
$(CC) $(CFLAGS) -I$(srcdir)/test_server $?
|
||||
|
||||
# Replacement files
|
||||
getcwd@o@: $(srcdir)/clib/getcwd.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
getopt@o@: $(srcdir)/clib/getopt.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
memcmp@o@: $(srcdir)/clib/memcmp.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
memcpy@o@: $(srcdir)/clib/memmove.c
|
||||
$(CC) -DMEMCOPY $(CFLAGS) $? -o $@
|
||||
memmove@o@: $(srcdir)/clib/memmove.c
|
||||
$(CC) -DMEMMOVE $(CFLAGS) $?
|
||||
raise@o@: $(srcdir)/clib/raise.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
strcasecmp@o@: $(srcdir)/clib/strcasecmp.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
snprintf@o@: $(srcdir)/clib/snprintf.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
strerror@o@: $(srcdir)/clib/strerror.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
vsnprintf@o@: $(srcdir)/clib/vsnprintf.c
|
||||
$(CC) $(CFLAGS) $?
|
||||
8
bdb/dist/RELEASE
vendored
Normal file
8
bdb/dist/RELEASE
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# $Id: RELEASE,v 11.72 2001/01/24 15:20:14 bostic Exp $
|
||||
|
||||
DB_VERSION_MAJOR=3
|
||||
DB_VERSION_MINOR=2
|
||||
DB_VERSION_PATCH=9
|
||||
DB_RELEASE_DATE=`date "+%B %e, %Y"`
|
||||
|
||||
DB_VERSION_STRING="Sleepycat Software: Berkeley DB $DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH: ($DB_RELEASE_DATE)"
|
||||
108
bdb/dist/acconfig.h
vendored
Normal file
108
bdb/dist/acconfig.h
vendored
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* $Id: acconfig.h,v 11.29 2000/09/20 16:30:33 bostic Exp $
|
||||
*/
|
||||
|
||||
/* Define if you are building a version for running the test suite. */
|
||||
#undef CONFIG_TEST
|
||||
|
||||
/* Define if you want a debugging version. */
|
||||
#undef DEBUG
|
||||
|
||||
/* Define if you want a version that logs read operations. */
|
||||
#undef DEBUG_ROP
|
||||
|
||||
/* Define if you want a version that logs write operations. */
|
||||
#undef DEBUG_WOP
|
||||
|
||||
/* Define if you want a version with run-time diagnostic checking. */
|
||||
#undef DIAGNOSTIC
|
||||
|
||||
/* Define if you want to mask harmless unitialized memory read/writes. */
|
||||
#undef UMRW
|
||||
|
||||
/* Define if fcntl/F_SETFD denies child access to file descriptors. */
|
||||
#undef HAVE_FCNTL_F_SETFD
|
||||
|
||||
/* Define if building big-file environment (e.g., AIX, HP/UX, Solaris). */
|
||||
#undef HAVE_FILE_OFFSET_BITS
|
||||
|
||||
/* Mutex possibilities. */
|
||||
#undef HAVE_MUTEX_68K_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_AIX_CHECK_LOCK
|
||||
#undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_HPPA_MSEM_INIT
|
||||
#undef HAVE_MUTEX_IA64_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_MACOS
|
||||
#undef HAVE_MUTEX_MSEM_INIT
|
||||
#undef HAVE_MUTEX_PPC_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_PTHREADS
|
||||
#undef HAVE_MUTEX_RELIANTUNIX_INITSPIN
|
||||
#undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_SEMA_INIT
|
||||
#undef HAVE_MUTEX_SGI_INIT_LOCK
|
||||
#undef HAVE_MUTEX_SOLARIS_LOCK_TRY
|
||||
#undef HAVE_MUTEX_SOLARIS_LWP
|
||||
#undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_THREADS
|
||||
#undef HAVE_MUTEX_UI_THREADS
|
||||
#undef HAVE_MUTEX_UTS_CC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_VMS
|
||||
#undef HAVE_MUTEX_VXWORKS
|
||||
#undef HAVE_MUTEX_WIN16
|
||||
#undef HAVE_MUTEX_WIN32
|
||||
#undef HAVE_MUTEX_X86_GCC_ASSEMBLY
|
||||
|
||||
/* Define if building on QNX. */
|
||||
#undef HAVE_QNX
|
||||
|
||||
/* Define if building RPC client/server. */
|
||||
#undef HAVE_RPC
|
||||
|
||||
/* Define if your sprintf returns a pointer, not a length. */
|
||||
#undef SPRINTF_RET_CHARPNT
|
||||
|
||||
@BOTTOM@
|
||||
|
||||
/*
|
||||
* Big-file configuration.
|
||||
*/
|
||||
#ifdef HAVE_FILE_OFFSET_BITS
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Don't step on the namespace. Other libraries may have their own
|
||||
* implementations of these functions, we don't want to use their
|
||||
* implementations or force them to use ours based on the load order.
|
||||
*/
|
||||
#ifndef HAVE_GETCWD
|
||||
#define getcwd __db_Cgetcwd
|
||||
#endif
|
||||
#ifndef HAVE_GETOPT
|
||||
#define getopt __db_Cgetopt
|
||||
#endif
|
||||
#ifndef HAVE_MEMCMP
|
||||
#define memcmp __db_Cmemcmp
|
||||
#endif
|
||||
#ifndef HAVE_MEMCPY
|
||||
#define memcpy __db_Cmemcpy
|
||||
#endif
|
||||
#ifndef HAVE_MEMMOVE
|
||||
#define memmove __db_Cmemmove
|
||||
#endif
|
||||
#ifndef HAVE_RAISE
|
||||
#define raise __db_Craise
|
||||
#endif
|
||||
#ifndef HAVE_SNPRINTF
|
||||
#define snprintf __db_Csnprintf
|
||||
#endif
|
||||
#ifndef HAVE_STRCASECMP
|
||||
#define strcasecmp __db_Cstrcasecmp
|
||||
#endif
|
||||
#ifndef HAVE_STRERROR
|
||||
#define strerror __db_Cstrerror
|
||||
#endif
|
||||
#ifndef HAVE_VSNPRINTF
|
||||
#define vsnprintf __db_Cvsnprintf
|
||||
#endif
|
||||
395
bdb/dist/aclocal/mutex.m4
vendored
Normal file
395
bdb/dist/aclocal/mutex.m4
vendored
Normal file
|
|
@ -0,0 +1,395 @@
|
|||
dnl $Id: mutex.m4,v 11.20 2000/12/20 22:16:56 bostic Exp $
|
||||
|
||||
dnl Figure out mutexes for this compiler/architecture.
|
||||
AC_DEFUN(AM_DEFINE_MUTEXES, [
|
||||
|
||||
AC_CACHE_CHECK([for mutexes], db_cv_mutex, [dnl
|
||||
db_cv_mutex=no
|
||||
|
||||
orig_libs=$LIBS
|
||||
|
||||
dnl User-specified POSIX mutexes.
|
||||
dnl
|
||||
dnl Assume that -lpthread exists when the user specifies POSIX mutexes. (I
|
||||
dnl only expect this option to be used on Solaris, which has -lpthread.)
|
||||
if test "$db_cv_posixmutexes" = yes; then
|
||||
db_cv_mutex="posix_only"
|
||||
fi
|
||||
|
||||
dnl User-specified UI mutexes.
|
||||
dnl
|
||||
dnl Assume that -lthread exists when the user specifies UI mutexes. (I only
|
||||
dnl expect this option to be used on Solaris, which has -lthread.)
|
||||
if test "$db_cv_uimutexes" = yes; then
|
||||
db_cv_mutex="ui_only"
|
||||
fi
|
||||
|
||||
dnl LWP threads: _lwp_XXX
|
||||
dnl
|
||||
dnl Test for LWP threads before testing for UI/POSIX threads, we prefer them
|
||||
dnl on Solaris. There are two reasons: the Solaris C library has UI/POSIX
|
||||
dnl interface stubs, but they're broken, configuring them for inter-process
|
||||
dnl mutexes doesn't return an error, but it doesn't work either. Second,
|
||||
dnl there's a bug in SunOS 5.7 where applications get pwrite, not pwrite64,
|
||||
dnl if they load the C library before the appropriate threads library, e.g.,
|
||||
dnl tclsh using dlopen to load the DB library. Anyway, by using LWP threads
|
||||
dnl we avoid answering lots of user questions, not to mention the bugs.
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([
|
||||
#include <synch.h>
|
||||
main(){
|
||||
static lwp_mutex_t mi = SHAREDMUTEX;
|
||||
static lwp_cond_t ci = SHAREDCV;
|
||||
lwp_mutex_t mutex = mi;
|
||||
lwp_cond_t cond = ci;
|
||||
exit (
|
||||
_lwp_mutex_lock(&mutex) ||
|
||||
_lwp_mutex_unlock(&mutex));
|
||||
}], [db_cv_mutex="Solaris/lwp"])
|
||||
fi
|
||||
|
||||
dnl UI threads: thr_XXX
|
||||
dnl
|
||||
dnl Try with and without the -lthread library.
|
||||
if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "ui_only"; then
|
||||
LIBS="-lthread $LIBS"
|
||||
AC_TRY_RUN([
|
||||
#include <thread.h>
|
||||
#include <synch.h>
|
||||
main(){
|
||||
mutex_t mutex;
|
||||
cond_t cond;
|
||||
int type = USYNC_PROCESS;
|
||||
exit (
|
||||
mutex_init(&mutex, type, NULL) ||
|
||||
cond_init(&cond, type, NULL) ||
|
||||
mutex_lock(&mutex) ||
|
||||
mutex_unlock(&mutex));
|
||||
}], [db_cv_mutex="UI/threads/library"])
|
||||
LIBS="$orig_libs"
|
||||
fi
|
||||
if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "ui_only"; then
|
||||
AC_TRY_RUN([
|
||||
#include <thread.h>
|
||||
#include <synch.h>
|
||||
main(){
|
||||
mutex_t mutex;
|
||||
cond_t cond;
|
||||
int type = USYNC_PROCESS;
|
||||
exit (
|
||||
mutex_init(&mutex, type, NULL) ||
|
||||
cond_init(&cond, type, NULL) ||
|
||||
mutex_lock(&mutex) ||
|
||||
mutex_unlock(&mutex));
|
||||
}], [db_cv_mutex="UI/threads"])
|
||||
fi
|
||||
if test "$db_cv_mutex" = "ui_only"; then
|
||||
AC_MSG_ERROR([unable to find UI mutex interfaces])
|
||||
fi
|
||||
|
||||
|
||||
dnl POSIX.1 pthreads: pthread_XXX
|
||||
dnl
|
||||
dnl Try with and without the -lpthread library.
|
||||
if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then
|
||||
AC_TRY_RUN([
|
||||
#include <pthread.h>
|
||||
main(){
|
||||
pthread_cond_t cond;
|
||||
pthread_mutex_t mutex;
|
||||
pthread_condattr_t condattr;
|
||||
pthread_mutexattr_t mutexattr;
|
||||
exit (
|
||||
pthread_condattr_init(&condattr) ||
|
||||
pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
|
||||
pthread_mutexattr_init(&mutexattr) ||
|
||||
pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
|
||||
pthread_cond_init(&cond, &condattr) ||
|
||||
pthread_mutex_init(&mutex, &mutexattr) ||
|
||||
pthread_mutex_lock(&mutex) ||
|
||||
pthread_mutex_unlock(&mutex) ||
|
||||
pthread_mutex_destroy(&mutex) ||
|
||||
pthread_cond_destroy(&cond) ||
|
||||
pthread_condattr_destroy(&condattr) ||
|
||||
pthread_mutexattr_destroy(&mutexattr));
|
||||
}], [db_cv_mutex="POSIX/pthreads"])
|
||||
fi
|
||||
if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then
|
||||
LIBS="-lpthread $LIBS"
|
||||
AC_TRY_RUN([
|
||||
#include <pthread.h>
|
||||
main(){
|
||||
pthread_cond_t cond;
|
||||
pthread_mutex_t mutex;
|
||||
pthread_condattr_t condattr;
|
||||
pthread_mutexattr_t mutexattr;
|
||||
exit (
|
||||
pthread_condattr_init(&condattr) ||
|
||||
pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
|
||||
pthread_mutexattr_init(&mutexattr) ||
|
||||
pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
|
||||
pthread_cond_init(&cond, &condattr) ||
|
||||
pthread_mutex_init(&mutex, &mutexattr) ||
|
||||
pthread_mutex_lock(&mutex) ||
|
||||
pthread_mutex_unlock(&mutex) ||
|
||||
pthread_mutex_destroy(&mutex) ||
|
||||
pthread_cond_destroy(&cond) ||
|
||||
pthread_condattr_destroy(&condattr) ||
|
||||
pthread_mutexattr_destroy(&mutexattr));
|
||||
}], [db_cv_mutex="POSIX/pthreads/library"])
|
||||
LIBS="$orig_libs"
|
||||
fi
|
||||
if test "$db_cv_mutex" = "posix_only"; then
|
||||
AC_MSG_ERROR([unable to find POSIX mutex interfaces])
|
||||
fi
|
||||
|
||||
dnl msemaphore: HPPA only
|
||||
dnl Try HPPA before general msem test, it needs special alignment.
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([
|
||||
#include <sys/mman.h>
|
||||
main(){
|
||||
#if defined(__hppa)
|
||||
typedef msemaphore tsl_t;
|
||||
msemaphore x;
|
||||
msem_init(&x, 0);
|
||||
msem_lock(&x, 0);
|
||||
msem_unlock(&x, 0);
|
||||
exit(0);
|
||||
#else
|
||||
exit(1);
|
||||
#endif
|
||||
}], [db_cv_mutex="HP/msem_init"])
|
||||
fi
|
||||
|
||||
dnl msemaphore: AIX, OSF/1
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>;
|
||||
main(){
|
||||
typedef msemaphore tsl_t;
|
||||
msemaphore x;
|
||||
msem_init(&x, 0);
|
||||
msem_lock(&x, 0);
|
||||
msem_unlock(&x, 0);
|
||||
exit(0);
|
||||
}], [db_cv_mutex="UNIX/msem_init"])
|
||||
fi
|
||||
|
||||
dnl ReliantUNIX
|
||||
if test "$db_cv_mutex" = no; then
|
||||
LIBS="$LIBS -lmproc"
|
||||
AC_TRY_LINK([#include <ulocks.h>],
|
||||
[typedef spinlock_t tsl_t;
|
||||
spinlock_t x; initspin(&x, 1); cspinlock(&x); spinunlock(&x);],
|
||||
[db_cv_mutex="ReliantUNIX/initspin"])
|
||||
LIBS="$orig_libs"
|
||||
fi
|
||||
|
||||
dnl SCO: UnixWare has threads in libthread, but OpenServer doesn't.
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([
|
||||
main(){
|
||||
#if defined(__USLC__)
|
||||
exit(0);
|
||||
#endif
|
||||
exit(1);
|
||||
}], [db_cv_mutex="SCO/x86/cc-assembly"])
|
||||
fi
|
||||
|
||||
dnl abilock_t: SGI
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_LINK([#include <abi_mutex.h>],
|
||||
[typedef abilock_t tsl_t;
|
||||
abilock_t x; init_lock(&x); acquire_lock(&x); release_lock(&x);],
|
||||
[db_cv_mutex="SGI/init_lock"])
|
||||
fi
|
||||
|
||||
dnl sema_t: Solaris
|
||||
dnl The sema_XXX calls do not work on Solaris 5.5. I see no reason to ever
|
||||
dnl turn this test on, unless we find some other platform that uses the old
|
||||
dnl POSIX.1 interfaces. (I plan to move directly to pthreads on Solaris.)
|
||||
if test "$db_cv_mutex" = DOESNT_WORK; then
|
||||
AC_TRY_LINK([#include <synch.h>],
|
||||
[typedef sema_t tsl_t;
|
||||
sema_t x;
|
||||
sema_init(&x, 1, USYNC_PROCESS, NULL); sema_wait(&x); sema_post(&x);],
|
||||
[db_cv_mutex="UNIX/sema_init"])
|
||||
fi
|
||||
|
||||
dnl _lock_try/_lock_clear: Solaris
|
||||
dnl On Solaris systems without Pthread or UI mutex interfaces, DB uses the
|
||||
dnl undocumented _lock_try _lock_clear function calls instead of either the
|
||||
dnl sema_trywait(3T) or sema_wait(3T) function calls. This is because of
|
||||
dnl problems in those interfaces in some releases of the Solaris C library.
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_LINK([#include <sys/machlock.h>],
|
||||
[typedef lock_t tsl_t;
|
||||
lock_t x;
|
||||
_lock_try(&x); _lock_clear(&x);],
|
||||
[db_cv_mutex="Solaris/_lock_try"])
|
||||
fi
|
||||
|
||||
dnl _check_lock/_clear_lock: AIX
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_LINK([#include <sys/atomic_op.h>],
|
||||
[int x; _check_lock(&x,0,1); _clear_lock(&x,0);],
|
||||
[db_cv_mutex="AIX/_check_lock"])
|
||||
fi
|
||||
|
||||
dnl Alpha/gcc: OSF/1
|
||||
dnl The alpha/gcc code doesn't work as far as I know. There are
|
||||
dnl two versions, both have problems. See Support Request #1583.
|
||||
if test "$db_cv_mutex" = DOESNT_WORK; then
|
||||
AC_TRY_RUN([main(){
|
||||
#if defined(__alpha)
|
||||
#if defined(__GNUC__)
|
||||
exit(0);
|
||||
#endif
|
||||
#endif
|
||||
exit(1);}],
|
||||
[db_cv_mutex="ALPHA/gcc-assembly"])
|
||||
fi
|
||||
|
||||
dnl PaRisc/gcc: HP/UX
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([main(){
|
||||
#if defined(__hppa)
|
||||
#if defined(__GNUC__)
|
||||
exit(0);
|
||||
#endif
|
||||
#endif
|
||||
exit(1);}],
|
||||
[db_cv_mutex="HPPA/gcc-assembly"])
|
||||
fi
|
||||
|
||||
dnl PPC/gcc:
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([main(){
|
||||
#if defined(__powerpc__)
|
||||
#if defined(__GNUC__)
|
||||
exit(0);
|
||||
#endif
|
||||
#endif
|
||||
exit(1);}],
|
||||
[db_cv_mutex="PPC/gcc-assembly"])
|
||||
fi
|
||||
|
||||
dnl Sparc/gcc: SunOS, Solaris
|
||||
dnl The sparc/gcc code doesn't always work, specifically, I've seen assembler
|
||||
dnl failures from the stbar instruction on SunOS 4.1.4/sun4c and gcc 2.7.2.2.
|
||||
if test "$db_cv_mutex" = DOESNT_WORK; then
|
||||
AC_TRY_RUN([main(){
|
||||
#if defined(__sparc__)
|
||||
#if defined(__GNUC__)
|
||||
exit(0);
|
||||
#endif
|
||||
#endif
|
||||
exit(1);
|
||||
}], [db_cv_mutex="Sparc/gcc-assembly"])
|
||||
fi
|
||||
|
||||
dnl 68K/gcc: SunOS
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([main(){
|
||||
#if (defined(mc68020) || defined(sun3))
|
||||
#if defined(__GNUC__)
|
||||
exit(0);
|
||||
#endif
|
||||
#endif
|
||||
exit(1);
|
||||
}], [db_cv_mutex="68K/gcc-assembly"])
|
||||
fi
|
||||
|
||||
dnl x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([main(){
|
||||
#if defined(i386) || defined(__i386__)
|
||||
#if defined(__GNUC__)
|
||||
exit(0);
|
||||
#endif
|
||||
#endif
|
||||
exit(1);
|
||||
}], [db_cv_mutex="x86/gcc-assembly"])
|
||||
fi
|
||||
|
||||
dnl ia86/gcc: Linux
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([main(){
|
||||
#if defined(__ia64)
|
||||
#if defined(__GNUC__)
|
||||
exit(0);
|
||||
#endif
|
||||
#endif
|
||||
exit(1);
|
||||
}], [db_cv_mutex="ia64/gcc-assembly"])
|
||||
fi
|
||||
|
||||
dnl: uts/cc: UTS
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_TRY_RUN([main(){
|
||||
#if defined(_UTS)
|
||||
exit(0);
|
||||
#endif
|
||||
exit(1);
|
||||
}], [db_cv_mutex="UTS/cc-assembly"])
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$db_cv_mutex" = no; then
|
||||
AC_MSG_WARN(
|
||||
[THREAD MUTEXES NOT AVAILABLE FOR THIS COMPILER/ARCHITECTURE.])
|
||||
ADDITIONAL_OBJS="mut_fcntl${o} $ADDITIONAL_OBJS"
|
||||
else
|
||||
AC_DEFINE(HAVE_MUTEX_THREADS)
|
||||
fi
|
||||
|
||||
case "$db_cv_mutex" in
|
||||
68K/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_68K_GCC_ASSEMBLY);;
|
||||
AIX/_check_lock) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_AIX_CHECK_LOCK);;
|
||||
ALPHA/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_ALPHA_GCC_ASSEMBLY);;
|
||||
HP/msem_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_HPPA_MSEM_INIT);;
|
||||
HPPA/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_HPPA_GCC_ASSEMBLY);;
|
||||
ia64/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_IA64_GCC_ASSEMBLY);;
|
||||
POSIX/pthreads) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_PTHREADS);;
|
||||
POSIX/pthreads/library) LIBS="-lpthread $LIBS"
|
||||
ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_PTHREADS);;
|
||||
PPC/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_PPC_GCC_ASSEMBLY);;
|
||||
ReliantUNIX/initspin) LIBS="$LIBS -lmproc"
|
||||
ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_RELIANTUNIX_INITSPIN);;
|
||||
SCO/x86/cc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY);;
|
||||
SGI/init_lock) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_SGI_INIT_LOCK);;
|
||||
Solaris/_lock_try) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_SOLARIS_LOCK_TRY);;
|
||||
Solaris/lwp) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_SOLARIS_LWP);;
|
||||
Sparc/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_SPARC_GCC_ASSEMBLY);;
|
||||
UI/threads) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_UI_THREADS);;
|
||||
UI/threads/library) LIBS="-lthread $LIBS"
|
||||
ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_UI_THREADS);;
|
||||
UNIX/msem_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_MSEM_INIT);;
|
||||
UNIX/sema_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_SEMA_INIT);;
|
||||
UTS/cc-assembly) ADDITIONAL_OBJS="$ADDITIONAL_OBJS uts4.cc${o}"
|
||||
AC_DEFINE(HAVE_MUTEX_UTS_CC_ASSEMBLY);;
|
||||
x86/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
|
||||
AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY);;
|
||||
esac
|
||||
])dnl
|
||||
121
bdb/dist/aclocal/options.m4
vendored
Normal file
121
bdb/dist/aclocal/options.m4
vendored
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
dnl $Id: options.m4,v 11.10 2000/07/07 15:50:39 bostic Exp $
|
||||
|
||||
dnl Process user-specified options.
|
||||
AC_DEFUN(AM_OPTIONS_SET, [
|
||||
|
||||
AC_MSG_CHECKING(if --disable-bigfile option specified)
|
||||
AC_ARG_ENABLE(bigfile,
|
||||
[ --disable-bigfile Disable AIX, HP/UX, Solaris big files.],
|
||||
[db_cv_bigfile="yes"], [db_cv_bigfile="no"])
|
||||
AC_MSG_RESULT($db_cv_bigfile)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-compat185 option specified)
|
||||
AC_ARG_ENABLE(compat185,
|
||||
[ --enable-compat185 Build DB 1.85 compatibility API.],
|
||||
[db_cv_compat185="$enable_compat185"], [db_cv_compat185="no"])
|
||||
AC_MSG_RESULT($db_cv_compat185)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-cxx option specified)
|
||||
AC_ARG_ENABLE(cxx,
|
||||
[ --enable-cxx Build C++ API.],
|
||||
[db_cv_cxx="$enable_cxx"], [db_cv_cxx="no"])
|
||||
AC_MSG_RESULT($db_cv_cxx)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-debug option specified)
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug Build a debugging version.],
|
||||
[db_cv_debug="$enable_debug"], [db_cv_debug="no"])
|
||||
AC_MSG_RESULT($db_cv_debug)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-debug_rop option specified)
|
||||
AC_ARG_ENABLE(debug_rop,
|
||||
[ --enable-debug_rop Build a version that logs read operations.],
|
||||
[db_cv_debug_rop="$enable_debug_rop"], [db_cv_debug_rop="no"])
|
||||
AC_MSG_RESULT($db_cv_debug_rop)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-debug_wop option specified)
|
||||
AC_ARG_ENABLE(debug_wop,
|
||||
[ --enable-debug_wop Build a version that logs write operations.],
|
||||
[db_cv_debug_wop="$enable_debug_wop"], [db_cv_debug_wop="no"])
|
||||
AC_MSG_RESULT($db_cv_debug_wop)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-diagnostic option specified)
|
||||
AC_ARG_ENABLE(diagnostic,
|
||||
[ --enable-diagnostic Build a version with run-time diagnostics.],
|
||||
[db_cv_diagnostic="$enable_diagnostic"], [db_cv_diagnostic="no"])
|
||||
AC_MSG_RESULT($db_cv_diagnostic)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-dump185 option specified)
|
||||
AC_ARG_ENABLE(dump185,
|
||||
[ --enable-dump185 Build db_dump185(1) to dump 1.85 databases.],
|
||||
[db_cv_dump185="$enable_dump185"], [db_cv_dump185="no"])
|
||||
AC_MSG_RESULT($db_cv_dump185)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-dynamic option specified)
|
||||
AC_ARG_ENABLE(dynamic,
|
||||
[ --enable-dynamic Build with dynamic libraries.],
|
||||
[db_cv_dynamic="$enable_dynamic"], [db_cv_dynamic="no"])
|
||||
AC_MSG_RESULT($db_cv_dynamic)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-java option specified)
|
||||
AC_ARG_ENABLE(java,
|
||||
[ --enable-java Build Java API.],
|
||||
[db_cv_java="$enable_java"], [db_cv_java="no"])
|
||||
AC_MSG_RESULT($db_cv_java)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-posixmutexes option specified)
|
||||
AC_ARG_ENABLE(posixmutexes,
|
||||
[ --enable-posixmutexes Force use of POSIX standard mutexes.],
|
||||
[db_cv_posixmutexes="$enable_posixmutexes"], [db_cv_posixmutexes="no"])
|
||||
AC_MSG_RESULT($db_cv_posixmutexes)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-rpc option specified)
|
||||
AC_ARG_ENABLE(rpc,
|
||||
[ --enable-rpc Build RPC client/server.],
|
||||
[db_cv_rpc="$enable_rpc"], [db_cv_rpc="no"])
|
||||
AC_MSG_RESULT($db_cv_rpc)
|
||||
|
||||
dnl --enable-shared is an alias for --enable-dynamic. We support it for
|
||||
dnl compatibility with other applications, e.g., Tcl.
|
||||
AC_MSG_CHECKING(if --enable-shared option specified)
|
||||
AC_ARG_ENABLE(shared,
|
||||
[ --enable-shared Build with dynamic libraries.],
|
||||
[db_cv_shared="$enable_shared"], [db_cv_shared="no"])
|
||||
AC_MSG_RESULT($db_cv_shared)
|
||||
if test "$db_cv_shared" != "no"; then
|
||||
db_cv_dynamic="yes"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(if --enable-tcl option specified)
|
||||
AC_ARG_ENABLE(tcl,
|
||||
[ --enable-tcl Build Tcl API.],
|
||||
[db_cv_tcl="$enable_tcl"], [db_cv_tcl="no"])
|
||||
AC_MSG_RESULT($db_cv_tcl)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-test option specified)
|
||||
AC_ARG_ENABLE(test,
|
||||
[ --enable-test Configure to run the test suite.],
|
||||
[db_cv_test="$enable_test"], [db_cv_test="no"])
|
||||
AC_MSG_RESULT($db_cv_test)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-uimutexes option specified)
|
||||
AC_ARG_ENABLE(uimutexes,
|
||||
[ --enable-uimutexes Force use of Unix International mutexes.],
|
||||
[db_cv_uimutexes="$enable_uimutexes"], [db_cv_uimutexes="no"])
|
||||
AC_MSG_RESULT($db_cv_uimutexes)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-umrw option specified)
|
||||
AC_ARG_ENABLE(umrw,
|
||||
[ --enable-umrw Mask harmless unitialized memory read/writes.],
|
||||
[db_cv_umrw="$enable_umrw"], [db_cv_umrw="no"])
|
||||
AC_MSG_RESULT($db_cv_umrw)
|
||||
|
||||
AC_MSG_CHECKING([if --with-tcl option specified])
|
||||
AC_ARG_WITH(tcl,
|
||||
[ --with-tcl=DIR Directory location of tclConfig.sh.],
|
||||
with_tclconfig=${withval}, with_tclconfig="no")
|
||||
AC_MSG_RESULT($with_tclconfig)
|
||||
if test "$with_tclconfig" != "no"; then
|
||||
db_cv_tcl="yes"
|
||||
fi
|
||||
])dnl
|
||||
48
bdb/dist/aclocal/programs.m4
vendored
Normal file
48
bdb/dist/aclocal/programs.m4
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
dnl $Id: programs.m4,v 11.11 2000/03/30 21:20:50 bostic Exp $
|
||||
|
||||
dnl Check for programs used in building/installation.
|
||||
AC_DEFUN(AM_PROGRAMS_SET, [
|
||||
|
||||
AC_PATH_PROG(db_cv_path_ar, ar, missing_ar)
|
||||
if test "$db_cv_path_ar" = missing_ar; then
|
||||
AC_MSG_ERROR([No ar utility found.])
|
||||
fi
|
||||
AC_PATH_PROG(db_cv_path_chmod, chmod, missing_chmod)
|
||||
if test "$db_cv_path_chmod" = missing_chmod; then
|
||||
AC_MSG_ERROR([No chmod utility found.])
|
||||
fi
|
||||
AC_PATH_PROG(db_cv_path_cp, cp, missing_cp)
|
||||
if test "$db_cv_path_cp" = missing_cp; then
|
||||
AC_MSG_ERROR([No cp utility found.])
|
||||
fi
|
||||
AC_PATH_PROG(db_cv_path_ln, ln, missing_ln)
|
||||
if test "$db_cv_path_ln" = missing_ln; then
|
||||
AC_MSG_ERROR([No ln utility found.])
|
||||
fi
|
||||
AC_PATH_PROG(db_cv_path_mkdir, mkdir, missing_mkdir)
|
||||
if test "$db_cv_path_mkdir" = missing_mkdir; then
|
||||
AC_MSG_ERROR([No mkdir utility found.])
|
||||
fi
|
||||
AC_PATH_PROG(db_cv_path_ranlib, ranlib, missing_ranlib)
|
||||
AC_PATH_PROG(db_cv_path_rm, rm, missing_rm)
|
||||
if test "$db_cv_path_rm" = missing_rm; then
|
||||
AC_MSG_ERROR([No rm utility found.])
|
||||
fi
|
||||
AC_PATH_PROG(db_cv_path_sh, sh, missing_sh)
|
||||
if test "$db_cv_path_sh" = missing_sh; then
|
||||
AC_MSG_ERROR([No sh utility found.])
|
||||
fi
|
||||
AC_PATH_PROG(db_cv_path_strip, strip, missing_strip)
|
||||
if test "$db_cv_path_strip" = missing_strip; then
|
||||
AC_MSG_ERROR([No strip utility found.])
|
||||
fi
|
||||
|
||||
dnl Check for programs used in testing.
|
||||
if test "$db_cv_test" = "yes"; then
|
||||
AC_PATH_PROG(db_cv_path_kill, kill, missing_kill)
|
||||
if test "$db_cv_path_kill" = missing_kill; then
|
||||
AC_MSG_ERROR([No kill utility found.])
|
||||
fi
|
||||
fi
|
||||
|
||||
])dnl
|
||||
126
bdb/dist/aclocal/tcl.m4
vendored
Normal file
126
bdb/dist/aclocal/tcl.m4
vendored
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
dnl $Id: tcl.m4,v 11.5 2000/06/27 13:21:28 bostic Exp $
|
||||
|
||||
dnl The SC_* macros in this file are from the unix/tcl.m4 files in the Tcl
|
||||
dnl 8.3.0 distribution, with some minor changes. For this reason, license
|
||||
dnl terms for the Berkeley DB distribution dist/aclocal/tcl.m4 file are as
|
||||
dnl follows (copied from the license.terms file in the Tcl 8.3 distribution):
|
||||
dnl
|
||||
dnl This software is copyrighted by the Regents of the University of
|
||||
dnl California, Sun Microsystems, Inc., Scriptics Corporation,
|
||||
dnl and other parties. The following terms apply to all files associated
|
||||
dnl with the software unless explicitly disclaimed in individual files.
|
||||
dnl
|
||||
dnl The authors hereby grant permission to use, copy, modify, distribute,
|
||||
dnl and license this software and its documentation for any purpose, provided
|
||||
dnl that existing copyright notices are retained in all copies and that this
|
||||
dnl notice is included verbatim in any distributions. No written agreement,
|
||||
dnl license, or royalty fee is required for any of the authorized uses.
|
||||
dnl Modifications to this software may be copyrighted by their authors
|
||||
dnl and need not follow the licensing terms described here, provided that
|
||||
dnl the new terms are clearly indicated on the first page of each file where
|
||||
dnl they apply.
|
||||
dnl
|
||||
dnl IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
|
||||
dnl FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
dnl ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
|
||||
dnl DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
|
||||
dnl POSSIBILITY OF SUCH DAMAGE.
|
||||
dnl
|
||||
dnl THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
|
||||
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
dnl FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
|
||||
dnl IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
|
||||
dnl NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
|
||||
dnl MODIFICATIONS.
|
||||
dnl
|
||||
dnl GOVERNMENT USE: If you are acquiring this software on behalf of the
|
||||
dnl U.S. government, the Government shall have only "Restricted Rights"
|
||||
dnl in the software and related documentation as defined in the Federal
|
||||
dnl Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
|
||||
dnl are acquiring the software on behalf of the Department of Defense, the
|
||||
dnl software shall be classified as "Commercial Computer Software" and the
|
||||
dnl Government shall have only "Restricted Rights" as defined in Clause
|
||||
dnl 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
|
||||
dnl authors grant the U.S. Government and others acting in its behalf
|
||||
dnl permission to use and distribute the software in accordance with the
|
||||
dnl terms specified in this license.
|
||||
|
||||
AC_DEFUN(SC_PATH_TCLCONFIG, [
|
||||
AC_CACHE_VAL(ac_cv_c_tclconfig,[
|
||||
|
||||
# First check to see if --with-tclconfig was specified.
|
||||
if test "${with_tclconfig}" != no; then
|
||||
if test -f "${with_tclconfig}/tclConfig.sh" ; then
|
||||
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
|
||||
else
|
||||
AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
|
||||
fi
|
||||
fi
|
||||
|
||||
# check in a few common install locations
|
||||
if test x"${ac_cv_c_tclconfig}" = x ; then
|
||||
for i in `ls -d /usr/local/lib 2>/dev/null` ; do
|
||||
if test -f "$i/tclConfig.sh" ; then
|
||||
ac_cv_c_tclconfig=`(cd $i; pwd)`
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
if test x"${ac_cv_c_tclconfig}" = x ; then
|
||||
TCL_BIN_DIR="# no Tcl configs found"
|
||||
AC_MSG_ERROR(can't find Tcl configuration definitions)
|
||||
else
|
||||
TCL_BIN_DIR=${ac_cv_c_tclconfig}
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(SC_LOAD_TCLCONFIG, [
|
||||
AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
|
||||
|
||||
if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
|
||||
AC_MSG_RESULT([loading])
|
||||
. $TCL_BIN_DIR/tclConfig.sh
|
||||
else
|
||||
AC_MSG_RESULT([file not found])
|
||||
fi
|
||||
|
||||
#
|
||||
# The eval is required to do the TCL_DBGX substitution in the
|
||||
# TCL_LIB_FILE variable
|
||||
#
|
||||
eval TCL_LIB_FILE="${TCL_LIB_FILE}"
|
||||
eval TCL_LIB_FLAG="${TCL_LIB_FLAG}"
|
||||
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
|
||||
|
||||
AC_SUBST(TCL_BIN_DIR)
|
||||
AC_SUBST(TCL_SRC_DIR)
|
||||
AC_SUBST(TCL_LIB_FILE)
|
||||
|
||||
AC_SUBST(TCL_TCLSH)
|
||||
TCL_TCLSH="${TCL_PREFIX}/bin/tclsh${TCL_VERSION}"
|
||||
])
|
||||
|
||||
dnl Optional Tcl API.
|
||||
AC_DEFUN(AM_TCL_LOAD, [
|
||||
if test "$db_cv_tcl" != no; then
|
||||
if test "$db_cv_dynamic" != "yes"; then
|
||||
AC_MSG_ERROR([--with-tcl requires --enable-dynamic])
|
||||
fi
|
||||
|
||||
AC_SUBST(TCFLAGS)
|
||||
|
||||
SC_PATH_TCLCONFIG
|
||||
SC_LOAD_TCLCONFIG
|
||||
|
||||
if test x"$TCL_PREFIX" != x && test -f "$TCL_PREFIX/include/tcl.h"; then
|
||||
TCFLAGS="-I$TCL_PREFIX/include"
|
||||
fi
|
||||
|
||||
LIBS="$LIBS $TCL_LIB_SPEC $TCL_LIBS"
|
||||
|
||||
ADDITIONAL_LIBS="$ADDITIONAL_LIBS \$(libtso_target)"
|
||||
DEFAULT_INSTALL="${DEFAULT_INSTALL} install_tcl"
|
||||
fi])
|
||||
139
bdb/dist/aclocal/types.m4
vendored
Normal file
139
bdb/dist/aclocal/types.m4
vendored
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
dnl $Id: types.m4,v 11.4 1999/12/04 19:18:28 bostic Exp $
|
||||
|
||||
dnl Check for the standard shorthand types.
|
||||
AC_DEFUN(AM_SHORTHAND_TYPES, [dnl
|
||||
|
||||
AC_SUBST(ssize_t_decl)
|
||||
AC_CACHE_CHECK([for ssize_t], db_cv_ssize_t, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], ssize_t foo;,
|
||||
[db_cv_ssize_t=yes], [db_cv_ssize_t=no])])
|
||||
if test "$db_cv_ssize_t" = no; then
|
||||
ssize_t_decl="typedef int ssize_t;"
|
||||
fi
|
||||
|
||||
AC_SUBST(u_char_decl)
|
||||
AC_CACHE_CHECK([for u_char], db_cv_uchar, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], u_char foo;,
|
||||
[db_cv_uchar=yes], [db_cv_uchar=no])])
|
||||
if test "$db_cv_uchar" = no; then
|
||||
u_char_decl="typedef unsigned char u_char;"
|
||||
fi
|
||||
|
||||
AC_SUBST(u_short_decl)
|
||||
AC_CACHE_CHECK([for u_short], db_cv_ushort, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], u_short foo;,
|
||||
[db_cv_ushort=yes], [db_cv_ushort=no])])
|
||||
if test "$db_cv_ushort" = no; then
|
||||
u_short_decl="typedef unsigned short u_short;"
|
||||
fi
|
||||
|
||||
AC_SUBST(u_int_decl)
|
||||
AC_CACHE_CHECK([for u_int], db_cv_uint, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], u_int foo;,
|
||||
[db_cv_uint=yes], [db_cv_uint=no])])
|
||||
if test "$db_cv_uint" = no; then
|
||||
u_int_decl="typedef unsigned int u_int;"
|
||||
fi
|
||||
|
||||
AC_SUBST(u_long_decl)
|
||||
AC_CACHE_CHECK([for u_long], db_cv_ulong, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], u_long foo;,
|
||||
[db_cv_ulong=yes], [db_cv_ulong=no])])
|
||||
if test "$db_cv_ulong" = no; then
|
||||
u_long_decl="typedef unsigned long u_long;"
|
||||
fi
|
||||
|
||||
dnl DB/Vi use specific integer sizes.
|
||||
AC_SUBST(u_int8_decl)
|
||||
AC_CACHE_CHECK([for u_int8_t], db_cv_uint8, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], u_int8_t foo;,
|
||||
[db_cv_uint8=yes],
|
||||
AC_TRY_RUN([main(){exit(sizeof(unsigned char) != 1);}],
|
||||
[db_cv_uint8="unsigned char"], [db_cv_uint8=no]))])
|
||||
if test "$db_cv_uint8" = no; then
|
||||
AC_MSG_ERROR(No unsigned 8-bit integral type.)
|
||||
fi
|
||||
if test "$db_cv_uint8" != yes; then
|
||||
u_int8_decl="typedef $db_cv_uint8 u_int8_t;"
|
||||
fi
|
||||
|
||||
AC_SUBST(u_int16_decl)
|
||||
AC_CACHE_CHECK([for u_int16_t], db_cv_uint16, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], u_int16_t foo;,
|
||||
[db_cv_uint16=yes],
|
||||
AC_TRY_RUN([main(){exit(sizeof(unsigned short) != 2);}],
|
||||
[db_cv_uint16="unsigned short"],
|
||||
AC_TRY_RUN([main(){exit(sizeof(unsigned int) != 2);}],
|
||||
[db_cv_uint16="unsigned int"], [db_cv_uint16=no])))])
|
||||
if test "$db_cv_uint16" = no; then
|
||||
AC_MSG_ERROR([No unsigned 16-bit integral type.])
|
||||
fi
|
||||
if test "$db_cv_uint16" != yes; then
|
||||
u_int16_decl="typedef $db_cv_uint16 u_int16_t;"
|
||||
fi
|
||||
|
||||
AC_SUBST(int16_decl)
|
||||
AC_CACHE_CHECK([for int16_t], db_cv_int16, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], int16_t foo;,
|
||||
[db_cv_int16=yes],
|
||||
AC_TRY_RUN([main(){exit(sizeof(short) != 2);}],
|
||||
[db_cv_int16="short"],
|
||||
AC_TRY_RUN([main(){exit(sizeof(int) != 2);}],
|
||||
[db_cv_int16="int"], [db_cv_int16=no])))])
|
||||
if test "$db_cv_int16" = no; then
|
||||
AC_MSG_ERROR([No signed 16-bit integral type.])
|
||||
fi
|
||||
if test "$db_cv_int16" != yes; then
|
||||
int16_decl="typedef $db_cv_int16 int16_t;"
|
||||
fi
|
||||
|
||||
AC_SUBST(u_int32_decl)
|
||||
AC_CACHE_CHECK([for u_int32_t], db_cv_uint32, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], u_int32_t foo;,
|
||||
[db_cv_uint32=yes],
|
||||
AC_TRY_RUN([main(){exit(sizeof(unsigned int) != 4);}],
|
||||
[db_cv_uint32="unsigned int"],
|
||||
AC_TRY_RUN([main(){exit(sizeof(unsigned long) != 4);}],
|
||||
[db_cv_uint32="unsigned long"], [db_cv_uint32=no])))])
|
||||
if test "$db_cv_uint32" = no; then
|
||||
AC_MSG_ERROR([No unsigned 32-bit integral type.])
|
||||
fi
|
||||
if test "$db_cv_uint32" != yes; then
|
||||
u_int32_decl="typedef $db_cv_uint32 u_int32_t;"
|
||||
fi
|
||||
|
||||
AC_SUBST(int32_decl)
|
||||
AC_CACHE_CHECK([for int32_t], db_cv_int32, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], int32_t foo;,
|
||||
[db_cv_int32=yes],
|
||||
AC_TRY_RUN([main(){exit(sizeof(int) != 4);}],
|
||||
[db_cv_int32="int"],
|
||||
AC_TRY_RUN([main(){exit(sizeof(long) != 4);}],
|
||||
[db_cv_int32="long"], [db_cv_int32=no])))])
|
||||
if test "$db_cv_int32" = no; then
|
||||
AC_MSG_ERROR([No signed 32-bit integral type.])
|
||||
fi
|
||||
if test "$db_cv_int32" != yes; then
|
||||
int32_decl="typedef $db_cv_int32 int32_t;"
|
||||
fi
|
||||
|
||||
dnl Figure out largest integral type.
|
||||
AC_SUBST(db_align_t_decl)
|
||||
AC_CACHE_CHECK([for largest integral type], db_cv_align_t, [dnl
|
||||
AC_TRY_COMPILE([#include <sys/types.h>], long long foo;,
|
||||
[db_cv_align_t="unsigned long long"], [db_cv_align_t="unsigned long"])])
|
||||
db_align_t_decl="typedef $db_cv_align_t db_align_t;"
|
||||
|
||||
dnl Figure out integral type the same size as a pointer.
|
||||
AC_SUBST(db_alignp_t_decl)
|
||||
AC_CACHE_CHECK([for integral type equal to pointer size], db_cv_alignp_t, [dnl
|
||||
db_cv_alignp_t=$db_cv_align_t
|
||||
AC_TRY_RUN([main(){exit(sizeof(unsigned int) != sizeof(char *));}],
|
||||
[db_cv_alignp_t="unsigned int"])
|
||||
AC_TRY_RUN([main(){exit(sizeof(unsigned long) != sizeof(char *));}],
|
||||
[db_cv_alignp_t="unsigned long"])
|
||||
AC_TRY_RUN([main(){exit(sizeof(unsigned long long) != sizeof(char *));}],
|
||||
[db_cv_alignp_t="unsigned long long"])])
|
||||
db_alignp_t_decl="typedef $db_cv_alignp_t db_alignp_t;"
|
||||
|
||||
])dnl
|
||||
50
bdb/dist/build/chk.def
vendored
Executable file
50
bdb/dist/build/chk.def
vendored
Executable file
|
|
@ -0,0 +1,50 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.def,v 1.4 2000/12/12 18:20:59 bostic Exp $
|
||||
#
|
||||
# Check to make sure we haven't forgotten to add any interfaces
|
||||
# to the Win32 libdb.def file.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
f=build_win32/libdb.def
|
||||
t1=/tmp/__1
|
||||
t2=/tmp/__2
|
||||
|
||||
sed '/; /d' $f |
|
||||
egrep @ |
|
||||
awk '{print $1}' |
|
||||
sed -e '/db_xa_switch/d' \
|
||||
-e '/^__/d' -e '/^;/d' |
|
||||
sort > ${t1}
|
||||
|
||||
egrep __P include/db.src |
|
||||
sed '/^[a-z]/!d' |
|
||||
awk '{print $2}' |
|
||||
sed 's/^\*//' |
|
||||
sed '/^__/d' | sort > ${t2}
|
||||
|
||||
if cmp -s ${t1} ${t2} ; then
|
||||
:
|
||||
else
|
||||
echo "<<< libdb.def"
|
||||
echo ">>> DB include files"
|
||||
diff ${t1} ${t2}
|
||||
fi
|
||||
|
||||
# Check to make sure we don't have any extras in the libdb.def file.
|
||||
sed '/; /d' $f |
|
||||
egrep @ |
|
||||
awk '{print $1}' |
|
||||
sed -e '/__db_global_values/d' > ${t1}
|
||||
|
||||
for i in `cat ${t1}`; do
|
||||
if egrep $i */*.c > /dev/null; then
|
||||
:
|
||||
else
|
||||
echo "$f: $i not found in DB sources"
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f ${t1} ${t2}
|
||||
55
bdb/dist/build/chk.define
vendored
Executable file
55
bdb/dist/build/chk.define
vendored
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.define,v 1.8 2000/12/12 18:20:59 bostic Exp $
|
||||
#
|
||||
# Check to make sure that all #defines are actually used.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
t1=/tmp/__1
|
||||
|
||||
egrep '^#define' include/*.h |
|
||||
sed -e '/db_185.h/d' -e '/xa.h/d' |
|
||||
awk '{print $2}' |
|
||||
sed -e '/^B_DELETE/d' \
|
||||
-e '/^B_MAX/d' \
|
||||
-e '/^CIRCLEQ/d' \
|
||||
-e '/^DB_RO_ACCESS/d' \
|
||||
-e '/^DEFINE_DB_CLASS/d' \
|
||||
-e '/^LIST/d' \
|
||||
-e '/^LOG_OP/d' \
|
||||
-e '/^MINFILL/d' \
|
||||
-e '/^MUTEX_FIELDS/d' \
|
||||
-e '/^NCACHED2X/d' \
|
||||
-e '/^NCACHED30/d' \
|
||||
-e '/^PAIR_MASK/d' \
|
||||
-e '/^POWER_OF_TWO/d' \
|
||||
-e '/^P_16_COPY/d' \
|
||||
-e '/^P_32_COPY/d' \
|
||||
-e '/^P_32_SWAP/d' \
|
||||
-e '/^SH_CIRCLEQ/d' \
|
||||
-e '/^SH_LIST/d' \
|
||||
-e '/^SH_TAILQ/d' \
|
||||
-e '/^TAILQ/d' \
|
||||
-e '/UNUSED/d' \
|
||||
-e '/^WRAPPED_CLASS/d' \
|
||||
-e '/^XA_$/d' \
|
||||
-e '/^_DB_SERVER_H_RPCGEN/d' \
|
||||
-e '/_AUTO_H$/d' \
|
||||
-e '/_H_$/d' \
|
||||
-e '/ext_h_/d' \
|
||||
-e '/^i_/d' \
|
||||
-e 's/(.*//' | sort > ${t1}
|
||||
|
||||
for i in `cat ${t1}`; do
|
||||
if egrep -w $i */*.c */*.cpp > /dev/null; then
|
||||
:;
|
||||
else
|
||||
f=`egrep -l $i include/*.h |
|
||||
sed 's;include/;;' | tr -s "[:space:]" " "`
|
||||
echo "$i: $f"
|
||||
fi
|
||||
done | sort +1
|
||||
|
||||
rm -f ${t1}
|
||||
19
bdb/dist/build/chk.offt
vendored
Executable file
19
bdb/dist/build/chk.offt
vendored
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.offt,v 1.3 2000/12/12 18:20:59 bostic Exp $
|
||||
#
|
||||
# Make sure that no off_t's have snuck into the release.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
egrep -w off_t */*.[ch] |
|
||||
sed -e "/#undef off_t/d" \
|
||||
-e "/mp_fopen.c:.*can't use off_t's here/d" \
|
||||
-e "/mp_fopen.c:.*size or type off_t's or/d" \
|
||||
-e "/mp_fopen.c:.*where an off_t is 32-bits/d" \
|
||||
-e "/os_map.c:.*(off_t)0))/d" \
|
||||
-e "/os_rw.c:.*(off_t)db_iop->pgno/d" \
|
||||
-e "/os_seek.c:.*off_t offset;/d" \
|
||||
-e "/os_seek.c:.*offset = /d" \
|
||||
-e "/test_vxworks\/vx_mutex.c:/d"
|
||||
29
bdb/dist/build/chk.srcfiles
vendored
Executable file
29
bdb/dist/build/chk.srcfiles
vendored
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.srcfiles,v 1.3 2000/12/12 18:20:59 bostic Exp $
|
||||
#
|
||||
# Check to make sure we haven't forgotten to add any files to the list
|
||||
# of source files Win32 uses to build its dsp files.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
f=dist/srcfiles.in
|
||||
t1=/tmp/__1
|
||||
t2=/tmp/__2
|
||||
|
||||
sed -e '/^[ #]/d' \
|
||||
-e '/^$/d' < $f |
|
||||
awk '{print $1}' > ${t1}
|
||||
find . -type f |
|
||||
sed -e 's/^\.\///' |
|
||||
egrep '\.c$|\.cpp$|\.def$|\.rc$' |
|
||||
sed -e '/dist\/build\/chk.def/d' \
|
||||
-e '/perl.DB_File\/version.c/d' |
|
||||
sort > ${t2}
|
||||
|
||||
cmp ${t1} ${t2} > /dev/null ||
|
||||
(echo "<<< srcfiles.in >>> existing files" && \
|
||||
diff ${t1} ${t2} | tee /tmp/_f)
|
||||
|
||||
rm -f ${t1} ${t2}
|
||||
39
bdb/dist/build/chk.tags
vendored
Executable file
39
bdb/dist/build/chk.tags
vendored
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.tags,v 1.5 2000/12/22 15:35:32 bostic Exp $
|
||||
#
|
||||
# Check to make sure we don't need any more symbolic links to tags files.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
t1=/tmp/__1
|
||||
t2=/tmp/__2
|
||||
|
||||
(ls -F | egrep / | sort |
|
||||
sed -e 's/\///' \
|
||||
-e '/^CVS$/d' \
|
||||
-e '/^build_vxworks$/d' \
|
||||
-e '/^build_win32$/d' \
|
||||
-e '/^docs$/d' \
|
||||
-e '/^docs.text$/d' \
|
||||
-e '/^docs_src$/d' \
|
||||
-e '/^docs_text$/d' \
|
||||
-e '/^java$/d' \
|
||||
-e '/^perl.BerkeleyDB$/d' \
|
||||
-e '/^perl.DB_File$/d' \
|
||||
-e '/^test$/d' \
|
||||
-e '/^test_purify$/d' \
|
||||
-e '/^test_thread$/d' \
|
||||
-e '/^test_vxworks$/d') > ${t1}
|
||||
|
||||
(ls */tags | sed 's/\/tags$//' | sort) > ${t2}
|
||||
if diff ${t1} ${t2} > /dev/null; then
|
||||
:
|
||||
else
|
||||
echo "<<< source tree"
|
||||
echo ">>> tags files"
|
||||
diff ${t1} ${t2}
|
||||
fi
|
||||
|
||||
rm -f ${t1} ${t2}
|
||||
94
bdb/dist/build/script
vendored
Normal file
94
bdb/dist/build/script
vendored
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
#!/bin/sh -
|
||||
# $Id: script,v 1.21 2001/01/19 18:13:16 bostic Exp $
|
||||
#
|
||||
# Build the distribution archives.
|
||||
#
|
||||
# A set of commands intended to be cut and pasted into a csh window.
|
||||
|
||||
# Development tree, release home.
|
||||
setenv D /a/db
|
||||
|
||||
# Update the release number.
|
||||
cd $D/dist
|
||||
vi RELEASE
|
||||
setenv VERSION \
|
||||
`sh -c '. RELEASE; echo $DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH'`
|
||||
echo "Version: $VERSION"
|
||||
|
||||
# Make sure the source tree is up-to-date, generate new support files, and
|
||||
# commit anything that's changed.
|
||||
cd $D && cvs -q update
|
||||
cd $D/dist && sh s_all
|
||||
cd $D && cvs -q commit
|
||||
|
||||
# Build the documentation.
|
||||
cd $D/docs_src && make clean
|
||||
cd $D/docs_src && make
|
||||
cd $D/docs_src && make && make check
|
||||
|
||||
# Copy a development tree into a release tree.
|
||||
setenv R /a/db-$VERSION
|
||||
rm -rf $R && mkdir -p $R
|
||||
cd $D && tar cf - \
|
||||
`cvs -q status | sed -n -e "/Repository/s;.*/CVSROOT/db/;;" -e "s/,v//p"` | \
|
||||
(cd $R && tar xpf -)
|
||||
|
||||
# Fix symbolic links and permissions.
|
||||
cd $R/dist && sh s_perm
|
||||
cd $R/dist && sh s_symlink
|
||||
|
||||
# Build the documents.
|
||||
cd $R/docs_src && make
|
||||
|
||||
# Build a version.
|
||||
cd $R && rm -rf build_run && mkdir build_run
|
||||
cd $R/build_run && ~bostic/bin/dbconf && make >& mklog
|
||||
|
||||
# Smoke test.
|
||||
./ex_access
|
||||
|
||||
# Check the install
|
||||
make prefix=`pwd`/BDB install
|
||||
|
||||
# Run distribution check scripts
|
||||
$R/dist/build/chk.def
|
||||
$R/dist/build/chk.define
|
||||
$R/dist/build/chk.offt
|
||||
$R/dist/build/chk.srcfiles
|
||||
$R/dist/build/chk.tags
|
||||
|
||||
# Clean up the tree.
|
||||
cd $R && rm -rf build_run docs_src
|
||||
cd $R && rm -rf test_thread test_purify test_server test_vxworks test/TODO
|
||||
cd $R && rm -rf test/upgrade/databases && mkdir test/upgrade/databases
|
||||
|
||||
# ACQUIRE ROOT PRIVILEGES
|
||||
cd $R && find . -type d | xargs chmod 775
|
||||
cd $R && find . -type f | xargs chmod 444
|
||||
cd $R/dist && sh s_perm
|
||||
chown -R 100.100 $R
|
||||
# DISCARD ROOT PRIVILEGES
|
||||
|
||||
# Compare this release with the last one.
|
||||
set LR=3.1.X
|
||||
cd $R/.. && gzcat /a/releases/db-${LR}.tar.gz | tar xf -
|
||||
cd $R/../db-${LR} && find . | sort > /tmp/__OLD
|
||||
cd $R && find . | sort > /tmp/__NEW
|
||||
diff -c /tmp/__OLD /tmp/__NEW
|
||||
|
||||
# Create the tar archive release.
|
||||
setenv T "$R/../db-$VERSION.tar.gz"
|
||||
cd $R/.. && tar cf - db-$VERSION | gzip --best > $T
|
||||
chmod 444 $T
|
||||
|
||||
# Create the zip archive release.
|
||||
#
|
||||
# Remove symbolic links to tags files. They're large and we don't want to
|
||||
# store real symbolic links in the archive for portability reasons.
|
||||
# ACQUIRE ROOT PRIVILEGES
|
||||
cd $R && rm -f `find . -type l -name 'tags'`
|
||||
# DISCARD ROOT PRIVILEGES
|
||||
|
||||
setenv T "$R/../db-$VERSION.zip"
|
||||
cd $R/.. && zip -r - db-$VERSION > $T
|
||||
chmod 444 $T
|
||||
1289
bdb/dist/config.guess
vendored
Executable file
1289
bdb/dist/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load diff
231
bdb/dist/config.hin
vendored
Normal file
231
bdb/dist/config.hin
vendored
Normal file
|
|
@ -0,0 +1,231 @@
|
|||
/* config.hin. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* 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. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* 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. */
|
||||
#undef CONFIG_TEST
|
||||
|
||||
/* Define if you want a debugging version. */
|
||||
#undef DEBUG
|
||||
|
||||
/* Define if you want a version that logs read operations. */
|
||||
#undef DEBUG_ROP
|
||||
|
||||
/* Define if you want a version that logs write operations. */
|
||||
#undef DEBUG_WOP
|
||||
|
||||
/* Define if you want a version with run-time diagnostic checking. */
|
||||
#undef DIAGNOSTIC
|
||||
|
||||
/* Define if you want to mask harmless unitialized memory read/writes. */
|
||||
#undef UMRW
|
||||
|
||||
/* Define if fcntl/F_SETFD denies child access to file descriptors. */
|
||||
#undef HAVE_FCNTL_F_SETFD
|
||||
|
||||
/* Define if building big-file environment (e.g., AIX, HP/UX, Solaris). */
|
||||
#undef HAVE_FILE_OFFSET_BITS
|
||||
|
||||
/* Mutex possibilities. */
|
||||
#undef HAVE_MUTEX_68K_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_AIX_CHECK_LOCK
|
||||
#undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_HPPA_MSEM_INIT
|
||||
#undef HAVE_MUTEX_IA64_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_MACOS
|
||||
#undef HAVE_MUTEX_MSEM_INIT
|
||||
#undef HAVE_MUTEX_PPC_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_PTHREADS
|
||||
#undef HAVE_MUTEX_RELIANTUNIX_INITSPIN
|
||||
#undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_SEMA_INIT
|
||||
#undef HAVE_MUTEX_SGI_INIT_LOCK
|
||||
#undef HAVE_MUTEX_SOLARIS_LOCK_TRY
|
||||
#undef HAVE_MUTEX_SOLARIS_LWP
|
||||
#undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_THREADS
|
||||
#undef HAVE_MUTEX_UI_THREADS
|
||||
#undef HAVE_MUTEX_UTS_CC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_VMS
|
||||
#undef HAVE_MUTEX_VXWORKS
|
||||
#undef HAVE_MUTEX_WIN16
|
||||
#undef HAVE_MUTEX_WIN32
|
||||
#undef HAVE_MUTEX_X86_GCC_ASSEMBLY
|
||||
|
||||
/* 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. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* 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. */
|
||||
#undef HAVE_MEMCMP
|
||||
|
||||
/* Define if you have the memcpy function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* 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. */
|
||||
#undef HAVE_QSORT
|
||||
|
||||
/* Define if you have the raise function. */
|
||||
#undef HAVE_RAISE
|
||||
|
||||
/* 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. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strtoul function. */
|
||||
#undef HAVE_STRTOUL
|
||||
|
||||
/* 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. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
|
||||
/* Define 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
|
||||
|
||||
/*
|
||||
* Big-file configuration.
|
||||
*/
|
||||
#ifdef HAVE_FILE_OFFSET_BITS
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Don't step on the namespace. Other libraries may have their own
|
||||
* implementations of these functions, we don't want to use their
|
||||
* implementations or force them to use ours based on the load order.
|
||||
*/
|
||||
#ifndef HAVE_GETCWD
|
||||
#define getcwd __db_Cgetcwd
|
||||
#endif
|
||||
#ifndef HAVE_GETOPT
|
||||
#define getopt __db_Cgetopt
|
||||
#endif
|
||||
#ifndef HAVE_MEMCMP
|
||||
#define memcmp __db_Cmemcmp
|
||||
#endif
|
||||
#ifndef HAVE_MEMCPY
|
||||
#define memcpy __db_Cmemcpy
|
||||
#endif
|
||||
#ifndef HAVE_MEMMOVE
|
||||
#define memmove __db_Cmemmove
|
||||
#endif
|
||||
#ifndef HAVE_RAISE
|
||||
#define raise __db_Craise
|
||||
#endif
|
||||
#ifndef HAVE_SNPRINTF
|
||||
#define snprintf __db_Csnprintf
|
||||
#endif
|
||||
#ifndef HAVE_STRCASECMP
|
||||
#define strcasecmp __db_Cstrcasecmp
|
||||
#endif
|
||||
#ifndef HAVE_STRERROR
|
||||
#define strerror __db_Cstrerror
|
||||
#endif
|
||||
#ifndef HAVE_VSNPRINTF
|
||||
#define vsnprintf __db_Cvsnprintf
|
||||
#endif
|
||||
1328
bdb/dist/config.sub
vendored
Executable file
1328
bdb/dist/config.sub
vendored
Executable file
File diff suppressed because it is too large
Load diff
501
bdb/dist/configure.in
vendored
Normal file
501
bdb/dist/configure.in
vendored
Normal file
|
|
@ -0,0 +1,501 @@
|
|||
dnl $Id: configure.in,v 11.77 2001/01/18 19:05:25 bostic Exp $
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(../db/db.c)
|
||||
AC_CONFIG_HEADER(db_config.h:config.hin)
|
||||
|
||||
dnl Configure setup.
|
||||
AC_PROG_INSTALL()
|
||||
AC_CANONICAL_HOST
|
||||
AC_ARG_PROGRAM()
|
||||
|
||||
dnl We cannot build in the top-level directory.
|
||||
AC_MSG_CHECKING(if building in the top-level directory)
|
||||
[ test -d db_archive ] && AC_MSG_ERROR([
|
||||
Berkeley DB cannot be built in the top-level distribution directory.])
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl Substitution variables.
|
||||
AC_SUBST(ADDITIONAL_INCS)
|
||||
AC_SUBST(ADDITIONAL_LANG)
|
||||
AC_SUBST(ADDITIONAL_LIBS)
|
||||
AC_SUBST(ADDITIONAL_OBJS)
|
||||
AC_SUBST(ADDITIONAL_PROGS)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(CPPFLAGS)
|
||||
AC_SUBST(CXX)
|
||||
AC_SUBST(CXXFLAGS)
|
||||
AC_SUBST(DBS_LIBS)
|
||||
AC_SUBST(DEFAULT_INSTALL)
|
||||
AC_SUBST(DEFAULT_LIB)
|
||||
AC_SUBST(INSTALLER)
|
||||
AC_SUBST(INSTALL_LIBS)
|
||||
AC_SUBST(JAR)
|
||||
AC_SUBST(JAVAC)
|
||||
AC_SUBST(JAVACFLAGS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
AC_SUBST(LIBDB_ARGS)
|
||||
AC_SUBST(LIBJSO_LIBS)
|
||||
AC_SUBST(LIBS)
|
||||
AC_SUBST(LIBSO_LIBS)
|
||||
AC_SUBST(LIBTOOL)
|
||||
AC_SUBST(LIBTSO_LIBS)
|
||||
AC_SUBST(LIBXSO_LIBS)
|
||||
AC_SUBST(MAKEFILE_CC)
|
||||
AC_SUBST(MAKEFILE_CCLINK)
|
||||
AC_SUBST(MAKEFILE_CXX)
|
||||
AC_SUBST(POSTLINK)
|
||||
AC_SUBST(RPC_OBJS)
|
||||
AC_SUBST(SOFLAGS)
|
||||
AC_SUBST(SOLINK)
|
||||
AC_SUBST(SOSUFFIX)
|
||||
|
||||
dnl $o is set to ".o" or ".lo", and is the file suffix used in the
|
||||
dnl Makefile instead of .o
|
||||
AC_SUBST(o)
|
||||
o=.o
|
||||
INSTALLER="\$(cp)"
|
||||
DEFAULT_LIB="\$(libdb)"
|
||||
DEFAULT_INSTALL="install_static"
|
||||
|
||||
dnl Set the version.
|
||||
AM_VERSION_SET
|
||||
|
||||
dnl Set the default installation location.
|
||||
AC_PREFIX_DEFAULT(/usr/local/BerkeleyDB.@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@)
|
||||
|
||||
dnl Process all options before using them. This is necessary because there
|
||||
dnl are dependencies among them.
|
||||
AM_OPTIONS_SET
|
||||
|
||||
dnl This is where we handle stuff that autoconf can't handle: compiler,
|
||||
dnl preprocessor and load flags, libraries that the standard tests don't
|
||||
dnl look for. The default optimization is -O. We would like to set the
|
||||
dnl default optimization for systems using gcc to -O2, but we can't. By
|
||||
dnl the time we know we're using gcc, it's too late to set optimization
|
||||
dnl flags.
|
||||
dnl
|
||||
dnl There are additional libraries we need for some compiler/architecture
|
||||
dnl combinations.
|
||||
dnl
|
||||
dnl Some architectures require DB to be compiled with special flags and/or
|
||||
dnl libraries for threaded applications
|
||||
dnl
|
||||
dnl The makefile CC may be different than the CC used in config testing,
|
||||
dnl because the makefile CC may be set to use $(LIBTOOL).
|
||||
dnl
|
||||
dnl XXX
|
||||
dnl Don't override anything if it's already set from the environment.
|
||||
optimize_def="-O"
|
||||
case "$host_os" in
|
||||
aix4.*) optimize_def="-O2"
|
||||
CC=${CC-"xlc_r"}
|
||||
CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS"
|
||||
LIBTSO_LIBS="\$(LIBS)";;
|
||||
bsdi3*) CC=${CC-"shlicc2"}
|
||||
optimize_def="-O2"
|
||||
LIBS="-lipc $LIBS";;
|
||||
bsdi*) optimize_def="-O2";;
|
||||
freebsd*) optimize_def="-O2"
|
||||
CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS"
|
||||
LIBS="-pthread";;
|
||||
hpux*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";;
|
||||
irix*) optimize_def="-O2"
|
||||
CPPFLAGS="-D_SGI_MP_SOURCE $CPPFLAGS";;
|
||||
linux*) optimize_def="-O2"
|
||||
CFLAGS="-D_GNU_SOURCE"
|
||||
CPPFLAGS="-D_REENTRANT $CPPFLAGS";;
|
||||
mpeix*) CPPFLAGS="-D_POSIX_SOURCE -D_SOCKET_SOURCE $CPPFLAGS"
|
||||
LIBS="-lsocket -lsvipc $LIBS";;
|
||||
osf*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";;
|
||||
*qnx) AC_DEFINE(HAVE_QNX);;
|
||||
sco3.2v4*) CC=${CC-"cc -belf"}
|
||||
LIBS="-lsocket -lnsl_s $LIBS";;
|
||||
sco*) CC=${CC-"cc -belf"}
|
||||
LIBS="-lsocket -lnsl $LIBS";;
|
||||
solaris*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";;
|
||||
esac
|
||||
|
||||
dnl Set CFLAGS/CXXFLAGS. We MUST set the flags before we call autoconf
|
||||
dnl compiler configuration macros, because if we don't, they set CFLAGS
|
||||
dnl to no optimization and -g, which isn't what we want.
|
||||
CFLAGS=${CFLAGS-$optimize_def}
|
||||
CXXFLAGS=${CXXFLAGS-"$CFLAGS"}
|
||||
|
||||
dnl If the user wants a debugging environment, add -g to the CFLAGS value.
|
||||
dnl
|
||||
dnl XXX
|
||||
dnl Some compilers can't mix optimizing and debug flags. The only way to
|
||||
dnl handle this is to specify CFLAGS in the environment before configuring.
|
||||
if test "$db_cv_debug" = yes; then
|
||||
AC_DEFINE(DEBUG)
|
||||
CFLAGS="$CFLAGS -g"
|
||||
CXXFLAGS="$CXXFLAGS -g"
|
||||
fi
|
||||
|
||||
dnl The default compiler is cc (NOT gcc), the default CFLAGS is as specified
|
||||
dnl above, NOT what is set by AC_PROG_CC, as it won't set optimization flags.
|
||||
dnl We still call AC_PROG_CC so that we get the other side-effects.
|
||||
AC_CHECK_PROG(CC, cc, cc)
|
||||
AC_CHECK_PROG(CC, gcc, gcc)
|
||||
AC_PROG_CC
|
||||
|
||||
dnl Because of dynamic library building, the ${CC} used for config tests
|
||||
dnl may be different than the ${CC} we want to put in the Makefile.
|
||||
dnl The latter is known as ${MAKEFILE_CC} in this script.
|
||||
MAKEFILE_CC=${CC}
|
||||
MAKEFILE_CCLINK="\$(CC)"
|
||||
MAKEFILE_CXX="nocxx"
|
||||
|
||||
dnl Set some #defines based on configuration options.
|
||||
if test "$db_cv_diagnostic" = yes; then
|
||||
AC_DEFINE(DIAGNOSTIC)
|
||||
fi
|
||||
if test "$db_cv_debug_rop" = yes; then
|
||||
AC_DEFINE(DEBUG_ROP)
|
||||
fi
|
||||
if test "$db_cv_debug_wop" = yes; then
|
||||
AC_DEFINE(DEBUG_WOP)
|
||||
fi
|
||||
if test "$db_cv_umrw" = yes; then
|
||||
AC_DEFINE(UMRW)
|
||||
fi
|
||||
if test "$db_cv_test" = yes; then
|
||||
AC_DEFINE(CONFIG_TEST)
|
||||
fi
|
||||
|
||||
dnl See if we need the C++ compiler at all. If so, we'd like to find one that
|
||||
dnl interoperates with the C compiler we chose. Since we prefered cc over gcc,
|
||||
dnl we'll also prefer the vendor's compiler over g++/gcc. If we're wrong, the
|
||||
dnl user can set CC and CXX in their environment before running configure.
|
||||
dnl
|
||||
dnl AC_PROG_CXX sets CXX, but it uses $CXX and $CCC (in that order) as its
|
||||
dnl first choices.
|
||||
if test "$db_cv_cxx" = "yes"; then
|
||||
if test "$GCC" != "yes"; then
|
||||
case "$host_os" in
|
||||
aix*) AC_CHECK_PROG(CCC, xlC_r, xlC_r);;
|
||||
hpux*) AC_CHECK_PROG(CCC, aCC, aCC);;
|
||||
osf*) AC_CHECK_PROG(CCC, cxx, cxx);;
|
||||
solaris*) AC_CHECK_PROG(CCC, CC, CC);;
|
||||
esac
|
||||
fi
|
||||
AC_PROG_CXX
|
||||
MAKEFILE_CXX=${CXX}
|
||||
fi
|
||||
|
||||
dnl XXX
|
||||
dnl Versions of GCC up to 2.8.0 required -fhandle-exceptions, but it is
|
||||
dnl renamed as -fexceptions and is the default in versions 2.8.0 and after.
|
||||
dnl
|
||||
dnl $GXX may be set as a result of enabling C++ or Java.
|
||||
if test "$GXX" = "yes"; then
|
||||
CXXVERSION=`${MAKEFILE_CXX} --version`
|
||||
case ${CXXVERSION} in
|
||||
1.*|2.[[01234567]].*|*-1.*|*-2.[[01234567]].* )
|
||||
CXXFLAGS="-fhandle-exceptions $CXXFLAGS";;
|
||||
* ) CXXFLAGS="-fexceptions $CXXFLAGS";;
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl Export our compiler preferences for the libtool configuration.
|
||||
export CC CCC
|
||||
CCC=CXX
|
||||
|
||||
dnl Dynamic library and libtool configuration; optional, but required for
|
||||
dnl Tcl or Java support.
|
||||
LIBDB_ARGS="libdb.a"
|
||||
LIBTOOL="nolibtool"
|
||||
POSTLINK="@true"
|
||||
SOSUFFIX="so"
|
||||
if test "$db_cv_dynamic" = "yes"; then
|
||||
SAVE_CC="${MAKEFILE_CC}"
|
||||
SAVE_CXX="${MAKEFILE_CXX}"
|
||||
|
||||
# Configure libtool.
|
||||
AC_MSG_CHECKING(libtool configuration)
|
||||
AC_MSG_RESULT([])
|
||||
${CONFIG_SHELL-/bin/sh} $srcdir/ltconfig \
|
||||
--no-verify $srcdir/ltmain.sh \
|
||||
--output=./libtool $host_os \
|
||||
--disable-static \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
|
||||
SOSUFFIX=`sed -e '/^library_names_spec=/!d' -e 's/.*\.\([[a-zA-Z0-9_]]*\).*/\1/' ./libtool`
|
||||
DEFAULT_LIB="\$(libso_target)"
|
||||
DEFAULT_INSTALL="install_dynamic"
|
||||
LIBDB_ARGS="\$(libso_linkname)"
|
||||
LIBTOOL="\$(SHELL) ./libtool"
|
||||
|
||||
MAKEFILE_CC="\$(LIBTOOL) --mode=compile ${SAVE_CC}"
|
||||
MAKEFILE_CXX="\$(LIBTOOL) --mode=compile ${SAVE_CXX}"
|
||||
MAKEFILE_CCLINK="\$(LIBTOOL) --mode=link ${SAVE_CC}"
|
||||
|
||||
INSTALLER="\$(LIBTOOL) --mode=install cp"
|
||||
POSTLINK="\$(LIBTOOL) --mode=execute true"
|
||||
SOLINK="\$(LIBTOOL) --mode=link ${SAVE_CC} -avoid-version"
|
||||
SOFLAGS="-rpath \$(libdir)"
|
||||
o=".lo"
|
||||
fi
|
||||
|
||||
dnl Optional C++ API.
|
||||
if test "$db_cv_cxx" = "yes"; then
|
||||
if test "$db_cv_dynamic" = "yes"; then
|
||||
ADDITIONAL_LIBS="$ADDITIONAL_LIBS \$(libxso_target)"
|
||||
DEFAULT_INSTALL="${DEFAULT_INSTALL} install_dynamic_cxx"
|
||||
else
|
||||
ADDITIONAL_LIBS="$ADDITIONAL_LIBS \$(libcxx)"
|
||||
DEFAULT_INSTALL="${DEFAULT_INSTALL} install_static_cxx"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Optional Java API.
|
||||
if test "$db_cv_java" = "yes"; then
|
||||
if test "$db_cv_dynamic" != "yes"; then
|
||||
AC_MSG_ERROR([--enable-java requires --enable-dynamic])
|
||||
fi
|
||||
|
||||
AC_CHECK_PROG(JAVAC, javac, javac, nojavac)
|
||||
if test "$JAVAC" = "nojavac"; then
|
||||
AC_MSG_ERROR([no javac compiler in PATH])
|
||||
fi
|
||||
AC_CHECK_PROG(JAR, jar, jar, nojar)
|
||||
if test "$JAR" = "nojar"; then
|
||||
AC_MSG_ERROR([no jar utility in PATH])
|
||||
fi
|
||||
AC_PATH_PROG(JAVACABS, javac, nojavac)
|
||||
ADDITIONAL_LIBS="$ADDITIONAL_LIBS \$(libjso_target)"
|
||||
ADDITIONAL_LANG="$ADDITIONAL_LANG java"
|
||||
DEFAULT_INSTALL="${DEFAULT_INSTALL} install_java"
|
||||
|
||||
dnl find the include directory relative to the javac executable
|
||||
while ls -ld "$JAVACABS" 2>/dev/null | grep " -> " >/dev/null; do
|
||||
AC_MSG_CHECKING(symlink for $JAVACABS)
|
||||
JAVACLINK=`ls -ld $JAVACABS | sed 's/.* -> //'`
|
||||
case "$JAVACLINK" in
|
||||
/*) JAVACABS="$JAVACLINK";;
|
||||
dnl 'X' avoids triggering unwanted echo options.
|
||||
*) JAVACABS=`echo "X$JAVACABS" | sed -e 's/^X//' -e 's:[[^/]]*$::'`"$JAVACLINK";;
|
||||
esac
|
||||
AC_MSG_RESULT($JAVACABS)
|
||||
done
|
||||
JTOPDIR=`echo "$JAVACABS" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
|
||||
if test -f "$JTOPDIR/include/jni.h"; then
|
||||
CPPFLAGS="$CPPFLAGSS -I$JTOPDIR/include"
|
||||
else
|
||||
JTOPDIR=`echo "$JTOPDIR" | sed -e 's:/[[^/]]*$::'`
|
||||
if test -f "$JTOPDIR/include/jni.h"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$JTOPDIR/include"
|
||||
else
|
||||
AC_MSG_ERROR([cannot find java include files])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl get the likely subdirectories for system specific java includes
|
||||
case "$host_os" in
|
||||
solaris*) JINCSUBDIRS="solaris";;
|
||||
linux*) JINCSUBDIRS="linux genunix";;
|
||||
*) JINCSUBDIRS="genunix";;
|
||||
esac
|
||||
|
||||
for JINCSUBDIR in $JINCSUBDIRS
|
||||
do
|
||||
if test -d "$JTOPDIR/include/$JINCSUBDIR"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$JTOPDIR/include/$JINCSUBDIR"
|
||||
fi
|
||||
done
|
||||
else
|
||||
JAVAC=nojavac
|
||||
fi
|
||||
|
||||
dnl Optional RPC client/server.
|
||||
if test "$db_cv_rpc" = "yes"; then
|
||||
AC_DEFINE(HAVE_RPC)
|
||||
|
||||
RPC_OBJS="\$(RPC_OBJS)"
|
||||
ADDITIONAL_PROGS="berkeley_db_svc $ADDITIONAL_PROGS"
|
||||
|
||||
case "$host_os" in
|
||||
hpux*)
|
||||
AC_CHECK_FUNC(svc_run,,
|
||||
AC_CHECK_LIB(nsl, svc_run,
|
||||
LIBS="-lnsl $LIBS"; LIBTSO_LIBS="-lnsl $LIBTSO_LIBS"));;
|
||||
solaris*)
|
||||
AC_CHECK_FUNC(svc_run,, AC_CHECK_LIB(nsl, svc_run));;
|
||||
esac
|
||||
fi
|
||||
|
||||
AM_TCL_LOAD
|
||||
|
||||
dnl Optional DB 1.85 compatibility API.
|
||||
if test "$db_cv_compat185" = "yes"; then
|
||||
ADDITIONAL_INCS="db_185.h $ADDITIONAL_INCS"
|
||||
ADDITIONAL_OBJS="db185${o} $ADDITIONAL_OBJS"
|
||||
fi
|
||||
|
||||
dnl Optional utilities.
|
||||
if test "$db_cv_dump185" = "yes"; then
|
||||
ADDITIONAL_PROGS="db_dump185 $ADDITIONAL_PROGS"
|
||||
fi
|
||||
|
||||
dnl Test Server.
|
||||
dnl Include -lpthread if the library exists.
|
||||
AC_CHECK_LIB(pthread, pthread_create, DBS_LIBS=-lpthread)
|
||||
|
||||
dnl Checks for typedefs, structures, and system/compiler characteristics.
|
||||
AC_C_BIGENDIAN
|
||||
AC_C_CONST
|
||||
AC_HEADER_STAT
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_ST_BLKSIZE
|
||||
AC_TYPE_MODE_T
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
dnl Define any short-hand types we're missing.
|
||||
AM_SHORTHAND_TYPES
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
AC_CHECK_HEADERS(sys/select.h)
|
||||
AC_CHECK_HEADERS(sys/time.h)
|
||||
|
||||
dnl Check for mutexes. We do this here because it changes $LIBS.
|
||||
AM_DEFINE_MUTEXES
|
||||
|
||||
dnl Checks for system functions for which we have replacements.
|
||||
dnl
|
||||
dnl XXX
|
||||
dnl The only portable getcwd call is getcwd(char *, size_t), where the
|
||||
dnl buffer is non-NULL -- Solaris can't handle a NULL buffer, and they
|
||||
dnl deleted getwd().
|
||||
AC_REPLACE_FUNCS(getcwd getopt memcmp memcpy memmove)
|
||||
AC_REPLACE_FUNCS(raise snprintf strcasecmp strerror vsnprintf)
|
||||
|
||||
dnl XXX
|
||||
dnl Nasty hack. AC_REPLACE_FUNCS added entries of the form xxx.o to the
|
||||
dnl LIBOBJS variable. They have to be xxx.lo if we are building shared
|
||||
dnl libraries. Use sed, configure already requires it.
|
||||
tmp="`echo \"$LIBOBJS\" | sed \"s/\.o/${o}/g\"`"
|
||||
LIBOBJS="$tmp"
|
||||
|
||||
dnl Check for system functions we optionally use.
|
||||
AC_CHECK_FUNCS(getuid pstat_getdynamic sysconf sched_yield strtoul yield)
|
||||
|
||||
dnl Pread/pwrite.
|
||||
dnl
|
||||
dnl HP-UX has pread/pwrite, but it doesn't work with bigfile support.
|
||||
case "$host_os" in
|
||||
hpux*)
|
||||
AC_MSG_WARN([pread/pwrite interfaces ignored on $host_os.]);;
|
||||
*) AC_CHECK_FUNCS(pread pwrite)
|
||||
esac
|
||||
|
||||
dnl Check for fcntl(2) to deny child process access to file descriptors.
|
||||
AC_CACHE_CHECK([for fcntl/F_SETFD], db_cv_fcntl_f_setfd, [dnl
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
main(){exit(fcntl(1, F_SETFD, 1) == -1);}],
|
||||
[db_cv_fcntl_f_setfd=yes], [db_cv_fcntl_f_setfd=no])])
|
||||
if test "$db_cv_fcntl_f_setfd" = yes; then
|
||||
AC_DEFINE(HAVE_FCNTL_F_SETFD)
|
||||
fi
|
||||
|
||||
dnl A/UX has a broken getopt(3).
|
||||
case "$host_os" in
|
||||
aux*) ADDITIONAL_OBJS="getopt${o} $ADDITIONAL_OBJS";;
|
||||
esac
|
||||
|
||||
dnl Checks for system functions for which we don't have replacements.
|
||||
|
||||
dnl We require qsort(3) and select(2).
|
||||
AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
|
||||
AC_CHECK_FUNCS(select, , AC_MSG_ERROR([No select library function.]))
|
||||
|
||||
dnl Some versions of sprintf return a pointer to the first argument instead
|
||||
dnl of a character count. We assume that the return value of snprintf and
|
||||
dnl vsprintf etc. will be the same as sprintf, and check the easy one.
|
||||
AC_CACHE_CHECK([for int type sprintf return value], db_cv_sprintf_count, [dnl
|
||||
AC_TRY_RUN([main(){char buf[20]; exit(sprintf(buf, "XXX") != 3);}],
|
||||
[db_cv_sprintf_count=yes], [db_cv_sprintf_count=no])])
|
||||
if test "$db_cv_sprintf_count" = no; then
|
||||
AC_DEFINE(SPRINTF_RET_CHARPNT)
|
||||
fi
|
||||
|
||||
dnl Vendors are doing 64-bit lseek in different ways.
|
||||
dnl AIX, HP/UX, Solaris and Linux all use _FILE_OFFSET_BITS
|
||||
dnl to specify a "big-file" environment.
|
||||
dnl
|
||||
dnl You can't build C++ with big-file support on HP-UX, the include files
|
||||
dnl are wrong. On Solaris 8, <fcntl.h> included with big-file support
|
||||
dnl is not compatible with C++.
|
||||
if test "$db_cv_bigfile" = no; then
|
||||
case "$host_os" in
|
||||
solaris2.8|hpux*)
|
||||
if test "$db_cv_cxx" = "yes"; then
|
||||
AC_MSG_WARN([Large file and C++ API support are incompatible on HP-UX])
|
||||
AC_MSG_WARN([and Solaris 8; large file support has been turned off.])
|
||||
else
|
||||
AC_DEFINE(HAVE_FILE_OFFSET_BITS)
|
||||
fi;;
|
||||
aix*|solaris*|linux*)
|
||||
AC_DEFINE(HAVE_FILE_OFFSET_BITS);;
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl Figure out how to create shared regions.
|
||||
dnl
|
||||
dnl First, we look for mmap.
|
||||
dnl
|
||||
dnl BSD/OS has mlock(2), but it doesn't work until the 4.1 release.
|
||||
dnl
|
||||
dnl Nextstep (version 3.3) apparently supports mmap(2) (the mmap symbol
|
||||
dnl is defined in the C library) but does not support munmap(2). Don't
|
||||
dnl try to use mmap if we can't find munmap.
|
||||
dnl
|
||||
dnl Ultrix has mmap(2), but it doesn't work.
|
||||
mmap_ok=no
|
||||
case "$host_os" in
|
||||
bsdi3*|bsdi4.0)
|
||||
AC_MSG_WARN([mlock(2) interface ignored on BSD/OS 3.X and 4.0.])
|
||||
mmap_ok=yes
|
||||
AC_CHECK_FUNCS(mmap munmap, , mmap_ok=no);;
|
||||
ultrix*)
|
||||
AC_MSG_WARN([mmap(2) interface ignored on Ultrix.]);;
|
||||
*)
|
||||
mmap_ok=yes
|
||||
AC_CHECK_FUNCS(mlock munlock)
|
||||
AC_CHECK_FUNCS(mmap munmap, , mmap_ok=no);;
|
||||
esac
|
||||
|
||||
dnl Second, we look for shmget.
|
||||
dnl
|
||||
dnl SunOS has the shmget(2) interfaces, but there appears to be a missing
|
||||
dnl #include <debug/debug.h> file, so we ignore them.
|
||||
shmget_ok=no
|
||||
case "$host_os" in
|
||||
sunos*)
|
||||
AC_MSG_WARN([shmget(2) interface ignored on SunOS.]);;
|
||||
*)
|
||||
shmget_ok=yes
|
||||
AC_CHECK_FUNCS(shmget, , shmget_ok=no);;
|
||||
esac
|
||||
|
||||
dnl We require either mmap/munmap(2) or shmget(2).
|
||||
if test "$mmap_ok" = no -a "$shmget_ok" = no; then
|
||||
AC_MSG_WARN([Neither mmap/munmap(2) or shmget(2) library functions.])
|
||||
fi
|
||||
|
||||
dnl Check for programs used in building and installation.
|
||||
AM_PROGRAMS_SET
|
||||
|
||||
CREATE_LIST="Makefile
|
||||
include.tcl:../test/include.tcl
|
||||
db.h:../include/db.src
|
||||
db_int.h:../include/db_int.src"
|
||||
if test "$db_cv_compat185" = "yes"; then
|
||||
CREATE_LIST="${CREATE_LIST} db_185.h:../include/db_185.h"
|
||||
fi
|
||||
AC_OUTPUT(${CREATE_LIST})
|
||||
475
bdb/dist/gen_rec.awk
vendored
Normal file
475
bdb/dist/gen_rec.awk
vendored
Normal file
|
|
@ -0,0 +1,475 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# See the file LICENSE for redistribution information.
|
||||
#
|
||||
# Copyright (c) 1996, 1997, 1998, 1999, 2000
|
||||
# Sleepycat Software. All rights reserved.
|
||||
#
|
||||
# $Id: gen_rec.awk,v 11.26 2001/01/08 21:06:46 bostic Exp $
|
||||
#
|
||||
|
||||
# This awk script generates all the log, print, and read routines for the DB
|
||||
# logging. It also generates a template for the recovery functions (these
|
||||
# functions must still be edited, but are highly stylized and the initial
|
||||
# template gets you a fair way along the path).
|
||||
#
|
||||
# For a given file prefix.src, we generate a file prefix_auto.c, and a file
|
||||
# prefix_auto.h that contains:
|
||||
#
|
||||
# external declarations for the file's functions
|
||||
# defines for the physical record types
|
||||
# (logical types are defined in each subsystem manually)
|
||||
# structures to contain the data unmarshalled from the log.
|
||||
#
|
||||
# This awk script requires that five variables be set when it is called:
|
||||
#
|
||||
# source_file -- the C source file being created
|
||||
# subsystem -- the subsystem prefix, e.g., "db"
|
||||
# header_file -- the C #include file being created
|
||||
# template_file -- the template file being created
|
||||
# template_dir -- the directory to find the source template
|
||||
#
|
||||
# And stdin must be the input file that defines the recovery setup.
|
||||
|
||||
BEGIN {
|
||||
if (source_file == "" || subsystem == "" ||
|
||||
header_file == "" || template_file == "" || template_dir == "") {
|
||||
print "Usage: gen_rec.awk requires five variables to be set:"
|
||||
print "\tsource_file\t-- the C source file being created"
|
||||
print "\tsubsystem\t-- the subsystem prefix, e.g., \"db\""
|
||||
print "\theader_file\t-- the C #include file being created"
|
||||
print "\ttemplate_file\t-- the template file being created"
|
||||
print "\ttemplate_dir\t-- the directory to find the source template"
|
||||
exit
|
||||
}
|
||||
FS="[\t ][\t ]*"
|
||||
CFILE=source_file
|
||||
NAME=subsystem
|
||||
HFILE=header_file
|
||||
TFILE=template_file
|
||||
TDIR=template_dir
|
||||
}
|
||||
/^[ ]*PREFIX/ {
|
||||
prefix = $2
|
||||
num_funcs = 0;
|
||||
|
||||
# Start .c file.
|
||||
printf("/* Do not edit: automatically built by gen_rec.awk. */\n") \
|
||||
> CFILE
|
||||
|
||||
# Start .h file, make the entire file conditional.
|
||||
printf("/* Do not edit: automatically built by gen_rec.awk. */\n\n") \
|
||||
> HFILE
|
||||
printf("#ifndef\t%s_AUTO_H\n#define\t%s_AUTO_H\n", prefix, prefix) \
|
||||
>> HFILE;
|
||||
|
||||
# Write recovery template file headers
|
||||
# This assumes we're doing DB recovery.
|
||||
printf("#include \"db_config.h\"\n\n") > TFILE
|
||||
printf("#ifndef NO_SYSTEM_INCLUDES\n") >> TFILE
|
||||
printf("#include <sys/types.h>\n\n") >> TFILE
|
||||
printf("#include <string.h>\n") >> TFILE
|
||||
printf("#endif\n\n") >> TFILE
|
||||
printf("#include \"db_int.h\"\n") >> TFILE
|
||||
printf("#include \"db_page.h\"\n") >> TFILE
|
||||
printf("#include \"%s.h\"\n", prefix) >> TFILE
|
||||
printf("#include \"log.h\"\n\n") >> TFILE
|
||||
}
|
||||
/^[ ]*INCLUDE/ {
|
||||
if ($3 == "")
|
||||
printf("%s\n", $2) >> CFILE
|
||||
else
|
||||
printf("%s %s\n", $2, $3) >> CFILE
|
||||
}
|
||||
/^[ ]*(BEGIN|DEPRECATED)/ {
|
||||
if (in_begin) {
|
||||
print "Invalid format: missing END statement"
|
||||
exit
|
||||
}
|
||||
in_begin = 1;
|
||||
is_dbt = 0;
|
||||
is_deprecated = ($1 == "DEPRECATED");
|
||||
nvars = 0;
|
||||
|
||||
thisfunc = $2;
|
||||
funcname = sprintf("%s_%s", prefix, $2);
|
||||
|
||||
rectype = $3;
|
||||
|
||||
funcs[num_funcs] = funcname;
|
||||
funcs_dep[num_funcs] = is_deprecated;
|
||||
++num_funcs;
|
||||
}
|
||||
/^[ ]*(ARG|DBT|POINTER)/ {
|
||||
vars[nvars] = $2;
|
||||
types[nvars] = $3;
|
||||
atypes[nvars] = $1;
|
||||
modes[nvars] = $1;
|
||||
formats[nvars] = $NF;
|
||||
for (i = 4; i < NF; i++)
|
||||
types[nvars] = sprintf("%s %s", types[nvars], $i);
|
||||
|
||||
if ($1 == "ARG")
|
||||
sizes[nvars] = sprintf("sizeof(%s)", $2);
|
||||
else if ($1 == "POINTER")
|
||||
sizes[nvars] = sprintf("sizeof(*%s)", $2);
|
||||
else { # DBT
|
||||
sizes[nvars] = \
|
||||
sprintf("sizeof(u_int32_t) + (%s == NULL ? 0 : %s->size)", \
|
||||
$2, $2);
|
||||
is_dbt = 1;
|
||||
}
|
||||
nvars++;
|
||||
}
|
||||
/^[ ]*END/ {
|
||||
if (!in_begin) {
|
||||
print "Invalid format: missing BEGIN statement"
|
||||
exit;
|
||||
}
|
||||
|
||||
# Declare the record type.
|
||||
printf("\n#define\tDB_%s\t%d\n", funcname, rectype) >> HFILE
|
||||
|
||||
# Structure declaration.
|
||||
printf("typedef struct _%s_args {\n", funcname) >> HFILE
|
||||
|
||||
# Here are the required fields for every structure
|
||||
printf("\tu_int32_t type;\n\tDB_TXN *txnid;\n") >> HFILE
|
||||
printf("\tDB_LSN prev_lsn;\n") >>HFILE
|
||||
|
||||
# Here are the specified fields.
|
||||
for (i = 0; i < nvars; i++) {
|
||||
t = types[i];
|
||||
if (modes[i] == "POINTER") {
|
||||
ndx = index(t, "*");
|
||||
t = substr(types[i], 0, ndx - 2);
|
||||
}
|
||||
printf("\t%s\t%s;\n", t, vars[i]) >> HFILE
|
||||
}
|
||||
printf("} __%s_args;\n\n", funcname) >> HFILE
|
||||
|
||||
# Output the log, print and read functions.
|
||||
if (!is_deprecated)
|
||||
log_function();
|
||||
print_function();
|
||||
read_function();
|
||||
|
||||
# Recovery template
|
||||
cmd = sprintf("sed -e s/PREF/%s/ -e s/FUNC/%s/ < %s/rec_ctemp >> %s",
|
||||
prefix, thisfunc, TDIR, TFILE)
|
||||
system(cmd);
|
||||
|
||||
# Done writing stuff, reset and continue.
|
||||
in_begin = 0;
|
||||
}
|
||||
|
||||
END {
|
||||
# Print initialization routine; function prototype
|
||||
printf("int __%s_init_print __P((DB_ENV *));\n", prefix) >> HFILE;
|
||||
|
||||
# Create the routine to call db_add_recovery(print_fn, id)
|
||||
printf("int\n__%s_init_print(dbenv)\n", prefix) >> CFILE;
|
||||
printf("\tDB_ENV *dbenv;\n{\n\tint ret;\n\n") >> CFILE;
|
||||
for (i = 0; i < num_funcs; i++) {
|
||||
printf("\tif ((ret = __db_add_recovery(dbenv,\n") >> CFILE;
|
||||
printf("\t __%s_print, DB_%s)) != 0)\n", \
|
||||
funcs[i], funcs[i]) >> CFILE;
|
||||
printf("\t\treturn (ret);\n") >> CFILE;
|
||||
}
|
||||
printf("\treturn (0);\n}\n\n") >> CFILE;
|
||||
|
||||
# Recover initialization routine
|
||||
printf("int __%s_init_recover __P((DB_ENV *));\n", prefix) >> HFILE;
|
||||
|
||||
# Create the routine to call db_add_recovery(func, id)
|
||||
printf("int\n__%s_init_recover(dbenv)\n", prefix) >> CFILE;
|
||||
printf("\tDB_ENV *dbenv;\n{\n\tint ret;\n\n") >> CFILE;
|
||||
for (i = 0; i < num_funcs; i++) {
|
||||
printf("\tif ((ret = __db_add_recovery(dbenv,\n") >> CFILE;
|
||||
if (funcs_dep[i] == 1)
|
||||
printf("\t __deprecated_recover, DB_%s)) != 0)\n", \
|
||||
funcs[i]) >> CFILE;
|
||||
else
|
||||
printf("\t __%s_recover, DB_%s)) != 0)\n", \
|
||||
funcs[i], funcs[i]) >> CFILE;
|
||||
printf("\t\treturn (ret);\n") >> CFILE;
|
||||
}
|
||||
printf("\treturn (0);\n}\n\n") >> CFILE;
|
||||
|
||||
# End the conditional for the HFILE
|
||||
printf("#endif\n") >> HFILE;
|
||||
}
|
||||
|
||||
function log_function() {
|
||||
# Write the log function; function prototype
|
||||
printf("int __%s_log __P((", funcname) >> HFILE;
|
||||
printf("DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t") >> HFILE;
|
||||
for (i = 0; i < nvars; i++) {
|
||||
printf(", ") >> HFILE;
|
||||
if (modes[i] == "DBT")
|
||||
printf("const ") >> HFILE;
|
||||
printf("%s", types[i]) >> HFILE;
|
||||
if (modes[i] == "DBT")
|
||||
printf(" *") >> HFILE;
|
||||
}
|
||||
printf("));\n") >> HFILE;
|
||||
|
||||
# Function declaration
|
||||
printf("int\n__%s_log(dbenv, txnid, ret_lsnp, flags", \
|
||||
funcname) >> CFILE;
|
||||
for (i = 0; i < nvars; i++) {
|
||||
printf(",") >> CFILE;
|
||||
if ((i % 6) == 0)
|
||||
printf("\n\t") >> CFILE;
|
||||
else
|
||||
printf(" ") >> CFILE;
|
||||
printf("%s", vars[i]) >> CFILE;
|
||||
}
|
||||
printf(")\n") >> CFILE;
|
||||
|
||||
# Now print the parameters
|
||||
printf("\tDB_ENV *dbenv;\n") >> CFILE;
|
||||
printf("\tDB_TXN *txnid;\n\tDB_LSN *ret_lsnp;\n") >> CFILE;
|
||||
printf("\tu_int32_t flags;\n") >> CFILE;
|
||||
for (i = 0; i < nvars; i++) {
|
||||
if (modes[i] == "DBT")
|
||||
printf("\tconst %s *%s;\n", types[i], vars[i]) >> CFILE;
|
||||
else
|
||||
printf("\t%s %s;\n", types[i], vars[i]) >> CFILE;
|
||||
}
|
||||
|
||||
# Function body and local decls
|
||||
printf("{\n") >> CFILE;
|
||||
printf("\tDBT logrec;\n") >> CFILE;
|
||||
printf("\tDB_LSN *lsnp, null_lsn;\n") >> CFILE;
|
||||
if (is_dbt == 1)
|
||||
printf("\tu_int32_t zero;\n") >> CFILE;
|
||||
printf("\tu_int32_t rectype, txn_num;\n") >> CFILE;
|
||||
printf("\tint ret;\n") >> CFILE;
|
||||
printf("\tu_int8_t *bp;\n\n") >> CFILE;
|
||||
|
||||
# Initialization
|
||||
printf("\trectype = DB_%s;\n", funcname) >> CFILE;
|
||||
printf("\tif (txnid != NULL &&\n") >> CFILE;
|
||||
printf("\t TAILQ_FIRST(&txnid->kids) != NULL &&\n") >> CFILE;
|
||||
printf("\t (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)\n")\
|
||||
>> CFILE;
|
||||
printf("\t\treturn (ret);\n") >> CFILE;
|
||||
printf("\ttxn_num = txnid == NULL ? 0 : txnid->txnid;\n") >> CFILE;
|
||||
printf("\tif (txnid == NULL) {\n") >> CFILE;
|
||||
printf("\t\tZERO_LSN(null_lsn);\n") >> CFILE;
|
||||
printf("\t\tlsnp = &null_lsn;\n") >> CFILE;
|
||||
printf("\t} else\n\t\tlsnp = &txnid->last_lsn;\n") >> CFILE;
|
||||
|
||||
# Malloc
|
||||
printf("\tlogrec.size = sizeof(rectype) + ") >> CFILE;
|
||||
printf("sizeof(txn_num) + sizeof(DB_LSN)") >> CFILE;
|
||||
for (i = 0; i < nvars; i++)
|
||||
printf("\n\t + %s", sizes[i]) >> CFILE;
|
||||
printf(";\n\tif ((ret = ") >> CFILE;
|
||||
printf(\
|
||||
"__os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)\n")\
|
||||
>> CFILE;
|
||||
printf("\t\treturn (ret);\n\n") >> CFILE;
|
||||
|
||||
# Copy args into buffer
|
||||
printf("\tbp = logrec.data;\n") >> CFILE;
|
||||
printf("\tmemcpy(bp, &rectype, sizeof(rectype));\n") >> CFILE;
|
||||
printf("\tbp += sizeof(rectype);\n") >> CFILE;
|
||||
printf("\tmemcpy(bp, &txn_num, sizeof(txn_num));\n") >> CFILE;
|
||||
printf("\tbp += sizeof(txn_num);\n") >> CFILE;
|
||||
printf("\tmemcpy(bp, lsnp, sizeof(DB_LSN));\n") >> CFILE;
|
||||
printf("\tbp += sizeof(DB_LSN);\n") >> CFILE;
|
||||
|
||||
for (i = 0; i < nvars; i ++) {
|
||||
if (modes[i] == "ARG") {
|
||||
printf("\tmemcpy(bp, &%s, %s);\n", \
|
||||
vars[i], sizes[i]) >> CFILE;
|
||||
printf("\tbp += %s;\n", sizes[i]) >> CFILE;
|
||||
} else if (modes[i] == "DBT") {
|
||||
printf("\tif (%s == NULL) {\n", vars[i]) >> CFILE;
|
||||
printf("\t\tzero = 0;\n") >> CFILE;
|
||||
printf("\t\tmemcpy(bp, &zero, sizeof(u_int32_t));\n") \
|
||||
>> CFILE;
|
||||
printf("\t\tbp += sizeof(u_int32_t);\n") >> CFILE;
|
||||
printf("\t} else {\n") >> CFILE;
|
||||
printf("\t\tmemcpy(bp, &%s->size, ", vars[i]) >> CFILE;
|
||||
printf("sizeof(%s->size));\n", vars[i]) >> CFILE;
|
||||
printf("\t\tbp += sizeof(%s->size);\n", vars[i]) \
|
||||
>> CFILE;
|
||||
printf("\t\tmemcpy(bp, %s->data, %s->size);\n", \
|
||||
vars[i], vars[i]) >> CFILE;
|
||||
printf("\t\tbp += %s->size;\n\t}\n", vars[i]) >> CFILE;
|
||||
} else { # POINTER
|
||||
printf("\tif (%s != NULL)\n", vars[i]) >> CFILE;
|
||||
printf("\t\tmemcpy(bp, %s, %s);\n", vars[i], \
|
||||
sizes[i]) >> CFILE;
|
||||
printf("\telse\n") >> CFILE;
|
||||
printf("\t\tmemset(bp, 0, %s);\n", sizes[i]) >> CFILE;
|
||||
printf("\tbp += %s;\n", sizes[i]) >> CFILE;
|
||||
}
|
||||
}
|
||||
|
||||
# Error checking
|
||||
printf("\tDB_ASSERT((u_int32_t)") >> CFILE;
|
||||
printf("(bp - (u_int8_t *)logrec.data) == logrec.size);\n") >> CFILE;
|
||||
|
||||
# Issue log call
|
||||
# The logging system cannot call the public log_put routine
|
||||
# due to mutual exclusion constraints. So, if we are
|
||||
# generating code for the log subsystem, use the internal
|
||||
# __log_put.
|
||||
if (prefix == "log")
|
||||
printf("\tret = __log_put\(dbenv, ret_lsnp, ") >> CFILE;
|
||||
else
|
||||
printf("\tret = log_put(dbenv, ret_lsnp, ") >> CFILE;
|
||||
printf("(DBT *)&logrec, flags);\n") >> CFILE;
|
||||
|
||||
# Update the transactions last_lsn
|
||||
printf("\tif (txnid != NULL)\n") >> CFILE;
|
||||
printf("\t\ttxnid->last_lsn = *ret_lsnp;\n") >> CFILE;
|
||||
|
||||
# Free and return
|
||||
printf("\t__os_free(logrec.data, logrec.size);\n") >> CFILE;
|
||||
printf("\treturn (ret);\n}\n\n") >> CFILE;
|
||||
}
|
||||
|
||||
function print_function() {
|
||||
# Write the print function; function prototype
|
||||
printf("int __%s_print", funcname) >> HFILE;
|
||||
printf(" __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));\n") \
|
||||
>> HFILE;
|
||||
|
||||
# Function declaration
|
||||
printf("int\n__%s_print(dbenv, ", funcname) >> CFILE;
|
||||
printf("dbtp, lsnp, notused2, notused3)\n") >> CFILE;
|
||||
printf("\tDB_ENV *dbenv;\n") >> CFILE;
|
||||
printf("\tDBT *dbtp;\n") >> CFILE;
|
||||
printf("\tDB_LSN *lsnp;\n") >> CFILE;
|
||||
printf("\tdb_recops notused2;\n\tvoid *notused3;\n{\n") >> CFILE;
|
||||
|
||||
# Locals
|
||||
printf("\t__%s_args *argp;\n", funcname) >> CFILE;
|
||||
printf("\tu_int32_t i;\n\tu_int ch;\n\tint ret;\n\n") >> CFILE;
|
||||
|
||||
# Get rid of complaints about unused parameters.
|
||||
printf("\ti = 0;\n\tch = 0;\n") >> CFILE;
|
||||
printf("\tnotused2 = DB_TXN_ABORT;\n\tnotused3 = NULL;\n\n") >> CFILE;
|
||||
|
||||
# Call read routine to initialize structure
|
||||
printf("\tif ((ret = __%s_read(dbenv, dbtp->data, &argp)) != 0)\n", \
|
||||
funcname) >> CFILE;
|
||||
printf("\t\treturn (ret);\n") >> CFILE;
|
||||
|
||||
# Print values in every record
|
||||
printf("\tprintf(\"[%%lu][%%lu]%s: ", funcname) >> CFILE;
|
||||
printf("rec: %%lu txnid %%lx ") >> CFILE;
|
||||
printf("prevlsn [%%lu][%%lu]\\n\",\n") >> CFILE;
|
||||
printf("\t (u_long)lsnp->file,\n") >> CFILE;
|
||||
printf("\t (u_long)lsnp->offset,\n") >> CFILE;
|
||||
printf("\t (u_long)argp->type,\n") >> CFILE;
|
||||
printf("\t (u_long)argp->txnid->txnid,\n") >> CFILE;
|
||||
printf("\t (u_long)argp->prev_lsn.file,\n") >> CFILE;
|
||||
printf("\t (u_long)argp->prev_lsn.offset);\n") >> CFILE;
|
||||
|
||||
# Now print fields of argp
|
||||
for (i = 0; i < nvars; i ++) {
|
||||
printf("\tprintf(\"\\t%s: ", vars[i]) >> CFILE;
|
||||
|
||||
if (modes[i] == "DBT") {
|
||||
printf("\");\n") >> CFILE;
|
||||
printf("\tfor (i = 0; i < ") >> CFILE;
|
||||
printf("argp->%s.size; i++) {\n", vars[i]) >> CFILE;
|
||||
printf("\t\tch = ((u_int8_t *)argp->%s.data)[i];\n", \
|
||||
vars[i]) >> CFILE;
|
||||
printf("\t\tif (isprint(ch) || ch == 0xa)\n") >> CFILE;
|
||||
printf("\t\t\tputchar(ch);\n") >> CFILE;
|
||||
printf("\t\telse\n") >> CFILE;
|
||||
printf("\t\t\tprintf(\"%%#x \", ch);\n") >> CFILE;
|
||||
printf("\t}\n\tprintf(\"\\n\");\n") >> CFILE;
|
||||
} else if (types[i] == "DB_LSN *") {
|
||||
printf("[%%%s][%%%s]\\n\",\n", \
|
||||
formats[i], formats[i]) >> CFILE;
|
||||
printf("\t (u_long)argp->%s.file,", \
|
||||
vars[i]) >> CFILE;
|
||||
printf(" (u_long)argp->%s.offset);\n", \
|
||||
vars[i]) >> CFILE;
|
||||
} else {
|
||||
if (formats[i] == "lx")
|
||||
printf("0x") >> CFILE;
|
||||
printf("%%%s\\n\", ", formats[i]) >> CFILE;
|
||||
if (formats[i] == "lx" || formats[i] == "lu")
|
||||
printf("(u_long)") >> CFILE;
|
||||
if (formats[i] == "ld")
|
||||
printf("(long)") >> CFILE;
|
||||
printf("argp->%s);\n", vars[i]) >> CFILE;
|
||||
}
|
||||
}
|
||||
printf("\tprintf(\"\\n\");\n") >> CFILE;
|
||||
printf("\t__os_free(argp, 0);\n") >> CFILE;
|
||||
printf("\treturn (0);\n") >> CFILE;
|
||||
printf("}\n\n") >> CFILE;
|
||||
}
|
||||
|
||||
function read_function() {
|
||||
# Write the read function; function prototype
|
||||
printf("int __%s_read __P((DB_ENV *, void *, ", funcname) >> HFILE;
|
||||
printf("__%s_args **));\n", funcname) >> HFILE;
|
||||
|
||||
# Function declaration
|
||||
printf("int\n__%s_read(dbenv, recbuf, argpp)\n", funcname) >> CFILE;
|
||||
|
||||
# Now print the parameters
|
||||
printf("\tDB_ENV *dbenv;\n") >> CFILE;
|
||||
printf("\tvoid *recbuf;\n") >> CFILE;
|
||||
printf("\t__%s_args **argpp;\n", funcname) >> CFILE;
|
||||
|
||||
# Function body and local decls
|
||||
printf("{\n\t__%s_args *argp;\n", funcname) >> CFILE;
|
||||
printf("\tu_int8_t *bp;\n") >> CFILE;
|
||||
printf("\tint ret;\n") >> CFILE;
|
||||
|
||||
printf("\n\tret = __os_malloc(dbenv, sizeof(") >> CFILE;
|
||||
printf("__%s_args) +\n\t sizeof(DB_TXN), NULL, &argp);\n", \
|
||||
funcname) >> CFILE;
|
||||
printf("\tif (ret != 0)\n\t\treturn (ret);\n") >> CFILE;
|
||||
|
||||
# Set up the pointers to the txnid and the prev lsn
|
||||
printf("\targp->txnid = (DB_TXN *)&argp[1];\n") >> CFILE;
|
||||
|
||||
# First get the record type, prev_lsn, and txnid fields.
|
||||
|
||||
printf("\tbp = recbuf;\n") >> CFILE;
|
||||
printf("\tmemcpy(&argp->type, bp, sizeof(argp->type));\n") >> CFILE;
|
||||
printf("\tbp += sizeof(argp->type);\n") >> CFILE;
|
||||
printf("\tmemcpy(&argp->txnid->txnid, bp, ") >> CFILE;
|
||||
printf("sizeof(argp->txnid->txnid));\n") >> CFILE;
|
||||
printf("\tbp += sizeof(argp->txnid->txnid);\n") >> CFILE;
|
||||
printf("\tmemcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));\n") >> CFILE;
|
||||
printf("\tbp += sizeof(DB_LSN);\n") >> CFILE;
|
||||
|
||||
# Now get rest of data.
|
||||
for (i = 0; i < nvars; i ++) {
|
||||
if (modes[i] == "DBT") {
|
||||
printf("\tmemset(&argp->%s, 0, sizeof(argp->%s));\n", \
|
||||
vars[i], vars[i]) >> CFILE;
|
||||
printf("\tmemcpy(&argp->%s.size, ", vars[i]) >> CFILE;
|
||||
printf("bp, sizeof(u_int32_t));\n") >> CFILE;
|
||||
printf("\tbp += sizeof(u_int32_t);\n") >> CFILE;
|
||||
printf("\targp->%s.data = bp;\n", vars[i]) >> CFILE;
|
||||
printf("\tbp += argp->%s.size;\n", vars[i]) >> CFILE;
|
||||
} else if (modes[i] == "ARG") {
|
||||
printf("\tmemcpy(&argp->%s, bp, %s%s));\n", \
|
||||
vars[i], "sizeof(argp->", vars[i]) >> CFILE;
|
||||
printf("\tbp += sizeof(argp->%s);\n", vars[i]) >> CFILE;
|
||||
} else { # POINTER
|
||||
printf("\tmemcpy(&argp->%s, bp, ", vars[i]) >> CFILE;
|
||||
printf(" sizeof(argp->%s));\n", vars[i]) >> CFILE;
|
||||
printf("\tbp += sizeof(argp->%s);\n", vars[i]) >> CFILE;
|
||||
}
|
||||
}
|
||||
|
||||
# Free and return
|
||||
printf("\t*argpp = argp;\n") >> CFILE;
|
||||
printf("\treturn (0);\n}\n\n") >> CFILE;
|
||||
}
|
||||
1482
bdb/dist/gen_rpc.awk
vendored
Normal file
1482
bdb/dist/gen_rpc.awk
vendored
Normal file
File diff suppressed because it is too large
Load diff
251
bdb/dist/install-sh
vendored
Executable file
251
bdb/dist/install-sh
vendored
Executable file
|
|
@ -0,0 +1,251 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
3136
bdb/dist/ltconfig
vendored
Normal file
3136
bdb/dist/ltconfig
vendored
Normal file
File diff suppressed because it is too large
Load diff
4029
bdb/dist/ltmain.sh
vendored
Normal file
4029
bdb/dist/ltmain.sh
vendored
Normal file
File diff suppressed because it is too large
Load diff
62
bdb/dist/rec_ctemp
vendored
Normal file
62
bdb/dist/rec_ctemp
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* __PREF_FUNC_recover --
|
||||
* Recovery function for FUNC.
|
||||
*
|
||||
* PUBLIC: int __PREF_FUNC_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__PREF_FUNC_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__PREF_FUNC_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__PREF_FUNC_print);
|
||||
REC_INTRO(__PREF_FUNC_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
16
bdb/dist/s_all
vendored
Normal file
16
bdb/dist/s_all
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_all,v 1.7 2000/12/22 15:35:32 bostic Exp $
|
||||
|
||||
sh s_perm # permissions.
|
||||
sh s_symlink # symbolic links.
|
||||
sh s_config # autoconf.
|
||||
sh s_readme # db/README file.
|
||||
sh s_recover # logging/recovery files.
|
||||
sh s_rpc # RPC files.
|
||||
sh s_include # standard include files.
|
||||
sh s_win32 # Win32 include files.
|
||||
sh s_win32_dsp # Win32 build environment.
|
||||
sh s_vxworks # VxWorks include files.
|
||||
sh s_java # Java support.
|
||||
sh s_tcl # Tcl support.
|
||||
sh s_tags # Tags files.
|
||||
37
bdb/dist/s_config
vendored
Executable file
37
bdb/dist/s_config
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_config,v 1.3 2000/07/13 18:38:46 bostic Exp $
|
||||
#
|
||||
# Build the autoconfiguration files.
|
||||
|
||||
msgm4="dnl DO NOT EDIT: automatically built by dist/s_config."
|
||||
|
||||
. ./RELEASE
|
||||
|
||||
echo "Building aclocal.m4"
|
||||
rm -f aclocal.m4
|
||||
(echo "$msgm4" &&
|
||||
echo "AC_DEFUN(AM_VERSION_SET, [" &&
|
||||
echo "AC_SUBST(DB_VERSION_MAJOR)" &&
|
||||
echo "DB_VERSION_MAJOR=$DB_VERSION_MAJOR" &&
|
||||
echo "AC_SUBST(DB_VERSION_MINOR)" &&
|
||||
echo "DB_VERSION_MINOR=$DB_VERSION_MINOR" &&
|
||||
echo "AC_SUBST(DB_VERSION_PATCH)" &&
|
||||
echo "DB_VERSION_PATCH=$DB_VERSION_PATCH" &&
|
||||
echo "AC_SUBST(DB_VERSION_STRING)" &&
|
||||
echo "DB_VERSION_STRING=\"\\\"$DB_VERSION_STRING\\\"\"" &&
|
||||
echo "])dnl" &&
|
||||
cat aclocal/*.m4) > aclocal.m4
|
||||
chmod 444 aclocal.m4
|
||||
|
||||
rm -f config.hin
|
||||
echo "Building config.hin (autoheader)"
|
||||
(autoheader configure.in > config.hin) 2>&1 | \
|
||||
sed '/warning: AC_TRY_RUN called without default/d'
|
||||
chmod 444 config.hin
|
||||
|
||||
rm -f configure
|
||||
echo "Building configure (autoconf)"
|
||||
autoconf 2>&1 | sed '/warning: AC_TRY_RUN called without default/d'
|
||||
|
||||
chmod 555 configure config.guess config.sub install-sh
|
||||
rm -f aclocal.m4
|
||||
33
bdb/dist/s_include
vendored
Executable file
33
bdb/dist/s_include
vendored
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_include,v 1.7 2000/07/13 18:38:46 bostic Exp $
|
||||
#
|
||||
# Build the automatically generated function prototype files.
|
||||
|
||||
msgc="/* DO NOT EDIT: automatically built by dist/s_include. */"
|
||||
cxx_if="#if defined(__cplusplus)"
|
||||
cxx_head="extern \"C\" {"
|
||||
cxx_foot="}"
|
||||
cxx_endif="#endif"
|
||||
|
||||
tmp=/tmp/__db_inc.$$
|
||||
trap 'rm -f $tmp ; exit 0' 0 1 2 3 13 15
|
||||
|
||||
for i in db btree clib common env hash \
|
||||
lock log mp mutex os qam rpc_client rpc_server tcl txn xa; do
|
||||
f=../include/${i}_ext.h
|
||||
(echo "$msgc" &&
|
||||
echo "#ifndef _${i}_ext_h_" &&
|
||||
echo "#define _${i}_ext_h_" &&
|
||||
echo "$cxx_if" &&
|
||||
echo "$cxx_head" &&
|
||||
echo "$cxx_endif" &&
|
||||
sed -n "s/^ \* PUBLIC:[ ]\(.*\)/\1/p" ../$i/*.c;
|
||||
[ $i = os ] &&
|
||||
sed -n "s/^ \* PUBLIC:[ ]\(.*\)/\1/p" ../os_win32/*.c;
|
||||
echo "$cxx_if" &&
|
||||
echo "$cxx_foot" &&
|
||||
echo "$cxx_endif" &&
|
||||
echo "#endif /* _${i}_ext_h_ */") > $tmp
|
||||
cmp $tmp $f > /dev/null 2>&1 ||
|
||||
(echo "Building $f" && rm -f $f && cp $tmp $f && chmod 444 $f)
|
||||
done
|
||||
31
bdb/dist/s_java
vendored
Executable file
31
bdb/dist/s_java
vendored
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_java,v 1.3 2000/07/13 18:38:46 bostic Exp $
|
||||
#
|
||||
# Build the Java files.
|
||||
|
||||
msgcxx="// DO NOT EDIT: automatically built by dist/s_java."
|
||||
|
||||
. RELEASE
|
||||
|
||||
f=../java/src/com/sleepycat/db/DbConstants.java
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
(echo "$msgcxx" && \
|
||||
echo &&
|
||||
echo 'package com.sleepycat.db;' &&
|
||||
echo &&
|
||||
echo 'public class DbConstants' &&
|
||||
echo '{' &&
|
||||
egrep '^#define.DB_' ../include/db.src | \
|
||||
sed -e '/"/d' \
|
||||
-e '/@DB_VERSION_/d' \
|
||||
-e '/DB_REDO/d' \
|
||||
-e '/DB_UNDO/d' \
|
||||
-e 's/[()]/ /g' \
|
||||
-e 's/\/\*/ /' | \
|
||||
awk '{ print "\tpublic static final int " $2 " = " $3 ";" }' &&
|
||||
echo " public static final int DB_VERSION_MAJOR = $DB_VERSION_MAJOR;" &&
|
||||
echo " public static final int DB_VERSION_MINOR = $DB_VERSION_MINOR;" &&
|
||||
echo " public static final int DB_VERSION_PATCH = $DB_VERSION_PATCH;" &&
|
||||
echo '}') > $f
|
||||
chmod 444 $f
|
||||
37
bdb/dist/s_perm
vendored
Executable file
37
bdb/dist/s_perm
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_perm,v 1.9 2001/01/24 15:55:38 bostic Exp $
|
||||
|
||||
echo 'Updating Berkeley DB source tree permissions...'
|
||||
|
||||
run()
|
||||
{
|
||||
echo " $1 ($2)"
|
||||
if [ -f "../$1" ]; then
|
||||
chmod "$2" "../$1"
|
||||
else
|
||||
echo "$1: no such file or directory"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run dist/build/chk.def 0555
|
||||
run dist/build/chk.define 0555
|
||||
run dist/build/chk.offt 0555
|
||||
run dist/build/chk.srcfiles 0555
|
||||
run dist/build/chk.tags 0555
|
||||
run dist/config.guess 0555
|
||||
run dist/config.sub 0555
|
||||
run dist/configure 0555
|
||||
run dist/install-sh 0555
|
||||
run dist/s_config 0555
|
||||
run dist/s_include 0555
|
||||
run dist/s_java 0555
|
||||
run dist/s_perm 0555
|
||||
run dist/s_readme 0555
|
||||
run dist/s_recover 0555
|
||||
run dist/s_symlink 0555
|
||||
run dist/s_tags 0555
|
||||
run dist/s_tcl 0555
|
||||
run dist/s_win32 0555
|
||||
run perl.BerkeleyDB/dbinfo 0555
|
||||
run perl.BerkeleyDB/mkpod 0555
|
||||
18
bdb/dist/s_readme
vendored
Executable file
18
bdb/dist/s_readme
vendored
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_readme,v 1.2 2000/01/27 21:42:18 bostic Exp $
|
||||
#
|
||||
# Build the README.
|
||||
|
||||
. RELEASE
|
||||
|
||||
f=../README
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
(echo "$DB_VERSION_STRING" &&
|
||||
echo "" &&
|
||||
echo -n "This is version " &&
|
||||
echo -n "$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH" &&
|
||||
echo " of Berkeley DB from Sleepycat Software. To view" &&
|
||||
echo "the release and installation documentation, load the distribution file" &&
|
||||
echo "docs/index.html into your web browser.") > $f
|
||||
chmod 444 $f
|
||||
56
bdb/dist/s_recover
vendored
Executable file
56
bdb/dist/s_recover
vendored
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_recover,v 1.3 2000/03/30 05:24:36 krinsky Exp $
|
||||
#
|
||||
# Build the automatically generated logging/recovery files.
|
||||
|
||||
DIR="db btree hash log qam txn"
|
||||
|
||||
t=/tmp/__db_$$
|
||||
loglist=../test/logtrack.list
|
||||
rm -f $t
|
||||
rm -f $loglist
|
||||
|
||||
trap 'rm -f $t; exit 1' 1 2 3 13 15
|
||||
|
||||
# Check to make sure we haven't duplicated a log record entry, and build
|
||||
# the list of log record types that the test suite uses.
|
||||
for i in $DIR; do
|
||||
p=none
|
||||
for f in ../$i/*.src; do
|
||||
# Grab the PREFIX; there should only be one per file, and
|
||||
# so it's okay to just take the first.
|
||||
grep '^PREFIX' $f | head -1
|
||||
egrep '^DEPRECATED[ ]|^BEGIN[ ]' $f | \
|
||||
awk '{print $1 "\t" $2 "\t" $3}'
|
||||
|
||||
done
|
||||
done > $loglist
|
||||
grep -v '^PREFIX' $loglist | awk '{print $2 "\t" $3}' | sort +1 -n | \
|
||||
uniq -d -f 1 > $t
|
||||
[ -s $t ] && {
|
||||
echo "DUPLICATE LOG VALUES:"
|
||||
cat $t
|
||||
rm -f $t
|
||||
exit 1
|
||||
}
|
||||
rm -f $t
|
||||
|
||||
for i in db btree hash log qam txn; do
|
||||
for f in ../$i/*.src; do
|
||||
subsystem=`basename $f .src`
|
||||
header_file=../include/${subsystem}_auto.h
|
||||
source_file=../$i/${subsystem}_auto.c
|
||||
template_file=template/rec_${subsystem}
|
||||
template_source=.
|
||||
|
||||
echo "Building $source_file, $header_file, $template_file"
|
||||
rm -f $header_file $source_file $template_file
|
||||
awk -f gen_rec.awk \
|
||||
-v subsystem=$subsystem \
|
||||
-v source_file=$source_file \
|
||||
-v header_file=$header_file \
|
||||
-v template_file=$template_file \
|
||||
-v template_dir=. < $f
|
||||
chmod 444 $header_file $source_file $template_file
|
||||
done
|
||||
done
|
||||
70
bdb/dist/s_rpc
vendored
Normal file
70
bdb/dist/s_rpc
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_rpc,v 11.6 2000/04/26 19:15:51 sue Exp $
|
||||
#
|
||||
# Build the automatically generated RPC files
|
||||
|
||||
echo "Building RPC client/server files"
|
||||
|
||||
client_file=../rpc_client/gen_client.c
|
||||
cproto_file=../include/gen_client_ext.h
|
||||
ctmpl_file=./template/gen_client_ret
|
||||
header_file=../include/db_server.h
|
||||
rpcclnt_file=../rpc_client/db_server_clnt.c
|
||||
rpcsvc_file=../rpc_server/db_server_svc.c
|
||||
rpcxdr_file=../rpc_server/db_server_xdr.c
|
||||
sed_file=../rpc_server/db_server_proc.sed
|
||||
server_file=../rpc_server/gen_db_server.c
|
||||
sproto_file=../include/gen_server_ext.h
|
||||
stmpl_file=./template/db_server_proc
|
||||
xdr_file=../rpc_server/db_server.x
|
||||
|
||||
#
|
||||
# NOTE: We do NOT want to remove proc_file. It is what we apply
|
||||
# sed_file to, but we do not want to remove it.
|
||||
#
|
||||
proc_file=../rpc_server/db_server_proc.c
|
||||
svrsed_file=../rpc_server/db_server_svc.sed
|
||||
rpcsed_file=../rpc_server/db_server.sed
|
||||
|
||||
rm -f $client_file $cproto_file $ctmpl_file $header_file $rpcsvc_file \
|
||||
$rpcclnt_file $rpcxdr_file $sed_file $server_file $sproto_file \
|
||||
$stmpl_file $xdr_file
|
||||
|
||||
#
|
||||
# Generate client/server/XDR code
|
||||
#
|
||||
awk -f gen_rpc.awk \
|
||||
-v client_file=$client_file \
|
||||
-v cproto_file=$cproto_file \
|
||||
-v ctmpl_file=$ctmpl_file \
|
||||
-v sed_file=$sed_file \
|
||||
-v server_file=$server_file \
|
||||
-v sproto_file=$sproto_file \
|
||||
-v stmpl_file=$stmpl_file \
|
||||
-v xdr_file=$xdr_file < ../rpc_server/rpc.src
|
||||
chmod 444 $client_file $server_file
|
||||
|
||||
#
|
||||
# Now run rpcgen to generate all our sources from the XDR file
|
||||
#
|
||||
rpcgen -h $xdr_file > $header_file
|
||||
rpcgen -l $xdr_file > $rpcclnt_file
|
||||
rpcgen -s tcp $xdr_file > $rpcsvc_file
|
||||
rpcgen -c $xdr_file > $rpcxdr_file
|
||||
|
||||
# Run server files through sed
|
||||
sed -f $svrsed_file $rpcsvc_file > ${rpcsvc_file}.new
|
||||
mv ${rpcsvc_file}.new $rpcsvc_file
|
||||
sed -f $sed_file $proc_file > ${proc_file}.new
|
||||
mv ${proc_file}.new $proc_file
|
||||
|
||||
# Run rpcgen files through sed to add HAVE_RPC ifdef
|
||||
sed -f $rpcsed_file $rpcsvc_file > ${rpcsvc_file}.new
|
||||
mv ${rpcsvc_file}.new $rpcsvc_file
|
||||
sed -f $rpcsed_file $rpcxdr_file > ${rpcxdr_file}.new
|
||||
mv ${rpcxdr_file}.new $rpcxdr_file
|
||||
sed -f $rpcsed_file $rpcclnt_file > ${rpcclnt_file}.new
|
||||
mv ${rpcclnt_file}.new $rpcclnt_file
|
||||
|
||||
chmod 444 $header_file $rpcclnt_file $rpcsvc_file $rpcxdr_file
|
||||
|
||||
91
bdb/dist/s_symlink
vendored
Executable file
91
bdb/dist/s_symlink
vendored
Executable file
|
|
@ -0,0 +1,91 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_symlink,v 1.9 2000/09/05 21:27:04 bostic Exp $
|
||||
|
||||
echo 'Creating Berkeley DB source tree symbolic links...'
|
||||
|
||||
build()
|
||||
{
|
||||
echo " $1 -> $2"
|
||||
(cd ../`dirname $1` && rm -f `basename $1` && ln -s $2 `basename $1`)
|
||||
}
|
||||
|
||||
build btree/tags ../dist/tags
|
||||
build build_unix/tags ../dist/tags
|
||||
build clib/tags ../dist/tags
|
||||
build common/tags ../dist/tags
|
||||
build cxx/tags ../dist/tags
|
||||
build db/tags ../dist/tags
|
||||
build db185/tags ../dist/tags
|
||||
build db_archive/tags ../dist/tags
|
||||
build db_checkpoint/tags ../dist/tags
|
||||
build db_deadlock/tags ../dist/tags
|
||||
build db_dump/tags ../dist/tags
|
||||
build db_dump185/tags ../dist/tags
|
||||
build db_load/tags ../dist/tags
|
||||
build db_printlog/tags ../dist/tags
|
||||
build db_recover/tags ../dist/tags
|
||||
build db_stat/tags ../dist/tags
|
||||
build db_upgrade/tags ../dist/tags
|
||||
build db_verify/tags ../dist/tags
|
||||
build dbm/tags ../dist/tags
|
||||
build docs_src/api_cxx/Makefile ../api_c/Makefile
|
||||
build docs_src/api_cxx/m4.seealso ../api_c/m4.seealso
|
||||
build docs_src/api_cxx/spell.ok ../api_c/spell.ok
|
||||
build docs_src/api_java/Makefile ../api_c/Makefile
|
||||
build docs_src/api_java/java_index.so ../api_cxx/cxx_index.so
|
||||
build docs_src/api_java/m4.seealso ../api_c/m4.seealso
|
||||
build docs_src/api_java/spell.ok ../api_c/spell.ok
|
||||
build docs_src/api_tcl/spell.ok ../api_c/spell.ok
|
||||
build docs_src/ref/am/spell.ok ../spell.ok
|
||||
build docs_src/ref/am_conf/spell.ok ../spell.ok
|
||||
build docs_src/ref/arch/spell.ok ../spell.ok
|
||||
build docs_src/ref/build_unix/spell.ok ../spell.ok
|
||||
build docs_src/ref/build_vxworks/spell.ok ../spell.ok
|
||||
build docs_src/ref/build_win/spell.ok ../spell.ok
|
||||
build docs_src/ref/cam/spell.ok ../spell.ok
|
||||
build docs_src/ref/debug/spell.ok ../spell.ok
|
||||
build docs_src/ref/distrib/spell.ok ../spell.ok
|
||||
build docs_src/ref/dumpload/spell.ok ../spell.ok
|
||||
build docs_src/ref/env/spell.ok ../spell.ok
|
||||
build docs_src/ref/install/spell.ok ../spell.ok
|
||||
build docs_src/ref/intro/spell.ok ../spell.ok
|
||||
build docs_src/ref/java/spell.ok ../spell.ok
|
||||
build docs_src/ref/lock/spell.ok ../spell.ok
|
||||
build docs_src/ref/log/spell.ok ../spell.ok
|
||||
build docs_src/ref/mp/spell.ok ../spell.ok
|
||||
build docs_src/ref/perl/spell.ok ../spell.ok
|
||||
build docs_src/ref/program/spell.ok ../spell.ok
|
||||
build docs_src/ref/refs/spell.ok ../spell.ok
|
||||
build docs_src/ref/rpc/spell.ok ../spell.ok
|
||||
build docs_src/ref/sendmail/spell.ok ../spell.ok
|
||||
build docs_src/ref/simple_tut/spell.ok ../spell.ok
|
||||
build docs_src/ref/tcl/spell.ok ../spell.ok
|
||||
build docs_src/ref/test/spell.ok ../spell.ok
|
||||
build docs_src/ref/transapp/spell.ok ../spell.ok
|
||||
build docs_src/ref/txn/spell.ok ../spell.ok
|
||||
build docs_src/ref/upgrade.2.0/spell.ok ../spell.ok
|
||||
build docs_src/ref/upgrade.3.0/spell.ok ../spell.ok
|
||||
build docs_src/ref/upgrade.3.1/spell.ok ../spell.ok
|
||||
build docs_src/ref/upgrade.3.2/spell.ok ../spell.ok
|
||||
build docs_src/ref/xa/spell.ok ../spell.ok
|
||||
build env/tags ../dist/tags
|
||||
build examples_c/tags ../dist/tags
|
||||
build examples_cxx/tags ../dist/tags
|
||||
build examples_java java/src/com/sleepycat/examples
|
||||
build hash/tags ../dist/tags
|
||||
build hsearch/tags ../dist/tags
|
||||
build include/tags ../dist/tags
|
||||
build libdb_java/tags ../dist/tags
|
||||
build lock/tags ../dist/tags
|
||||
build log/tags ../dist/tags
|
||||
build mp/tags ../dist/tags
|
||||
build mutex/tags ../dist/tags
|
||||
build os/tags ../dist/tags
|
||||
build os_vxworks/tags ../dist/tags
|
||||
build os_win32/tags ../dist/tags
|
||||
build qam/tags ../dist/tags
|
||||
build rpc_client/tags ../dist/tags
|
||||
build rpc_server/tags ../dist/tags
|
||||
build tcl/tags ../dist/tags
|
||||
build txn/tags ../dist/tags
|
||||
build xa/tags ../dist/tags
|
||||
47
bdb/dist/s_tags
vendored
Executable file
47
bdb/dist/s_tags
vendored
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_tags,v 1.5 2000/09/05 21:27:04 bostic Exp $
|
||||
#
|
||||
# Build tags files.
|
||||
|
||||
files="../include/*.h \
|
||||
../include/*.src \
|
||||
../btree/*.[ch] \
|
||||
../clib/*.[ch] \
|
||||
../common/*.[ch] \
|
||||
../db/*.[ch] \
|
||||
../db185/*.[ch] \
|
||||
../dbm/*.[ch] \
|
||||
../env/*.[ch] \
|
||||
../hash/*.[ch] \
|
||||
../hsearch/*.[ch] \
|
||||
../libdb_java/*.[ch] \
|
||||
../lock/*.[ch] \
|
||||
../log/*.[ch] \
|
||||
../mp/*.[ch] \
|
||||
../mutex/*.[ch] \
|
||||
../os/*.[ch] \
|
||||
../qam/*.[ch] \
|
||||
../rpc_client/*.[ch] \
|
||||
../rpc_server/*.[ch] \
|
||||
../tcl/*.[ch] \
|
||||
../txn/*.[ch] \
|
||||
../xa/*.[ch]"
|
||||
|
||||
f=tags
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
|
||||
# Figure out what flags this ctags accepts.
|
||||
flags=""
|
||||
if ctags -d ../db/db.c 2>/dev/null; then
|
||||
flags="-d $flags"
|
||||
fi
|
||||
if ctags -t ../db/db.c 2>/dev/null; then
|
||||
flags="-t $flags"
|
||||
fi
|
||||
if ctags -w ../db/db.c 2>/dev/null; then
|
||||
flags="-w $flags"
|
||||
fi
|
||||
|
||||
ctags $flags $files 2>/dev/null
|
||||
chmod 444 $f
|
||||
53
bdb/dist/s_tcl
vendored
Executable file
53
bdb/dist/s_tcl
vendored
Executable file
|
|
@ -0,0 +1,53 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_tcl,v 1.14 2000/11/09 19:24:07 sue Exp $
|
||||
#
|
||||
# Build the Tcl test files.
|
||||
|
||||
msgshb="# DO NOT EDIT BELOW THIS LINE: automatically built by dist/s_tcl."
|
||||
|
||||
. RELEASE
|
||||
|
||||
f=../test/include.tcl
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
(echo "set tclsh_path @TCL_TCLSH@" && \
|
||||
echo "set tcllib .libs/libdb_tcl-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@SOSUFFIX@" && \
|
||||
echo "set rpc_server localhost" && \
|
||||
echo "set rpc_path ." && \
|
||||
echo "set test_path @srcdir@/../test" && \
|
||||
echo "" && \
|
||||
echo "set KILL \"@db_cv_path_kill@\"" && \
|
||||
echo "" && \
|
||||
echo "$msgshb" && \
|
||||
echo "" && \
|
||||
echo "global dict" && \
|
||||
echo "global testdir" && \
|
||||
echo "global util_path" && \
|
||||
echo "set testdir ./TESTDIR" && \
|
||||
echo "set rpc_testdir \$rpc_path/TESTDIR" && \
|
||||
echo "" && \
|
||||
echo "global is_hp_test" && \
|
||||
echo "global is_qnx_test" && \
|
||||
echo "global is_windows_test") > $f
|
||||
chmod 444 $f
|
||||
|
||||
f=../build_win32/include.tcl
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
(echo "set tclsh_path SET_YOUR_TCLSH_PATH" && \
|
||||
echo "set test_path ../test" && \
|
||||
echo "set tcllib ./Debug/libdb_tcl${DB_VERSION_MAJOR}${DB_VERSION_MINOR}d.dll" && \
|
||||
echo "" && \
|
||||
echo "set KILL ./dbkill.exe" && \
|
||||
echo "" && \
|
||||
echo "$msgshb" && \
|
||||
echo "" && \
|
||||
echo "global dict" && \
|
||||
echo "global testdir" && \
|
||||
echo "global util_path" && \
|
||||
echo "set testdir ./TESTDIR" && \
|
||||
echo "" && \
|
||||
echo "global is_hp_test" && \
|
||||
echo "global is_qnx_test" && \
|
||||
echo "global is_windows_test") > $f
|
||||
chmod 444 $f
|
||||
48
bdb/dist/s_vxworks
vendored
Normal file
48
bdb/dist/s_vxworks
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_vxworks,v 1.3 2000/07/13 18:38:46 bostic Exp $
|
||||
#
|
||||
# Build the VxWorks files.
|
||||
|
||||
msgc="/* DO NOT EDIT: automatically built by dist/s_vxworks. */"
|
||||
|
||||
. RELEASE
|
||||
|
||||
t=/tmp/__db_$$
|
||||
rm -f $t
|
||||
|
||||
trap 'rm -f $t ; exit 1' 1 2 3 13 15
|
||||
|
||||
f=../build_vxworks/db.h
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
cat <<ENDOFSEDTEXT > $t
|
||||
s/@u_int8_decl@/typedef unsigned char u_int8_t;/
|
||||
s/@u_int16_decl@/typedef unsigned short u_int16_t;/
|
||||
s/@u_int32_decl@/typedef unsigned int u_int32_t;/
|
||||
/@int16_decl@/d
|
||||
/@int32_decl@/d
|
||||
/@u_char_decl@/d
|
||||
/@u_short_decl@/d
|
||||
/@u_int_decl@/d
|
||||
/@u_long_decl@/d
|
||||
/@ssize_t_decl@/d
|
||||
s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/
|
||||
s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/
|
||||
s/@DB_VERSION_PATCH@/$DB_VERSION_PATCH/
|
||||
s/@DB_VERSION_STRING@/"$DB_VERSION_STRING"/
|
||||
ENDOFSEDTEXT
|
||||
(echo "$msgc" && sed -f $t ../include/db.src) > $f
|
||||
chmod 444 $f
|
||||
|
||||
f=../build_vxworks/db_int.h
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
cat <<ENDOFSEDTEXT > $t
|
||||
s/\(PATH_SEPARATOR[^"]*"\)\/"/\1\/\\\\\\\\\\"/
|
||||
s/@db_align_t_decl@/typedef unsigned long db_align_t;/
|
||||
s/@db_alignp_t_decl@/typedef unsigned long db_alignp_t;/
|
||||
ENDOFSEDTEXT
|
||||
(echo "$msgc" && sed -f $t ../include/db_int.src) > $f
|
||||
chmod 444 $f
|
||||
|
||||
rm -f $t
|
||||
67
bdb/dist/s_win32
vendored
Executable file
67
bdb/dist/s_win32
vendored
Executable file
|
|
@ -0,0 +1,67 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_win32,v 1.9 2000/09/20 15:29:54 bostic Exp $
|
||||
#
|
||||
# Build Windows/32 include files.
|
||||
|
||||
msgc="/* DO NOT EDIT: automatically built by dist/s_win32. */"
|
||||
|
||||
. RELEASE
|
||||
|
||||
t=/tmp/__db_$$
|
||||
rm -f $t
|
||||
|
||||
trap 'rm -f $t ; exit 1' 1 2 3 13 15
|
||||
|
||||
f=../build_win32/db.h
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
cat <<ENDOFSEDTEXT > $t
|
||||
s/@u_int8_decl@/typedef unsigned char u_int8_t;/
|
||||
s/@int16_decl@/typedef short int16_t;/
|
||||
s/@u_int16_decl@/typedef unsigned short u_int16_t;/
|
||||
s/@int32_decl@/typedef int int32_t;/
|
||||
s/@u_int32_decl@/typedef unsigned int u_int32_t;/
|
||||
/@u_char_decl@/{
|
||||
i\\
|
||||
#if !defined(_WINSOCKAPI_)
|
||||
s/@u_char_decl@/typedef unsigned char u_char;/
|
||||
}
|
||||
s/@u_short_decl@/typedef unsigned short u_short;/
|
||||
s/@u_int_decl@/typedef unsigned int u_int;/
|
||||
/@u_long_decl@/{
|
||||
s/@u_long_decl@/typedef unsigned long u_long;/
|
||||
a\\
|
||||
#endif
|
||||
}
|
||||
s/@ssize_t_decl@/typedef int ssize_t;/
|
||||
s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/
|
||||
s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/
|
||||
s/@DB_VERSION_PATCH@/$DB_VERSION_PATCH/
|
||||
s/@DB_VERSION_STRING@/"$DB_VERSION_STRING"/
|
||||
ENDOFSEDTEXT
|
||||
(echo "$msgc" && sed -f $t ../include/db.src) > $f
|
||||
chmod 444 $f
|
||||
|
||||
f=../build_win32/db_int.h
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
cat <<ENDOFSEDTEXT > $t
|
||||
s/\(PATH_SEPARATOR[^"]*"\)\/"/\1\\\\\\\\\\/:\"/
|
||||
s/@db_align_t_decl@/typedef unsigned long db_align_t;/
|
||||
s/@db_alignp_t_decl@/typedef unsigned long db_alignp_t;/
|
||||
ENDOFSEDTEXT
|
||||
(echo "$msgc" && sed -f $t ../include/db_int.src) > $f
|
||||
chmod 444 $f
|
||||
|
||||
f=../build_win32/libdb.rc
|
||||
echo "Building $f"
|
||||
rm -f $f
|
||||
cat <<ENDOFSEDTEXT > $t
|
||||
s/%MAJOR%/$DB_VERSION_MAJOR/
|
||||
s/%MINOR%/$DB_VERSION_MINOR/
|
||||
s/%PATCH%/$DB_VERSION_PATCH/
|
||||
ENDOFSEDTEXT
|
||||
sed -f $t ../build_win32/libdbrc.src > $f
|
||||
chmod 444 $f
|
||||
|
||||
rm -f $t
|
||||
98
bdb/dist/s_win32_dsp
vendored
Normal file
98
bdb/dist/s_win32_dsp
vendored
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
#!/bin/sh -
|
||||
# $Id: s_win32_dsp,v 1.3 2000/12/02 04:36:47 dda Exp $
|
||||
#
|
||||
# Build Windows/32 .dsp files.
|
||||
|
||||
. RELEASE
|
||||
|
||||
BUILDDIR=../build_win32
|
||||
SRCFILES=srcfiles.in
|
||||
|
||||
create_dsp()
|
||||
{
|
||||
projname="$1" # name of the .dsp file
|
||||
match="$2" # the string used to egrep the $sources file
|
||||
sources="$3" # a modified version of $SRCFILES to facilitate matches
|
||||
dsptemplate="$4" # overall template file for the .dsp
|
||||
srctemplate="$5" # template file for the src file fragments
|
||||
|
||||
dspoutput=$BUILDDIR/$projname.dsp
|
||||
|
||||
echo "Building $dspoutput"
|
||||
rm -f $dspoutput.insert
|
||||
for srcpath in `egrep "$match" $sources | sed -e 's/[ ].*//'`
|
||||
do
|
||||
# take the path name and break it up, converting / to \\.
|
||||
# so many backslashes needed because of shell quoting and
|
||||
# sed quoting -- we'll end up with two backslashes for every
|
||||
# forward slash, but we need that when feeding that to the
|
||||
# later sed command.
|
||||
set - `echo $srcpath | sed -e 's;\(.*\)/;../\\1 ;' \
|
||||
-e 's;../build_win32;.;' \
|
||||
-e 's;/;\\\\\\\\;g'`
|
||||
srcdir="$1"
|
||||
srcfile="$2"
|
||||
sed -e "s/@srcdir@/$srcdir/g" \
|
||||
-e "s/@srcfile@/$srcfile/g" \
|
||||
< $srctemplate >> $dspoutput.insert
|
||||
done
|
||||
sed -e "/@SOURCE_FILES@/r$dspoutput.insert" \
|
||||
-e "/@SOURCE_FILES@/d" \
|
||||
-e "s/@project_name@/$projname/g" \
|
||||
-e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \
|
||||
-e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" \
|
||||
< $dsptemplate > $dspoutput.new
|
||||
rm -f $dspoutput $dspoutput.insert
|
||||
mv $dspoutput.new $dspoutput
|
||||
}
|
||||
|
||||
TMPA=/tmp/swin32dsp$$a
|
||||
trap "rm -f $TMPA; exit 1" 1 2 3 15
|
||||
|
||||
# create a copy of the srcfiles with comments and 'skip' lines removed.
|
||||
# add a space at the end of each list of modules so that each module
|
||||
# can be unambiguously matched e.g. ' dynamic '
|
||||
#
|
||||
sed -e "s/#.*$//" \
|
||||
-e "/^[ ]*$/d" \
|
||||
-e "s/[ ][ ]*/ /" \
|
||||
-e "s/[ ]*$//" \
|
||||
-e "/ skip$/d" \
|
||||
-e "s/$/ /" < $SRCFILES > $TMPA
|
||||
|
||||
# get a list of all modules mentioned
|
||||
#
|
||||
MODULES="`sed -e 's/^[^ ]* //' < $TMPA \
|
||||
| tr ' ' '\012' | sort | uniq`"
|
||||
|
||||
for module in $MODULES
|
||||
do
|
||||
case "$module" in
|
||||
dynamic )
|
||||
create_dsp db_dll " $module " $TMPA \
|
||||
$BUILDDIR/dynamic_dsp.src $BUILDDIR/srcfile_dsp.src
|
||||
;;
|
||||
java )
|
||||
create_dsp db_java " $module " $TMPA \
|
||||
$BUILDDIR/java_dsp.src $BUILDDIR/srcfile_dsp.src
|
||||
;;
|
||||
tcl )
|
||||
create_dsp db_tcl " $module " $TMPA \
|
||||
$BUILDDIR/tcl_dsp.src $BUILDDIR/srcfile_dsp.src
|
||||
;;
|
||||
static )
|
||||
create_dsp db_static " $module " $TMPA \
|
||||
$BUILDDIR/static_dsp.src $BUILDDIR/srcfile_dsp.src
|
||||
;;
|
||||
app=* )
|
||||
appname=`echo $module | sed -e 's/^app=//'`
|
||||
create_dsp $appname " $module " $TMPA \
|
||||
$BUILDDIR/app_dsp.src $BUILDDIR/srcfile_dsp.src
|
||||
;;
|
||||
* )
|
||||
echo "s_win32_dsp: module name $module in $SRCFILES is unknown type"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
rm -f $TMPA
|
||||
269
bdb/dist/srcfiles.in
vendored
Normal file
269
bdb/dist/srcfiles.in
vendored
Normal file
|
|
@ -0,0 +1,269 @@
|
|||
# $Id: srcfiles.in,v 1.7 2000/11/30 18:42:21 dda Exp $
|
||||
#
|
||||
# This is an input file for the s_win32_dsp script. It describes every
|
||||
# source files used by Windows, and lists those that aren't as well,
|
||||
# as a completeness sanity check.
|
||||
#
|
||||
# Please keep this list sorted alphabetically!
|
||||
#
|
||||
# Each non-blank, non-comment line is of the form
|
||||
# filename module [ module ...]
|
||||
#
|
||||
# The possible modules, including the name of the project (.dsp) file:
|
||||
#
|
||||
# app=NAME this is linked into application NAME.exe (db_NAME.dsp)
|
||||
# dynamic file appears in the DLL (db_dll.dsp)
|
||||
# java file appears in the java DLL (db_java.dsp)
|
||||
# skip this file is not used by Windows
|
||||
# static file appears in the static library (db_static.dsp)
|
||||
# tcl file appears in the tcl DLL (db_tcl.dsp)
|
||||
|
||||
btree/bt_compare.c dynamic static
|
||||
btree/bt_conv.c dynamic static
|
||||
btree/bt_curadj.c dynamic static
|
||||
btree/bt_cursor.c dynamic static
|
||||
btree/bt_delete.c dynamic static
|
||||
btree/bt_method.c dynamic static
|
||||
btree/bt_open.c dynamic static
|
||||
btree/bt_put.c dynamic static
|
||||
btree/bt_rec.c dynamic static
|
||||
btree/bt_reclaim.c dynamic static
|
||||
btree/bt_recno.c dynamic static
|
||||
btree/bt_rsearch.c dynamic static
|
||||
btree/bt_search.c dynamic static
|
||||
btree/bt_split.c dynamic static
|
||||
btree/bt_stat.c dynamic static
|
||||
btree/bt_upgrade.c dynamic static
|
||||
btree/bt_verify.c dynamic static
|
||||
btree/btree_auto.c dynamic static
|
||||
build_win32/dbkill.cpp skip
|
||||
build_win32/dllmain.c dynamic
|
||||
build_win32/libdb.def dynamic
|
||||
build_win32/libdb.rc dynamic
|
||||
build_win32/libdb_tcl.def tcl
|
||||
clib/getcwd.c skip
|
||||
clib/getopt.c skip # must be linked into each app
|
||||
clib/memcmp.c skip
|
||||
clib/memmove.c skip
|
||||
clib/raise.c skip
|
||||
clib/snprintf.c skip
|
||||
clib/strcasecmp.c dynamic static
|
||||
clib/strerror.c skip
|
||||
clib/vsnprintf.c skip
|
||||
common/db_byteorder.c dynamic static
|
||||
common/db_err.c dynamic static
|
||||
common/db_getlong.c dynamic static
|
||||
common/db_log2.c dynamic static
|
||||
common/util_log.c dynamic static
|
||||
common/util_sig.c dynamic static
|
||||
cxx/cxx_app.cpp dynamic static
|
||||
cxx/cxx_except.cpp dynamic static
|
||||
cxx/cxx_lock.cpp dynamic static
|
||||
cxx/cxx_log.cpp dynamic static
|
||||
cxx/cxx_mpool.cpp dynamic static
|
||||
cxx/cxx_table.cpp dynamic static
|
||||
cxx/cxx_txn.cpp dynamic static
|
||||
db/crdel_auto.c dynamic static
|
||||
db/crdel_rec.c dynamic static
|
||||
db/db.c dynamic static
|
||||
db/db_am.c dynamic static
|
||||
db/db_auto.c dynamic static
|
||||
db/db_cam.c dynamic static
|
||||
db/db_conv.c dynamic static
|
||||
db/db_dispatch.c dynamic static
|
||||
db/db_dup.c dynamic static
|
||||
db/db_iface.c dynamic static
|
||||
db/db_join.c dynamic static
|
||||
db/db_meta.c dynamic static
|
||||
db/db_method.c dynamic static
|
||||
db/db_overflow.c dynamic static
|
||||
db/db_pr.c dynamic static
|
||||
db/db_rec.c dynamic static
|
||||
db/db_reclaim.c dynamic static
|
||||
db/db_ret.c dynamic static
|
||||
db/db_upg.c dynamic static
|
||||
db/db_upg_opd.c dynamic static
|
||||
db/db_vrfy.c dynamic static
|
||||
db/db_vrfyutil.c dynamic static
|
||||
db185/db185.c skip
|
||||
db_archive/db_archive.c app=db_archive
|
||||
db_checkpoint/db_checkpoint.c app=db_checkpoint
|
||||
db_deadlock/db_deadlock.c app=db_deadlock
|
||||
db_dump/db_dump.c app=db_dump
|
||||
db_dump185/db_dump185.c skip
|
||||
db_load/db_load.c app=db_load
|
||||
db_printlog/db_printlog.c app=db_printlog
|
||||
db_recover/db_recover.c app=db_recover
|
||||
db_stat/db_stat.c app=db_stat
|
||||
db_upgrade/db_upgrade.c app=db_upgrade
|
||||
db_verify/db_verify.c app=db_verify
|
||||
dbm/dbm.c dynamic static
|
||||
env/db_salloc.c dynamic static
|
||||
env/db_shash.c dynamic static
|
||||
env/env_method.c dynamic static
|
||||
env/env_open.c dynamic static
|
||||
env/env_recover.c dynamic static
|
||||
env/env_region.c dynamic static
|
||||
examples_c/ex_access.c app=ex_access
|
||||
examples_c/ex_btrec.c app=ex_btrec
|
||||
examples_c/ex_dbclient.c skip
|
||||
examples_c/ex_env.c app=ex_env
|
||||
examples_c/ex_lock.c app=ex_lock
|
||||
examples_c/ex_mpool.c app=ex_mpool
|
||||
examples_c/ex_thread.c skip
|
||||
examples_c/ex_tpcb.c app=ex_tpcb
|
||||
examples_cxx/AccessExample.cpp app=excxx_access
|
||||
examples_cxx/BtRecExample.cpp app=excxx_btrec
|
||||
examples_cxx/EnvExample.cpp app=excxx_env
|
||||
examples_cxx/LockExample.cpp app=excxx_lock
|
||||
examples_cxx/MpoolExample.cpp app=excxx_mpool
|
||||
examples_cxx/TpcbExample.cpp app=excxx_tpcb
|
||||
hash/hash.c dynamic static
|
||||
hash/hash_auto.c dynamic static
|
||||
hash/hash_conv.c dynamic static
|
||||
hash/hash_dup.c dynamic static
|
||||
hash/hash_func.c dynamic static
|
||||
hash/hash_meta.c dynamic static
|
||||
hash/hash_method.c dynamic static
|
||||
hash/hash_page.c dynamic static
|
||||
hash/hash_rec.c dynamic static
|
||||
hash/hash_reclaim.c dynamic static
|
||||
hash/hash_stat.c dynamic static
|
||||
hash/hash_upgrade.c dynamic static
|
||||
hash/hash_verify.c dynamic static
|
||||
hsearch/hsearch.c dynamic static
|
||||
libdb_java/java_Db.c java
|
||||
libdb_java/java_DbEnv.c java
|
||||
libdb_java/java_DbLock.c java
|
||||
libdb_java/java_DbLsn.c java
|
||||
libdb_java/java_DbTxn.c java
|
||||
libdb_java/java_Dbc.c java
|
||||
libdb_java/java_Dbt.c java
|
||||
libdb_java/java_info.c java
|
||||
libdb_java/java_locked.c java
|
||||
libdb_java/java_util.c java
|
||||
lock/lock.c dynamic static
|
||||
lock/lock_conflict.c dynamic static
|
||||
lock/lock_deadlock.c dynamic static
|
||||
lock/lock_method.c dynamic static
|
||||
lock/lock_region.c dynamic static
|
||||
lock/lock_stat.c dynamic static
|
||||
lock/lock_util.c dynamic static
|
||||
log/log.c dynamic static
|
||||
log/log_archive.c dynamic static
|
||||
log/log_auto.c dynamic static
|
||||
log/log_compare.c dynamic static
|
||||
log/log_findckp.c dynamic static
|
||||
log/log_get.c dynamic static
|
||||
log/log_method.c dynamic static
|
||||
log/log_put.c dynamic static
|
||||
log/log_rec.c dynamic static
|
||||
log/log_register.c dynamic static
|
||||
mp/mp_alloc.c dynamic static
|
||||
mp/mp_bh.c dynamic static
|
||||
mp/mp_fget.c dynamic static
|
||||
mp/mp_fopen.c dynamic static
|
||||
mp/mp_fput.c dynamic static
|
||||
mp/mp_fset.c dynamic static
|
||||
mp/mp_method.c dynamic static
|
||||
mp/mp_region.c dynamic static
|
||||
mp/mp_register.c dynamic static
|
||||
mp/mp_stat.c dynamic static
|
||||
mp/mp_sync.c dynamic static
|
||||
mp/mp_trickle.c dynamic static
|
||||
mutex/mut_fcntl.c skip
|
||||
mutex/mut_pthread.c skip
|
||||
mutex/mut_tas.c dynamic static
|
||||
mutex/mutex.c dynamic static
|
||||
os/os_abs.c skip
|
||||
os/os_alloc.c dynamic static
|
||||
os/os_dir.c skip
|
||||
os/os_errno.c skip
|
||||
os/os_fid.c skip
|
||||
os/os_finit.c skip
|
||||
os/os_fsync.c dynamic static
|
||||
os/os_handle.c dynamic static
|
||||
os/os_map.c skip
|
||||
os/os_method.c dynamic static
|
||||
os/os_oflags.c dynamic static
|
||||
os/os_open.c skip
|
||||
os/os_region.c dynamic static
|
||||
os/os_rename.c skip
|
||||
os/os_root.c dynamic static
|
||||
os/os_rpath.c dynamic static
|
||||
os/os_rw.c dynamic static
|
||||
os/os_seek.c skip
|
||||
os/os_sleep.c skip
|
||||
os/os_spin.c skip
|
||||
os/os_stat.c dynamic static
|
||||
os/os_tmpdir.c dynamic static
|
||||
os/os_unlink.c dynamic static
|
||||
os_vxworks/os_abs.c skip
|
||||
os_vxworks/os_finit.c skip
|
||||
os_vxworks/os_map.c skip
|
||||
os_win32/os_abs.c dynamic static
|
||||
os_win32/os_dir.c dynamic static
|
||||
os_win32/os_errno.c dynamic static
|
||||
os_win32/os_fid.c dynamic static
|
||||
os_win32/os_finit.c dynamic static
|
||||
os_win32/os_map.c dynamic static
|
||||
os_win32/os_open.c dynamic static
|
||||
os_win32/os_rename.c dynamic static
|
||||
os_win32/os_seek.c dynamic static
|
||||
os_win32/os_sleep.c dynamic static
|
||||
os_win32/os_spin.c dynamic static
|
||||
os_win32/os_type.c dynamic static
|
||||
qam/qam.c dynamic static
|
||||
qam/qam_auto.c dynamic static
|
||||
qam/qam_conv.c dynamic static
|
||||
qam/qam_files.c dynamic static
|
||||
qam/qam_method.c dynamic static
|
||||
qam/qam_open.c dynamic static
|
||||
qam/qam_rec.c dynamic static
|
||||
qam/qam_stat.c dynamic static
|
||||
qam/qam_upgrade.c dynamic static
|
||||
qam/qam_verify.c dynamic static
|
||||
rpc_client/client.c skip
|
||||
rpc_client/db_server_clnt.c skip
|
||||
rpc_client/gen_client.c skip
|
||||
rpc_client/gen_client_ret.c skip
|
||||
rpc_server/db_server_proc.c skip
|
||||
rpc_server/db_server_svc.c skip
|
||||
rpc_server/db_server_util.c skip
|
||||
rpc_server/db_server_xdr.c skip
|
||||
rpc_server/gen_db_server.c skip
|
||||
tcl/tcl_compat.c tcl
|
||||
tcl/tcl_db.c tcl
|
||||
tcl/tcl_db_pkg.c tcl
|
||||
tcl/tcl_dbcursor.c tcl
|
||||
tcl/tcl_env.c tcl
|
||||
tcl/tcl_internal.c tcl
|
||||
tcl/tcl_lock.c tcl
|
||||
tcl/tcl_log.c tcl
|
||||
tcl/tcl_mp.c tcl
|
||||
tcl/tcl_txn.c tcl
|
||||
test_server/dbs.c skip
|
||||
test_server/dbs_am.c skip
|
||||
test_server/dbs_checkpoint.c skip
|
||||
test_server/dbs_debug.c skip
|
||||
test_server/dbs_handles.c skip
|
||||
test_server/dbs_log.c skip
|
||||
test_server/dbs_qam.c skip
|
||||
test_server/dbs_spawn.c skip
|
||||
test_server/dbs_trickle.c skip
|
||||
test_server/dbs_util.c skip
|
||||
test_server/dbs_yield.c skip
|
||||
test_thread/lock.c skip
|
||||
test_thread/log.c skip
|
||||
test_thread/mpool.c skip
|
||||
test_thread/mutex.c skip
|
||||
test_vxworks/vx_mutex.c skip
|
||||
test_vxworks/vxtpcb_files.c skip
|
||||
test_vxworks/vxtpcb_onefile.c skip
|
||||
txn/txn.c dynamic static
|
||||
txn/txn_auto.c dynamic static
|
||||
txn/txn_rec.c dynamic static
|
||||
txn/txn_region.c dynamic static
|
||||
xa/xa.c dynamic static
|
||||
xa/xa_db.c dynamic static
|
||||
xa/xa_map.c dynamic static
|
||||
1057
bdb/dist/template/db_server_proc
vendored
Normal file
1057
bdb/dist/template/db_server_proc
vendored
Normal file
File diff suppressed because it is too large
Load diff
522
bdb/dist/template/gen_client_ret
vendored
Normal file
522
bdb/dist/template/gen_client_ret
vendored
Normal file
|
|
@ -0,0 +1,522 @@
|
|||
/* Do not edit: automatically built by gen_rpc.awk. */
|
||||
#include "db_config.h"
|
||||
|
||||
#ifdef HAVE_RPC
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
#include <rpc/rpc.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include "db_server.h"
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "db_ext.h"
|
||||
#include "txn.h"
|
||||
|
||||
#include "gen_client_ext.h"
|
||||
|
||||
int
|
||||
__dbcl_env_close_ret(dbenv, flags, replyp)
|
||||
DB_ENV * dbenv;
|
||||
u_int32_t flags;
|
||||
__env_close_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_env_open_ret(dbenv, home, flags, mode, replyp)
|
||||
DB_ENV * dbenv;
|
||||
const char * home;
|
||||
u_int32_t flags;
|
||||
int mode;
|
||||
__env_open_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_env_remove_ret(dbenv, home, flags, replyp)
|
||||
DB_ENV * dbenv;
|
||||
const char * home;
|
||||
u_int32_t flags;
|
||||
__env_remove_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_txn_abort_ret(txnp, replyp)
|
||||
DB_TXN * txnp;
|
||||
__txn_abort_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_txn_begin_ret(envp, parent, txnpp, flags, replyp)
|
||||
DB_ENV * envp;
|
||||
DB_TXN * parent;
|
||||
DB_TXN ** txnpp;
|
||||
u_int32_t flags;
|
||||
__txn_begin_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
long txnid;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
txnid = replyp->txnidcl_id;
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_txn_commit_ret(txnp, flags, replyp)
|
||||
DB_TXN * txnp;
|
||||
u_int32_t flags;
|
||||
__txn_commit_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_db_close_ret(dbp, flags, replyp)
|
||||
DB * dbp;
|
||||
u_int32_t flags;
|
||||
__db_close_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_db_get_ret(dbp, txnp, key, data, flags, replyp)
|
||||
DB * dbp;
|
||||
DB_TXN * txnp;
|
||||
DBT * key;
|
||||
DBT * data;
|
||||
u_int32_t flags;
|
||||
__db_get_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
/* DBT key; */
|
||||
/* DBT data; */
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
/* Handle replyp->keydata; */
|
||||
/* Handle replyp->datadata; */
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_db_key_range_ret(dbp, txnp, key, range, flags, replyp)
|
||||
DB * dbp;
|
||||
DB_TXN * txnp;
|
||||
DBT * key;
|
||||
DB_KEY_RANGE * range;
|
||||
u_int32_t flags;
|
||||
__db_key_range_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
double less;
|
||||
double equal;
|
||||
double greater;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
less = replyp->less;
|
||||
equal = replyp->equal;
|
||||
greater = replyp->greater;
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_db_open_ret(dbp, name, subdb, type, flags, mode, replyp)
|
||||
DB * dbp;
|
||||
const char * name;
|
||||
const char * subdb;
|
||||
DBTYPE type;
|
||||
u_int32_t flags;
|
||||
int mode;
|
||||
__db_open_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
DBTYPE type;
|
||||
u_int32_t dbflags;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
type = replyp->type;
|
||||
dbflags = replyp->dbflags;
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_db_put_ret(dbp, txnp, key, data, flags, replyp)
|
||||
DB * dbp;
|
||||
DB_TXN * txnp;
|
||||
DBT * key;
|
||||
DBT * data;
|
||||
u_int32_t flags;
|
||||
__db_put_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
/* DBT key; */
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
/* Handle replyp->keydata; */
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_db_remove_ret(dbp, name, subdb, flags, replyp)
|
||||
DB * dbp;
|
||||
const char * name;
|
||||
const char * subdb;
|
||||
u_int32_t flags;
|
||||
__db_remove_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_db_rename_ret(dbp, name, subdb, newname, flags, replyp)
|
||||
DB * dbp;
|
||||
const char * name;
|
||||
const char * subdb;
|
||||
const char * newname;
|
||||
u_int32_t flags;
|
||||
__db_rename_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int __db_db_stat_statsreplist __P((__db_stat_statsreplist, u_int32_t **));
|
||||
void __db_db_stat_statsfree __P((u_int32_t *));
|
||||
|
||||
int
|
||||
__dbcl_db_stat_ret(dbp, sp, func0, flags, replyp)
|
||||
DB * dbp;
|
||||
void * sp;
|
||||
void *(*func0) __P((size_t));
|
||||
u_int32_t flags;
|
||||
__db_stat_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
u_int32_t *__db_statslist;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
if ((ret = __db_db_stat_statslist(replyp->statslist, &__db_statslist)) != 0)
|
||||
return (ret);
|
||||
|
||||
/*
|
||||
* XXX Handle list
|
||||
*/
|
||||
|
||||
__db_db_stat_statsfree(__db_statslist);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__db_db_stat_statsreplist(locp, ppp)
|
||||
__db_stat_statsreplist *locp;
|
||||
u_int32_t **ppp;
|
||||
{
|
||||
u_int32_t *pp;
|
||||
int cnt, ret, size;
|
||||
__db_stat_statsreplist *nl;
|
||||
|
||||
for (cnt = 0, nl = locp; nl != NULL; cnt++, nl = nl->next)
|
||||
;
|
||||
|
||||
if (cnt == 0) {
|
||||
*ppp = NULL;
|
||||
return (0);
|
||||
}
|
||||
size = sizeof(*pp) * cnt;
|
||||
if ((ret = __os_malloc(NULL, size, NULL, ppp)) != 0)
|
||||
return (ret);
|
||||
memset(*ppp, 0, size);
|
||||
for (pp = *ppp, nl = locp; nl != NULL; nl = nl->next, pp++) {
|
||||
*pp = *(u_int32_t *)nl->ent.ent_val;
|
||||
}
|
||||
return (0);
|
||||
out:
|
||||
__db_db_stat_statsfree(*ppp);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void
|
||||
__db_db_stat_statsfree(pp)
|
||||
u_int32_t *pp;
|
||||
{
|
||||
size_t size;
|
||||
u_int32_t *p;
|
||||
|
||||
if (pp == NULL)
|
||||
return;
|
||||
size = sizeof(*p);
|
||||
for (p = pp; *p != 0; p++) {
|
||||
size += sizeof(*p);
|
||||
}
|
||||
__os_free(pp, size);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_db_cursor_ret(dbp, txnp, dbcpp, flags, replyp)
|
||||
DB * dbp;
|
||||
DB_TXN * txnp;
|
||||
DBC ** dbcpp;
|
||||
u_int32_t flags;
|
||||
__db_cursor_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
long dbcid;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
dbcid = replyp->dbcidcl_id;
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp)
|
||||
DB * dbp;
|
||||
DBC ** curs;
|
||||
DBC ** dbcp;
|
||||
u_int32_t flags;
|
||||
__db_join_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
long dbcid;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
dbcid = replyp->dbcidcl_id;
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_dbc_close_ret(dbc, replyp)
|
||||
DBC * dbc;
|
||||
__dbc_close_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_dbc_count_ret(dbc, countp, flags, replyp)
|
||||
DBC * dbc;
|
||||
db_recno_t * countp;
|
||||
u_int32_t flags;
|
||||
__dbc_count_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
db_recno_t dupcount;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
dupcount = replyp->dupcount;
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp)
|
||||
DBC * dbc;
|
||||
DBC ** dbcp;
|
||||
u_int32_t flags;
|
||||
__dbc_dup_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
long dbcid;
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
dbcid = replyp->dbcidcl_id;
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_dbc_get_ret(dbc, key, data, flags, replyp)
|
||||
DBC * dbc;
|
||||
DBT * key;
|
||||
DBT * data;
|
||||
u_int32_t flags;
|
||||
__dbc_get_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
/* DBT key; */
|
||||
/* DBT data; */
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
/* Handle replyp->keydata; */
|
||||
/* Handle replyp->datadata; */
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
int
|
||||
__dbcl_dbc_put_ret(dbc, key, data, flags, replyp)
|
||||
DBC * dbc;
|
||||
DBT * key;
|
||||
DBT * data;
|
||||
u_int32_t flags;
|
||||
__dbc_put_reply *replyp;
|
||||
{
|
||||
int ret;
|
||||
/* DBT key; */
|
||||
|
||||
if (replyp->status != 0)
|
||||
return (replyp->status);
|
||||
/* Handle replyp->keydata; */
|
||||
|
||||
/*
|
||||
* XXX Code goes here
|
||||
*/
|
||||
|
||||
return (replyp->status);
|
||||
}
|
||||
|
||||
#endif /* HAVE_RPC */
|
||||
943
bdb/dist/template/rec_btree
vendored
Normal file
943
bdb/dist/template/rec_btree
vendored
Normal file
|
|
@ -0,0 +1,943 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "bam.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __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;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_pg_alloc_print);
|
||||
REC_INTRO(__bam_pg_alloc_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_pg_alloc1_recover --
|
||||
* Recovery function for pg_alloc1.
|
||||
*
|
||||
* PUBLIC: int __bam_pg_alloc1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_pg_alloc1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_pg_alloc1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_pg_alloc1_print);
|
||||
REC_INTRO(__bam_pg_alloc1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __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;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_pg_free_print);
|
||||
REC_INTRO(__bam_pg_free_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_pg_free1_recover --
|
||||
* Recovery function for pg_free1.
|
||||
*
|
||||
* PUBLIC: int __bam_pg_free1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_pg_free1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_pg_free1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_pg_free1_print);
|
||||
REC_INTRO(__bam_pg_free1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_split1_recover --
|
||||
* Recovery function for split1.
|
||||
*
|
||||
* PUBLIC: int __bam_split1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_split1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_split1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_split1_print);
|
||||
REC_INTRO(__bam_split1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_split_recover --
|
||||
* Recovery function for split.
|
||||
*
|
||||
* PUBLIC: int __bam_split_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_split_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_split_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_split_print);
|
||||
REC_INTRO(__bam_split_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_rsplit1_recover --
|
||||
* Recovery function for rsplit1.
|
||||
*
|
||||
* PUBLIC: int __bam_rsplit1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_rsplit1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_rsplit1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_rsplit1_print);
|
||||
REC_INTRO(__bam_rsplit1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_rsplit_recover --
|
||||
* Recovery function for rsplit.
|
||||
*
|
||||
* PUBLIC: int __bam_rsplit_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_rsplit_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_rsplit_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_rsplit_print);
|
||||
REC_INTRO(__bam_rsplit_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_adj_recover --
|
||||
* Recovery function for adj.
|
||||
*
|
||||
* PUBLIC: int __bam_adj_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_adj_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_adj_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_adj_print);
|
||||
REC_INTRO(__bam_adj_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_cadjust_recover --
|
||||
* Recovery function for cadjust.
|
||||
*
|
||||
* PUBLIC: int __bam_cadjust_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_cadjust_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_cadjust_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_cadjust_print);
|
||||
REC_INTRO(__bam_cadjust_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_cdel_recover --
|
||||
* Recovery function for cdel.
|
||||
*
|
||||
* PUBLIC: int __bam_cdel_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_cdel_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_cdel_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_cdel_print);
|
||||
REC_INTRO(__bam_cdel_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_repl_recover --
|
||||
* Recovery function for repl.
|
||||
*
|
||||
* PUBLIC: int __bam_repl_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_repl_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_repl_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_repl_print);
|
||||
REC_INTRO(__bam_repl_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_root_recover --
|
||||
* Recovery function for root.
|
||||
*
|
||||
* PUBLIC: int __bam_root_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_root_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_root_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_root_print);
|
||||
REC_INTRO(__bam_root_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_curadj_recover --
|
||||
* Recovery function for curadj.
|
||||
*
|
||||
* PUBLIC: int __bam_curadj_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_curadj_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_curadj_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_curadj_print);
|
||||
REC_INTRO(__bam_curadj_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_rcuradj_recover --
|
||||
* Recovery function for rcuradj.
|
||||
*
|
||||
* PUBLIC: int __bam_rcuradj_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_rcuradj_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_rcuradj_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_rcuradj_print);
|
||||
REC_INTRO(__bam_rcuradj_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
385
bdb/dist/template/rec_crdel
vendored
Normal file
385
bdb/dist/template/rec_crdel
vendored
Normal file
|
|
@ -0,0 +1,385 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "crdel.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __crdel_fileopen_recover --
|
||||
* Recovery function for fileopen.
|
||||
*
|
||||
* PUBLIC: int __crdel_fileopen_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_fileopen_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_fileopen_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_fileopen_print);
|
||||
REC_INTRO(__crdel_fileopen_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_metasub_recover --
|
||||
* Recovery function for metasub.
|
||||
*
|
||||
* PUBLIC: int __crdel_metasub_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_metasub_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_metasub_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_metasub_print);
|
||||
REC_INTRO(__crdel_metasub_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_metapage_recover --
|
||||
* Recovery function for metapage.
|
||||
*
|
||||
* PUBLIC: int __crdel_metapage_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_metapage_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_metapage_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_metapage_print);
|
||||
REC_INTRO(__crdel_metapage_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_old_delete_recover --
|
||||
* Recovery function for old_delete.
|
||||
*
|
||||
* PUBLIC: int __crdel_old_delete_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_old_delete_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_old_delete_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_old_delete_print);
|
||||
REC_INTRO(__crdel_old_delete_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_rename_recover --
|
||||
* Recovery function for rename.
|
||||
*
|
||||
* PUBLIC: int __crdel_rename_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_rename_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_rename_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_rename_print);
|
||||
REC_INTRO(__crdel_rename_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_delete_recover --
|
||||
* Recovery function for delete.
|
||||
*
|
||||
* PUBLIC: int __crdel_delete_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_delete_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_delete_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_delete_print);
|
||||
REC_INTRO(__crdel_delete_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
509
bdb/dist/template/rec_db
vendored
Normal file
509
bdb/dist/template/rec_db
vendored
Normal file
|
|
@ -0,0 +1,509 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "db.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __db_addrem_recover --
|
||||
* Recovery function for addrem.
|
||||
*
|
||||
* PUBLIC: int __db_addrem_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_addrem_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_addrem_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_addrem_print);
|
||||
REC_INTRO(__db_addrem_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_split_recover --
|
||||
* Recovery function for split.
|
||||
*
|
||||
* PUBLIC: int __db_split_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_split_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_split_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_split_print);
|
||||
REC_INTRO(__db_split_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_big_recover --
|
||||
* Recovery function for big.
|
||||
*
|
||||
* PUBLIC: int __db_big_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_big_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_big_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_big_print);
|
||||
REC_INTRO(__db_big_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_ovref_recover --
|
||||
* Recovery function for ovref.
|
||||
*
|
||||
* PUBLIC: int __db_ovref_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_ovref_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_ovref_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_ovref_print);
|
||||
REC_INTRO(__db_ovref_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_relink_recover --
|
||||
* Recovery function for relink.
|
||||
*
|
||||
* PUBLIC: int __db_relink_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_relink_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_relink_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_relink_print);
|
||||
REC_INTRO(__db_relink_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_addpage_recover --
|
||||
* Recovery function for addpage.
|
||||
*
|
||||
* PUBLIC: int __db_addpage_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_addpage_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_addpage_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_addpage_print);
|
||||
REC_INTRO(__db_addpage_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_debug_recover --
|
||||
* Recovery function for debug.
|
||||
*
|
||||
* PUBLIC: int __db_debug_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_debug_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_debug_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_debug_print);
|
||||
REC_INTRO(__db_debug_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_noop_recover --
|
||||
* Recovery function for noop.
|
||||
*
|
||||
* PUBLIC: int __db_noop_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_noop_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_noop_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_noop_print);
|
||||
REC_INTRO(__db_noop_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
881
bdb/dist/template/rec_hash
vendored
Normal file
881
bdb/dist/template/rec_hash
vendored
Normal file
|
|
@ -0,0 +1,881 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "ham.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __ham_insdel_recover --
|
||||
* Recovery function for insdel.
|
||||
*
|
||||
* PUBLIC: int __ham_insdel_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_insdel_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_insdel_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_insdel_print);
|
||||
REC_INTRO(__ham_insdel_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_newpage_recover --
|
||||
* Recovery function for newpage.
|
||||
*
|
||||
* PUBLIC: int __ham_newpage_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_newpage_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_newpage_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_newpage_print);
|
||||
REC_INTRO(__ham_newpage_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_splitmeta_recover --
|
||||
* Recovery function for splitmeta.
|
||||
*
|
||||
* PUBLIC: int __ham_splitmeta_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_splitmeta_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_splitmeta_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_splitmeta_print);
|
||||
REC_INTRO(__ham_splitmeta_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_splitdata_recover --
|
||||
* Recovery function for splitdata.
|
||||
*
|
||||
* PUBLIC: int __ham_splitdata_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_splitdata_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_splitdata_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_splitdata_print);
|
||||
REC_INTRO(__ham_splitdata_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_replace_recover --
|
||||
* Recovery function for replace.
|
||||
*
|
||||
* PUBLIC: int __ham_replace_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_replace_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_replace_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_replace_print);
|
||||
REC_INTRO(__ham_replace_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_newpgno_recover --
|
||||
* Recovery function for newpgno.
|
||||
*
|
||||
* PUBLIC: int __ham_newpgno_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_newpgno_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_newpgno_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_newpgno_print);
|
||||
REC_INTRO(__ham_newpgno_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_ovfl_recover --
|
||||
* Recovery function for ovfl.
|
||||
*
|
||||
* PUBLIC: int __ham_ovfl_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_ovfl_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_ovfl_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_ovfl_print);
|
||||
REC_INTRO(__ham_ovfl_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_copypage_recover --
|
||||
* Recovery function for copypage.
|
||||
*
|
||||
* PUBLIC: int __ham_copypage_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_copypage_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_copypage_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_copypage_print);
|
||||
REC_INTRO(__ham_copypage_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_metagroup_recover --
|
||||
* Recovery function for metagroup.
|
||||
*
|
||||
* PUBLIC: int __ham_metagroup_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_metagroup_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_metagroup_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_metagroup_print);
|
||||
REC_INTRO(__ham_metagroup_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_groupalloc1_recover --
|
||||
* Recovery function for groupalloc1.
|
||||
*
|
||||
* PUBLIC: int __ham_groupalloc1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_groupalloc1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_groupalloc1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_groupalloc1_print);
|
||||
REC_INTRO(__ham_groupalloc1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_groupalloc2_recover --
|
||||
* Recovery function for groupalloc2.
|
||||
*
|
||||
* PUBLIC: int __ham_groupalloc2_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_groupalloc2_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_groupalloc2_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_groupalloc2_print);
|
||||
REC_INTRO(__ham_groupalloc2_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_groupalloc_recover --
|
||||
* Recovery function for groupalloc.
|
||||
*
|
||||
* PUBLIC: int __ham_groupalloc_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_groupalloc_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_groupalloc_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_groupalloc_print);
|
||||
REC_INTRO(__ham_groupalloc_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_curadj_recover --
|
||||
* Recovery function for curadj.
|
||||
*
|
||||
* PUBLIC: int __ham_curadj_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_curadj_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_curadj_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_curadj_print);
|
||||
REC_INTRO(__ham_curadj_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_chgpg_recover --
|
||||
* Recovery function for chgpg.
|
||||
*
|
||||
* PUBLIC: int __ham_chgpg_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_chgpg_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_chgpg_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_chgpg_print);
|
||||
REC_INTRO(__ham_chgpg_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
137
bdb/dist/template/rec_log
vendored
Normal file
137
bdb/dist/template/rec_log
vendored
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "log.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __log_register1_recover --
|
||||
* Recovery function for register1.
|
||||
*
|
||||
* PUBLIC: int __log_register1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__log_register1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__log_register1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__log_register1_print);
|
||||
REC_INTRO(__log_register1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __log_register_recover --
|
||||
* Recovery function for register.
|
||||
*
|
||||
* PUBLIC: int __log_register_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__log_register_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__log_register_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__log_register_print);
|
||||
REC_INTRO(__log_register_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
509
bdb/dist/template/rec_qam
vendored
Normal file
509
bdb/dist/template/rec_qam
vendored
Normal file
|
|
@ -0,0 +1,509 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "qam.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __qam_inc_recover --
|
||||
* Recovery function for inc.
|
||||
*
|
||||
* PUBLIC: int __qam_inc_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_inc_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_inc_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_inc_print);
|
||||
REC_INTRO(__qam_inc_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_incfirst_recover --
|
||||
* Recovery function for incfirst.
|
||||
*
|
||||
* PUBLIC: int __qam_incfirst_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_incfirst_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_incfirst_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_incfirst_print);
|
||||
REC_INTRO(__qam_incfirst_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_mvptr_recover --
|
||||
* Recovery function for mvptr.
|
||||
*
|
||||
* PUBLIC: int __qam_mvptr_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_mvptr_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_mvptr_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_mvptr_print);
|
||||
REC_INTRO(__qam_mvptr_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_del_recover --
|
||||
* Recovery function for del.
|
||||
*
|
||||
* PUBLIC: int __qam_del_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_del_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_del_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_del_print);
|
||||
REC_INTRO(__qam_del_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_add_recover --
|
||||
* Recovery function for add.
|
||||
*
|
||||
* PUBLIC: int __qam_add_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_add_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_add_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_add_print);
|
||||
REC_INTRO(__qam_add_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_delete_recover --
|
||||
* Recovery function for delete.
|
||||
*
|
||||
* PUBLIC: int __qam_delete_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_delete_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_delete_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_delete_print);
|
||||
REC_INTRO(__qam_delete_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_rename_recover --
|
||||
* Recovery function for rename.
|
||||
*
|
||||
* PUBLIC: int __qam_rename_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_rename_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_rename_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_rename_print);
|
||||
REC_INTRO(__qam_rename_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_delext_recover --
|
||||
* Recovery function for delext.
|
||||
*
|
||||
* PUBLIC: int __qam_delext_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_delext_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_delext_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_delext_print);
|
||||
REC_INTRO(__qam_delext_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
509
bdb/dist/template/rec_txn
vendored
Normal file
509
bdb/dist/template/rec_txn
vendored
Normal file
|
|
@ -0,0 +1,509 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "txn.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __txn_old_regop_recover --
|
||||
* Recovery function for old_regop.
|
||||
*
|
||||
* PUBLIC: int __txn_old_regop_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_old_regop_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_old_regop_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_old_regop_print);
|
||||
REC_INTRO(__txn_old_regop_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_regop_recover --
|
||||
* Recovery function for regop.
|
||||
*
|
||||
* PUBLIC: int __txn_regop_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_regop_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_regop_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_regop_print);
|
||||
REC_INTRO(__txn_regop_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_old_ckp_recover --
|
||||
* Recovery function for old_ckp.
|
||||
*
|
||||
* PUBLIC: int __txn_old_ckp_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_old_ckp_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_old_ckp_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_old_ckp_print);
|
||||
REC_INTRO(__txn_old_ckp_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_ckp_recover --
|
||||
* Recovery function for ckp.
|
||||
*
|
||||
* PUBLIC: int __txn_ckp_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_ckp_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_ckp_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_ckp_print);
|
||||
REC_INTRO(__txn_ckp_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_xa_regop_old_recover --
|
||||
* Recovery function for xa_regop_old.
|
||||
*
|
||||
* PUBLIC: int __txn_xa_regop_old_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_xa_regop_old_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_xa_regop_old_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_xa_regop_old_print);
|
||||
REC_INTRO(__txn_xa_regop_old_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_xa_regop_recover --
|
||||
* Recovery function for xa_regop.
|
||||
*
|
||||
* PUBLIC: int __txn_xa_regop_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_xa_regop_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_xa_regop_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_xa_regop_print);
|
||||
REC_INTRO(__txn_xa_regop_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_child_old_recover --
|
||||
* Recovery function for child_old.
|
||||
*
|
||||
* PUBLIC: int __txn_child_old_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_child_old_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_child_old_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_child_old_print);
|
||||
REC_INTRO(__txn_child_old_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_child_recover --
|
||||
* Recovery function for child.
|
||||
*
|
||||
* PUBLIC: int __txn_child_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_child_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_child_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_child_print);
|
||||
REC_INTRO(__txn_child_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue