Merge over all the parts of Berkeley DB that libdb will include.

This commit is contained in:
Gregory Burd 2011-09-13 13:48:33 -04:00 committed by Gregory Burd
parent 05c4aa6cba
commit a835393fa1
1237 changed files with 496881 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
build_unix/**

130
LICENSE Normal file
View file

@ -0,0 +1,130 @@
/*-
* $Id$
*/
The following is the license that applies to this copy of the Berkeley DB
software. For a license to use the Berkeley DB software under conditions
other than those described here, or to purchase support for this software,
please contact Oracle at berkeleydb-info_us@oracle.com.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/*
* Copyright (c) 1990, 2011 Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Redistributions in any form must be accompanied by information on
* how to obtain complete source code for the DB software and any
* accompanying software that uses the DB software. The source code
* must either be included in the distribution or be available for no
* more than the cost of distribution plus a nominal fee, and must be
* freely redistributable under reasonable conditions. For an
* executable file, complete source code means the source code for all
* modules it contains. It does not include source code for modules or
* files that typically accompany the major components of the operating
* system on which the executable file runs.
*
* THIS SOFTWARE IS PROVIDED BY ORACLE ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
* NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL ORACLE BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) 1990, 1993, 1994, 1995
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright (c) 1995, 1996
* The President and Fellows of Harvard University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY HARVARD AND ITS CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL HARVARD OR ITS CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/***
* ASM: a very small and fast Java bytecode manipulation framework
* Copyright (c) 2000-2005 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

5
README
View file

@ -0,0 +1,5 @@
Berkeley DB 11g Release 2, library version 11.2.5.2.28: (June 10, 2011)
This is Berkeley DB 11g Release 2 from Oracle. To view release and
installation documentation, load the distribution file docs/index.html
into your web browser.

3
build_unix/.IGNORE_ME Normal file
View file

@ -0,0 +1,3 @@
Some combinations of the gzip and tar archive exploders found
on Linux systems ignore directories that don't have any files
(other than symbolic links) in them. So, here's a file.

426
dist/ChangeLog vendored Normal file
View file

@ -0,0 +1,426 @@
= Berkeley DB 5.2 Changelog =
== Database or Log File On-Disk Format Changes ==
Existing database file formats were unchanged in library version 11.2.5.2.
However, a new database file format, "heap", was introduced.
The log file format changed in library version 11.2.5.2.
== New Features ==
Replication Manager now manages Group Membership. This allows sites to be added to
and removed from the replication group dynamically. Replication Manager
also now automatically keeps track of the group size (nsites). [#14778]
Initial allocations for various non-pagebuffer (mpool) system resources
may now be specified, as well as a total maximum of memory to use, rather than
specifying a maximum value for each resource. [#16334]
Implemented Berkeley DB globalization support architecture to enable localized
and stripped error and output messages. [#16863]
Added a new access method, DB_HEAP. Heap aims for efficient use (and re-use)
of disk space. Keys in a heap database are automatically generated by BDB, it
is recommended that one or more secondary indexes be used with a heap
database. For full details on DB_HEAP, see the Programmer's Reference
Guide. [#17627]
Added a compatible mode for 32bit and 64bit Windows environment. [#18225]
For the SQL API, concurrency between read and write transactions can now be
enabled using "PRAGMA multiversion". Added several pragmas that can be
used to configure the Berkeley DB datastore. [#18521]
Add several new pragmas to provide in-process support for replication in
the SQL API. [#18528]
The Berkeley DB X/open compliant XA resource manager has been restored,
including support for multi-threaded servers. [#18701]
Improved the ability to recover from an application crash on connections
through the SQL API. Berkeley DB will try to automatically clean up locks,
mutexes and transactions from the failed process. [#18713]
Add support for sequence usage in the SQL API using SQLite custom
functions. [#19007]
Add a pragma in the SQL API to allow execution of a cache trickle
command. [#19202]
Add a pragma in the SQL API to allow configuration of DB_SYSTEM_MEM
environments. [#19249]
The new db_env_set_win_security(SECURITY_ATTRIBUTES *) function allows an
application to specify the particular Microsoft Windows security attributes
to be used by Berkeley DB. This helps support applications which reduce their
privileges after opening the environment. [#19529]
== Database Environment Changes ==
None
== Concurrent Data Store Changes ==
None
== Access Method Changes ==
Modified the queue access method so that it only uses latches on the metadata
page rather than a latch and a lock. This was done to improve
performance. [#18749]
Fixed several bugs that could cause an update running with MVCC to get the
wrong version of a page or improperly update the metadata last page
number. [#19063]
The database open code will no longer log the open and close of the master
database in a file when opening a sub database in that file. [#19071]
Fixed a bug where an error during an update to a hash database with
DB_NOOVERWRITE set could return DB_KEYEXIST rather than the correct
error. [#19077]
Fixed a bug that could cause the wrong page number to be on a root or metadata
page if DB->compact moved the page and the operation was later rolled
forward. [#19167]
Fixed a bug that could cause the close of a secondary index database to fail
if the transaction doing the open aborted. [#19169]
Fixed a bug that could prevent an update to a primary recno or queue database
with DB_NOOVERWITE set. [#19230]
Fixed a bug when an update to a database with DB_NOOVERWRITE set could
incorrectly return DB_KEYEXIST rather than the correct error
(e.g., DB_LOCK_DEADLOCK). [#19345]
Fixed a bug preventing the use of the set_re_len and set_re_pad methods with
a RECNO database when configuring with --disable-queue. [#19367]
Fixed a bug in DB->compact on BTREE databases that did not check if the last
page in the database could be moved to a lower numbered page. [#19394]
Fixed a bug that could cause a Log Sequence Error when recovering the
deallocation of a multiple page overflow chain. [#19474]
Fixed a bug that could cause a diagnostic assertion if MVCC was in use
and multiple levels of a btree needed to be split. [#19481]
Fixed a few error paths that could cause a Panic with an "unpinned page
returned" error. [#19493]
Fixed a bug that closed a race condition that under heavy mult-threaded
appending to a queue database could cause some records to be lost. [#19498]
Fixed a bug that might cause DB->compact to mis-estimate the size of an
overflow record when merging two pages. This may cause the page to have more
data than desired. [#19562]
Fixed a bug in DB_ENV->fileid_reset that did not update the fileid's on the
metadata pages of subdatabases if the database file was not in native
byte order. [#19608]
Fixed a bug that caused the first directory specified in the create of
a partitioned database to get too many partitions. [#20041]
== SQL API Changes ==
Fixed a race condition that would cause a corruption error in one process when
two processes created the same SQL database. [#18929]
Fixed a bug that would cause a constraint violation when updating the
primary key with the same value. [#18976]
Overwriting an old backup with a new backup using the SQL online backup API
will no longer double the size of the database. [#19021]
Implemented index optimizations for indexes on large values. [#19094]
Fixed a bug that could cause an undetected deadlock between a
thread which moved a metadata or root page via a DB->compact operation and
another thread trying to open the database if the old page was being removed
from the file. [#19186]
Fix a bug in the BDBSQL_FILE_PER_TABLE option, to allow absolute
path names. [#19190]
Add a pragma to allow configuration of DB_SYSTEM_MEM environments. [#19249]
Exclusive transactions will now block new transactions and will prevent
existing transactions from making forward progress. [#19256]
Fixed a bug that would cause assert error when opening an in-memory hash
database with thread count configured when compiled with
--enable-diagnostic. [#19357]
Upgrade the bundled version of SQLite to 3.7.6.2 [#19376]
Fixed a performance bug with the cache victim selection algorithm when there
were multiple cache regions. [#19385]
Fixed a bug which could cause two SQL threads to have an undetected deadlock
when opening or closing tables. [#19386]
Fix a bug that could cause a hang when deleting a table if there are multiple
connections to a database from different processes. [#19419]
Fixed a bug which could cause multiple threads performing DB->compact on
the same database file to overrun the in-memory freelist, which could
potentially lead to memory corruption. [#19571]
Fixed a bug in DB->compact that could cause a loop if an attempt to move a
sub-database meta data page deadlocked. [#20028]
== C API Changes ==
Fixed a bug where encryption could not be enabled for individual databases
in an encrypted environment. [#18891]
Removed two unused error codes, DB_NOSERVER_HOME and DB_NOSERVER_ID. [#18978]
Added a DB_DBT_READONLY flag so that users can pass in a non-usermem key
(DB_DBT_USERMEM) for get operations. [#19360]
Fixed a bug in DB/DBC->get/pget that the partial flags are silently ignored
with positional flags and return inconsistent DBT. [#19540]
Fixed a bug which prevented items from being deleted on a secondary
database. [#19573]
Fixed a bug to correctly handle the DB_BUFFER_SMALL case on delete
operations when compression is enabled. [#19660]
== Tcl-specific API Changes ==
None.
== C#-specific API Changes ==
Added support for partial put/get in the C# API. [#18795]
Fixed a bug in compare delegate for secondary db. [#18935]
== Replication Changes ==
Replication Manager now allows differing ack policies at different
sites throughout the group, and supports dynamic changes to the ack
policy. (The ack policy in force is determined by the current
master.) [#14993]
Replication Manager "channels" feature allows applications to
share repmgr's communication facilities. [#17228]
Add example program for RepMgr "channels" feature: ex_rep_chan. [#17387]
Replication Manager now allows dynamic changes to a site's
"electability" (changes between zero and non-zero priority). This
feature should be used with care, because electability changes can in
boundary cases invalidate durability guarantees granted for previous
transactions. [#17497]
Changed election criteria so that later group transactions
won't get overwritten by earlier generations with more log. [#17815]
Added changes to master lease checks that result in improved
performance when using master leases. [#18960]
A log write failure on a replication master will now cause
a panic since the transaction may be committed on some clients. [#19054]
Fixed a few memory leak conditions on error paths. [#19131]
Change lease code so that zero priority sites do not count
in lease guarantees since they cannot be elected. [#19154]
Repmgr rerequest processing is moved from a dedicated thread to heartbeat
messages. Repmgr clients using heartbeats can now detect and rerequest
missing final master log records without master activity. [#19197]
Repmgr statistics are now included in full statistics output for
an environment. [#19198]
Fix an inefficiency in mixed version elections. We now check
if an election is won via the EID instead of priority. [#19254]
Changed election LSNs to use the last txn commit LSN instead
of the end of the log. [#19278]
Create replication internal database files in the environment
home directory rather than the data directory so that they are in the
same location as the other internal replication files. [#19403]
Fix a bug that was preventing repmgr from calling an election
when starting a site with the DB_REP_ELECTION flag. [#19546]
Fixed a bug which could cause a segfault at a replication master if a
named in-memory database was being created around the same time as a
client site were synchronizing (in "internal init") with the master.
[#19583]
Adjust lease code to consider timeout length when retrying. [#19705]
Fixed a bug that could cause a crash in replication groups of more
than 10 sites, with multiple processes sharing each DB environment
concurrently. [#19818]
Fix a bug where an assertion failure could happen if pages in a database
were deallocated during a client internal initialization.[#19851]
Fix a bug where an internal initialization of a queue database with
non-contiguous extent files could return an error. [#19925]
The 2SITE_STRICT replication configuration parameter is now turned on
by default. It can be turned off via a call to
DB_ENV->rep_set_config(). [#19937]
Repmgr heartbeats can now help detect a duplicate master without the
need for application activity. [#19950]
== Locking Subsystem Changes ==
Fixed a bug where an updater supporting DB_READ_UNCOMMITED might downgrade
its lock too soon if there was an error during the update. [#19155]
Fixed a bug where transaction timeouts could have been specified in a
database environment where the locking subsystem was disabled. [#19582]
Fixed a bug in a diagnostic assertion that was improperly triggered by the
removal of a sub-database. [#19683]
Fixed a bug that would cause DB_ENV->failcheck to free locks for a locker
associated with a database handle after the thread that opened the handle
exited. [#19881]
== Logging Subsystem Changes ==
Enhanced recovery so that it will not output extra checkpoint or transaction
id recycle log records if there was no activity since the last
checkpoint. [#15330]
Log checksums can now be disabled using the compile argument
--disable-log-checksum. This will give a performance increase at the risk
of undetectable corruption in the log records, which would make recovery
impossible. [#19143]
Fixed a bug that could cause a page that should have been removed from the
end of a file still be in the copy of the file in a hot backup. [#19996]
== Memory Pool Subsystem Changes ==
Fixed a bug in MPOOLFILE->get that did not permit the DB_MPOOL_DIRTY flag
to be used with other flags. [#19421]
== Mutex Subsystem Changes ==
Fixed a bug when the mutex region needs to be larger than 4GB, the region size
was incorrectly adjusted to be slightly too small to fit the mutexes. [#18968]
Fixed a performance problem with hybrid shared latches in which a request for
exclusive access would busy-wait (rather than put itself to sleep) if the latch
were held by a shared reader. This also fixed the timeout handling of hybrid
mutexes. In some cases the timeout would not be honored, resulting in delays
for the replication "read your writes" feature which were longer than requested.
[#18982]
Fixed the timeout handling of the pthreads mutexes used by the replication
"read your writes" feature. When a timeout occurred there was a race condition
which might result in a hang. [#19047]
== Transaction Subsystem Changes ==
Fixed a leak of log file ids when a database is closed before the end of a
transaction that references it. [#15957]
Fixed a bug that would cause a panic if a child transaction performed a database
rename, then aborted, and then the parent transaction committed. [#18069]
Fixed a bug where we released the metadata page lock too early if a
non-transactional update was being done. [#19036]
Removed the possibility that checkpoints will overlap in the log, decreasing
the time to recover. [#19062]
== Test Suite Changes ==
Require Tcl 8.5 or greater.
== Utility Changes ==
Added a new utility, db_tuner, which analyzes the data in a btree database,
and suggests a reasonable pagesize. [#18910]
Fixed some bugs in log_verify when there are in-memory database logs and subdb
logs. [#19157]
Modified db_hotbackup to not read from the file system as required on non-UNIX
systems. Also provided the db_copy function for this purpose. [#19863]
Fixed db_hotbackup so that when -d/-l or -D is not specified, DB_CONFIG is
used to determine the locations of the databases and logs in the source
environment. [#19994]
== Configuration, Documentation, Sample Apps, Portability and Build Changes ==
Changed SQL API library built on *nix to link with libpthreads when
necessary. [#19098]
Added CPPFLAGS into our --enable-jdbc configuration. [#19234]
Added encryption support into the Windows CE build project for SQL API. [#19632]
Fixed a bug in the STAT_INC_VERB() dtrace probe that was causing compiler
warnings. [#19707]
Fixed a bug that could cause a trap in db_dump using salvage mode if a
page was found that was not associated with any database in the file. [#19974]
On Cygwin, circumvented a bug in libtool that is exposed when building the
BDB SQL API in a directory path containing whitespace characters. [#19812]
== Example Changes ==
Update repmgr C, C#, C++, Java examples(ex_rep_mgr, ex_rep_gsg_repmgr,
ex_rep_chan, excs_repquote, excxx_repquote, excxx_epquote_gsg, repquote,
repquote_gsg) with their related API changes for group
membership. [#19586][#19622]
Port ex_rep_chan, ex_rep_gsg_repmgr,ex_rep_gsg_simple,
excxx_repquote_gsg_repmgr, excxx_repquote_gsg_simple to Window.[#19890]
== Miscellaneous Bug Fixes ==
Fixed a bug where memory copied from the Java API could leak if flags were not
correctly configured. [#19152]
== Deprecated Features ==
None
== Known Bugs ==
The SQL API has a known issue when using a blob field with a lot of content
and multiple concurrent connections to the database. [#19945]
Rollback of a dropped table in the SQL layer contains a mutex leak, which
can consume all mutex resources if enough rollbacks of table drops are
performed. [#20077]
The DB_CONFIG configuration parameters which specify path names currently
do not support names containing any whitespace characters. [#20158]
The BFile module has a known crash issue when using BFile handle for SQL
expressions interface on 64bit platforms. [#20193]
On systems without FTRUNCATE, db_verify will return an error for truncated
heap databases. This is a bug in db_verify, the database has been truncated
correctly and can be used in the future. [#20195]
An application using queue extents which is append mostly could see a
decrease in the buffer pool hit rate due to the failure to remove pages
from closed extents from the buffer pool. [#20217]

2657
dist/Makefile.in vendored Normal file

File diff suppressed because it is too large Load diff

16
dist/RELEASE vendored Normal file
View file

@ -0,0 +1,16 @@
# $Id$
DB_VERSION_FAMILY=11
DB_VERSION_LETTER="g"
DB_VERSION_RELEASE=2
DB_VERSION_MAJOR=5
DB_VERSION_MINOR=2
DB_VERSION_PATCH=28
DB_VERSION="$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH"
DB_VERSION_FULL="$DB_VERSION_FAMILY.$DB_VERSION_RELEASE.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH"
DB_VERSION_UNIQUE_NAME=`printf "_%d%03d" $DB_VERSION_MAJOR $DB_VERSION_MINOR`
DB_RELEASE_DATE="June 10, 2011"
DB_VERSION_STRING="Berkeley DB $DB_VERSION: ($DB_RELEASE_DATE)"
DB_VERSION_FULL_STRING="Berkeley DB $DB_VERSION_FAMILY$DB_VERSION_LETTER Release $DB_VERSION_RELEASE, library version $DB_VERSION_FULL: ($DB_RELEASE_DATE)"

59
dist/aclocal/clock.m4 vendored Normal file
View file

@ -0,0 +1,59 @@
# $Id$
# Configure clocks and timers.
AC_DEFUN(AC_TIMERS, [
AC_CHECK_FUNCS(gettimeofday localtime time strftime)
# AIX 4.3 will link applications with calls to clock_gettime, but the
# calls always fail.
case "$host_os" in
aix4.3.*)
;;
*)
AC_CHECK_FUNCS(clock_gettime);;
esac
# clock_gettime -- monotonic clocks.
# Check to see if we can get a monotonic clock. We actually try and
# run the program if possible, because we don't trust the #define's
# existence to mean the clock really exists.
AC_CACHE_CHECK([for clock_gettime monotonic clock], db_cv_clock_monotonic, [
AC_TRY_RUN([
#include <sys/time.h>
main() {
struct timespec t;
return (clock_gettime(CLOCK_MONOTONIC, &t) != 0);
}], db_cv_clock_monotonic=yes, db_cv_clock_monotonic=no,
AC_TRY_LINK([
#include <sys/time.h>], [
struct timespec t;
clock_gettime(CLOCK_MONOTONIC, &t);
], db_cv_clock_monotonic=yes, db_cv_clock_monotonic=no))
])
if test "$db_cv_clock_monotonic" = "yes"; then
AC_DEFINE(HAVE_CLOCK_MONOTONIC)
AH_TEMPLATE(HAVE_CLOCK_MONOTONIC,
[Define to 1 if clock_gettime supports CLOCK_MONOTONIC.])
fi
# ctime_r --
#
# There are two versions of ctime_r, one of which takes a buffer length as a
# third argument, and one which only takes two arguments. (There is also a
# difference in return values and the type of the 3rd argument, but we handle
# those problems in the code itself.)
AC_CHECK_FUNCS(ctime_r)
if test "$ac_cv_func_ctime_r" = "yes"; then
AC_CACHE_CHECK([for 2 or 3 argument version of ctime_r], db_cv_ctime_r_3arg, [
AC_TRY_LINK([
#include <time.h>], [
ctime_r(NULL, NULL, 100);
], [db_cv_ctime_r_3arg="3-argument"], [db_cv_ctime_r_3arg="2-argument"])])
fi
if test "$db_cv_ctime_r_3arg" = "3-argument"; then
AC_DEFINE(HAVE_CTIME_R_3ARG)
AH_TEMPLATE(HAVE_CTIME_R_3ARG,
[Define to 1 if ctime_r takes a buffer length as a third argument.])
fi
])

19
dist/aclocal/config.m4 vendored Normal file
View file

@ -0,0 +1,19 @@
# Features we don't test for, but want the #defines to exist for
# other ports.
AH_TEMPLATE(DB_WIN32,
[We use DB_WIN32 much as one would use _WIN32 -- to specify that
we're using an operating system environment that supports Win32
calls and semantics. We don't use _WIN32 because Cygwin/GCC also
defines _WIN32, even though Cygwin/GCC closely emulates the Unix
environment.])
AH_TEMPLATE(HAVE_VXWORKS, [Define to 1 if building on VxWorks.])
AH_TEMPLATE(HAVE_FILESYSTEM_NOTZERO,
[Define to 1 if allocated filesystem blocks are not zeroed.])
AH_TEMPLATE(HAVE_UNLINK_WITH_OPEN_FAILURE,
[Define to 1 if unlink of file with open file descriptors will fail.])
AH_TEMPLATE(HAVE_SYSTEM_INCLUDE_FILES,
[Define to 1 if port includes files in the Berkeley DB source code.])

304
dist/aclocal/cxx.m4 vendored Normal file
View file

@ -0,0 +1,304 @@
# C++ language checks
AC_DEFUN(AC_CXX_STDHEADERS, [
AC_SUBST(cxx_have_stdheaders)
AC_MSG_CHECKING(whether C++ supports the ISO C++ standard includes)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <iostream>],[std::ostream *o; return 0;],
db_cv_cxx_have_stdheaders=yes, db_cv_cxx_have_stdheaders=no)
AC_LANG_RESTORE
AC_MSG_RESULT($db_cv_cxx_have_stdheaders)
if test "$db_cv_cxx_have_stdheaders" = yes; then
cxx_have_stdheaders="#define HAVE_CXX_STDHEADERS 1"
fi])
AC_DEFUN(AC_CXX_WSTRING, [
AC_MSG_CHECKING(whether C++ supports the wstring class)
AC_SUBST(WSTRING_decl)
AC_LANG_PUSH(C++)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <string>]]
[[std::wstring ws; ws.find_first_of(ws);]]),
[WSTRING_decl="#define HAVE_WSTRING 1" ; AC_MSG_RESULT(yes)],
[WSTRING_decl="#undef HAVE_WSTRING" ; AC_MSG_RESULT(no)]])
AC_LANG_POP(C++)
])
AC_DEFUN(AC_CXX_SUPPORTS_TEMPLATES, [
AC_MSG_CHECKING(whether the C++ compiler supports templates for STL)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <iostream>
#include <string>
#include <vector>
using std::string;
using std::vector;
namespace dbstl_configure_test {
template<typename T1, typename T2 = int>
class MyClass
{
public:
explicit MyClass(int i) { imem = i;}
MyClass(const T1& t1, const T2& t2, int i)
{
mem1 = t1;
mem2 = t2;
imem = i;
}
template <typename T3>
T2 templ_mem_func(T1 t1, T3 t3)
{
mem2 = t1;
T3 t32 = t3;
T2 t2;
return t2;
}
double templ_mem_func(T1 t1, double t3)
{
mem1 = t1;
double t32 = t3;
return t3;
}
template <typename ReturnType, typename T7, typename T8>
ReturnType templ_mem_func(T7, T8);
operator T1() const {return mem1;}
private:
T1 mem1;
T2 mem2;
int imem;
};
template<typename T1, typename T2>
template <typename ReturnType, typename T7, typename T8>
ReturnType MyClass<T1, T2>::templ_mem_func(T7, T8)
{
ReturnType rt;
return rt;
}
template<>
class MyClass<double, float>
{
public:
explicit MyClass(int i) { imem = i;}
MyClass(const double& t1, const float& t2, int i)
{
mem1 = t1;
mem2 = t2;
imem = i;
}
template <typename T3>
float templ_mem_func(double t1, T3 t3)
{
mem2 = t1;
T3 t32 = t3;
float t2;
return t2;
}
double templ_mem_func(double t1, double t3)
{
mem1 = t1;
double t32 = t3;
return t3;
}
template <typename ReturnType, typename T7, typename T8>
ReturnType templ_mem_func(T7, T8);
operator double() const {return mem1;}
private:
double mem1;
float mem2;
int imem;
};
template <typename ReturnType, typename T7, typename T8>
ReturnType MyClass<double, float>::templ_mem_func(T7, T8)
{
ReturnType rt;
return rt;
}
template <typename T1, typename T2>
class MyClass2 {
public:
MyClass2(const T1& t1, const T2&t2){}
};
// partial specialization: both template parameters have same type
template <typename T>
class MyClass2<T,T> {
public:
MyClass2(const T& t1, const T&t2){}
};
// partial specialization: second type is int
template <typename T>
class MyClass2<T,int> {
public:
MyClass2(const T& t1, const int&t2){}
};
// partial specialization: both template parameters are pointer types
template <typename T1, typename T2>
class MyClass2<T1*,T2*> {
public:
MyClass2(const T1* t1, const T2*t2){}
};
template <typename T>
class MyClass2<T*,T*> {
public:
MyClass2(const T* t1, const T*t2){}
};
template <typename T4, typename T5>
int part_spec_func(T4 t4, T5 t5)
{
// Zero Initialization should work.
T4 t44 = T4();
T5 t55 = T5();
t44 = t4;
t55 = t5;
}
template <typename T4>
int part_spec_func(T4 t4, std::vector<T4> t55)
{
T4 t44 = t4;
std::vector<T4> abc = t55;
}
// maximum of two int values
inline int const& max (int const& a, int const& b)
{
return a<b?b:a;
}
// maximum of two values of any type
template <typename T1, typename T2>
inline T2 const max (T1 const& a, T2 const& b)
{
return a<b?b:a;
}
// maximum of two values of any type
template <typename T>
inline T const& max (T const& a, T const& b)
{
return a<b?b:a;
}
// maximum of three values of any type
template <typename T>
inline T const& max (T const& a, T const& b, T const& c)
{
return max (max(a,b), c);
}
template <typename T>
class Base {
public:
void exit2(){}
Base(){}
};
template <typename T>
class Derived : public Base<T> {
public:
// Call Base<T>() explicitly here, otherwise can't access it.
// Kind of like this->.
Derived() : Base<T>(){}
void foo() {
this->exit2();
}
};
} // dbstl_configure_test
using namespace dbstl_configure_test;], [
char cc = 'a';
int i = 4;
double pi = 3.14;
float gold = 0.618;
MyClass2<int,float> mif(i, gold); // uses MyClass2<T1,T2>
MyClass2<float,float> mff(gold, gold); // uses MyClass2<T,T>
MyClass2<float,int> mfi(gold, i); // uses MyClass2<T,int>
MyClass2<int*,float*> mp(&i, &gold); // uses MyClass2<T1*,T2*>
MyClass2<int*,int*> m(&i, &i); // uses MyClass2<T*, T*>
MyClass<char> obj1(i);
obj1.templ_mem_func(cc, pi);
obj1.templ_mem_func(cc, gold);
obj1.templ_mem_func(i, pi);
obj1.templ_mem_func(cc, cc);
char ch = (char)obj1;
string str1("abc"), str2("def");
MyClass<const char*, std::string> obj2(str1.c_str(), str2, i);
obj2.templ_mem_func("klm", str2);
obj2.templ_mem_func("hij", pi);
// Use j to help distinguish, otherwise unable to use the one defined
// outside of class body.
int j = obj2.templ_mem_func<int, char, char>(cc, cc);
// Call explicitly.
obj2.templ_mem_func<int, float, double>(gold, pi);
const char *pch = (const char*)obj2;
MyClass<double, float> obj3(pi, gold, i);
obj3.templ_mem_func(pi, i);
obj3.templ_mem_func(pi, str1);
obj3.templ_mem_func(pi, pi);
obj3.templ_mem_func(cc, pi);
obj3.templ_mem_func(cc, cc);
double tmpd = (double)obj3;
MyClass<double, float> obj4(i);
obj4.templ_mem_func(pi, i);
obj4.templ_mem_func(pi, str1);
obj4.templ_mem_func(pi, pi);
obj4.templ_mem_func(gold, pi);
tmpd = (double)obj4;
// Function template partial specialization.
part_spec_func(pi, gold);
part_spec_func(gold, i);
part_spec_func(str1, str2);
std::vector<std::string> strv;
part_spec_func(str1, strv);
std::vector<double> dblv;
part_spec_func(pi, dblv);
// Function template overloads and explicit call and deduction.
dbstl_configure_test::max(7, 42, 68); // calls the template for three arguments
dbstl_configure_test::max(7.0, 42.0); // calls max<double> (by argument deduction)
dbstl_configure_test::max('a', 'b'); // calls max<char> (by argument deduction)
dbstl_configure_test::max(7, 42.0);
dbstl_configure_test::max<double>(4,4.2); // instantiate T as double
dbstl_configure_test::max(7, 42); // calls the nontemplate for two ints
dbstl_configure_test::max<>(7, 42); // calls max<int> (by argument deduction)
dbstl_configure_test::max<double, double>(7, 42); // calls max<double> (no argument deduction)
dbstl_configure_test::max('a', 42.7); // calls the nontemplate for two ints
Base<double> bobj;
bobj.exit2();
// Using this-> to access base class members.
Derived<double> dobj;
dobj.foo();
dobj.exit2();
], AC_MSG_RESULT(yes), AC_MSG_ERROR(no))
AC_LANG_RESTORE
])

19
dist/aclocal/gcc.m4 vendored Normal file
View file

@ -0,0 +1,19 @@
# Version 2.96 of gcc (shipped with RedHat Linux 7.[01] and Mandrake) had
# serious problems.
AC_DEFUN(AC_GCC_CONFIG1, [
AC_CACHE_CHECK([whether we are using gcc version 2.96],
db_cv_gcc_2_96, [
db_cv_gcc_2_96=no
if test "$GCC" = "yes"; then
GCC_VERSION=`${MAKEFILE_CC} --version`
case ${GCC_VERSION} in
2.96*)
db_cv_gcc_2_96=yes;;
esac
fi])
if test "$db_cv_gcc_2_96" = "yes"; then
CFLAGS=`echo "$CFLAGS" | sed 's/-O2/-O/'`
CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-O2/-O/'`
AC_MSG_WARN([INSTALLED GCC COMPILER HAS SERIOUS BUGS; PLEASE UPGRADE.])
AC_MSG_WARN([GCC OPTIMIZATION LEVEL SET TO -O.])
fi])

7831
dist/aclocal/libtool.m4 vendored Normal file

File diff suppressed because it is too large Load diff

369
dist/aclocal/ltoptions.m4 vendored Normal file
View file

@ -0,0 +1,369 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[pic_mode="$withval"],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

123
dist/aclocal/ltsugar.m4 vendored Normal file
View file

@ -0,0 +1,123 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

23
dist/aclocal/ltversion.m4 vendored Normal file
View file

@ -0,0 +1,23 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# serial 3293 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4])
m4_define([LT_PACKAGE_REVISION], [1.3293])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4'
macro_revision='1.3293'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

98
dist/aclocal/lt~obsolete.m4 vendored Normal file
View file

@ -0,0 +1,98 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

109
dist/aclocal/mmap.m4 vendored Normal file
View file

@ -0,0 +1,109 @@
# Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
# Detect mmap capability: If the file underlying an mmap is extended,
# does the addressable memory grow too?
AC_DEFUN(AM_MMAP_EXTEND, [
AH_TEMPLATE(HAVE_MMAP_EXTEND, [Define to 1 where mmap() incrementally extends the accessible mapping as the underlying file grows.])
if test "$mmap_ok" = "yes" ; then
AC_MSG_CHECKING([for growing a file under an mmap region])
db_cv_mmap_extend="no"
AC_TRY_RUN([
/*
* Most mmap() implemenations allow you to map in a region which is much
* larger than the underlying file. Only the second less than the actual
* file size is accessible -- a SIGSEV typically results when attemping
* a memory reference between EOF and the end of the mapped region.
* One can extend the file to allow references into higher-addressed
* sections of the region. However this automatic extension of the
* addressible memory is beyond what POSIX requires. This function detects
* whether mmap supports this automatic extension. If not (e.g. cygwin)
* then the entire (hopefully sparse) file will need to be written before
* the first mmap.
*/
/* Not all these includes are needed, but the minimal set varies from
* system to system.
*/
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <signal.h>
#define TEST_MMAP_BUFSIZE (16 * 1024)
#define TEST_MMAP_EXTENDSIZE (16 * 1024 * 1024)
#ifndef MAP_FAILED
#define MAP_FAILED (-1)
#endif
int catch_sig(sig)
int sig;
{
exit(1);
}
main() {
const char *underlying;
unsigned gapsize;
char *base;
int count, fd, i, mode, open_flags, ret, total_size;
char buf[TEST_MMAP_BUFSIZE];
gapsize = 1024;
underlying = ".mmap_config";
(void) unlink(underlying);
open_flags = O_CREAT | O_TRUNC | O_RDWR;
mode = S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH;
if ((fd = open(underlying, open_flags, mode)) < 0) {
perror("open");
return (1);
}
total_size = TEST_MMAP_EXTENDSIZE;
memset(buf, 0, sizeof(buf));
if ((count = write(fd, buf, sizeof(buf))) != sizeof(buf)) {
perror("initial write");
return (2);
}
if ((base = mmap(NULL, total_size,
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) {
perror("mmap");
return (3);
}
/* Extend the file with just 1 byte */
if (lseek(fd, total_size - 1, SEEK_SET) < 0 ||
(count = write(fd, buf, 1)) != 1) {
perror("extending write");
return (4);
}
(void) signal(SIGSEGV, catch_sig);
(void) signal(SIGBUS, catch_sig);
for (i = sizeof(buf); i < total_size; i += gapsize)
base[i] = 'A';
close(fd);
(void) unlink(underlying);
return (0);
}], [db_cv_mmap_extend="yes"],[db_cv_mmap_extend="no"],[db_cv_mmap_extend="no"])
if test "$db_cv_mmap_extend" = yes; then
AC_DEFINE(HAVE_MMAP_EXTEND)
fi
AC_MSG_RESULT($db_cv_mmap_extend)
fi
])

932
dist/aclocal/mutex.m4 vendored Normal file
View file

@ -0,0 +1,932 @@
# $Id$
# POSIX pthreads tests: inter-process safe and intra-process only.
AC_DEFUN(AM_PTHREADS_SHARED, [
AC_TRY_RUN([
#include <stdlib.h>
#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="$1"],,
AC_TRY_LINK([
#include <stdlib.h>
#include <pthread.h>],[
pthread_cond_t cond;
pthread_mutex_t mutex;
pthread_condattr_t condattr;
pthread_mutexattr_t mutexattr;
exit (
pthread_condattr_init(&condattr) ||
pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) ||
pthread_mutexattr_init(&mutexattr) ||
pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) ||
pthread_cond_init(&cond, &condattr) ||
pthread_mutex_init(&mutex, &mutexattr) ||
pthread_mutex_lock(&mutex) ||
pthread_mutex_unlock(&mutex) ||
pthread_mutex_destroy(&mutex) ||
pthread_cond_destroy(&cond) ||
pthread_condattr_destroy(&condattr) ||
pthread_mutexattr_destroy(&mutexattr));
], [db_cv_mutex="$1"]))])
AC_DEFUN(AM_PTHREADS_PRIVATE, [
AC_TRY_RUN([
#include <stdlib.h>
#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_mutexattr_init(&mutexattr) ||
pthread_cond_init(&cond, &condattr) ||
pthread_mutex_init(&mutex, &mutexattr) ||
pthread_mutex_lock(&mutex) ||
pthread_mutex_unlock(&mutex) ||
pthread_mutex_destroy(&mutex) ||
pthread_cond_destroy(&cond) ||
pthread_condattr_destroy(&condattr) ||
pthread_mutexattr_destroy(&mutexattr));
}], [db_cv_mutex="$1"],,
AC_TRY_LINK([
#include <stdlib.h>
#include <pthread.h>],[
pthread_cond_t cond;
pthread_mutex_t mutex;
pthread_condattr_t condattr;
pthread_mutexattr_t mutexattr;
exit (
pthread_condattr_init(&condattr) ||
pthread_mutexattr_init(&mutexattr) ||
pthread_cond_init(&cond, &condattr) ||
pthread_mutex_init(&mutex, &mutexattr) ||
pthread_mutex_lock(&mutex) ||
pthread_mutex_unlock(&mutex) ||
pthread_mutex_destroy(&mutex) ||
pthread_cond_destroy(&cond) ||
pthread_condattr_destroy(&condattr) ||
pthread_mutexattr_destroy(&mutexattr));
], [db_cv_mutex="$1"]))])
AC_DEFUN(AM_PTHREADS_CONDVAR_DUPINITCHK, [
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
main() {
pthread_cond_t cond;
pthread_condattr_t condattr;
exit(pthread_condattr_init(&condattr) ||
pthread_cond_init(&cond, &condattr) ||
pthread_cond_init(&cond, &condattr));
}], [db_cv_pthread_condinit_dupgood="yes"],
[db_cv_pthread_condinit_dupgood="no"],
AC_TRY_LINK([
#include <stdlib.h>
#include <pthread.h>], [
pthread_cond_t cond;
pthread_condattr_t condattr;
exit(pthread_condattr_init(&condattr) ||
pthread_cond_init(&cond, &condattr));
], [db_cv_pthread_condinit_dupgood="yes"],
[db_cv_pthread_condinit_dupgood="no"]))])
AC_DEFUN(AM_PTHREADS_RWLOCKVAR_DUPINITCHK, [
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
main() {
pthread_rwlock_t rwlock;
pthread_rwlockattr_t rwlockattr;
exit(pthread_rwlockattr_init(&rwlockattr) ||
pthread_rwlock_init(&rwlock, &rwlockattr) ||
pthread_rwlock_init(&rwlock, &rwlockattr));
}], [db_cv_pthread_rwlockinit_dupgood="yes"],
[db_cv_pthread_rwlockinit_dupgood="no"],
AC_TRY_LINK([
#include <stdlib.h>
#include <pthread.h>], [
pthread_rwlock_t rwlock;
pthread_rwlockattr_t rwlockattr;
exit(pthread_rwlockattr_init(&rwlockattr) ||
pthread_rwlock_init(&rwlock, &rwlockattr));
], [db_cv_pthread_rwlockinit_dupgood="yes"],
[db_cv_pthread_rwlockinit_dupgood="no"]))])
# Figure out mutexes for this compiler/architecture.
#
# There are 3 mutex groups in BDB: pthreads-style, test-and-set, or a hybrid
# combination of the two. We first test for the pthreads-style mutex, and
# then for a test-and-set mutex.
AC_DEFUN(AM_DEFINE_MUTEXES, [
# Mutexes we don't test for, but want the #defines to exist for other ports.
AH_TEMPLATE(HAVE_MUTEX_VMS, [Define to 1 to use VMS mutexes.])
AH_TEMPLATE(HAVE_MUTEX_VXWORKS, [Define to 1 to use VxWorks mutexes.])
AC_CACHE_CHECK([for mutexes], db_cv_mutex, [
orig_libs=$LIBS
db_cv_mutex=no
# Mutexes can be disabled.
if test "$db_cv_build_mutexsupport" = no; then
db_cv_mutex=disabled;
fi
# User-specified Win32 mutexes (MinGW build)
if test "$db_cv_mingw" = yes; then
db_cv_mutex=win32/gcc
fi
if test "$db_cv_mutex" = no; then
# User-specified POSIX or UI mutexes.
#
# There are two different reasons to specify mutexes: First, the
# application is already using one type of mutex and doesn't want
# to mix-and-match (for example, on Solaris, which has POSIX, UI
# and LWP mutexes). Second, the application's POSIX pthreads
# mutexes don't support inter-process locking, but the application
# wants to use them anyway (for example, some Linux and *BSD systems).
#
# Test for POSIX threads before testing for UI/LWP threads, they are
# the Sun-recommended choice on Solaris. Also, there are Linux systems
# that support a UI compatibility mode, and applications are more
# likely to be written for POSIX threads than UI threads.
if test "$db_cv_posixmutexes" = yes; then
db_cv_mutex=posix_only;
fi
if test "$db_cv_uimutexes" = yes; then
db_cv_mutex=ui_only;
fi
# POSIX.1 pthreads: pthread_XXX
#
# If the user specified we use POSIX pthreads mutexes, and we fail to
# find the full interface, try and configure for just intra-process
# support.
if test "$db_cv_mutex" = no -o "$db_cv_mutex" = posix_only; then
LIBS="$LIBS -lpthread"
AM_PTHREADS_SHARED(POSIX/pthreads/library)
AM_PTHREADS_CONDVAR_DUPINITCHK
AM_PTHREADS_RWLOCKVAR_DUPINITCHK
LIBS="$orig_libs"
fi
if test "$db_cv_mutex" = no -o "$db_cv_mutex" = posix_only; then
AM_PTHREADS_SHARED(POSIX/pthreads)
AM_PTHREADS_CONDVAR_DUPINITCHK
AM_PTHREADS_RWLOCKVAR_DUPINITCHK
fi
if test "$db_cv_mutex" = posix_only; then
AM_PTHREADS_PRIVATE(POSIX/pthreads/private)
AM_PTHREADS_CONDVAR_DUPINITCHK
AM_PTHREADS_RWLOCKVAR_DUPINITCHK
fi
if test "$db_cv_mutex" = posix_only; then
LIBS="$LIBS -lpthread"
AM_PTHREADS_PRIVATE(POSIX/pthreads/library/private)
AM_PTHREADS_CONDVAR_DUPINITCHK
AM_PTHREADS_RWLOCKVAR_DUPINITCHK
LIBS="$orig_libs"
fi
if test "$db_cv_mutex" = posix_only; then
AC_MSG_ERROR([unable to find POSIX 1003.1 mutex interfaces])
fi
# LWP threads: _lwp_XXX
if test "$db_cv_mutex" = no; then
AC_TRY_LINK([
#include <synch.h>],[
static lwp_mutex_t mi = SHAREDMUTEX;
static lwp_cond_t ci = SHAREDCV;
lwp_mutex_t mutex = mi;
lwp_cond_t cond = ci;
exit (
_lwp_mutex_lock(&mutex) ||
_lwp_mutex_unlock(&mutex));
], [db_cv_mutex=Solaris/lwp])
fi
# UI threads: thr_XXX
if test "$db_cv_mutex" = no -o "$db_cv_mutex" = ui_only; then
LIBS="$LIBS -lthread"
AC_TRY_LINK([
#include <thread.h>
#include <synch.h>],[
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_LINK([
#include <thread.h>
#include <synch.h>],[
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
# We're done testing for pthreads-style mutexes. Next, check for
# test-and-set mutexes. Check first for hybrid implementations,
# because we check for them even if we've already found a
# pthreads-style mutex and they're the most common architectures
# anyway.
#
# x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux
AC_TRY_COMPILE(,[
#if (defined(i386) || defined(__i386__)) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex="$db_cv_mutex/x86/gcc-assembly"])
# x86_64/gcc: FreeBSD, NetBSD, BSD/OS, Linux
AC_TRY_COMPILE(,[
#if (defined(x86_64) || defined(__x86_64__)) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex="$db_cv_mutex/x86_64/gcc-assembly"])
# Solaris is one of the systems where we can configure hybrid mutexes.
# However, we require the membar_enter function for that, and only newer
# Solaris releases have it. Check to see if we can configure hybrids.
AC_TRY_LINK([
#include <sys/atomic.h>
#include <sys/machlock.h>],[
typedef lock_t tsl_t;
lock_t x;
_lock_try(&x);
_lock_clear(&x);
membar_enter();
], [db_cv_mutex="$db_cv_mutex/Solaris/_lock_try/membar"])
# Sparc/gcc: SunOS, Solaris, ultrasparc assembler support
AC_TRY_COMPILE(,[
#if defined(__sparc__) && defined(__GNUC__)
asm volatile ("membar #StoreStore|#StoreLoad|#LoadStore");
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex="$db_cv_mutex/Sparc/gcc-assembly"])
# We're done testing for any hybrid mutex implementations. If we did
# not find a pthreads-style mutex, but did find a test-and-set mutex,
# we set db_cv_mutex to "no/XXX" -- clean that up.
db_cv_mutex=`echo $db_cv_mutex | sed 's/^no\///'`
fi
# If we still don't have a mutex implementation yet, continue testing for a
# test-and-set mutex implementation.
# _lock_try/_lock_clear: Solaris
# On Solaris systems without other mutex interfaces, DB uses the undocumented
# _lock_try _lock_clear function calls instead of either the sema_trywait(3T)
# or sema_wait(3T) function calls. This is because of problems in those
# interfaces in some releases of the Solaris C library.
if test "$db_cv_mutex" = no; then
AC_TRY_LINK([
#include <sys/atomic.h>
#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
# msemaphore: HPPA only
# Try HPPA before general msem test, it needs special alignment.
if test "$db_cv_mutex" = no; then
AC_TRY_LINK([
#include <sys/mman.h>],[
#if defined(__hppa)
typedef msemaphore tsl_t;
msemaphore x;
msem_init(&x, 0);
msem_lock(&x, 0);
msem_unlock(&x, 0);
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=HP/msem_init])
fi
# msemaphore: AIX, OSF/1
if test "$db_cv_mutex" = no; then
AC_TRY_LINK([
#include <sys/types.h>
#include <sys/mman.h>],[
typedef msemaphore tsl_t;
msemaphore x;
msem_init(&x, 0);
msem_lock(&x, 0);
msem_unlock(&x, 0);
exit(0);
], [db_cv_mutex=UNIX/msem_init])
fi
# ReliantUNIX
if test "$db_cv_mutex" = no; then
LIBS="$LIBS -lmproc"
AC_TRY_LINK([
#include <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
# SCO: UnixWare has threads in libthread, but OpenServer doesn't.
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__USLC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=SCO/x86/cc-assembly])
fi
# abilock_t: SGI
if test "$db_cv_mutex" = no; then
AC_TRY_LINK([
#include <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
# sema_t: Solaris
# The sema_XXX calls do not work on Solaris 5.5. I see no reason to ever
# turn this test on, unless we find some other platform that uses the old
# POSIX.1 interfaces.
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
# _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
# _spin_lock_try/_spin_unlock: Apple/Darwin
if test "$db_cv_mutex" = no; then
AC_TRY_LINK(,[
int x;
_spin_lock_try(&x);
_spin_unlock(&x);
], [db_cv_mutex=Darwin/_spin_lock_try])
fi
# Tru64/cc
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__alpha) && defined(__DECC)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=Tru64/cc-assembly])
fi
# Alpha/gcc
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__alpha) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=ALPHA/gcc-assembly])
fi
# ARM/gcc: Linux
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__arm__) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=ARM/gcc-assembly])
fi
# MIPS/gcc: Linux
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if (defined(__mips) || defined(__mips__)) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=MIPS/gcc-assembly])
fi
# PaRisc/gcc: HP/UX
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if (defined(__hppa) || defined(__hppa__)) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=HPPA/gcc-assembly])
fi
# PPC/gcc:
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=PPC/gcc-assembly])
fi
# 68K/gcc: SunOS
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if (defined(mc68020) || defined(sun3)) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=68K/gcc-assembly])
fi
# S390/cc: IBM OS/390 Unix
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__MVS__) && defined(__IBMC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=S390/cc-assembly])
fi
# S390/gcc: Linux
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__s390__) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=S390/gcc-assembly])
fi
# ia64/gcc: Linux
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__ia64) && defined(__GNUC__)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=ia64/gcc-assembly])
fi
# uts/cc: UTS
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(_UTS)
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_mutex=UTS/cc-assembly])
fi
# UNIX fcntl system call mutexes.
# Note that fcntl mutexes are no longer supported as of 4.8. This code has been
# left in place in case there is some system that we are not aware of that
# only uses fcntl mutexes. In that case, contact Oracle for support.
if test "$db_cv_mutex" = no; then
db_cv_mutex=UNIX/fcntl
AC_TRY_LINK([
#include <fcntl.h>],[
struct flock l;
l.l_whence = SEEK_SET;
l.l_start = 10;
l.l_len = 1;
l.l_type = F_WRLCK;
fcntl(0, F_SETLK, &l);
], [db_cv_mutex=UNIX/fcntl])
fi
])
# Configure a pthreads-style mutex implementation.
hybrid=pthread
case "$db_cv_mutex" in
POSIX/pthreads/private*)ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_PTHREADS)
if test "$db_cv_pthread_condinit_dupgood" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_COND_REINIT_OKAY)
fi
if test "$db_cv_pthread_rwlockinit_dupgood" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_RWLOCK_REINIT_OKAY)
fi
AC_DEFINE(HAVE_MUTEX_THREAD_ONLY)
AH_TEMPLATE(HAVE_MUTEX_THREAD_ONLY,
[Define to 1 to configure mutexes intra-process only.]);;
POSIX/pthreads/library/private*)
ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_PTHREADS)
if test "$db_cv_pthread_condinit_dupgood" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_COND_REINIT_OKAY)
fi
if test "$db_cv_pthread_rwlockinit_dupgood" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_RWLOCK_REINIT_OKAY)
fi
AC_DEFINE(HAVE_MUTEX_THREAD_ONLY);;
POSIX/pthreads/library*)ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_PTHREADS)
if test "$db_cv_pthread_condinit_dupgood" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_COND_REINIT_OKAY)
fi
if test "$db_cv_pthread_rwlockinit_dupgood" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_RWLOCK_REINIT_OKAY)
fi;;
POSIX/pthreads*) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_PTHREADS)
AH_TEMPLATE(HAVE_MUTEX_PTHREADS,
[Define to 1 to use POSIX 1003.1 pthread_XXX mutexes.])
if test "$db_cv_pthread_condinit_dupgood" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_COND_REINIT_OKAY)
fi
if test "$db_cv_pthread_rwlockinit_dupgood" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_RWLOCK_REINIT_OKAY)
fi
AH_TEMPLATE(HAVE_PTHREAD_COND_REINIT_OKAY,
[Define to 1 if it is OK to initialize an already initialized pthread_cond_t.])
AH_TEMPLATE(HAVE_PTHREAD_RWLOCK_REINIT_OKAY,
[Define to 1 if it is OK to initialize an already initialized pthread_rwlock_t.]);;
Solaris/lwp*) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_SOLARIS_LWP)
AH_TEMPLATE(HAVE_MUTEX_SOLARIS_LWP,
[Define to 1 to use the Solaris lwp threads mutexes.]);;
UI/threads/library*) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_UI_THREADS);;
*) hybrid=no;;
UI/threads*) ADDITIONAL_OBJS="mut_pthread${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_UI_THREADS)
AH_TEMPLATE(HAVE_MUTEX_UI_THREADS,
[Define to 1 to use the UNIX International mutexes.]);;
esac
# Configure a test-and-set mutex implementation.
case "$db_cv_mutex" in
68K/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_68K_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_68K_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and 68K assembly language mutexes.]);;
AIX/_check_lock) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_AIX_CHECK_LOCK)
AH_TEMPLATE(HAVE_MUTEX_AIX_CHECK_LOCK,
[Define to 1 to use the AIX _check_lock mutexes.]);;
Darwin/_spin_lock_try) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY)
AH_TEMPLATE(HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY,
[Define to 1 to use the Apple/Darwin _spin_lock_try mutexes.]);;
ALPHA/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_ALPHA_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_ALPHA_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and Alpha assembly language mutexes.]);;
ARM/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_ARM_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_ARM_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and ARM assembly language mutexes.]);;
HP/msem_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_HPPA_MSEM_INIT)
AH_TEMPLATE(HAVE_MUTEX_HPPA_MSEM_INIT,
[Define to 1 to use the msem_XXX mutexes on HP-UX.]);;
HPPA/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_HPPA_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_HPPA_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and PaRisc assembly language mutexes.]);;
ia64/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_IA64_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_IA64_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and IA64 assembly language mutexes.]);;
MIPS/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_MIPS_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_MIPS_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and MIPS assembly language mutexes.]);;
PPC/gcc-assembly)
ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_PPC_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_PPC_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and PowerPC assembly language mutexes.]);;
ReliantUNIX/initspin) LIBSO_LIBS="$LIBSO_LIBS -lmproc"
ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_RELIANTUNIX_INITSPIN)
AH_TEMPLATE(HAVE_MUTEX_RELIANTUNIX_INITSPIN,
[Define to 1 to use Reliant UNIX initspin mutexes.]);;
S390/cc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_S390_CC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_S390_CC_ASSEMBLY,
[Define to 1 to use the IBM C compiler and S/390 assembly language mutexes.]);;
S390/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_S390_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_S390_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and S/390 assembly language mutexes.]);;
SCO/x86/cc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY,
[Define to 1 to use the SCO compiler and x86 assembly language mutexes.]);;
SGI/init_lock) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_SGI_INIT_LOCK)
AH_TEMPLATE(HAVE_MUTEX_SGI_INIT_LOCK,
[Define to 1 to use the SGI XXX_lock mutexes.]);;
Solaris/_lock_try) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_SOLARIS_LOCK_TRY)
AH_TEMPLATE(HAVE_MUTEX_SOLARIS_LOCK_TRY,
[Define to 1 to use the Solaris _lock_XXX mutexes.]);;
*Solaris/_lock_try/membar)
hybrid="$hybrid/tas"
ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_SOLARIS_LOCK_TRY)
AH_TEMPLATE(HAVE_MUTEX_SOLARIS_LOCK_TRY,
[Define to 1 to use the Solaris _lock_XXX mutexes.]);;
*Sparc/gcc-assembly) hybrid="$hybrid/tas"
ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_SPARC_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_SPARC_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and Sparc assembly language mutexes.]);;
Tru64/cc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_TRU64_CC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_TRU64_CC_ASSEMBLY,
[Define to 1 to use the CC compiler and Tru64 assembly language mutexes.]);;
UNIX/msem_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_MSEM_INIT)
AH_TEMPLATE(HAVE_MUTEX_MSEM_INIT,
[Define to 1 to use the msem_XXX mutexes on systems other than HP-UX.]);;
UNIX/sema_init) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_SEMA_INIT)
AH_TEMPLATE(HAVE_MUTEX_SEMA_INIT,
[Define to 1 to use the obsolete POSIX 1003.1 sema_XXX mutexes.]);;
UTS/cc-assembly) ADDITIONAL_OBJS="uts4.cc${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_UTS_CC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_UTS_CC_ASSEMBLY,
[Define to 1 to use the UTS compiler and assembly language mutexes.]);;
*x86/gcc-assembly) hybrid="$hybrid/tas"
ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_X86_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and 32-bit x86 assembly language mutexes.]);;
*x86_64/gcc-assembly) hybrid="$hybrid/tas"
ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_X86_64_GCC_ASSEMBLY)
AH_TEMPLATE(HAVE_MUTEX_X86_64_GCC_ASSEMBLY,
[Define to 1 to use the GCC compiler and 64-bit x86 assembly language mutexes.]);;
esac
# Configure the remaining special cases.
case "$db_cv_mutex" in
UNIX/fcntl) AC_MSG_ERROR(
[Support for FCNTL mutexes was removed in BDB 4.8.])
ADDITIONAL_OBJS="mut_fcntl${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_FCNTL)
AH_TEMPLATE(HAVE_MUTEX_FCNTL,
[Define to 1 to use the UNIX fcntl system call mutexes.]);;
win32) ADDITIONAL_OBJS="mut_win32${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_WIN32)
AH_TEMPLATE(HAVE_MUTEX_WIN32, [Define to 1 to use the MSVC compiler and Windows mutexes.]);;
win32/gcc) ADDITIONAL_OBJS="mut_win32${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_WIN32_GCC)
AH_TEMPLATE(HAVE_MUTEX_WIN32_GCC, [Define to 1 to use the GCC compiler and Windows mutexes.]);;
esac
# Mutexes may not have been found, or may have been disabled.
case "$db_cv_mutex" in
disabled)
;;
*)
# Test to see if mutexes have been found by checking the list of
# additional objects for a mutex implementation.
case "$ADDITIONAL_OBJS" in
*mut_pthread*|*mut_tas*|*mut_win32*)
AC_DEFINE(HAVE_MUTEX_SUPPORT)
AH_TEMPLATE(HAVE_MUTEX_SUPPORT,
[Define to 1 if the Berkeley DB library should support mutexes.])
# Shared latches are required in 4.8, and are implemented using
# mutexes if we don't have a native implementation.
# This macro may be removed in a future release.
AH_TEMPLATE(HAVE_SHARED_LATCHES,
[Define to 1 to configure Berkeley DB to use read/write latches.])
AC_DEFINE(HAVE_SHARED_LATCHES);;
*)
AC_MSG_ERROR([Unable to find a mutex implementation]);;
esac
esac
# We may have found both a pthreads-style mutex implementation as well as a
# test-and-set, in which case configure for the hybrid.
if test "$hybrid" = pthread/tas; then
AC_DEFINE(HAVE_MUTEX_HYBRID)
AH_TEMPLATE(HAVE_MUTEX_HYBRID,
[Define to 1 to use test-and-set mutexes with blocking mutexes.])
fi
# The mutex selection may require specific declarations -- we fill in most of
# them above, but here are the common ones.
#
# The mutex selection may tell us what kind of thread package we're using,
# which we use to figure out the thread type.
#
# If we're configured for the POSIX pthread API, then force the thread ID type
# and include function, regardless of the mutex selection. Ditto for the
# (default) Solaris lwp mutexes, because they don't have a way to return the
# thread ID.
#
# Try and link with a threads library if possible. The problem is the Solaris
# C library has UI/POSIX interface stubs, but they're broken, configuring them
# for inter-process mutexes doesn't return an error, but it doesn't work either.
# For that reason always add -lpthread if we're using pthread calls or mutexes
# and there's a pthread library.
#
# We can't depend on any specific call existing (pthread_create, for example),
# as it may be #defined in an include file -- OSF/1 (Tru64) has this problem.
AC_SUBST(thread_h_decl)
AC_SUBST(db_threadid_t_decl)
db_threadid_t_decl=notset
case "$db_cv_mutex" in
UI/threads*)
thread_h_decl="#include <thread.h>"
db_threadid_t_decl="typedef thread_t db_threadid_t;"
AC_HAVE_LIBRARY(thread, LIBSO_LIBS="$LIBSO_LIBS -lthread");;
*)
AC_CHECK_HEADER(pthread.h, [ac_cv_header_pthread_h=yes])
if test "$ac_cv_header_pthread_h" = "yes" ; then
thread_h_decl="#include <pthread.h>"
db_threadid_t_decl="typedef pthread_t db_threadid_t;"
fi
AC_HAVE_LIBRARY(pthread, LIBSO_LIBS="$LIBSO_LIBS -lpthread");;
esac
# We need to know if the thread ID type will fit into an integral type and we
# can compare it for equality and generally treat it like an int, or if it's a
# non-integral type and we have to treat it like a structure or other untyped
# block of bytes. For example, MVS typedef's pthread_t to a structure.
AH_TEMPLATE(HAVE_SIMPLE_THREAD_TYPE,
[Define to 1 if thread identifier type db_threadid_t is integral.])
if test "$db_threadid_t_decl" = notset; then
db_threadid_t_decl="typedef uintmax_t db_threadid_t;"
AC_DEFINE(HAVE_SIMPLE_THREAD_TYPE)
else
AC_TRY_COMPILE(
#include <sys/types.h>
$thread_h_decl, [
$db_threadid_t_decl
db_threadid_t a;
a = 0;
], AC_DEFINE(HAVE_SIMPLE_THREAD_TYPE))
fi
# There are 3 classes of mutexes:
#
# 1: Mutexes requiring no cleanup, for example, test-and-set mutexes.
# 2: Mutexes that must be destroyed, but which don't hold permanent system
# resources, for example, pthread mutexes on MVS aka OS/390 aka z/OS.
# 3: Mutexes that must be destroyed, even after the process is gone, for
# example, pthread mutexes on QNX and binary semaphores on VxWorks.
#
# DB cannot currently distinguish between #2 and #3 because DB does not know
# if the application is running environment recovery as part of startup and
# does not need to do cleanup, or if the environment is being removed and/or
# recovered in a loop in the application, and so does need to clean up. If
# we get it wrong, we're going to call the mutex destroy routine on a random
# piece of memory, which usually works, but just might drop core. For now,
# we group #2 and #3 into the HAVE_MUTEX_SYSTEM_RESOURCES define, until we
# have a better solution or reason to solve this in a general way -- so far,
# the places we've needed to handle this are few.
AH_TEMPLATE(HAVE_MUTEX_SYSTEM_RESOURCES,
[Define to 1 if mutexes hold system resources.])
case "$host_os$db_cv_mutex" in
*qnx*POSIX/pthread*|openedition*POSIX/pthread*)
AC_DEFINE(HAVE_MUTEX_SYSTEM_RESOURCES);;
esac])
AC_DEFUN(AM_DEFINE_ATOMIC, [
# Probe for native atomic operations
# gcc/x86{,_64} inline asm
# solaris atomic_* library calls
AH_TEMPLATE(HAVE_ATOMIC_SUPPORT,
[Define to 1 to use native atomic operations.])
AH_TEMPLATE(HAVE_ATOMIC_X86_GCC_ASSEMBLY,
[Define to 1 to use GCC and x86 or x86_64 assemlby language atomic operations.])
AH_TEMPLATE(HAVE_ATOMIC_SOLARIS,
[Define to 1 to use Solaris library routes for atomic operations.])
AC_CACHE_CHECK([for atomic operations], db_cv_atomic, [
db_cv_atomic=no
# atomic operations can be disabled via --disable-atomicsupport
if test "$db_cv_build_atomicsupport" = no; then
db_cv_atomic=disabled
fi
# The MinGW build uses the Windows API for atomic operations
if test "$db_cv_mingw" = yes; then
db_cv_atomic=mingw
fi
if test "$db_cv_atomic" = no; then
AC_TRY_COMPILE(,[
#if ((defined(i386) || defined(__i386__)) && defined(__GNUC__))
exit(0);
#elif ((defined(x86_64) || defined(__x86_64__)) && defined(__GNUC__))
exit(0);
#else
FAIL TO COMPILE/LINK
#endif
], [db_cv_atomic="x86/gcc-assembly"])
fi
if test "$db_cv_atomic" = no; then
AC_TRY_LINK([
#include <sys/atomic.h>],[
volatile unsigned val = 1;
exit (atomic_inc_uint_nv(&val) != 2 ||
atomic_dec_uint_nv(&val) != 1 ||
atomic_cas_32(&val, 1, 3) != 3);
], [db_cv_atomic="solaris/atomic"])
fi
])
case "$db_cv_atomic" in
x86/gcc-assembly)
AC_DEFINE(HAVE_ATOMIC_SUPPORT)
AC_DEFINE(HAVE_ATOMIC_X86_GCC_ASSEMBLY)
;;
solaris/atomic)
AC_DEFINE(HAVE_ATOMIC_SUPPORT)
AC_DEFINE(HAVE_ATOMIC_SOLARIS)
;;
mingw)
AC_DEFINE(HAVE_ATOMIC_SUPPORT)
;;
esac
])

467
dist/aclocal/options.m4 vendored Normal file
View file

@ -0,0 +1,467 @@
# $Id$
# Process user-specified options.
AC_DEFUN(AM_OPTIONS_SET, [
AC_MSG_CHECKING(if --enable-smallbuild option specified)
AC_ARG_ENABLE(smallbuild,
[AC_HELP_STRING([--enable-smallbuild],
[Build small footprint version of the library.])],
[db_cv_smallbuild="$enable_smallbuild"], [db_cv_smallbuild="no"])
case "$db_cv_smallbuild" in
yes) db_cv_build_full="no";;
*) db_cv_build_full="yes";;
esac
AC_MSG_RESULT($db_cv_smallbuild)
AC_MSG_CHECKING(if --disable-atomicsupport option specified)
AC_ARG_ENABLE(atomicsupport,
AC_HELP_STRING([--disable-atomicsupport],
[Do not build any native atomic operation support.]),, enableval="yes")
db_cv_build_atomicsupport="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
# --enable-bigfile was the configuration option that Berkeley DB used before
# autoconf 2.50 was released (which had --enable-largefile integrated in).
AC_ARG_ENABLE(bigfile,
[AC_HELP_STRING([--disable-bigfile],
[Obsolete; use --disable-largefile instead.])],
[AC_MSG_ERROR(
[--enable-bigfile no longer supported, use --enable-largefile])])
AC_MSG_CHECKING(if --disable-compression option specified)
AC_ARG_ENABLE(compression,
AC_HELP_STRING([--disable-compression],
[Do not build compression support.]),, enableval=$db_cv_build_full)
db_cv_build_compression="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --disable-hash option specified)
AC_ARG_ENABLE(hash,
AC_HELP_STRING([--disable-hash],
[Do not build Hash access method.]),, enableval=$db_cv_build_full)
db_cv_build_hash="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --disable-heap option specified)
AC_ARG_ENABLE(heap,
[AC_HELP_STRING([--disable-heap],
[Do not build Heap access method.])],, enableval=$db_cv_build_full)
db_cv_build_heap="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --disable-mutexsupport option specified)
AC_ARG_ENABLE(mutexsupport,
AC_HELP_STRING([--disable-mutexsupport],
[Do not build any mutex support.]),, enableval="yes")
db_cv_build_mutexsupport="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --disable-log_checksum option specified)
AC_ARG_ENABLE(log_checksum,
AC_HELP_STRING([--disable-log_checksum],
[Disable log checksums.]),
[case "$enableval" in
no | yes) db_cv_log_checksum="$enableval" ;;
*) db_cv_log_checksum="yes" ;;
esac],
db_cv_log_checksum="yes")
case "$db_cv_log_checksum" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --disable-partition option specified)
AC_ARG_ENABLE(partition,
AC_HELP_STRING([--disable-partition],
[Do not build partitioned database support.]),,
enableval=$db_cv_build_full)
db_cv_build_partition="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --disable-queue option specified)
AC_ARG_ENABLE(queue,
AC_HELP_STRING([--disable-queue],
[Do not build Queue access method.]),, enableval=$db_cv_build_full)
db_cv_build_queue="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --disable-replication option specified)
AC_ARG_ENABLE(replication,
AC_HELP_STRING([--disable-replication],
[Do not build database replication support.]),,
enableval=$db_cv_build_full)
db_cv_build_replication="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --disable-statistics option specified)
AC_ARG_ENABLE(statistics,
AC_HELP_STRING([--disable-statistics],
[Do not build statistics support.]),, enableval=$db_cv_build_full)
db_cv_build_statistics="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --disable-verify option specified)
AC_ARG_ENABLE(verify,
AC_HELP_STRING([--disable-verify],
[Do not build database verification support.]),,
enableval=$db_cv_build_full)
db_cv_build_verify="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --enable-compat185 option specified)
AC_ARG_ENABLE(compat185,
[AC_HELP_STRING([--enable-compat185],
[Build DB 1.85 compatibility API.])],
[db_cv_compat185="$enable_compat185"], [db_cv_compat185="no"])
AC_MSG_RESULT($db_cv_compat185)
AC_MSG_CHECKING(if --enable-cxx option specified)
AC_ARG_ENABLE(cxx,
[AC_HELP_STRING([--enable-cxx],
[Build C++ API.])],
[db_cv_cxx="$enable_cxx"], [db_cv_cxx="no"])
AC_MSG_RESULT($db_cv_cxx)
AC_MSG_CHECKING(if --enable-debug option specified)
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],
[Build a debugging version.])],
[db_cv_debug="$enable_debug"], [db_cv_debug="no"])
AC_MSG_RESULT($db_cv_debug)
AC_MSG_CHECKING(if --enable-debug_rop option specified)
AC_ARG_ENABLE(debug_rop,
[AC_HELP_STRING([--enable-debug_rop],
[Build a version that logs read operations.])],
[db_cv_debug_rop="$enable_debug_rop"], [db_cv_debug_rop="no"])
AC_MSG_RESULT($db_cv_debug_rop)
AC_MSG_CHECKING(if --enable-debug_wop option specified)
AC_ARG_ENABLE(debug_wop,
[AC_HELP_STRING([--enable-debug_wop],
[Build a version that logs write operations.])],
[db_cv_debug_wop="$enable_debug_wop"], [db_cv_debug_wop="no"])
AC_MSG_RESULT($db_cv_debug_wop)
AC_MSG_CHECKING(if --enable-diagnostic option specified)
AC_ARG_ENABLE(diagnostic,
[AC_HELP_STRING([--enable-diagnostic],
[Build a version with run-time diagnostics.])],
[db_cv_diagnostic="$enable_diagnostic"], [db_cv_diagnostic="no"])
if test "$db_cv_diagnostic" = "yes"; then
AC_MSG_RESULT($db_cv_diagnostic)
fi
if test "$db_cv_diagnostic" = "no" -a "$db_cv_debug_rop" = "yes"; then
db_cv_diagnostic="yes"
AC_MSG_RESULT([by --enable-debug_rop])
fi
if test "$db_cv_diagnostic" = "no" -a "$db_cv_debug_wop" = "yes"; then
db_cv_diagnostic="yes"
AC_MSG_RESULT([by --enable-debug_wop])
fi
if test "$db_cv_diagnostic" = "no"; then
AC_MSG_RESULT($db_cv_diagnostic)
fi
AC_MSG_CHECKING(if --enable-dump185 option specified)
AC_ARG_ENABLE(dump185,
[AC_HELP_STRING([--enable-dump185],
[Build db_dump185(1) to dump 1.85 databases.])],
[db_cv_dump185="$enable_dump185"], [db_cv_dump185="no"])
AC_MSG_RESULT($db_cv_dump185)
AC_MSG_CHECKING(if --enable-java option specified)
AC_ARG_ENABLE(java,
[AC_HELP_STRING([--enable-java],
[Build Java API.])],
[db_cv_java="$enable_java"], [db_cv_java="no"])
AC_MSG_RESULT($db_cv_java)
AC_MSG_CHECKING(if --enable-mingw option specified)
AC_ARG_ENABLE(mingw,
[AC_HELP_STRING([--enable-mingw],
[Build Berkeley DB for MinGW.])],
[db_cv_mingw="$enable_mingw"], [db_cv_mingw="no"])
AC_MSG_RESULT($db_cv_mingw)
AC_MSG_CHECKING(if --enable-o_direct option specified)
AC_ARG_ENABLE(o_direct,
[AC_HELP_STRING([--enable-o_direct],
[Enable the O_DIRECT flag for direct I/O.])],
[db_cv_o_direct="$enable_o_direct"], [db_cv_o_direct="no"])
AC_MSG_RESULT($db_cv_o_direct)
AC_MSG_CHECKING(if --enable-posixmutexes option specified)
AC_ARG_ENABLE(posixmutexes,
[AC_HELP_STRING([--enable-posixmutexes],
[Force use of POSIX standard mutexes.])],
[db_cv_posixmutexes="$enable_posixmutexes"], [db_cv_posixmutexes="no"])
AC_MSG_RESULT($db_cv_posixmutexes)
AC_ARG_ENABLE(pthread_self,,
[AC_MSG_WARN([--enable-pthread_self is now always enabled])])
AC_ARG_ENABLE(pthread_api,,
[AC_MSG_WARN([--enable-pthread_api is now always enabled])])
AC_MSG_CHECKING(if --enable-rpc option specified)
AC_ARG_ENABLE(rpc,,
[AC_MSG_ERROR([RPC support has been removed from Berkeley DB.])]
, [db_cv_rpc="no"])
AC_MSG_RESULT($db_cv_rpc)
AC_MSG_CHECKING(if --enable-sql option specified)
AC_ARG_ENABLE(sql,
[AC_HELP_STRING([--enable-sql],
[Build the SQL API.])],
[db_cv_sql="$enable_sql"], [db_cv_sql="no"])
AC_MSG_RESULT($db_cv_sql)
AC_MSG_CHECKING(if --enable-sql_compat option specified)
AC_ARG_ENABLE(sql_compat,
[AC_HELP_STRING([--enable-sql_compat],
[Build a drop-in replacement sqlite3 library.])],
[db_cv_sql_compat="$enable_sql_compat"], [db_cv_sql_compat="no"])
AC_MSG_RESULT($db_cv_sql_compat)
AC_MSG_CHECKING(if --enable-jdbc option specified)
AC_ARG_ENABLE(jdbc,
[AC_HELP_STRING([--enable-jdbc],
[Build BDB SQL JDBC library.])],
[db_cv_jdbc="$enable_jdbc"], [db_cv_jdbc="no"])
AC_MSG_RESULT($db_cv_jdbc)
AC_MSG_CHECKING([if --with-jdbc=DIR option specified])
AC_ARG_WITH(jdbc,
[AC_HELP_STRING([--with-jdbc=DIR],
[Specify source directory of JDBC.])],
[with_jdbc="$withval"], [with_jdbc="no"])
AC_MSG_RESULT($with_jdbc)
if test "$with_jdbc" != "no"; then
db_cv_jdbc="yes"
fi
AC_MSG_CHECKING(if --enable-amalgamation option specified)
AC_ARG_ENABLE(amalgamation,
AC_HELP_STRING([--enable-amalgamation],
[Build a SQL amalgamation instead of building files separately.]),
[db_cv_sql_amalgamation="$enable_amalgamation"],
[db_cv_sql_amalgamation="no"])
AC_MSG_RESULT($db_cv_sql_amalgamation)
AC_MSG_CHECKING(if --enable-sql_codegen option specified)
AC_ARG_ENABLE(sql_codegen,
[AC_HELP_STRING([--enable-sql_codegen],
[Build the SQL-to-C code generation tool.])],
[db_cv_sql_codegen="$enable_sql_codegen"], [db_cv_sql_codegen="no"])
AC_MSG_RESULT($db_cv_sql_codegen)
AC_MSG_CHECKING(if --enable-stl option specified)
AC_ARG_ENABLE(stl,
[AC_HELP_STRING([--enable-stl],
[Build STL API.])],
[db_cv_stl="$enable_stl"], [db_cv_stl="no"])
if test "$db_cv_stl" = "yes" -a "$db_cv_cxx" = "no"; then
db_cv_cxx="yes"
fi
AC_MSG_RESULT($db_cv_stl)
AC_MSG_CHECKING(if --enable-tcl option specified)
AC_ARG_ENABLE(tcl,
[AC_HELP_STRING([--enable-tcl],
[Build Tcl API.])],
[db_cv_tcl="$enable_tcl"], [db_cv_tcl="no"])
AC_MSG_RESULT($db_cv_tcl)
AC_MSG_CHECKING(if --enable-test option specified)
AC_ARG_ENABLE(test,
[AC_HELP_STRING([--enable-test],
[Configure to run the test suite.])],
[db_cv_test="$enable_test"], [db_cv_test="no"])
AC_MSG_RESULT($db_cv_test)
AC_MSG_CHECKING(if --enable-localization option specified)
AC_ARG_ENABLE(localization,
[AC_HELP_STRING([--enable-localization],
[Configure to enable localization.])],
[db_cv_localization="$enable_localization"], [db_cv_localization="no"])
AC_MSG_RESULT($db_cv_localization)
AC_MSG_CHECKING(if --enable-stripped_messages option specified)
AC_ARG_ENABLE(stripped_messages,
[AC_HELP_STRING([--enable-stripped_messages],
[Configure to enable stripped messages.])],
[db_cv_stripped_messages="$enable_stripped_messages"], [db_cv_stripped_messages="no"])
AC_MSG_RESULT($db_cv_stripped_messages)
AC_MSG_CHECKING(if --enable-dbm option specified)
AC_ARG_ENABLE(dbm,
[AC_HELP_STRING([--enable-dbm],
[Configure to enable the historic dbm interface.])],
[db_cv_dbm="$enable_dbm"], [db_cv_dbm="$db_cv_test"])
AC_MSG_RESULT($db_cv_dbm)
AC_MSG_CHECKING(if --enable-dtrace option specified)
AC_ARG_ENABLE(dtrace,
[AC_HELP_STRING([--enable-dtrace],
[Configure to build in dtrace static probes])],
[db_cv_dtrace="$enable_dtrace"], [db_cv_dtrace="no"])
AC_MSG_RESULT($db_cv_dtrace)
AC_MSG_CHECKING(if --enable-systemtap option specified)
AC_ARG_ENABLE(systemtap,
[AC_HELP_STRING([--enable-systemtap],
[Configure to use systemtap to emulate dtrace static probes])],
[db_cv_systemtap="$enable_systemtap"], [db_cv_systemtap="no"])
AC_MSG_RESULT($db_cv_systemtap)
AC_MSG_CHECKING(if --enable-perfmon-statistics option specified)
AC_ARG_ENABLE(perfmon_statistics,
[AC_HELP_STRING([--enable-perfmon-statistics],
[Configure to build in performance monitoring of statistics values @<:@default=no@:>@.])],
[db_cv_perfmon_statistics="$enable_perfmon_statistics"], [db_cv_perfmon_statistics="no"])
AC_MSG_RESULT($db_cv_perfmon_statistics)
AC_MSG_CHECKING(if --enable-uimutexes option specified)
AC_ARG_ENABLE(uimutexes,
[AC_HELP_STRING([--enable-uimutexes],
[Force use of Unix International mutexes.])],
[db_cv_uimutexes="$enable_uimutexes"], [db_cv_uimutexes="no"])
AC_MSG_RESULT($db_cv_uimutexes)
AC_MSG_CHECKING(if --enable-umrw option specified)
AC_ARG_ENABLE(umrw,
[AC_HELP_STRING([--enable-umrw],
[Mask harmless uninitialized memory read/writes.])],
[db_cv_umrw="$enable_umrw"], [db_cv_umrw="no"])
AC_MSG_RESULT($db_cv_umrw)
# Cryptography support.
# Until Berkeley DB 5.0, this was a simple yes/no decision.
# With the addition of support for Intel Integrated Performance Primitives (ipp)
# things are more complex. There are now three options:
# 1) don't build cryptography (no)
# 2) build using the built-in software implementation (yes)
# 3) build using the Intel IPP implementation (ipp)
# We handle this by making the primary configuration method:
# --with-cryptography={yes|no|ipp}
# which defaults to yes. The old enable/disable-cryptography argument is still
# supported for backwards compatibility.
AC_MSG_CHECKING(if --with-cryptography option specified)
AC_ARG_ENABLE(cryptography, [], [], enableval=$db_cv_build_full)
enable_cryptography="$enableval"
AC_ARG_WITH([cryptography],
AC_HELP_STRING([--with-cryptography=yes|no|ipp], [Build database cryptography support @<:@default=yes@:>@.]),
[], [with_cryptography=$enable_cryptography])
case "$with_cryptography" in
yes|no|ipp) ;;
*) AC_MSG_ERROR([unknown --with-cryptography argument \'$with_cryptography\']) ;;
esac
db_cv_build_cryptography="$with_cryptography"
AC_MSG_RESULT($db_cv_build_cryptography)
AC_MSG_CHECKING(if --with-mutex=MUTEX option specified)
AC_ARG_WITH(mutex,
[AC_HELP_STRING([--with-mutex=MUTEX],
[Select non-default mutex implementation.])],
[with_mutex="$withval"], [with_mutex="no"])
if test "$with_mutex" = "yes"; then
AC_MSG_ERROR([--with-mutex requires a mutex name argument])
fi
if test "$with_mutex" != "no"; then
db_cv_mutex="$with_mutex"
fi
AC_MSG_RESULT($with_mutex)
# --with-mutexalign=ALIGNMENT was the configuration option that Berkeley DB
# used before the DbEnv::mutex_set_align method was added.
AC_ARG_WITH(mutexalign,
[AC_HELP_STRING([--with-mutexalign=ALIGNMENT],
[Obsolete; use DbEnv::mutex_set_align instead.])],
[AC_MSG_ERROR(
[--with-mutexalign no longer supported, use DbEnv::mutex_set_align])])
AC_ARG_WITH(stacksize,
[AC_HELP_STRING([--with-stacksize=SIZE],
[Set the stack size for Berkeley DB threads.])],
[with_stacksize="$withval"], [with_stacksize="no"])
AC_MSG_CHECKING([if --with-tcl=DIR option specified])
AC_ARG_WITH(tcl,
[AC_HELP_STRING([--with-tcl=DIR],
[Directory location of tclConfig.sh.])],
[with_tclconfig="$withval"], [with_tclconfig="no"])
AC_MSG_RESULT($with_tclconfig)
if test "$with_tclconfig" != "no"; then
db_cv_tcl="yes"
fi
AC_MSG_CHECKING([if --with-uniquename=NAME option specified])
AC_ARG_WITH(uniquename,
[AC_HELP_STRING([--with-uniquename=NAME],
[Build a uniquely named library.])],
[with_uniquename="$withval"], [with_uniquename="no"])
if test "$with_uniquename" = "no"; then
db_cv_uniquename="no"
DB_VERSION_UNIQUE_NAME=""
AC_MSG_RESULT($with_uniquename)
else
db_cv_uniquename="yes"
if test "$with_uniquename" = "yes"; then
DB_VERSION_UNIQUE_NAME="__EDIT_DB_VERSION_UNIQUE_NAME__"
else
DB_VERSION_UNIQUE_NAME="$with_uniquename"
fi
AC_MSG_RESULT($DB_VERSION_UNIQUE_NAME)
fi
# Undocumented option used for the dbsql command line tool (to match SQLite).
AC_ARG_ENABLE(readline, [], [with_readline=$enableval], [with_readline=no])
# --enable-sql_compat implies --enable-sql
if test "$db_cv_sql_compat" = "yes" -a "$db_cv_sql" = "no"; then
db_cv_sql=$db_cv_sql_compat
fi
# --enable-jdbc implies --enable-sql
if test "$db_cv_jdbc" = "yes" -a "$db_cv_sql" = "no"; then
db_cv_sql=$db_cv_jdbc
fi
# Testing requires Tcl.
if test "$db_cv_test" = "yes" -a "$db_cv_tcl" = "no"; then
AC_MSG_ERROR([--enable-test requires --enable-tcl])
fi])

97
dist/aclocal/perfmon.m4 vendored Normal file
View file

@ -0,0 +1,97 @@
# $Id$
# Determine what kind of application-specified performance event monitoring
# support is available for this platform. The options are:
# --enable-dtrace is supported on
# Solaris
# Linux SystemTap 1.1 or better
# Mac OS X version 10.5 (Leopard) or better
AC_DEFUN(AM_DEFINE_PERFMON, [
AH_TEMPLATE(HAVE_PERFMON,
[Define to 1 to enable some kind of performance event monitoring.])
AH_TEMPLATE(HAVE_PERFMON_STATISTICS,
[Define to 1 to enable performance event monitoring of *_stat() statistics.])
AH_TEMPLATE(HAVE_DTRACE,
[Define to 1 to use dtrace for performance monitoring.])
if test "$db_cv_systemtap" = "yes" ; then
if test "$DTRACE" != "dtrace"; then
AC_MSG_ERROR([The dtrace program is missing; is systemtap v1.1 or better installed?])
fi
db_cv_dtrace="yes"
fi
if test "$db_cv_dtrace" = "yes" ; then
db_cv_perfmon="yes"
fi
AC_SUBST(DTRACE_CPP)
DTRACE_CPP=-C
if test "$db_cv_perfmon" = "yes" ; then
if test "$DTRACE" = "dtrace" ; then
AC_CHECK_HEADERS(sys/sdt.h)
# Generate the DTrace provider header file. This is duplicated
# in Makefile.in, to allow custom events to be added.
if test "$STAP" = "stap"; then
# Linux DTrace support may have a bug with dtrace -C -h
# The preprocessing isn't needed for -h on Linux,
# so skip the unnecessary preprocessing.
DTRACE_CPP=
fi
# The OS X version of dtrace prints a spurious line here.
if ! dtrace -h $DTRACE_CPP -I../util/dtrace -s ../dist/db_provider.d; then
AC_MSG_ERROR([Could not build db_provider.d: dtrace -h failed])
fi
$RM db_provider.h.tmp
if ! mv db_provider.h db_provider.h.tmp ; then
AC_MSG_ERROR([Could not build db_provider.d: mv failed])
elif ! sed -e \
'/^#define[ ]*BDB_[A-Z_]*(.*)/y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' \
db_provider.h.tmp > db_provider.h ; then
AC_MSG_ERROR([Could not build db_provider.d: sed failed])
fi
# DTrace on Solaris needs to post-process .o files to both
# generate an additional .o as well as resolving the
# __dtrace___bdb___<xxx> symbols before putting them into
# libraries; Mac OS X does not. Treat a failing dtrace -G
# command as the indicator sign that dtrace -G is unnecessary.
# If it is needed then create an empty .c file to be a
# placeholder for the PIC & non-PIC versions of the dtrace -G
# output file. The root of this .c file must be the same as
# the root of the .d file -- i.e. db_provider -- for the
# dtrace -G lines at the end of Makefile.in to work correctly.
$RM db_provider.o
if dtrace -G $DTRACE_CPP -I../util/dtrace -s ../dist/db_provider.d 2> /dev/null && \
test -f db_provider.o ; then
FINAL_OBJS="$FINAL_OBJS db_provider${o}"
rm -f db_provider.c
echo "" > db_provider.c
fi
AC_DEFINE(HAVE_DTRACE)
else
AC_MSG_ERROR([No supported performance utility found.])
fi
AC_DEFINE(HAVE_PERFMON)
if test "$db_cv_perfmon_statistics" != "no" ; then
AC_DEFINE(HAVE_PERFMON_STATISTICS)
fi
# The method by which probes are listed depends on the underlying
# implementation; Linux's emulation of DTrace still uses the stap
# command at runtime.
AC_SUBST(LISTPROBES_DEPENDENCY)
AC_SUBST(LISTPROBES_COMMAND)
if test "$STAP" = "stap"; then
LISTPROBES_DEPENDENCY=.libs/libdb-$DB_VERSION_MAJOR.$DB_VERSION_MINOR$SOSUFFIX
LISTPROBES_COMMAND="stap -l 'process(\"$LISTPROBES_DEPENDENCY\").mark(\"*\")'"
elif test "$DTRACE" = "dtrace" ; then
LISTPROBES_DEPENDENCY=db_load
LISTPROBES_COMMAND="dnl
# Run a simple command which uses the library without needing any setup.
sleep 1 | dtrace -l -n 'bdb\$\$target:::' -c '.libs/db_load dummy.db'"
fi
elif test "$db_cv_perfmon_statistics" = "yes" ; then
AC_MSG_ERROR([Enabling perfmon statistics requires --enable-dtrace])
fi
])

59
dist/aclocal/programs.m4 vendored Normal file
View file

@ -0,0 +1,59 @@
# $Id$
# Check for programs used in building/installation.
AC_DEFUN(AM_PROGRAMS_SET, [
AC_CHECK_TOOL(CHMOD, chmod, none)
test "$CHMOD" = "none" && AC_MSG_ERROR([No chmod utility found.])
AC_CHECK_TOOL(CP, cp, none)
test "$CP" = "none" && AC_MSG_ERROR([No cp utility found.])
# The Tcl test suite requires a kill utility.
if test "$db_cv_test" = "yes"; then
AC_CHECK_TOOL(KILL, kill, none)
test "$KILL" = "none" && AC_MSG_ERROR([No kill utility found.])
fi
AC_CHECK_TOOL(LN, ln, none)
test "$LN" = "none" && AC_MSG_ERROR([No ln utility found.])
AC_CHECK_TOOL(MKDIR, mkdir, none)
test "$MKDIR" = "none" && AC_MSG_ERROR([No mkdir utility found.])
AC_CHECK_TOOL(RM, rm, none)
test "$RM" = "none" && AC_MSG_ERROR([No rm utility found.])
# We always want to force removes, and libtool assumes the same.
RM="$RM -f"
AC_CHECK_TOOL(MV, mv, none)
test "$MV" = "none" && AC_MSG_ERROR([No mv utility found.])
if test "$db_cv_systemtap" = "yes" -o "$db_cv_dtrace" = "yes"; then
AC_CHECK_TOOL(STAP, stap, none)
test "$STAP" = "none" -a "$db_cv_systemtap" = "yes" && \
AC_MSG_ERROR([No stap utility found.])
db_cv_dtrace=yes
fi
if test "$db_cv_dtrace" = "yes"; then
AC_CHECK_TOOL(DTRACE, dtrace, none)
test "$DTRACE" = "none" && AC_MSG_ERROR([No dtrace utility found.])
# Sed and perl are needed only if events are added after building
# the distribution; if either is missing it is not an error for now.
AC_CHECK_TOOL(SED, sed, none)
AC_CHECK_TOOL(PERL, perl, none)
fi
# We need a complete path for sh, because some make utility implementations get
# upset if SHELL is set to just the command name. Don't use the SHELL variable
# here because the user likely has the SHELL variable set to something other
# than the Bourne shell, which is what Make wants.
AC_PATH_TOOL(db_cv_path_sh, sh, none)
test "$db_cv_path_sh" = "none" && AC_MSG_ERROR([No sh utility found.])
# Don't strip the binaries if --enable-debug was specified.
if test "$db_cv_debug" = yes; then
STRIP=":"
fi])

91
dist/aclocal/sequence.m4 vendored Normal file
View file

@ -0,0 +1,91 @@
# $Id$
# Try and configure sequence support.
AC_DEFUN(AM_SEQUENCE_CONFIGURE, [
AC_MSG_CHECKING([for 64-bit integral type support for sequences])
db_cv_build_sequence="yes"
# Have to have found 64-bit types to support sequences. If we don't
# find the native types, we try and create our own.
if test "$ac_cv_type_int64_t" = "no" -a -z "$int64_decl"; then
db_cv_build_sequence="no"
fi
if test "$ac_cv_type_uint64_t" = "no" -a -z "$u_int64_decl"; then
db_cv_build_sequence="no"
fi
# Figure out what type is the right size, and set the format.
AC_SUBST(INT64_FMT)
AC_SUBST(UINT64_FMT)
db_cv_seq_type="no"
if test "$db_cv_build_sequence" = "yes" -a\
"$ac_cv_sizeof_long" -eq "8"; then
db_cv_seq_type="long"
db_cv_seq_fmt='"%ld"'
db_cv_seq_ufmt='"%lu"'
INT64_FMT='#define INT64_FMT "%ld"'
UINT64_FMT='#define UINT64_FMT "%lu"'
else if test "$db_cv_build_sequence" = "yes" -a\
"$ac_cv_sizeof_long_long" -eq "8"; then
db_cv_seq_type="long long"
db_cv_seq_fmt='"%lld"'
db_cv_seq_ufmt='"%llu"'
INT64_FMT='#define INT64_FMT "%lld"'
UINT64_FMT='#define UINT64_FMT "%llu"'
else
db_cv_build_sequence="no"
fi
fi
# Test to see if we can declare variables of the appropriate size
# and format them. If we're cross-compiling, all we get is a link
# test, which won't test for the appropriate printf format strings.
if test "$db_cv_build_sequence" = "yes"; then
AC_TRY_RUN([
main() {
$db_cv_seq_type l;
unsigned $db_cv_seq_type u;
char buf@<:@100@:>@;
buf@<:@0@:>@ = 'a';
l = 9223372036854775807LL;
(void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
if (strcmp(buf, "9223372036854775807"))
return (1);
u = 18446744073709551615ULL;
(void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
if (strcmp(buf, "18446744073709551615"))
return (1);
return (0);
}],, [db_cv_build_sequence="no"],
AC_TRY_LINK(,[
$db_cv_seq_type l;
unsigned $db_cv_seq_type u;
char buf@<:@100@:>@;
buf@<:@0@:>@ = 'a';
l = 9223372036854775807LL;
(void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
if (strcmp(buf, "9223372036854775807"))
return (1);
u = 18446744073709551615ULL;
(void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
if (strcmp(buf, "18446744073709551615"))
return (1);
return (0);
],, [db_cv_build_sequence="no"]))
fi
if test "$db_cv_build_sequence" = "yes"; then
AC_SUBST(db_seq_decl)
db_seq_decl="typedef $db_cv_seq_type db_seq_t;";
AC_DEFINE(HAVE_64BIT_TYPES)
AH_TEMPLATE(HAVE_64BIT_TYPES,
[Define to 1 if 64-bit types are available.])
else
# It still has to compile, but it won't run.
db_seq_decl="typedef int db_seq_t;";
fi
AC_MSG_RESULT($db_cv_build_sequence)
])

55
dist/aclocal/socklen.m4 vendored Normal file
View file

@ -0,0 +1,55 @@
dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Albert Chin, Windows fixes from Simon Josefsson.
dnl Check for socklen_t: historically on BSD it is an int, and in
dnl POSIX 1g it is a type of its own, but some platforms use different
dnl types for the argument to getsockopt, getpeername, etc. So we
dnl have to test to find something that will work.
dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
dnl it there first. That file is included by gnulib's socket_.h, which
dnl all users of this module should include. Cygwin must not include
dnl ws2tcpip.h.
dnl Windows fixes removed for Berkeley DB. Functions renamed, basic check
dnl remains the same though.
dnl !!!
dnl The original version had fixes for MinGW -- if you need those, go back
dnl and look at the original code.
AC_DEFUN([AM_SOCKLEN_T],[
AC_CHECK_TYPE([socklen_t], ,
[AC_MSG_CHECKING([for socklen_t equivalent])
AC_CACHE_VAL([db_cv_socklen_t_equiv],
[# Systems have either "struct sockaddr *" or
# "void *" as the second argument to getpeername
db_cv_socklen_t_equiv=
for arg2 in "struct sockaddr" void; do
for t in int size_t "unsigned int" "long int" "unsigned long int"; do
AC_TRY_COMPILE([$db_includes
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
int getpeername (int, $arg2 *, $t *);],
[$t len;
getpeername (0, 0, &len);],
[db_cv_socklen_t_equiv="$t"])
test "$db_cv_socklen_t_equiv" != "" && break
done
test "$db_cv_socklen_t_equiv" != "" && break
done
])
if test "$db_cv_socklen_t_equiv" = ""; then
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
fi
AC_MSG_RESULT([$db_cv_socklen_t_equiv])
AC_DEFINE_UNQUOTED([socklen_t], [$db_cv_socklen_t_equiv],
[type to use in place of socklen_t if not defined])],
[$db_includes
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif])])

75
dist/aclocal/sosuffix.m4 vendored Normal file
View file

@ -0,0 +1,75 @@
# $Id$
# Determine shared object suffixes.
#
# Our method is to use the libtool variable $library_names_spec,
# set by using AC_PROG_LIBTOOL. This variable is a snippet of shell
# defined in terms of $versuffix, $release, $libname and $module
# We want to eval it and grab the suffix used for shared objects.
# By setting $module to yes/no, we obtain the suffixes
# used to create dlloadable, or java loadable modules.
# On many (*nix) systems, these all evaluate to .so, but there
# are some notable exceptions.
# Before calling this macro, libtool must have been configured.
# This macro is used internally to discover the suffix for the current
# settings of $module. The result is stored in $_SOSUFFIX.
AC_DEFUN(_SOSUFFIX_INTERNAL, [
versuffix=""
release=""
libname=libfoo
eval _SOSUFFIX=\"$shrext_cmds\"
if test "$_SOSUFFIX" = "" ; then
_SOSUFFIX=".so"
if test "$enable_shared" != "yes"; then
if test "$_SOSUFFIX_MESSAGE" = ""; then
_SOSUFFIX_MESSAGE=yes
AC_MSG_WARN([libtool may not know about this architecture.])
AC_MSG_WARN([assuming $_SOSUFFIX suffix for dynamic libraries.])
fi
fi
fi
])
# SOSUFFIX_CONFIG will set the variable SOSUFFIX to be the
# shared library extension used for general linking, not dlopen.
AC_DEFUN(SOSUFFIX_CONFIG, [
AC_MSG_CHECKING([SOSUFFIX from libtool])
module=no
_SOSUFFIX_INTERNAL
SOSUFFIX=$_SOSUFFIX
AC_MSG_RESULT($SOSUFFIX)
AC_SUBST(SOSUFFIX)
])
# MODSUFFIX_CONFIG will set the variable MODSUFFIX to be the
# shared library extension used for dlopen'ed modules.
# To discover this, we set $module, simulating libtool's -module option.
AC_DEFUN(MODSUFFIX_CONFIG, [
AC_MSG_CHECKING([MODSUFFIX from libtool])
module=yes
_SOSUFFIX_INTERNAL
MODSUFFIX=$_SOSUFFIX
AC_MSG_RESULT($MODSUFFIX)
AC_SUBST(MODSUFFIX)
])
# JMODSUFFIX_CONFIG will set the variable JMODSUFFIX to be the
# shared library extension used JNI modules opened by Java.
# To discover this, we set $jnimodule, simulating libtool's -shrext option.
##########################################################################
# Robert Boehne: Not much point in this macro any more because apparently
# Darwin is the only OS that wants or needs the .jnilib extension.
##########################################################################
AC_DEFUN(JMODSUFFIX_CONFIG, [
AC_MSG_CHECKING([JMODSUFFIX from libtool])
module=yes
_SOSUFFIX_INTERNAL
if test `uname` = "Darwin"; then
JMODSUFFIX=".jnilib"
else
JMODSUFFIX=$_SOSUFFIX
fi
AC_MSG_RESULT($JMODSUFFIX)
AC_SUBST(JMODSUFFIX)
])

138
dist/aclocal/tcl.m4 vendored Normal file
View file

@ -0,0 +1,138 @@
# $Id$
# The SC_* macros in this file are from the unix/tcl.m4 files in the Tcl
# 8.3.0 distribution, with some minor changes. For this reason, license
# terms for the Berkeley DB distribution dist/aclocal/tcl.m4 file are as
# follows (copied from the license.terms file in the Tcl 8.3 distribution):
#
# This software is copyrighted by the Regents of the University of
# California, Sun Microsystems, Inc., Scriptics Corporation,
# and other parties. The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided
# that existing copyright notices are retained in all copies and that this
# notice is included verbatim in any distributions. No written agreement,
# license, or royalty fee is required for any of the authorized uses.
# Modifications to this software may be copyrighted by their authors
# and need not follow the licensing terms described here, provided that
# the new terms are clearly indicated on the first page of each file where
# they apply.
#
# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
# MODIFICATIONS.
#
# GOVERNMENT USE: If you are acquiring this software on behalf of the
# U.S. government, the Government shall have only "Restricted Rights"
# in the software and related documentation as defined in the Federal
# Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
# are acquiring the software on behalf of the Department of Defense, the
# software shall be classified as "Commercial Computer Software" and the
# Government shall have only "Restricted Rights" as defined in Clause
# 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
# authors grant the U.S. Government and others acting in its behalf
# permission to use and distribute the software in accordance with the
# terms specified in this license.
AC_DEFUN(SC_PATH_TCLCONFIG, [
AC_CACHE_VAL(ac_cv_c_tclconfig,[
# First check to see if --with-tclconfig was specified.
if test "${with_tclconfig}" != no; then
if test -f "${with_tclconfig}/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
else
AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
fi
fi
# check in a few common install locations
if test x"${ac_cv_c_tclconfig}" = x ; then
for i in `ls -d /usr/local/lib 2>/dev/null` ; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i; pwd)`
break
fi
done
fi
])
if test x"${ac_cv_c_tclconfig}" = x ; then
TCL_BIN_DIR="# no Tcl configs found"
AC_MSG_ERROR(can't find Tcl configuration definitions)
else
TCL_BIN_DIR=${ac_cv_c_tclconfig}
fi
])
AC_DEFUN(SC_LOAD_TCLCONFIG, [
AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
AC_MSG_RESULT([loading])
. $TCL_BIN_DIR/tclConfig.sh
else
AC_MSG_RESULT([file not found])
fi
# DB requires at least version 8.4.
if test ${TCL_MAJOR_VERSION} -lt 8 \
-o ${TCL_MAJOR_VERSION} -eq 8 -a ${TCL_MINOR_VERSION} -lt 4; then
AC_MSG_ERROR([Berkeley DB requires Tcl version 8.4 or better.])
fi
# The eval is required to do substitution (for example, the TCL_DBGX
# substitution in the TCL_LIB_FILE variable.
eval "TCL_INCLUDE_SPEC=\"${TCL_INCLUDE_SPEC}\""
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
#
# If the DB Tcl library isn't loaded with the Tcl spec and library
# flags on AIX, the resulting libdb_tcl-X.Y.so.0 will drop core at
# load time. [#4843] Furthermore, with Tcl 8.3, the link flags
# given by the Tcl spec are insufficient for our use. [#5779],[#17109]
#
case "$host_os" in
aix*)
LIBTSO_LIBS="$LIBTSO_LIBS $TCL_LIB_SPEC $TCL_LIB_FLAG"
LIBTSO_LIBS="$LIBTSO_LIBS -L$TCL_EXEC_PREFIX/lib -ltcl$TCL_VERSION";;
esac
AC_SUBST(TCL_BIN_DIR)
AC_SUBST(TCL_INCLUDE_SPEC)
AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_TCLSH)
TCL_TCLSH="${TCL_PREFIX}/bin/tclsh${TCL_VERSION}"
])
# Optional Tcl API.
AC_DEFUN(AM_TCL_LOAD, [
SC_PATH_TCLCONFIG
SC_LOAD_TCLCONFIG
if test "$enable_shared" = "no"; then
DEFAULT_LIB_TCL="\$(libtcl_version)"
fi
if test "$enable_shared" = "yes"; then
DEFAULT_LIB_TCL="\$(libtso_target)"
fi
INSTALL_LIBS="$INSTALL_LIBS $DEFAULT_LIB_TCL"
if test "$enable_static" = "yes"; then
INSTALL_LIBS="$INSTALL_LIBS \$(libtcl)"
fi
])

65
dist/aclocal/tls.m4 vendored Normal file
View file

@ -0,0 +1,65 @@
# Check for thread local storage support.
# Required when building with DB STL support.
# Based in part on: http://autoconf-archive.cryp.to/ax_tls.html
# by Alan Woodland <ajw05@aber.ac.uk>
AC_DEFUN([AX_TLS], [
AC_MSG_CHECKING(for thread local storage (TLS) class)
AC_SUBST(TLS_decl)
AC_SUBST(TLS_defn)
ac_cv_tls=none
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ax_tls_keywords="__thread __declspec(thread) __declspec(__thread)"
for ax_tls_decl_keyword in $ax_tls_keywords ""; do
for ax_tls_defn_keyword in $ax_tls_keywords ""; do
test -z "$ax_tls_decl_keyword" &&
test -z "$ax_tls_defn_keyword" && continue
AC_TRY_COMPILE([template <typename T>class TLSClass {
public: static ] $ax_tls_decl_keyword [ T *tlsvar;
};
class TLSClass2 {
public: static ] $ax_tls_decl_keyword [int tlsvar;
};
template<typename T> ] $ax_tls_defn_keyword [ T* TLSClass<T>::tlsvar = NULL;]
$ax_tls_defn_keyword [int TLSClass2::tlsvar = 1;
static $ax_tls_decl_keyword int x = 0;],
[TLSClass<int>::tlsvar = NULL; TLSClass2::tlsvar = 1;],
[ac_cv_tls=modifier ; break])
done
test "$ac_cv_tls" = none || break
done
AC_LANG_RESTORE
if test "$ac_cv_tls" = "none" ; then
AC_TRY_COMPILE(
[#include <stdlib.h>
#include <pthread.h>
static pthread_once_t once_control_ = PTHREAD_ONCE_INIT;
static pthread_key_t key;
static void init_once(void) {
pthread_key_create(&key, NULL);
}
static void *get_tls() {
return (void *)pthread_getspecific(&key);
}
static void set_tls(void *p) {
pthread_setspecific(&key, p);
}], [],
[ac_cv_tls=pthread])
fi
case "$ac_cv_tls" in
none) break ;;
pthread)
TLS_decl="#define HAVE_PTHREAD_TLS"
TLS_defn="" ;;
modifier)
TLS_decl="#define TLS_DECL_MODIFIER $ax_tls_decl_keyword"
TLS_defn="#define TLS_DEFN_MODIFIER $ax_tls_defn_keyword" ;;
esac
AC_MSG_RESULT([$ac_cv_tls])
])

212
dist/aclocal/types.m4 vendored Normal file
View file

@ -0,0 +1,212 @@
# $Id$
# Check the sizes we know about, and see if any of them match what's needed.
#
# Prefer ints to anything else, because read, write and others historically
# returned an int.
AC_DEFUN(AM_SEARCH_USIZES, [
case "$3" in
"$ac_cv_sizeof_unsigned_int")
$1="typedef unsigned int $2;";;
"$ac_cv_sizeof_unsigned_char")
$1="typedef unsigned char $2;";;
"$ac_cv_sizeof_unsigned_short")
$1="typedef unsigned short $2;";;
"$ac_cv_sizeof_unsigned_long")
$1="typedef unsigned long $2;";;
"$ac_cv_sizeof_unsigned_long_long")
$1="typedef unsigned long long $2;";;
*)
if test "$4" != "notfatal"; then
AC_MSG_ERROR([No unsigned $3-byte integral type])
fi;;
esac])
AC_DEFUN(AM_SEARCH_SSIZES, [
case "$3" in
"$ac_cv_sizeof_int")
$1="typedef int $2;";;
"$ac_cv_sizeof_char")
$1="typedef char $2;";;
"$ac_cv_sizeof_short")
$1="typedef short $2;";;
"$ac_cv_sizeof_long")
$1="typedef long $2;";;
"$ac_cv_sizeof_long_long")
$1="typedef long long $2;";;
*)
if test "$4" != "notfatal"; then
AC_MSG_ERROR([No signed $3-byte integral type])
fi;;
esac])
# Check for the standard system types.
AC_DEFUN(AM_TYPES, [
# db.h includes <sys/types.h> and <stdio.h>, not the other default includes
# autoconf usually includes. For that reason, we specify a set of includes
# for all type checking tests. [#5060]
#
# C99 says types should be in <stdint.h>; include <stdint.h> if it exists.
#
# Some systems have types in <stddef.h>; include <stddef.h> if it exists.
#
# IBM's OS/390 and z/OS releases have types in <inttypes.h> not also found
# in <sys/types.h>; include <inttypes.h> if it exists.
db_includes="#include <sys/types.h>"
AC_SUBST(inttypes_h_decl)
AC_CHECK_HEADER(inttypes.h, [
db_includes="$db_includes
#include <inttypes.h>"
inttypes_h_decl="#include <inttypes.h>"])
# IRIX has stdint.h that is only available when using c99 (i.e. __c99
# is defined). Problem with having it in a public header is that a c++
# compiler cannot #include <db.h> if db.h #includes stdint.h, so we
# need to check that stdint.h is available for all cases. Also the
# IRIX compiler does not exit with a non-zero exit code when it sees
# #error, so we actually need to use the header for the compiler to fail.
AC_SUBST(stdint_h_decl)
AC_MSG_CHECKING(for stdint.h)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <stdint.h>
int main() {
uint_least8_t x=0;
return x;
}])],[AC_MSG_RESULT(yes)
if test "$db_cv_cxx" = "yes"; then
AC_MSG_CHECKING([if stdint.h can be used by C++])
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <stdint.h>
int main() {
uint_least8_t x=0;
return x;
}])],[AC_MSG_RESULT(yes)
stdint_h_decl="#include <stdint.h>"
db_includes="$db_includes
#include <stdint.h>"
],[AC_MSG_RESULT(no)
stdint_h_decl="#ifndef __cplusplus
#include <stdint.h>
#endif"
db_includes="$db_includes
#ifndef __cplusplus
#include <stdint.h>
#endif"
])
AC_LANG_POP
else
stdint_h_decl="#include <stdint.h>"
db_includes="$db_includes
#include <stdint.h>"
fi],[AC_MSG_RESULT(no)])
AC_SUBST(stddef_h_decl)
AC_CHECK_HEADER(stddef.h, [
db_includes="$db_includes
#include <stddef.h>"
stddef_h_decl="#include <stddef.h>"])
AC_SUBST(unistd_h_decl)
AC_CHECK_HEADER(unistd.h, [
db_includes="$db_includes
#include <unistd.h>"
unistd_h_decl="#include <unistd.h>"])
db_includes="$db_includes
#include <stdio.h>"
# We need to know the sizes of various objects on this system.
AC_CHECK_SIZEOF(char,, $db_includes)
AC_CHECK_SIZEOF(unsigned char,, $db_includes)
AC_CHECK_SIZEOF(short,, $db_includes)
AC_CHECK_SIZEOF(unsigned short,, $db_includes)
AC_CHECK_SIZEOF(int,, $db_includes)
AC_CHECK_SIZEOF(unsigned int,, $db_includes)
AC_CHECK_SIZEOF(long,, $db_includes)
AC_CHECK_SIZEOF(unsigned long,, $db_includes)
AC_CHECK_SIZEOF(long long,, $db_includes)
AC_CHECK_SIZEOF(unsigned long long,, $db_includes)
AC_CHECK_SIZEOF(char *,, $db_includes)
# We look for u_char, u_short, u_int, u_long -- if we can't find them,
# we create our own.
AC_SUBST(u_char_decl)
AC_CHECK_TYPE(u_char,,
[u_char_decl="typedef unsigned char u_char;"], $db_includes)
AC_SUBST(u_short_decl)
AC_CHECK_TYPE(u_short,,
[u_short_decl="typedef unsigned short u_short;"], $db_includes)
AC_SUBST(u_int_decl)
AC_CHECK_TYPE(u_int,,
[u_int_decl="typedef unsigned int u_int;"], $db_includes)
AC_SUBST(u_long_decl)
AC_CHECK_TYPE(u_long,,
[u_long_decl="typedef unsigned long u_long;"], $db_includes)
# We look for fixed-size variants of u_char, u_short, u_int, u_long as well.
AC_SUBST(u_int8_decl)
AC_CHECK_TYPE(u_int8_t,,
[AM_SEARCH_USIZES(u_int8_decl, u_int8_t, 1)], $db_includes)
AC_SUBST(u_int16_decl)
AC_CHECK_TYPE(u_int16_t,,
[AM_SEARCH_USIZES(u_int16_decl, u_int16_t, 2)], $db_includes)
AC_SUBST(int16_decl)
AC_CHECK_TYPE(int16_t,,
[AM_SEARCH_SSIZES(int16_decl, int16_t, 2)], $db_includes)
AC_SUBST(u_int32_decl)
AC_CHECK_TYPE(u_int32_t,,
[AM_SEARCH_USIZES(u_int32_decl, u_int32_t, 4)], $db_includes)
AC_SUBST(int32_decl)
AC_CHECK_TYPE(int32_t,,
[AM_SEARCH_SSIZES(int32_decl, int32_t, 4)], $db_includes)
AC_SUBST(u_int64_decl)
AC_CHECK_TYPE(u_int64_t,,
[AM_SEARCH_USIZES(u_int64_decl, u_int64_t, 8, notfatal)], $db_includes)
AC_SUBST(int64_decl)
AC_CHECK_TYPE(int64_t,,
[AM_SEARCH_SSIZES(int64_decl, int64_t, 8, notfatal)], $db_includes)
# No currently autoconf'd systems lack FILE, off_t pid_t, size_t, time_t.
#
# We require them, we don't try to substitute our own if we can't find them.
AC_SUBST(FILE_t_decl)
AC_CHECK_TYPE(FILE *,, AC_MSG_ERROR([No FILE type.]), $db_includes)
AC_SUBST(off_t_decl)
AC_CHECK_TYPE(off_t,, AC_MSG_ERROR([No off_t type.]), $db_includes)
AC_SUBST(pid_t_decl)
AC_CHECK_TYPE(pid_t,, AC_MSG_ERROR([No pid_t type.]), $db_includes)
AC_SUBST(size_t_decl)
AC_CHECK_TYPE(size_t,, AC_MSG_ERROR([No size_t type.]), $db_includes)
AC_SUBST(time_t_decl)
AC_CHECK_TYPE(time_t,, AC_MSG_ERROR([No time_t type.]), $db_includes)
# Check for ssize_t -- if none exists, find a signed integral type that's
# the same size as a size_t.
AC_CHECK_SIZEOF(size_t,, $db_includes)
AC_SUBST(ssize_t_decl)
AC_CHECK_TYPE(ssize_t,,
[AM_SEARCH_SSIZES(ssize_t_decl, ssize_t, $ac_cv_sizeof_size_t)],
$db_includes)
# Check for uintmax_t -- if none exists, find the largest unsigned integral
# type available.
AC_SUBST(uintmax_t_decl)
AC_CHECK_TYPE(uintmax_t,, [AC_CHECK_TYPE(unsigned long long,
[uintmax_t_decl="typedef unsigned long long uintmax_t;"],
[uintmax_t_decl="typedef unsigned long uintmax_t;"], $db_includes)])
# Check for uintptr_t -- if none exists, find an integral type which is
# the same size as a pointer.
AC_SUBST(uintptr_t_decl)
AC_CHECK_TYPE(uintptr_t,,
[AM_SEARCH_USIZES(uintptr_t_decl, uintptr_t, $ac_cv_sizeof_char_p)])
AM_SOCKLEN_T
])

527
dist/api_flags vendored Normal file
View file

@ -0,0 +1,527 @@
db_env_create
DB_CXX_NO_EXCEPTIONS # C++: return error values
DbEnv.close
# Sync database when automatically closing its db handles.
DB_FORCESYNC
DbEnv.dbremove
DB_AUTO_COMMIT # Implied transaction
DB_LOG_NO_DATA # UNDOC: Don't log the data.
DB_NOSYNC # UNDOC: Don't sync for a subdb remove
DB_TXN_NOT_DURABLE # UNDOC: Don't log the remove
DbEnv.dbrename
DB_AUTO_COMMIT # Implied transaction
DB_NOSYNC # Don't sync for a subdb rename
DbEnv.fileid_reset
DB_ENCRYPT # File contains encrypted databases
DbEnv.log_verify
DB_LOG_VERIFY_ERR # Verify failed.
DB_LOG_VERIFY_CAF # Continue after a failed check.
# Not the entire logs are verified, due to user specified log range,
# archiving, or other reasons. Only part of the entire logs verified.
DB_LOG_VERIFY_PARTIAL
DB_LOG_VERIFY_DBFILE # Verify only logs of one db file.
# Pre-scan log from last to first record to get aborts and timestamps.
DB_LOG_VERIFY_FORWARD
DB_LOG_VERIFY_INTERR # Got internal error during verify.
DB_LOG_VERIFY_WARNING # Got warnings during verify.
DB_LOG_VERIFY_VERBOSE # Output verbose information.
DbEnv.open
DB_CREATE # Create as necessary
DB_FAILCHK # Run failchk on open
DB_FAILCHK_ISALIVE # UNDOC: failchk with isalive, for SQL
DB_INIT_CDB # Concurrent Access Methods
DB_INIT_LOCK # Initialize locking
DB_INIT_LOG # Initialize logging
DB_INIT_MPOOL # Initialize mpool
DB_INIT_MUTEX # Initialize mutex
DB_INIT_REP # Initialize replication
DB_INIT_TXN # Initialize transactions
DB_LOCKDOWN # Lock memory into physical core
DB_NO_CHECKPOINT # UNDOC: Recover but do not checkpoint
DB_PRIVATE # DB_ENV is process local
DB_RECOVER # Run normal recovery
DB_RECOVER_FATAL # Run catastrophic recovery
DB_REGISTER # Multi-process registry
DB_SYSTEM_MEM # Use system-backed memory
DB_THREAD # Handle is free-threaded
DB_USE_ENVIRON # Use the environment
DB_USE_ENVIRON_ROOT # Use the environment if root
DbEnv.lock_stat
DB_STAT_CLEAR # Clear stats after return
DbEnv.lock_stat_print
DB_STAT_ALL # Everything
DB_STAT_ALLOC # Print allocation information
DB_STAT_CLEAR # Clear stats after return
DB_STAT_LOCK_CONF # Print lock conflict matrix
DB_STAT_LOCK_LOCKERS # Print lockers
DB_STAT_LOCK_OBJECTS # Print lock objects
DB_STAT_LOCK_PARAMS # Print lock parameters
DB_STAT_SUBSYSTEM # Print subsystems
DbEnv.lock_vec
DB_LOCK_CHECK # UNDOC: check for a lock
DB_LOCK_NOWAIT # Don't wait for an unavailable lock
DB_LOCK_RECORD # UNDOC: record lock
DB_LOCK_SET_TIMEOUT # UNDOC: set lock timeout
DB_LOCK_SWITCH # UNDOC: switch existing lock
DB_LOCK_UPGRADE # UNDOC: upgrade existing lock
DbEnv.log_archive
DB_ARCH_ABS # Absolute pathnames
DB_ARCH_DATA # Data files
DB_ARCH_LOG # Log files
DB_ARCH_REMOVE # Remove log files
DbEnv.log_put
DB_FLUSH # Flush data to disk
DB_LOG_CHKPNT # UNDOC: Flush supports a checkpoint
DB_LOG_COMMIT # UNDOC: Flush supports a commit
DB_LOG_NOCOPY # UNDOC: Don't copy data
DB_LOG_NOT_DURABLE # UNDOC: Do not log; keep in memory
DB_LOG_WRNOSYNC # UNDOC: Write, don't sync log_put
DbEnv.log_set_config
DB_LOG_DIRECT # Don't buffer log files in the OS
DB_LOG_DSYNC # Set O_DSYNC on the log
DB_LOG_AUTO_REMOVE # Automatically remove log files
DB_LOG_IN_MEMORY # Store logs in buffers in memory
DB_LOG_ZERO # Zero log file on creation
DbEnv.log_stat
DB_STAT_CLEAR # Clear stats after return
DbEnv.log_stat_print
DB_STAT_ALL # Everything
DB_STAT_ALLOC # Print allocation information
DB_STAT_CLEAR # Clear stats after return
DB_STAT_SUBSYSTEM # Print subsystems
DbEnv.lsn_reset
DB_ENCRYPT # File contains encrypted databases
DbEnv.memp_stat
DB_STAT_CLEAR # Clear stats after return
DbEnv.memp_stat_print
DB_STAT_ALL # Everything
DB_STAT_ALLOC # Print allocation information
DB_STAT_CLEAR # Clear stats after return
DB_STAT_MEMP_HASH # Print mpool hash buckets
DB_STAT_MEMP_NOERROR # UNDOC: continue on error
DB_STAT_SUBSYSTEM # Print subsystems
DbEnv.mutex_alloc
DB_MUTEX_ALLOCATED # UNDOC: Mutex currently allocated
DB_MUTEX_LOCKED # UNDOC: Mutex currently locked
DB_MUTEX_LOGICAL_LOCK # UNDOC: Mutex backs a database lock
DB_MUTEX_PROCESS_ONLY # Mutex private to a process
DB_MUTEX_SELF_BLOCK # Must be able to block self
DB_MUTEX_SHARED # Shared (read/write) mutex
DbEnv.mutex_stat
DB_STAT_CLEAR # Clear stats after return
DbEnv.mutex_stat_print
DB_STAT_ALL # Everything
DB_STAT_ALLOC # Print allocation information
DB_STAT_CLEAR # Clear stats after return
DB_STAT_SUBSYSTEM # Print subsystems
DbEnv.remove
DB_FORCE
DB_USE_ENVIRON # Use the environment
DB_USE_ENVIRON_ROOT # Use the environment if root
DbEnv.rep_set_config
DB_REPMGR_CONF_2SITE_STRICT # Don't cheat on election votes
DB_REPMGR_CONF_ELECTIONS # Manage elections to choose master
DB_REP_CONF_AUTOINIT # automatic client init
DB_REP_CONF_AUTOROLLBACK # UNDOC: discard txns to sync w/ master
DB_REP_CONF_BULK # Bulk transfer
DB_REP_CONF_DELAYCLIENT # Delay client synchronization
DB_REP_CONF_INMEM # In-memory replication
DB_REP_CONF_LEASE # Master leases
DB_REP_CONF_NOWAIT # Don't wait, return error
DbEnv.rep_set_transport
DB_REP_ANYWHERE # Message can be serviced anywhere
DB_REP_NOBUFFER # Do not buffer this message
DB_REP_PERMANENT # Important -- app may want to flush
DB_REP_REREQUEST # This msg already been requested
DbEnv.rep_start
DB_REP_CLIENT # Client
DB_REP_MASTER # Master
DbEnv.rep_stat
DB_STAT_CLEAR # Clear stats after return
DbEnv.rep_stat_print
DB_STAT_ALL # Everything
DB_STAT_ALLOC # Print allocation information
DB_STAT_CLEAR # Clear stats after return
DB_STAT_SUBSYSTEM # Print subsystems
DB_STAT_SUMMARY # UNDOC: print summary
# Covers both flags to the callback-setting method, and the callback itself
DbEnv.repmgr_msg_dispatch
DB_REPMGR_NEED_RESPONSE # Synchronous request message type
DbEnv.repmgr_start
DB_REP_CLIENT # Client
DB_REP_ELECTION # Election
DB_REP_MASTER # Master
DbEnv.repmgr_stat
DB_STAT_CLEAR # Clear stats after return
DbEnv.repmgr_stat_print
DB_STAT_ALL # Everything
DB_STAT_ALLOC # Print allocation information
DB_STAT_CLEAR # Clear stats after return
DB_STAT_SUBSYSTEM # Print subsystems
DbEnv.set_encrypt
DB_ENCRYPT_AES # AES, assumes SHA1 checksum
DbEnv.set_feedback.op
DB_RECOVER # Running recovery.
DbEnv.set_flags
DB_AUTO_COMMIT # Implied transaction
DB_CDB_ALLDB # Set CDB locking per environment
DB_DATABASE_LOCKING # UNDOC: try database-level locking
DB_DIRECT_DB # Don't buffer databases in the OS
DB_DSYNC_DB # Set O_DSYNC on the databases
DB_HOTBACKUP_IN_PROGRESS # Inhibit bulk loading optimization
DB_MULTIVERSION # Multiversion concurrency control
DB_NOLOCKING # Set locking/mutex behavior
DB_NOMMAP # Don't mmap the underlying file
DB_NOPANIC # Set panic state per environment
DB_NOFLUSH # UNDOC: don't flush cache on close
DB_OVERWRITE # Overwrite unlinked region files
DB_PANIC_ENVIRONMENT # Set panic state per environment
DB_REGION_INIT # Page-fault regions on open
DB_TIME_NOTGRANTED # Return NOTGRANTED on timeout
DB_TXN_NOSYNC # Do not sync log on commit
DB_TXN_NOWAIT # Do not wait for locks
DB_TXN_SNAPSHOT # Snapshot isolation
DB_TXN_WRITE_NOSYNC # Write the log bug don't sync
DB_YIELDCPU # Yield the CPU (a lot)
DbEnv.set_isalive
DB_MUTEX_ALLOCATED # UNDOC: Mutex currently allocated
DB_MUTEX_LOCKED # UNDOC: Mutex currently locked
DB_MUTEX_LOGICAL_LOCK # UNDOC: Mutex backs a database lock
DB_MUTEX_PROCESS_ONLY # Mutex private to a process
DB_MUTEX_SELF_BLOCK # Must be able to block self
DbEnv.set_timeout
DB_SET_LOCK_TIMEOUT # Set lock timeout
DB_SET_TXN_NOW # UNDOC: Timeout lock now
DB_SET_TXN_TIMEOUT # Set transaction timeout
DB_SET_REG_TIMEOUT # Set dbregister timeout
DbEnv.set_verbose
DB_VERB_DEADLOCK # Deadlock detection information
DB_VERB_FILEOPS # Major file operations
DB_VERB_FILEOPS_ALL # All file operations
DB_VERB_RECOVERY # Recovery information
DB_VERB_REGISTER # Dump waits-for table
DB_VERB_REPLICATION # All replication and repmgr output
DB_VERB_REPMGR_CONNFAIL # Repmgr connection failure output
DB_VERB_REPMGR_MISC # Miscellaneous repmgr output
DB_VERB_REP_ELECT # Replication election output
DB_VERB_REP_LEASE # Replication master lease output
DB_VERB_REP_MISC # Miscellaneous replication output
DB_VERB_REP_MSGS # Replication message output
DB_VERB_REP_SYNC # Replication client sync output
DB_VERB_REP_SYSTEM # Replication system messages
DB_VERB_REP_TEST # Replication temporary test output
DB_VERB_WAITSFOR # Dump waits-for table
DbEnv.stat_print
DB_STAT_ALL # Everything
DB_STAT_ALLOC # Print allocation information
DB_STAT_CLEAR # Clear stats after return
DB_STAT_SUBSYSTEM # Print subsystems
DbEnv.txn_begin
DB_IGNORE_LEASE # UNDOC: Ignore leases
DB_READ_COMMITTED # Degree 2 isolation
DB_READ_UNCOMMITTED # Degree 1 isolation
DB_TXN_NOSYNC # Do not sync log on commit
DB_TXN_NOWAIT # Do not wait for locks
DB_TXN_FAMILY # Cursors and child txns are
# independent but lock-compatible
DB_TXN_SNAPSHOT # Snapshot isolation
DB_TXN_SYNC # Always sync log on commit
DB_TXN_WAIT # Always wait for locks in this txn
DB_TXN_WRITE_NOSYNC # Write the log but don't sync
DB_TXN_BULK # Enable transactional bulk loading
DbEnv.txn_checkpoint
DB_CKP_INTERNAL # UNDOC: internally generated checkpoint
DB_FORCE # Force
DbEnv.txn_recover
__MASK=0xff # Berkeley DB operation codes.
DbEnv.txn_stat
DB_STAT_CLEAR # Clear stats after return
DbEnv.txn_stat_print
DB_STAT_ALL # Everything
DB_STAT_ALLOC # Print allocation information
DB_STAT_CLEAR # Clear stats after return
DB_STAT_SUBSYSTEM # Print subsystems
DbLogc.get
__MASK=0xff # Berkeley DB operation codes.
DbMpoolFile.close
DB_MPOOL_DISCARD # UNDOC: Discard file
DB_MPOOL_NOLOCK # UNDOC: Already have mpf locked
DbMpoolFile.get
DB_MPOOL_CREATE # Create a page
DB_MPOOL_DIRTY # Get page for an update
DB_MPOOL_EDIT # Modify without copying
DB_MPOOL_FREE # UNDOC: Free page if present
DB_MPOOL_LAST # Return the last page
DB_MPOOL_NEW # Create a new page
DB_MPOOL_TRY # Try to read a page, but don't block
DbMpoolFile.open
DB_CREATE # Create as necessary
DB_DIRECT # Don't buffer the file in the OS
DB_DURABLE_UNKNOWN # UNDOC: Durability on open
DB_EXTENT # UNDOC: dealing with an extent
DB_MULTIVERSION # Multiversion concurrency control
DB_NOMMAP # Don't mmap underlying file
DB_ODDFILESIZE # Truncate file to N * pgsize
DB_RDONLY # Read-only (O_RDONLY)
DB_TXN_NOT_DURABLE # UNDOC: Mark file not durable on open
DbMpoolFile.set_flags
DB_MPOOL_NOFILE # Never open a backing file
DB_MPOOL_UNLINK # Unlink the file on last close
DbSequence.get
DB_AUTO_COMMIT # UNDOC: compatibility only
DB_TXN_NOSYNC # Do not sync log on commit
DbSequence.open
DB_AUTO_COMMIT # UNDOC: compatibility only
DB_CREATE # Create as necessary
DB_EXCL # Exclusive open (O_EXCL)
DB_THREAD # Handle is free-threaded
DbSequence.remove
DB_TXN_NOSYNC # Do not sync log on commit
DbSequence.set_flags
DB_SEQ_DEC # Decrement sequence
DB_SEQ_INC # Increment sequence
DB_SEQ_RANGE_SET # UNDOC: Range set
DB_SEQ_WRAP # Wrap sequence at min/max
DB_SEQ_WRAPPED # UNDOC: Just wrapped
DbSequence.stat
DB_STAT_CLEAR # Clear stats after return
DbSequence.stat_print
DB_STAT_CLEAR # Clear stats after return
DB_STAT_SUBSYSTEM # Print subsystems
DbSite.set_config
DB_BOOTSTRAP_HELPER # Join target for new group member
DB_GROUP_CREATOR # Primordial membership DB creator
DB_LEGACY # Upgrading pre-5.2 group
DB_LOCAL_SITE # Identifies this as the local site
DB_REPMGR_PEER # C2C synchronization
DbTxn.commit
DB_TXN_NOSYNC # Do not sync log on commit
DB_TXN_SYNC # Always sync log on commit
DbTxn.set_timeout
DB_SET_LOCK_TIMEOUT # Set lock timeout
DB_SET_TXN_TIMEOUT # Set transaction timeout
db_create
DB_CXX_NO_EXCEPTIONS # C++: return error values
DB_XA_CREATE # Create a DBP for an XA database
Db.associate
DB_AUTO_COMMIT # UNDOC: compatibility only
DB_CREATE # Create as necessary
DB_IMMUTABLE_KEY # Secondary key is immutable
Db.associate_foreign
DB_FOREIGN_ABORT # If foreign key exists, delete aborts
DB_FOREIGN_CASCADE # If foreign key exists, delete cascades
DB_FOREIGN_NULLIFY # If foreign key exists, nullify it
Db.close
DB_NOSYNC # Berkeley DB operation codes.
Db.compact
DB_FREELIST_ONLY # Just sort and truncate
DB_FREE_SPACE # Free space
Db.cursor
DB_CURSOR_BULK # Optimize for bulk updates
DB_CURSOR_TRANSIENT # UNDOC: Single-use cursor
DB_READ_COMMITTED # Degree 2 isolation
DB_READ_UNCOMMITTED # Degree 1 isolation
DB_RECOVER # Called from recovery (internal)
DB_WRITECURSOR # Cursor can update (CDB)
DB_WRITELOCK # Cursor should get write locks
DB_TXN_SNAPSHOT # Snapshot isolation
Db.del
DB_AUTO_COMMIT # UNDOC: compatibility only
DB_MULTIPLE # Delete multiple data values
DB_MULTIPLE_KEY # Delete multiple key/data pairs
Db.exists
DB_READ_COMMITTED # Degree 2 isolation
DB_READ_UNCOMMITTED # Degree 1 isolation
DB_RMW # Acquire write lock immediately
Db.get
__MASK=0xff # Berkeley DB operation codes.
DB_AUTO_COMMIT # UNDOC: compatibility only
DB_IGNORE_LEASE # Ignore leases
DB_MULTIPLE # Return multiple data values
DB_READ_COMMITTED # Degree 2 isolation
DB_READ_UNCOMMITTED # Degree 1 isolation
DB_RMW # Acquire write lock immediately
Db.pget
__MASK=0xff # Berkeley DB operation codes.
DB_IGNORE_LEASE # Ignore leases
DB_MULTIPLE # Return multiple data values
DB_READ_COMMITTED # Degree 2 isolation
DB_READ_UNCOMMITTED # Degree 1 isolation
DB_RMW # Acquire write lock immediately
Db.join
DB_JOIN_NOSORT # Don't try to optmize join
Db.open
DB_AUTO_COMMIT # Implied transaction
DB_CREATE # Create file as necessary
DB_EXCL # Exclusive open (O_EXCL)
DB_FCNTL_LOCKING # UNDOC: fcntl(2) locking
DB_MULTIVERSION # Multiversion concurrency control
DB_NOMMAP # Don't mmap underlying file
DB_NO_AUTO_COMMIT # UNDOC: override env's AUTO_COMMIT
DB_RDONLY # Read-only (O_RDONLY)
DB_RDWRMASTER # UNDOC: allow subdb master open R/W
DB_READ_UNCOMMITTED # Degree 1 isolation
DB_THREAD # Handle is free-threaded
DB_TRUNCATE # Discard existing DB (O_TRUNC)
# The following flags aren't actually part of the Db.open method
# API, but they are accepted by the underlying __db_open function.
DB_DURABLE_UNKNOWN # UNDOC: Durability on open
DB_INTERNAL_DB # UNDOC: Open db in env dir
DB_NOERROR # UNDOC: Don't raise errors.
DB_ODDFILESIZE # UNDOC: Truncate file to N * pgsize
DB_WRITEOPEN # UNDOC: open with write lock
# The following flags are DB constructor flags. However, create and/or
# open of BDB XML containers is done in a single call (rather than the
# two-call "construct the object, then open it" paradigm used by DB),
# and they can't collide for that reason.
DB_CXX_NO_EXCEPTIONS # C++: return error values
Db.put
__MASK=0xff # Berkeley DB operation codes.
DB_AUTO_COMMIT # UNDOC: compatibility only
DB_MULTIPLE # Put multiple (from key and data DBTs)
DB_MULTIPLE_KEY # Put multiple (from key DBT)
Db.set_encrypt
DB_ENCRYPT_AES # AES, assumes SHA1 checksum
Db.set_feedback
DB_UPGRADE # Upgrading
DB_VERIFY # Verifying
Db.set_flags
DB_CHKSUM # Checksums
DB_DUP # Btree, Hash: duplicate keys
DB_DUPSORT # Btree, Hash: sorted duplicated
DB_ENCRYPT # AES, assumes SHA1 checksum
DB_INORDER # Queue: strict ordering on consume
DB_RECNUM # Btree: record numbers
DB_RENUMBER # Recno: renumber on insert/delete
DB_REVSPLITOFF # Btree: turn off reverse splits
DB_SNAPSHOT # Recno: snapshot the input
DB_TXN_NOT_DURABLE # Do not log changes
Db.stat
DB_FAST_STAT # Don't traverse the database
DB_READ_COMMITTED # Degree 2 isolation
DB_READ_UNCOMMITTED # Degree 1 isolation
Db.truncate
DB_AUTO_COMMIT # UNDOC: compatibility only
Db.upgrade
DB_DUPSORT # Upgrade duplicate data items
Db.verify
DB_AGGRESSIVE # Salvage whatever could be data
DB_NOORDERCHK # Skip sort order/hashing check
DB_ORDERCHKONLY # Only perform the order check
DB_PRINTABLE # Use printable format for salvage
DB_PR_PAGE # UNDOC: Show page contents (-da)
DB_PR_RECOVERYTEST # UNDOC: Recover test (-dr)
DB_SALVAGE # Salvage what looks like data
DB_UNREF # UNDOC: Report unreferenced pages
DB_VERIFY_PARTITION # Verifying a partition
# Flags understood by the btree structure checks (__bam_vrfy_subtree).
# These share the same space as the global flags to Db.verify.
DB_ST_DUPOK # UNDOC: Duplicates are acceptable
DB_ST_DUPSET # UNDOC: Subtree is in a duplicate tree
DB_ST_DUPSORT # UNDOC: Duplicates are sorted
DB_ST_IS_RECNO # UNDOC: Subtree is a recno
DB_ST_OVFL_LEAF # UNDOC: Overflow reffed from leaf page
DB_ST_RECNUM # UNDOC: Subtree has record numbering on
DB_ST_RELEN # UNDOC: Subtree has fixed-length recs
DB_ST_TOPLEVEL # UNDOC: Subtree == entire tree
# Flags understood by __bam_salvage and __db_salvage. These need not
# share name space with the __bam_vrfy_subtree flags, but must share
# with Db.verify.
DB_SA_SKIPFIRSTKEY # UNDOC: I have no idea what this does.
DB_SA_UNKNOWNKEY # UNDOC: The salvage key is unknown
DbCursor.dup
__MASK=0xff # Berkeley DB operation codes.
DB_SHALLOW_DUP # UNDOC: Don't duplicate compression info
DbCursor.get
__MASK=0xff # Berkeley DB operation codes.
DB_IGNORE_LEASE # Ignore leases
DB_MULTIPLE # Return multiple data values
DB_MULTIPLE_KEY # Return multiple key/data pairs
DB_READ_COMMITTED # Degree 2 isolation
DB_READ_UNCOMMITTED # Degree 1 isolation
DB_RMW # Acquire write lock immediately
DbCursor.put
__MASK=0xff # Berkeley DB operation codes.

444
dist/api_flags.c vendored Normal file
View file

@ -0,0 +1,444 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996, 2011 Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
typedef struct {
char *name; /* API name */
u_int used_mask; /* Bits used. */
} API;
API **api_list, **api_end;
typedef struct {
char *name; /* Flag name */
int api_cnt; /* APIs that use this flag. */
API **api, **api_end;
u_int value; /* Bit value */
} FLAG;
FLAG **flag_list, **flag_end;
int verbose;
char *progname;
int add_entry(char *, char *);
void define_print(char *, u_int);
void dump_api(void);
void dump_flags(void);
int flag_cmp_alpha(const void *, const void *);
int flag_cmp_api_cnt(const void *, const void *);
int generate_flags(void);
int parse(void);
void print_api_mask(void);
void print_api_remainder(void);
void print_flag_value(void);
int syserr(void);
int usage(void);
int
main(int argc, char *argv[])
{
enum { API_MASK, API_REMAINDER, FLAG_VALUE } output;
int ch;
if ((progname = strrchr(argv[0], '/')) == NULL)
progname = argv[0];
else
++progname;
output = FLAG_VALUE;
while ((ch = getopt(argc, argv, "mrv")) != EOF)
switch (ch) {
case 'm':
output = API_MASK;
break;
case 'r':
output = API_REMAINDER;
break;
case 'v':
verbose = 1;
break;
case '?':
default:
return (usage());
}
argc -= optind;
argv += optind;
if (parse() || generate_flags())
return (EXIT_FAILURE);
switch (output) {
case API_MASK:
print_api_mask();
break;
case API_REMAINDER:
print_api_remainder();
break;
case FLAG_VALUE:
print_flag_value();
break;
}
if (verbose) {
dump_api();
dump_flags();
}
return (EXIT_SUCCESS);
}
int
parse()
{
int lc;
char *p, *api, buf[256];
api = NULL;
/*
* Read the method name/flag pairs.
*/
for (lc = 1; fgets(buf, sizeof(buf), stdin) != NULL; ++lc) {
if ((p = strchr(buf, '\n')) != NULL)
*p = '\0';
else {
fprintf(
stderr, "%s: %d: line too long\n", progname, lc);
return (1);
}
/* Ignore any empty line or hash mark. */
if (buf[0] == '\0' || buf[0] == '#')
continue;
/*
* A line without leading whitespace is an API name, a line
* with leading whitespace is a flag name.
*/
if (isspace(buf[0])) {
if ((p = strtok(buf, " \t")) == NULL || *p == '#')
continue;
/* A flag without an API makes no sense. */
if (api == NULL)
goto format;
/* Enter the pair into the array. */
if (add_entry(api, p))
return (1);
} else {
if ((p = strtok(buf, " \t")) == NULL)
continue;
if (api != NULL)
free(api);
if ((api = strdup(p)) == NULL)
return (syserr());
}
if ((p = strtok(NULL, " \t")) != NULL && *p != '#')
goto format;
}
return (0);
format: fprintf(stderr, "%s: format error: line %d\n", progname, lc);
return (1);
}
int
add_entry(char *api_name, char *flag_name)
{
FLAG **fpp, *fp;
API **app, *ap, **p;
u_int cnt;
/* Search for this api's API structure. */
for (app = api_list;
app != NULL && *app != NULL && app < api_end; ++app)
if (strcmp(api_name, (*app)->name) == 0)
break;
/* Allocate new space in the API array if necessary. */
if (app == NULL || app == api_end) {
cnt = app == NULL ? 100 : (u_int)(api_end - api_list) + 100;
if ((api_list = realloc(api_list, sizeof(API *) * cnt)) == NULL)
return (syserr());
api_end = api_list + cnt;
app = api_list + (cnt - 100);
memset(app, 0, (u_int)(api_end - app) * sizeof(API *));
}
/* Allocate a new API structure and fill in the name if necessary. */
if (*app == NULL &&
((*app = calloc(sizeof(API), 1)) == NULL ||
((*app)->name = strdup(api_name)) == NULL))
return (syserr());
ap = *app;
/*
* There's a special keyword, "__MASK=<value>" that sets the initial
* flags value for an API, and so prevents those flag bits from being
* chosen for that API's flags.
*/
if (strncmp(flag_name, "__MASK=", sizeof("__MASK=") - 1) == 0) {
ap->used_mask |=
strtoul(flag_name + sizeof("__MASK=") - 1, NULL, 0);
return (0);
}
/* Search for this flag's FLAG structure. */
for (fpp = flag_list;
fpp != NULL && *fpp != NULL && fpp < flag_end; ++fpp)
if (strcmp(flag_name, (*fpp)->name) == 0)
break;
/* Realloc space in the FLAG array if necessary. */
if (fpp == NULL || fpp == flag_end) {
cnt = fpp == NULL ? 100 : (u_int)(flag_end - flag_list) + 100;
if ((flag_list =
realloc(flag_list, sizeof(FLAG *) * cnt)) == NULL)
return (syserr());
flag_end = flag_list + cnt;
fpp = flag_list + (cnt - 100);
memset(fpp, 0, (u_int)(flag_end - fpp) * sizeof(FLAG *));
}
/* Allocate a new FLAG structure and fill in the name if necessary. */
if (*fpp == NULL &&
((*fpp = calloc(sizeof(FLAG), 1)) == NULL ||
((*fpp)->name = strdup(flag_name)) == NULL))
return (syserr());
fp = *fpp;
++fp->api_cnt;
/* Check to see if this API is already listed for this flag. */
for (p = fp->api; p != NULL && *p != NULL && p < fp->api_end; ++p)
if (strcmp(api_name, (*p)->name) == 0) {
fprintf(stderr,
"duplicate entry: %s / %s\n", api_name, flag_name);
return (1);
}
/* Realloc space in the FLAG's API array if necessary. */
if (p == NULL || p == fp->api_end) {
cnt = p == NULL ? 20 : (u_int)(fp->api_end - fp->api) + 20;
if ((fp->api = realloc(fp->api, sizeof(API *) * cnt)) == NULL)
return (syserr());
fp->api_end = fp->api + cnt;
p = fp->api + (cnt - 20);
memset(p, 0, (u_int)(fp->api_end - fp->api) * sizeof(API *));
}
*p = ap;
return (0);
}
void
dump_api()
{
API **app;
printf("=============================\nAPI:\n");
for (app = api_list; *app != NULL; ++app)
printf("%s (%#x)\n", (*app)->name, (*app)->used_mask);
}
void
dump_flags()
{
FLAG **fpp;
API **api;
char *sep;
printf("=============================\nFLAGS:\n");
for (fpp = flag_list; *fpp != NULL; ++fpp) {
printf("%s (%#x, %d): ",
(*fpp)->name, (*fpp)->value, (*fpp)->api_cnt);
sep = "";
for (api = (*fpp)->api; *api != NULL; ++api) {
printf("%s%s", sep, (*api)->name);
sep = ", ";
}
printf("\n");
}
}
int
flag_cmp_api_cnt(const void *a, const void *b)
{
FLAG *af, *bf;
af = *(FLAG **)a;
bf = *(FLAG **)b;
if (af == NULL) {
if (bf == NULL)
return (0);
return (1);
}
if (bf == NULL) {
if (af == NULL)
return (0);
return (-1);
}
if (af->api_cnt > bf->api_cnt)
return (-1);
if (af->api_cnt < bf->api_cnt)
return (1);
return (strcmp(af->name, bf->name));
}
int
generate_flags()
{
FLAG **fpp;
API **api;
u_int mask;
/* Sort the FLAGS array by reference count, in reverse order. */
qsort(flag_list,
(u_int)(flag_end - flag_list), sizeof(FLAG *), flag_cmp_api_cnt);
/*
* Here's the plan: walk the list of flags, allocating bits. For
* each flag, we walk the list of APIs that use it and find a bit
* none of them are using. That bit becomes the flag's value.
*/
for (fpp = flag_list; *fpp != NULL; ++fpp) {
mask = 0xffffffff; /* Set to all 1's */
for (api = (*fpp)->api; *api != NULL; ++api)
mask &= ~(*api)->used_mask; /* Clear API's bits */
if (mask == 0) {
fprintf(stderr, "%s: ran out of bits at flag %s\n",
progname, (*fpp)->name);
return (1);
}
(*fpp)->value = mask = 1 << (ffs(mask) - 1);
for (api = (*fpp)->api; *api != NULL; ++api)
(*api)->used_mask |= mask; /* Set bit for API */
}
return (0);
}
int
flag_cmp_alpha(const void *a, const void *b)
{
FLAG *af, *bf;
af = *(FLAG **)a;
bf = *(FLAG **)b;
if (af == NULL) {
if (bf == NULL)
return (0);
return (1);
}
if (bf == NULL) {
if (af == NULL)
return (0);
return (-1);
}
return (strcmp(af->name, bf->name));
}
void
print_api_mask()
{
API **app;
char *p, buf[256];
/* Output a mask for the API. */
for (app = api_list; *app != NULL; ++app) {
(void)snprintf(
buf, sizeof(buf), "_%s_API_MASK", (*app)->name);
for (p = buf; *p != '\0'; ++p)
if (islower(*p))
*p = toupper(*p);
else if (!isalpha(*p))
*p = '_';
define_print(buf, (*app)->used_mask);
}
}
void
print_api_remainder()
{
API **app;
int unused, i;
/* Output the bits remaining for the API. */
for (app = api_list; *app != NULL; ++app) {
for (i = unused = 0; i < 32; ++i)
if (!((*app)->used_mask & (1 << i)))
++unused;
printf("%s: %d bits unused\n", (*app)->name, unused);
}
}
void
print_flag_value()
{
FLAG **fpp;
/* Sort the FLAGS array in alphabetical order. */
qsort(flag_list,
(u_int)(flag_end - flag_list), sizeof(FLAG *), flag_cmp_alpha);
/* Output each flag's value. */
for (fpp = flag_list; *fpp != NULL; ++fpp)
define_print((*fpp)->name, (*fpp)->value);
}
void
define_print(char *name, u_int value)
{
char *sep;
switch (strlen(name) / 8) {
case 0:
sep = "\t\t\t\t\t";
break;
case 1:
sep = "\t\t\t\t";
break;
case 2:
sep = "\t\t\t";
break;
case 3:
sep = "\t\t";
break;
default:
sep = "\t";
break;
}
printf("#define\t%s%s%#010x\n", name, sep, value);
}
int
syserr(void)
{
fprintf(stderr, "%s: %s\n", progname, strerror(errno));
return (1);
}
int
usage()
{
(void)fprintf(stderr, "usage: %s [-mrv]\n", progname);
return (EXIT_FAILURE);
}

244
dist/buildpkg vendored Normal file
View file

@ -0,0 +1,244 @@
#!/bin/sh
# $Id: $
#
die()
{
echo >&2 "$@"
exit 1
}
# Build the distribution package.
. ./RELEASE || die "Can't read the RELEASE file"
CSHARP_DOC_SRC=""
# 0 is none, 1 is local dir, 2 is remote dir
CSHARP_DOC_LOCATION=0
test_run=0
while [ $# -gt 0 ]
do
case "$1" in
-n)
nodocs=true;;
-csharp_doc_src)
shift
if [ ! $# -gt 0 ]; then
die "csharp_doc_dir param requires argument."
fi
CSHARP_DOC_SRC=$1
CSHARP_DOC_LOCATION=1
if [ ! -f $CSHARP_DOC_SRC ]; then
die "CSharp doc archive must exist."
fi;;
-csharp_doc_url)
shift
if [ ! $# -gt 0 ]; then
die "csharp_doc_dir param requires argument."
fi
CSHARP_DOC_SRC=$1
CSHARP_DOC_LOCATION=2;;
-test)
echo "Doing a test run - this may contain changes that aren't\
reflected in a tag, so the package won't be reproducible."
test_run=1;;
esac
shift
done
# A version string can be specified on the command line (e.g., "20080219").
# Otherwise, use the standard X.X.X format.
VERSION=${1:-${DB_VERSION_MAJOR}.${DB_VERSION_MINOR}.${DB_VERSION_PATCH}}
# Use "ustar" as the archiver
TAR=ustar
# Set root directory where we do the work, can be anywhere.
START_DIR=`pwd`
D=`pwd`/../release
R="$D/db-${VERSION}"
RNC="$D/db-$VERSION.NC"
DOCS=`pwd`/../../docs_books
DB_ADDONS=`pwd`/../../db_addons
if [ ! -d $DB_ADDONS ]; then
echo "buildpkg requires a db_addons repository at the same level as the db repository."
exit 1
fi
# Create directory, remove any previous release tree.
rm -rf $R $RNC
mkdir -p $R
echo "Removed old release build from $R"
# Copy the files in the current tip to $R
hg archive $R
# If doing a test run, apply any local changes to the new tree.
if [ $test_run != 0 ]; then
hg diff | patch -p1 -d $R
fi
echo "Created hg archive in $R"
if [ "$nodocs" = true ] ; then
rm -rf $R/docs
else
[ -d $DOCS ] || die "buildpkg requires a docs_books repository at the same level as the db repository."
# Check that the doc repo is up to date, and create a tag if necessary.
cd $DOCS
hg pull -u
if [ $? != 0 ]; then
rm -rf $R
die "Failed updating the docs_books repository."
fi
has_tag=`hg tags | grep "db-${VERSION}"`
if [ "$has_tag" = "" ]; then
hg tag "db-${VERSION}"
TAG_CREATED="true"
else
hg up -r "db-${VERSION}"
fi
# Build a copy of the documentation in the release tree.
cd $R/dist
sh s_docs db-${VERSION} $DOCS
if [ $? != 0 ]; then
rm -rf $R
die "Failed generating documentation."
fi
# Copy in the C sharp doc.
if [ $CSHARP_DOC_LOCATION -eq 2 ]; then
scp $CSHARP_DOC_SRC .
CSHARP_DOC_SRC="csharp_docs.tgz"
if [ ! -f $CSHARP_DOC_SRC ]; then
echo "WARNING: Invalid csharp doc file - csharp_docs.tgz expected."
fi
fi
if [ $CSHARP_DOC_LOCATION -eq 0 -o ! -f $CSHARP_DOC_SRC ]; then
echo "WARNING: No csharp docs, skipping."
CSHARP_DOC_LOCATION=0
fi
if [ $CSHARP_DOC_LOCATION != 0 ]; then
rm -rf $R/docs/csharp
mkdir -p $R/docs/csharp
$TAR zxf $CSHARP_DOC_SRC -C $R/docs/csharp
fi
# Build the Java documentation.
cd $R/dist && sh s_javadoc
fi
# Pull a copy of the JDBC and ODBC libraries into the package.
# Build the ADO.NET package, including moving the ADO.NET doc built above
# into that package.
# Tell the script where to look for packages.
cd $R/dist && sh s_sql_drivers ../../../..
# Warn if s_sql_drivers didn't move its docs.
if [ -e "$R/docs/bdb-sql-ado" ]; then
echo "WARNING: ADO.NET doc is still in the non ADO.NET package."
fi
cd $START_DIR
# Pull a copy of the bfile directory into the package.
cd $DB_ADDONS
hg pull -u
if [ $? != 0 ]; then
echo "Failed updating the db_addons repository. Exiting."
rm -rf $R
exit 1
fi
cd $START_DIR
SQL_EXT_DIR=$R/lang/sql/sqlite/ext
if [ ! -d $SQL_EXT_DIR ]; then
mkdir -p $SQL_EXT_DIR
fi
if [ -d $SQL_EXT_DIR/bfile ]; then
rm -rf $SQL_EXT_DIR/bfile
fi
cp -rp $DB_ADDONS/bfile $SQL_EXT_DIR
# Remove source directories we don't distribute.
cd $R && rm -rf test/tcl/TODO test/upgrade test/scr036 test/erlang
cd $R && rm -rf test/perf test/purify test/repmgr
cd $R && rm -rf test/server test/stl test/vxworks
cd $R && find . -name '.hg*' | xargs rm -f
cd $R && find . -name 'tags' | xargs rm -f
# Create symbolic links and cscope output, fix permissions.
#cd $R/dist && sh s_perm
#cd $R/dist && sh s_cscope
# Build a regular version and smoke test.
### cd $R && rm -rf build_run && mkdir build_run
### cd $R/build_run && ../dist/configure && make >& mklog
### cd $R/build_run && make ex_access && echo "test" | ./ex_access
# Check the install
### cd $R/build_run && make prefix=`pwd`/BDB install
# Build a small-footprint version and smoke test.
### cd $R && rm -rf build_run && mkdir build_run
### cd $R/build_run && ../dist/configure --enable-smallbuild && make >& mklog
### cd $R/build_run && make ex_access && echo "test" | ./ex_access
# Remove the build directory
### cd $R && rm -rf build_run
(cd $R/dist && ./s_perm)
# Check for file names differing only in case.
cd $R && find . | sort -f | uniq -ic | sed '/1 /d'
# Create the crypto tar archive release.
T="$D/db-$VERSION.tar.gz"
rm -f $T
cd $D || die "Can't find $D"
# Move package files in db-$VERSION/release to current directory so that
# regular packages won't includes generated package twice.
if [ -d "db-$VERSION/release" ]; then
mv db-$VERSION/release/* .
rm -rf db-$VERSION/release
fi
$TAR czf $T -find db-$VERSION -chown 100 -chgrp 100
chmod 444 $T
# Create the non-crypto tree.
cd $D && mv -i db-$VERSION $RNC && $TAR xzf $T
cd $RNC/dist && sh s_crypto
(cd $RNC/dist && ./s_perm)
# Create the non-crypto tar archive release.
T="$D/db-$VERSION.NC.tar.gz"
rm -f $T
cd $RNC/.. && $TAR czf $T -find db-$VERSION.NC -chown 100 -chgrp 100
chmod 444 $T
t=__tmp
cd $R && awk '{print $0 "\r"}' < LICENSE > $t && rm -f LICENSE && cp $t LICENSE
cd $R && awk '{print $0 "\r"}' < README > $t && rm -f README && cp $t README && rm $t
cd $RNC && awk '{print $0 "\r"}' < LICENSE > $t && rm -f LICENSE && cp $t LICENSE
cd $RNC && awk '{print $0 "\r"}' < README > $t && rm -f README && cp $t README && rm $t
# Create the crypto zip archive release.
T="$D/db-$VERSION.zip"
rm -f $T
cd $R/.. && rm -f $T && zip -q -r $T db-$VERSION
chmod 444 $T
# Create the non-crypto zip archive release.
T="$D/db-$VERSION.NC.zip"
rm -f $T
cd $RNC/.. && rm -f $T && zip -q -r $T db-$VERSION.NC
chmod 444 $T
rm -rf $R $RNC
if [ "$TAG_CREATED" = "true" ]; then
echo "Created a tag in docs_books repository. Please push."
fi

59
dist/bumprel vendored Normal file
View file

@ -0,0 +1,59 @@
#!/bin/sh
#
# $Id: $
#
# Bump the Berkeley DB version
P=`pwd`
R=`dirname $P`
progname="$0"
VERSION="$1"
assembly="../lang/csharp/src/Properties/AssemblyInfo.cs"
t=/tmp/__assembly
# Sanity check
if [ ! -f $R/dist/RELEASE ] ; then
echo "$progname must be run in the dist directory of a Berkeley DB tree"
exit 1
fi
OIFS="$IFS"
IFS=.
set -- $VERSION
if [ $# != 5 ] ; then
echo "Usage: $progname X.X.X.X.X -- sets the Berkeley DB version to X.X.X.X.X"
exit 1
fi
FAMILY="$1" RELEASE="$2" MAJOR="$3" MINOR="$4" PATCH="$5"
DATE=`date "+%B %e, %Y"`
IFS="$OFS"
# Update the change log patch number -- there's 1 location to update in
# the change log "table of contents", and 2 in the Change Log itself.
#cd $R/docs_src/ref/changelog && vi toc.so ${MAJOR}.${MINOR}.html
# Update the release number.
cd $R/dist &&\
(echo "/^DB_VERSION_FAMILY/s/=.*/=$FAMILY/" &&\
echo "/^DB_VERSION_RELEASE/s/=.*/=$RELEASE/" &&\
echo "/^DB_VERSION_MAJOR/s/=.*/=$MAJOR/" &&\
echo "/^DB_VERSION_MINOR/s/=.*/=$MINOR/" &&\
echo "/^DB_VERSION_PATCH/s/=.*/=$PATCH/" &&\
echo "/^DB_RELEASE_DATE/s/=.*/=\"$DATE\"/" &&\
echo w &&\
echo q) | ed RELEASE > /dev/null
VERSION=`sh -c '. ./RELEASE; echo $DB_VERSION'`
echo "Berkeley DB release $VERSION."
# Build auto-generated files.
cd $R/dist && sh s_all
# Update the CSharp assembly information
sed -e "s:AssemblyVersion(\"[0-9]*\.[0-9]*\.[0-9]*\"):AssemblyVersion(\"$MAJOR\.$MINOR\.$PATCH\"):" < $assembly > $t
cmp $t $assembly > /dev/null 2>&1 ||
(rm -f $assembly && cp $t $assembly && rm -f $t && chmod 444 $assembly)
# Commit all of the changes.
echo "Now run 'hg commit && hg tag db-$MAJOR.$MINOR.$PATCH && hg push'"

279
dist/clib_port.in vendored Normal file
View file

@ -0,0 +1,279 @@
/* DO NOT EDIT: automatically built from dist/clib_port.in. */
/*
* Minimum/maximum values for various types.
*/
#ifndef UINT16_MAX /* Maximum 16-bit unsigned. */
#define UINT16_MAX 65535
#endif
#ifndef UINT32_MAX /* Maximum 32-bit unsigned. */
#define UINT32_MAX 4294967295U
#endif
#ifndef INT_MAX
#if SIZEOF_INT == 4
#define INT_MAX 2147483647
#endif
#if SIZEOF_INT == 8
#define INT_MAX 9223372036854775807
#endif
#endif
#ifndef INT_MIN /* minimum (signed) int value */
#define INT_MIN (-INT_MAX-1)
#endif
#ifndef UINT_MAX /* maximum (signed) int value */
#if SIZEOF_INT == 4
#define UINT_MAX 4294967295U
#endif
#if SIZEOF_INT == 8
#define UINT_MAX 18446744073709551615U
#endif
#endif
#ifndef LONG_MAX /* maximum (signed) long value */
#if SIZEOF_LONG == 4
#define LONG_MAX 2147483647
#endif
#if SIZEOF_LONG == 8
#define LONG_MAX 9223372036854775807L
#endif
#endif
#ifndef LONG_MIN /* minimum (signed) long value */
#define LONG_MIN (-LONG_MAX-1)
#endif
#ifndef ULONG_MAX /* maximum (unsigned) long value */
#if SIZEOF_LONG == 4
#define ULONG_MAX 4294967295U
#endif
#if SIZEOF_LONG == 8
#define ULONG_MAX 18446744073709551615UL
#endif
#endif
#if defined(HAVE_64BIT_TYPES)
/*
* Override the system's 64-bit min/max constants. AIX's 32-bit compiler can
* handle 64-bit values, but the system's constants don't include the LL/ULL
* suffix, and so can't be compiled using the 32-bit compiler.
*/
#undef INT64_MAX
#undef INT64_MIN
#undef UINT64_MAX
#ifdef DB_WIN32
#define INT64_MAX _I64_MAX
#define INT64_MIN _I64_MIN
#define UINT64_MAX _UI64_MAX
#else
#define INT64_MAX 9223372036854775807LL
#define INT64_MIN (-INT64_MAX-1)
#define UINT64_MAX 18446744073709551615ULL
#endif /* DB_WIN32 */
@INT64_FMT@
@UINT64_FMT@
#endif /* HAVE_64BIT_TYPES */
/*
* Exit success/failure macros.
*/
#ifndef HAVE_EXIT_SUCCESS
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#endif
/*
* File modes.
*/
#ifdef DB_WIN32
#ifndef S_IREAD /* WinCE doesn't have S_IREAD. */
#define S_IREAD 0
#endif
#ifndef S_IWRITE /* WinCE doesn't have S_IWRITE. */
#define S_IWRITE 0
#endif
#ifndef S_IRUSR
#define S_IRUSR S_IREAD /* R for owner */
#endif
#ifndef S_IWUSR
#define S_IWUSR S_IWRITE /* W for owner */
#endif
#ifndef S_IXUSR
#define S_IXUSR 0 /* X for owner */
#endif
#ifndef S_IRGRP
#define S_IRGRP 0 /* R for group */
#endif
#ifndef S_IWGRP
#define S_IWGRP 0 /* W for group */
#endif
#ifndef S_IXGRP
#define S_IXGRP 0 /* X for group */
#endif
#ifndef S_IROTH
#define S_IROTH 0 /* R for other */
#endif
#ifndef S_IWOTH
#define S_IWOTH 0 /* W for other */
#endif
#ifndef S_IXOTH
#define S_IXOTH 0 /* X for other */
#endif
#else /* !DB_WIN32 */
#ifndef S_IRUSR
#define S_IRUSR 0000400 /* R for owner */
#endif
#ifndef S_IWUSR
#define S_IWUSR 0000200 /* W for owner */
#endif
#ifndef S_IXUSR
#define S_IXUSR 0000100 /* X for owner */
#endif
#ifndef S_IRGRP
#define S_IRGRP 0000040 /* R for group */
#endif
#ifndef S_IWGRP
#define S_IWGRP 0000020 /* W for group */
#endif
#ifndef S_IXGRP
#define S_IXGRP 0000010 /* X for group */
#endif
#ifndef S_IROTH
#define S_IROTH 0000004 /* R for other */
#endif
#ifndef S_IWOTH
#define S_IWOTH 0000002 /* W for other */
#endif
#ifndef S_IXOTH
#define S_IXOTH 0000001 /* X for other */
#endif
#endif /* !DB_WIN32 */
/*
* Don't step on the namespace. Other libraries may have their own
* implementations of these functions, we don't want to use their
* implementations or force them to use ours based on the load order.
*/
#ifndef HAVE_ATOI
#define atoi __db_Catoi
#endif
#ifndef HAVE_ATOL
#define atol __db_Catol
#endif
#ifndef HAVE_BSEARCH
#define bsearch __db_Cbsearch
#endif
#ifndef HAVE_FCLOSE
#define fclose __db_Cfclose
#endif
#ifndef HAVE_FGETC
#define fgetc __db_Cfgetc
#endif
#ifndef HAVE_FGETS
#define fgets __db_Cfgets
#endif
#ifndef HAVE_FOPEN
#define fopen __db_Cfopen
#endif
#ifndef HAVE_FWRITE
#define fwrite __db_Cfwrite
#endif
#ifndef HAVE_GETADDRINFO
#define freeaddrinfo(a) __db_Cfreeaddrinfo(a)
#define getaddrinfo(a, b, c, d) __db_Cgetaddrinfo(a, b, c, d)
#endif
#ifndef HAVE_GETCWD
#define getcwd __db_Cgetcwd
#endif
#ifndef HAVE_GETOPT
#define getopt __db_Cgetopt
#define optarg __db_Coptarg
#define opterr __db_Copterr
#define optind __db_Coptind
#define optopt __db_Coptopt
#define optreset __db_Coptreset
#endif
#ifndef HAVE_ISALPHA
#define isalpha __db_Cisalpha
#endif
#ifndef HAVE_ISDIGIT
#define isdigit __db_Cisdigit
#endif
#ifndef HAVE_ISPRINT
#define isprint __db_Cisprint
#endif
#ifndef HAVE_ISSPACE
#define isspace __db_Cisspace
#endif
#ifndef HAVE_LOCALTIME
#define localtime __db_Clocaltime
#endif
#ifndef HAVE_MEMCMP
#define memcmp __db_Cmemcmp
#endif
#ifndef HAVE_MEMCPY
#define memcpy __db_Cmemcpy
#endif
#ifndef HAVE_MEMMOVE
#define memmove __db_Cmemmove
#endif
#ifndef HAVE_PRINTF
#define printf __db_Cprintf
#define fprintf __db_Cfprintf
#endif
#ifndef HAVE_QSORT
#define qsort __db_Cqsort
#endif
#ifndef HAVE_RAISE
#define raise __db_Craise
#endif
#ifndef HAVE_RAND
#define rand __db_Crand
#define srand __db_Csrand
#endif
#ifndef HAVE_SNPRINTF
#define snprintf __db_Csnprintf
#endif
#ifndef HAVE_STRCASECMP
#define strcasecmp __db_Cstrcasecmp
#define strncasecmp __db_Cstrncasecmp
#endif
#ifndef HAVE_STRCAT
#define strcat __db_Cstrcat
#endif
#ifndef HAVE_STRCHR
#define strchr __db_Cstrchr
#endif
#ifndef HAVE_STRDUP
#define strdup __db_Cstrdup
#endif
#ifndef HAVE_STRERROR
#define strerror __db_Cstrerror
#endif
#ifndef HAVE_STRNCAT
#define strncat __db_Cstrncat
#endif
#ifndef HAVE_STRNCMP
#define strncmp __db_Cstrncmp
#endif
#ifndef HAVE_STRRCHR
#define strrchr __db_Cstrrchr
#endif
#ifndef HAVE_STRSEP
#define strsep __db_Cstrsep
#endif
#ifndef HAVE_STRTOL
#define strtol __db_Cstrtol
#endif
#ifndef HAVE_STRTOUL
#define strtoul __db_Cstrtoul
#endif
#ifndef HAVE_TIME
#define time __db_Ctime
#endif
#ifndef HAVE_VSNPRINTF
#define vsnprintf __db_Cvsnprintf
#endif

1511
dist/config.guess vendored Executable file

File diff suppressed because it is too large Load diff

636
dist/config.hin vendored Normal file
View file

@ -0,0 +1,636 @@
/* config.hin. Generated from configure.ac by autoheader. */
/* Define to 1 if you want to build a version for running the test suite. */
#undef CONFIG_TEST
/* Defined to a size to limit the stack size of Berkeley DB threads. */
#undef DB_STACKSIZE
/* We use DB_WIN32 much as one would use _WIN32 -- to specify that we're using
an operating system environment that supports Win32 calls and semantics. We
don't use _WIN32 because Cygwin/GCC also defines _WIN32, even though
Cygwin/GCC closely emulates the Unix environment. */
#undef DB_WIN32
/* Define to 1 if you want a debugging version. */
#undef DEBUG
/* Define to 1 if you want a version that logs read operations. */
#undef DEBUG_ROP
/* Define to 1 if you want a version that logs write operations. */
#undef DEBUG_WOP
/* Define to 1 if you want a version with run-time diagnostic checking. */
#undef DIAGNOSTIC
/* Define to 1 if 64-bit types are available. */
#undef HAVE_64BIT_TYPES
/* Define to 1 if you have the `abort' function. */
#undef HAVE_ABORT
/* Define to 1 if you have the `atoi' function. */
#undef HAVE_ATOI
/* Define to 1 if you have the `atol' function. */
#undef HAVE_ATOL
/* Define to 1 to use Solaris library routes for atomic operations. */
#undef HAVE_ATOMIC_SOLARIS
/* Define to 1 to use native atomic operations. */
#undef HAVE_ATOMIC_SUPPORT
/* Define to 1 to use GCC and x86 or x86_64 assemlby language atomic
operations. */
#undef HAVE_ATOMIC_X86_GCC_ASSEMBLY
/* Define to 1 if you have the `backtrace' function. */
#undef HAVE_BACKTRACE
/* Define to 1 if you have the `backtrace_symbols' function. */
#undef HAVE_BACKTRACE_SYMBOLS
/* Define to 1 if you have the `bsearch' function. */
#undef HAVE_BSEARCH
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
/* Define to 1 if clock_gettime supports CLOCK_MONOTONIC. */
#undef HAVE_CLOCK_MONOTONIC
/* Define to 1 if building compression support. */
#undef HAVE_COMPRESSION
/* Define to 1 if building cryptography support. */
#undef HAVE_CRYPTO
/* Define to 1 if using Intel IPP for cryptography. */
#undef HAVE_CRYPTO_IPP
/* Define to 1 if you have the `ctime_r' function. */
#undef HAVE_CTIME_R
/* Define to 1 if ctime_r takes a buffer length as a third argument. */
#undef HAVE_CTIME_R_3ARG
/* Define to 1 if building the DBM API. */
#undef HAVE_DBM
/* Define to 1 if you have the `directio' function. */
#undef HAVE_DIRECTIO
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 to use dtrace for performance monitoring. */
#undef HAVE_DTRACE
/* Define to 1 if you have the <execinfo.h> header file. */
#undef HAVE_EXECINFO_H
/* Define to 1 if platform has EXIT_SUCCESS/EXIT_FAILURE #defines. */
#undef HAVE_EXIT_SUCCESS
/* Define to 1 if you have the `fchmod' function. */
#undef HAVE_FCHMOD
/* Define to 1 if you have the `fclose' function. */
#undef HAVE_FCLOSE
/* Define to 1 if you have the `fcntl' function. */
#undef HAVE_FCNTL
/* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */
#undef HAVE_FCNTL_F_SETFD
/* Define to 1 if you have the `fdatasync' function. */
#undef HAVE_FDATASYNC
/* Define to 1 if you have the `fgetc' function. */
#undef HAVE_FGETC
/* Define to 1 if you have the `fgets' function. */
#undef HAVE_FGETS
/* Define to 1 if allocated filesystem blocks are not zeroed. */
#undef HAVE_FILESYSTEM_NOTZERO
/* Define to 1 if you have the `fopen' function. */
#undef HAVE_FOPEN
/* Define to 1 if you have the `ftruncate' function. */
#undef HAVE_FTRUNCATE
/* Define to 1 if you have the `fwrite' function. */
#undef HAVE_FWRITE
/* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
/* Define to 1 if you have the `getenv' function. */
#undef HAVE_GETENV
/* Define to 1 if you have the `getgid' function. */
#undef HAVE_GETGID
/* Define to 1 if you have the `getopt' function. */
#undef HAVE_GETOPT
/* Define to 1 if getopt supports the optreset variable. */
#undef HAVE_GETOPT_OPTRESET
/* Define to 1 if you have the `getrusage' function. */
#undef HAVE_GETRUSAGE
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define to 1 if building Hash access method. */
#undef HAVE_HASH
/* Define to 1 if building Heap access method. */
#undef HAVE_HEAP
/* Define to 1 if you have the `hstrerror' function. */
#undef HAVE_HSTRERROR
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `isalpha' function. */
#undef HAVE_ISALPHA
/* Define to 1 if you have the `isdigit' function. */
#undef HAVE_ISDIGIT
/* Define to 1 if you have the `isprint' function. */
#undef HAVE_ISPRINT
/* Define to 1 if you have the `isspace' function. */
#undef HAVE_ISSPACE
/* Define to 1 if you have localization function to support globalization. */
#undef HAVE_LOCALIZATION
/* Define to 1 if you have the `localtime' function. */
#undef HAVE_LOCALTIME
/* Define to 1 if enabling checksums in log records. */
#undef HAVE_LOG_CHECKSUM
/* Define to 1 if you have the `memcmp' function. */
#undef HAVE_MEMCMP
/* Define to 1 if you have the `memcpy' function. */
#undef HAVE_MEMCPY
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mlock' function. */
#undef HAVE_MLOCK
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
/* Define to 1 where mmap() incrementally extends the accessible mapping as
the underlying file grows. */
#undef HAVE_MMAP_EXTEND
/* Define to 1 if you have the `mprotect' function. */
#undef HAVE_MPROTECT
/* Define to 1 if you have the `munlock' function. */
#undef HAVE_MUNLOCK
/* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP
/* Define to 1 to use the GCC compiler and 68K assembly language mutexes. */
#undef HAVE_MUTEX_68K_GCC_ASSEMBLY
/* Define to 1 to use the AIX _check_lock mutexes. */
#undef HAVE_MUTEX_AIX_CHECK_LOCK
/* Define to 1 to use the GCC compiler and Alpha assembly language mutexes. */
#undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY
/* Define to 1 to use the GCC compiler and ARM assembly language mutexes. */
#undef HAVE_MUTEX_ARM_GCC_ASSEMBLY
/* Define to 1 to use the Apple/Darwin _spin_lock_try mutexes. */
#undef HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY
/* Define to 1 to use the UNIX fcntl system call mutexes. */
#undef HAVE_MUTEX_FCNTL
/* Define to 1 to use the GCC compiler and PaRisc assembly language mutexes.
*/
#undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY
/* Define to 1 to use the msem_XXX mutexes on HP-UX. */
#undef HAVE_MUTEX_HPPA_MSEM_INIT
/* Define to 1 to use test-and-set mutexes with blocking mutexes. */
#undef HAVE_MUTEX_HYBRID
/* Define to 1 to use the GCC compiler and IA64 assembly language mutexes. */
#undef HAVE_MUTEX_IA64_GCC_ASSEMBLY
/* Define to 1 to use the GCC compiler and MIPS assembly language mutexes. */
#undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY
/* Define to 1 to use the msem_XXX mutexes on systems other than HP-UX. */
#undef HAVE_MUTEX_MSEM_INIT
/* Define to 1 to use the GCC compiler and PowerPC assembly language mutexes.
*/
#undef HAVE_MUTEX_PPC_GCC_ASSEMBLY
/* Define to 1 to use POSIX 1003.1 pthread_XXX mutexes. */
#undef HAVE_MUTEX_PTHREADS
/* Define to 1 to use Reliant UNIX initspin mutexes. */
#undef HAVE_MUTEX_RELIANTUNIX_INITSPIN
/* Define to 1 to use the IBM C compiler and S/390 assembly language mutexes.
*/
#undef HAVE_MUTEX_S390_CC_ASSEMBLY
/* Define to 1 to use the GCC compiler and S/390 assembly language mutexes. */
#undef HAVE_MUTEX_S390_GCC_ASSEMBLY
/* Define to 1 to use the SCO compiler and x86 assembly language mutexes. */
#undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY
/* Define to 1 to use the obsolete POSIX 1003.1 sema_XXX mutexes. */
#undef HAVE_MUTEX_SEMA_INIT
/* Define to 1 to use the SGI XXX_lock mutexes. */
#undef HAVE_MUTEX_SGI_INIT_LOCK
/* Define to 1 to use the Solaris _lock_XXX mutexes. */
#undef HAVE_MUTEX_SOLARIS_LOCK_TRY
/* Define to 1 to use the Solaris lwp threads mutexes. */
#undef HAVE_MUTEX_SOLARIS_LWP
/* Define to 1 to use the GCC compiler and Sparc assembly language mutexes. */
#undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY
/* Define to 1 if the Berkeley DB library should support mutexes. */
#undef HAVE_MUTEX_SUPPORT
/* Define to 1 if mutexes hold system resources. */
#undef HAVE_MUTEX_SYSTEM_RESOURCES
/* Define to 1 to configure mutexes intra-process only. */
#undef HAVE_MUTEX_THREAD_ONLY
/* Define to 1 to use the CC compiler and Tru64 assembly language mutexes. */
#undef HAVE_MUTEX_TRU64_CC_ASSEMBLY
/* Define to 1 to use the UNIX International mutexes. */
#undef HAVE_MUTEX_UI_THREADS
/* Define to 1 to use the UTS compiler and assembly language mutexes. */
#undef HAVE_MUTEX_UTS_CC_ASSEMBLY
/* Define to 1 to use VMS mutexes. */
#undef HAVE_MUTEX_VMS
/* Define to 1 to use VxWorks mutexes. */
#undef HAVE_MUTEX_VXWORKS
/* Define to 1 to use the MSVC compiler and Windows mutexes. */
#undef HAVE_MUTEX_WIN32
/* Define to 1 to use the GCC compiler and Windows mutexes. */
#undef HAVE_MUTEX_WIN32_GCC
/* Define to 1 to use the GCC compiler and 64-bit x86 assembly language
mutexes. */
#undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
/* Define to 1 to use the GCC compiler and 32-bit x86 assembly language
mutexes. */
#undef HAVE_MUTEX_X86_GCC_ASSEMBLY
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the O_DIRECT flag. */
#undef HAVE_O_DIRECT
/* Define to 1 if building partitioned database support. */
#undef HAVE_PARTITION
/* Define to 1 to enable some kind of performance event monitoring. */
#undef HAVE_PERFMON
/* Define to 1 to enable performance event monitoring of *_stat() statistics.
*/
#undef HAVE_PERFMON_STATISTICS
/* Define to 1 if you have the `pread' function. */
#undef HAVE_PREAD
/* Define to 1 if you have the `printf' function. */
#undef HAVE_PRINTF
/* Define to 1 if you have the `pstat_getdynamic' function. */
#undef HAVE_PSTAT_GETDYNAMIC
/* Define to 1 if it is OK to initialize an already initialized
pthread_cond_t. */
#undef HAVE_PTHREAD_COND_REINIT_OKAY
/* Define to 1 if it is OK to initialize an already initialized
pthread_rwlock_t. */
#undef HAVE_PTHREAD_RWLOCK_REINIT_OKAY
/* Define to 1 if you have the `pthread_self' function. */
#undef HAVE_PTHREAD_SELF
/* Define to 1 if you have the `pthread_yield' function. */
#undef HAVE_PTHREAD_YIELD
/* Define to 1 if you have the `pwrite' function. */
#undef HAVE_PWRITE
/* Define to 1 if building on QNX. */
#undef HAVE_QNX
/* Define to 1 if you have the `qsort' function. */
#undef HAVE_QSORT
/* Define to 1 if building Queue access method. */
#undef HAVE_QUEUE
/* Define to 1 if you have the `raise' function. */
#undef HAVE_RAISE
/* Define to 1 if you have the `rand' function. */
#undef HAVE_RAND
/* Define to 1 if you have the `random' function. */
#undef HAVE_RANDOM
/* Define to 1 if building replication support. */
#undef HAVE_REPLICATION
/* Define to 1 if building the Berkeley DB replication framework. */
#undef HAVE_REPLICATION_THREADS
/* Define to 1 if you have the `sched_yield' function. */
#undef HAVE_SCHED_YIELD
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define to 1 if you have the `setgid' function. */
#undef HAVE_SETGID
/* Define to 1 if you have the `setuid' function. */
#undef HAVE_SETUID
/* Define to 1 to configure Berkeley DB to use read/write latches. */
#undef HAVE_SHARED_LATCHES
/* Define to 1 if shmctl/SHM_LOCK locks down shared memory segments. */
#undef HAVE_SHMCTL_SHM_LOCK
/* Define to 1 if you have the `shmget' function. */
#undef HAVE_SHMGET
/* Define to 1 if you have the `sigaction' function. */
#undef HAVE_SIGACTION
/* Define to 1 if thread identifier type db_threadid_t is integral. */
#undef HAVE_SIMPLE_THREAD_TYPE
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the `stat' function. */
#undef HAVE_STAT
/* Define to 1 if building statistics support. */
#undef HAVE_STATISTICS
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strcat' function. */
#undef HAVE_STRCAT
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if building without output message content. */
#undef HAVE_STRIPPED_MESSAGES
/* Define to 1 if you have the `strncat' function. */
#undef HAVE_STRNCAT
/* Define to 1 if you have the `strncmp' function. */
#undef HAVE_STRNCMP
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
/* Define to 1 if you have the `strsep' function. */
#undef HAVE_STRSEP
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
/* Define to 1 if you have the `sysconf' function. */
#undef HAVE_SYSCONF
/* Define to 1 if port includes files in the Berkeley DB source code. */
#undef HAVE_SYSTEM_INCLUDE_FILES
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/sdt.h> header file. */
#undef HAVE_SYS_SDT_H
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the `time' function. */
#undef HAVE_TIME
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if unlink of file with open file descriptors will fail. */
#undef HAVE_UNLINK_WITH_OPEN_FAILURE
/* Define to 1 if port includes historic database upgrade support. */
#undef HAVE_UPGRADE_SUPPORT
/* Define to 1 if building access method verification support. */
#undef HAVE_VERIFY
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define to 1 if building on VxWorks. */
#undef HAVE_VXWORKS
/* Define to 1 if you have the `yield' function. */
#undef HAVE_YIELD
/* Define to 1 if you have the `_fstati64' function. */
#undef HAVE__FSTATI64
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `char', as computed by sizeof. */
#undef SIZEOF_CHAR
/* The size of `char *', as computed by sizeof. */
#undef SIZEOF_CHAR_P
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
/* The size of `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* The size of `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
/* The size of `unsigned char', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_CHAR
/* The size of `unsigned int', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_INT
/* The size of `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG
/* The size of `unsigned long long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG_LONG
/* The size of `unsigned short', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_SHORT
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to 1 to mask harmless uninitialized memory read/writes. */
#undef UMRW
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* type to use in place of socklen_t if not defined */
#undef socklen_t

1760
dist/config.sub vendored Executable file

File diff suppressed because it is too large Load diff

27335
dist/configure vendored Executable file

File diff suppressed because it is too large Load diff

1119
dist/configure.ac vendored Normal file

File diff suppressed because it is too large Load diff

361
dist/db_provider.d vendored Normal file
View file

@ -0,0 +1,361 @@
/*
* DO NOT EDIT: automatically built by dist/s_include.
* Oracle Berkeley DB DTrace Provider
*/
#include "dbdefs.d"
provider bdb {
/*
*
* dist/events.in - This description of Oracle Berkeley DB's internal
* events hierarchy is processes by dist/s_perfmon to generate the
* platform-specific files needed by the configured operating system.
*
* The entries starting in the first column are event class names, and consist
* of a single word. The class's individual function-like events follow.
*
* Some of these are included to enhance consistency; thse calls could be
* supported by pid$target::<function>:entry (DTrace) or
* probe process("$LIB").function("<function>").call (SystemTap) probes.
*
* For DTrace
* dist/bdb_provider.d
* util/dtrace/dbdefs.d
*
* Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
*
*/
/* The alloc class covers the allocation of "on disk" database pages. */
/*
* An attempt to allocate a database page of type 'type' for database 'db'
* returned 'ret'. If the allocation succeeded then ret is 0, pgno is the
* location of the new page, and pg is the address of the new page.
* Details of the page can be extracted from the pg pointer.
*/
probe alloc__new(char *file, char *db, unsigned pgno, unsigned type,
struct _db_page *pg, int ret);
/*
* An attempt to free the page 'pgno' of 'db' returned 'ret'.
* When successful the page is returned to the free list
* or the file is truncated.
*/
probe alloc__free(char *file, char *db, unsigned pgno, unsigned ret);
/*
* A btree split of pgno in db is being attempted. The parent page number
* and the level in the btree are also provided.
*/
probe alloc__btree_split(char *file, char *db, unsigned pgno, unsigned parent,
unsigned level);
/*
* These DB API calls provide the name of the file and database being accessed.
* In-memory databases will have a NULL (0) file name address. The db name will
* be null unless subdatabases are in use.
*/
/*
* The database or file name was opened. The 20 byte unique fileid can be
* used to keep track of databases as they are created and destroyed.
*/
probe db__open(char *file, char *db, unsigned flags, uint8_t *fileid);
/* The database or file name was closed. */
probe db__close(char *file, char *db, unsigned flags, uint8_t *fileid);
/* An attempt is being made to open a cursor on the database or file. */
probe db__cursor(char *file, char *db, unsigned txnid, unsigned flags,
uint8_t *fileid);
/* An attempt is being made to get data from a db. */
probe db__get(char *file, char *db, unsigned txnid, DBT *key, DBT *data,
unsigned flags);
/* An attempt is being made to put data to a db. */
probe db__put(char *file, char *db, unsigned txnid, DBT *key, DBT *data,
unsigned flags);
/* An attempt is being made to delete data from a db. */
probe db__del(char *file, char *db, unsigned txnid, DBT *key, unsigned flags);
/*
* The lock class monitors the transactional consistency locks: page, record,
* and database. It also monitors the non-transactional file handle locks.
*/
/*
* The thread is about to suspend itself because another locker already has
* a conflicting lock on object 'lock'. The lock DBT's data points to
* a __db_ilock structure, except for the atypical program which uses
* application specific locking.
*/
probe lock__suspend(DBT *lock, db_lockmode_t lock_mode);
/* The thread is awakening from a suspend. */
probe lock__resume(DBT *lock, db_lockmode_t lock_mode);
/* The lock is being freed. */
probe lock__put(struct __sh_dbt *lock, unsigned flags);
/*
* The lock would have been freed except that its refcount was greater
* than 1.
*/
probe lock__put_reduce_count(struct __sh_dbt *lock, unsigned flags);
/*
* These lock counters are included by --enable-perfmon-statistics.
*/
/*
* The locker_id's lock request in lock_obj is about to be aborted in
* order to resolve a deadlock. The lock region's st_ndeadlocks has
* been incremented.
*/
probe lock__deadlock(unsigned st_ndeadlocks, unsigned locker_id,
struct __sh_dbt *lock_obj);
/*
* A DB_LOCK_NOWAIT lock request by locker_id would have had to wait.
* The lock regions's st_lock_nowait has been incremented and
* the request returns DB_LOCK_NOTGRANTED.
*/
probe lock__nowait_notgranted(unsigned count, DBT *lock, unsigned locker_id);
probe lock__request(unsigned request_count, DBT *lock, unsigned locker_id);
probe lock__upgrade(unsigned upgrade_count, DBT *lock, unsigned locker_id);
/*
* A lock is being stolen from one partition for another one
* The 'from' lock partition's st_locksteals has been incremented.
*/
probe lock__steal(unsigned st_locksteals, unsigned from, unsigned to);
/*
* A lock object is being stolen from one partition for another one.
* The 'from' lock partition's st_objectsteals has been incremented.
*/
probe lock__object_steal(unsigned st_objectsteals, unsigned from, unsigned to);
/* A lock wait expired due to the lock request timeout. */
probe lock__locktimeout(unsigned st_nlocktimeouts, const DBT *lock);
/* A lock wait expired due to the transaction's timeout. */
probe lock__txntimeout(unsigned st_ntxntimeouts, const DBT *lock);
/*
* The allocation or deallocation of the locker id changed the number
* of active locker identifiers.
*/
probe lock__nlockers(unsigned active, unsigned locker_id);
/*
* The allocation of the locker id set a new maximum
* number of active locker identifiers.
*/
probe lock__maxnlockers(unsigned new_max_active, unsigned locker_id);
/* Log - Transaction log */
probe log__read(unsigned read_count, unsigned logfile);
/*
* The mpool class monitors the allocation and management of memory,
* including the cache.
*/
/* Read a page from file into buf. */
probe mpool__read(char *file, unsigned pgno, struct __bh *buf);
/* Write a page from buf to file. */
probe mpool__write(char *file, unsigned pgno, struct __bh *buf);
/*
* This is an attempt to allocate size bytes from region_id.
* The reg_type is one of the reg_type_t enum values.
*/
probe mpool__env_alloc(unsigned size, unsigned region_id, unsigned reg_type);
/* The page is about to be removed from the cache. */
probe mpool__evict(char *file, unsigned pgno, struct __bh *buf);
/*
* The memory allocator has incremented wrap_count after searching through
* the entire region without being able to fulfill the request for
* alloc_len bytes. As wrap_count increases the library makes more effort
* to allocate space.
*/
probe mpool__alloc_wrap(unsigned alloc_len, int region_id, int wrap_count,
int put_counter);
/*
* These mpool counters are included by --enable-perfmon-statistics.
*/
/* The eviction of a clean page from a cache incremented st_ro_evict. */
probe mpool__clean_eviction(unsigned st_ro_evict, unsigned region_id);
/*
* The eviction of a dirty page from a cache incremented st_rw_evict.
* The page has already been written out.
*/
probe mpool__dirty_eviction(unsigned st_rw_evict, unsigned region_id);
/* An attempt to allocate memory from region_id failed. */
probe mpool__fail(unsigned failure_count, unsigned alloc_len, unsigned region_id);
probe mpool__free(unsigned freed_count, unsigned alloc_len, unsigned region_id);
probe mpool__longest_search(unsigned count, unsigned alloc_len, unsigned region_id);
probe mpool__free_frozen(unsigned count, char *file, unsigned pgno);
probe mpool__freeze(unsigned hash_frozen, unsigned pgno);
/* A search for pgno of file incremented st_hash_searches. */
probe mpool__hash_search(unsigned st_hash_searches, char *file, unsigned pgno);
/*
* A search for pgno of file increased st_hash_examined by the number
* of hash buckets examined.
*/
probe mpool__hash_examined(unsigned st_hash_examined, char *file, unsigned pgno);
/* A search for pgno of file set a new maximum st_hash_longest value. */
probe mpool__hash_longest(unsigned st_hash_longest, char *file, unsigned pgno);
/*
* A file's st_map count was incremented after a page was mapped into
* memory. The mapping might have caused disk I/O.
*/
probe mpool__map(unsigned st_map, char *file, unsigned pgno);
/*
* The hit count was incremented because pgno from file was found
* in the cache.
*/
probe mpool__hit(unsigned st_cache_hit, char *file, unsigned pgno);
/*
* The miss count was incremented because pgno from file was
* not already present in the cache.
*/
probe mpool__miss(unsigned st_cache_miss, char *file, unsigned pgno);
/*
* The st_page_create field was incremented because
* the pgno of file was created in the cache.
*/
probe mpool__page_create(unsigned st_page_create, char *file, unsigned pgno);
/*
* The st_page_in field was incremented because
* the pgno from file was read into the cache.
*/
probe mpool__page_in(unsigned st_page_in, char *file, unsigned pgno);
/*
* The st_page_out field was incremented because
* the pgno from file was written out.
*/
probe mpool__page_out(unsigned st_page_out, char *file, unsigned pgno);
probe mpool__thaw(unsigned count, char *file, unsigned pgno);
probe mpool__alloc(unsigned success_count, unsigned len, unsigned region_id);
probe mpool__nallocs(unsigned st_alloc, unsigned alloc_len);
probe mpool__alloc_buckets(unsigned st_alloc_buckets, unsigned region_id);
probe mpool__alloc_max_buckets(unsigned max, unsigned region_id);
probe mpool__alloc_max_pages(unsigned max, unsigned region_id);
probe mpool__alloc_pages(unsigned count, unsigned region_id);
/*
* The mutex category monitors includes shared latches. The alloc_id value
* is one of the MTX_XXX definitions from dbinc/mutex.h
*/
/*
* This thread is about to suspend itself because a thread has the
* mutex or shared latch locked in a mode which conflicts with the
* this request.
*/
probe mutex__suspend(unsigned mutex, unsigned excl, unsigned alloc_id,
struct __db_mutex_t *mutexp);
/*
* The thread is returning from a suspend and will attempt to obtain
* the mutex or shared latch again. It might need to suspend again.
*/
probe mutex__resume(unsigned mutex, unsigned excl, unsigned alloc_id,
struct __db_mutex_t *mutexp);
/*
* These mutex counters are included by --enable-perfmon-statistics.
*/
/*
* Increment the count of times that the mutex was free when trying
* to lock it.
*/
probe mutex__set_nowait(unsigned mutex_set_nowait, unsigned mutex);
/*
* Increment the count of times that the mutex was busy when trying
* to lock it.
*/
probe mutex__set_wait(unsigned mutex_set_wait, unsigned mutex);
/*
* Increment the count of times that the shared latch was free
* when trying to get a shared lock on it.
*/
probe mutex__set_rd_nowait(unsigned mutex_set_rd_nowait, unsigned mutex);
/*
* Increment the count of times that the shared latch was already
* exclusively latched when trying to get a shared lock on it.
*/
probe mutex__set_rd_wait(unsigned mutex_set_rd_wait, unsigned mutex);
/*
* Increment the count of times that a hybrid mutex had to block
* on its condition variable. n a busy system this might happen
* several times before the corresponding hybrid_wakeup.
*/
probe mutex__hybrid_wait(unsigned hybrid_wait, unsigned mutex);
/*
* Increment the count of times that a hybrid mutex finished
* one or more waits for its condition variable.
*/
probe mutex__hybrid_wakeup(unsigned hybrid_wakeup, unsigned mutex);
/*
* The race events are triggered when the interactions between two threads
* causes a rarely executed code path to be taken. They are used primarily
* to help test and diagnose race conditions, though if they are being
* triggered too frequently it could result in performance degradation.
* They are intended for use by Berkeley DB engineers.
*/
/* A Btree search needs to wait for a page lock and retry from the top. */
probe race__bam_search(char *file, char *db, int errcode, struct _db_page *pg,
struct _db_page *parent, unsigned flags);
/*
* A record was not found searching an off-page duplicate tree.
* Retry the search.
*/
probe race__dbc_get(char *file, char *db, int errcode, unsigned flags, DBT *key);
/*
* The thread could not immediately open and lock the file handle
* without waiting. The thread will close, wait, and retry.
*/
probe race__fop_file_setup(char *file, int errcode, unsigned flags);
/* A get next or previous in a recno db had to retry. */
probe race__ramc_get(char *file, char *db, struct _db_page *pg, unsigned flags);
/* The statistics counters for replication are for internal use. */
probe rep__log_queued(unsigned count, DB_LSN *lsn);
probe rep__pg_duplicated(unsigned eid, unsigned pgno, unsigned file, unsigned count);
probe rep__pg_record(unsigned count, unsigned eid);
probe rep__pg_request(unsigned count, unsigned eid);
probe rep__election_won(unsigned count, unsigned generation);
probe rep__election(unsigned count, unsigned generation);
probe rep__log_request(unsigned count, unsigned eid);
probe rep__master_change(unsigned count, unsigned eid);
/* The txn category covers the basic transaction operations. */
/* A transaction was successfully begun. */
probe txn__begin(unsigned txnid, unsigned flags);
/* A transaction is starting to commit. */
probe txn__commit(unsigned txnid, unsigned flags);
/*
* The transaction is starting to prepare, flushing the log
* so that a future commit can be guaranteed to succeed.
* The global identifier field is 128 bytes long.
*/
probe txn__prepare(unsigned txnid, uint8_t *gid);
/* The transaction is about to abort. */
probe txn__abort(unsigned txnid);
/*
* These txn counters are included by --enable-perfmon-statistics.
*/
/* Beginning the transaction incremented st_nbegins. */
probe txn__nbegins(unsigned st_nbegins, unsigned txnid);
/* Aborting the transaction incremented st_naborts. */
probe txn__naborts(unsigned st_naborts, unsigned txnid);
/* Committing the transaction incremented st_ncommits. */
probe txn__ncommits(unsigned st_ncommits, unsigned txnid);
/*
* Beginning or ending the transaction updated the number of active
* transactions.
*/
probe txn__nactive(unsigned st_nactive, unsigned txnid);
/*
* The creation of the transaction set a new maximum number
* of active transactions.
*/
probe txn__maxnactive(unsigned st_maxnactive, unsigned txnid);
probe txn__nsnapshot(unsigned st_nsnapshot, unsigned txnid);
probe txn__maxnsnapshot(unsigned st_maxnsnapshot, unsigned txnid);
};
#pragma D attributes Evolving/Evolving/Common provider bdb provider
#pragma D attributes Private/Private/Common provider bdb module
#pragma D attributes Private/Private/Common provider bdb function
#pragma D attributes Evolving/Evolving/Common provider bdb name
#pragma D attributes Evolving/Evolving/Common provider bdb args

186
dist/errno.h vendored Normal file
View file

@ -0,0 +1,186 @@
/*-
* Copyright (c) 1982, 1986, 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)errno.h 8.5 (Berkeley) 1/21/94
* FreeBSD: /repoman/r/ncvs/src/sys/sys/errno.h,v 1.28 2005/04/02 12:33:28 das Exp $
*
* $Id$
*/
#ifndef _SYS_ERRNO_H_
#define _SYS_ERRNO_H_
#undef errno
#define errno DB_GLOBAL(db_errno)
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* Input/output error */
#define ENXIO 6 /* Device not configured */
#define E2BIG 7 /* Argument list too long */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file descriptor */
#define ECHILD 10 /* No child processes */
#define EDEADLK 11 /* Resource deadlock avoided */
/* 11 was EAGAIN */
#define ENOMEM 12 /* Cannot allocate memory */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
#ifndef _POSIX_SOURCE
#define ENOTBLK 15 /* Block device required */
#endif
#define EBUSY 16 /* Device busy */
#define EEXIST 17 /* File exists */
#define EXDEV 18 /* Cross-device link */
#define ENODEV 19 /* Operation not supported by device */
#define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* Too many open files in system */
#define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Inappropriate ioctl for device */
#ifndef _POSIX_SOURCE
#define ETXTBSY 26 /* Text file busy */
#endif
#define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Illegal seek */
#define EROFS 30 /* Read-only filesystem */
#define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */
/* math software */
#define EDOM 33 /* Numerical argument out of domain */
#define ERANGE 34 /* Result too large */
/* non-blocking and interrupt i/o */
#define EAGAIN 35 /* Resource temporarily unavailable */
#ifndef _POSIX_SOURCE
#define EWOULDBLOCK EAGAIN /* Operation would block */
#define EINPROGRESS 36 /* Operation now in progress */
#define EALREADY 37 /* Operation already in progress */
/* ipc/network software -- argument errors */
#define ENOTSOCK 38 /* Socket operation on non-socket */
#define EDESTADDRREQ 39 /* Destination address required */
#define EMSGSIZE 40 /* Message too long */
#define EPROTOTYPE 41 /* Protocol wrong type for socket */
#define ENOPROTOOPT 42 /* Protocol not available */
#define EPROTONOSUPPORT 43 /* Protocol not supported */
#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
#define EOPNOTSUPP 45 /* Operation not supported */
#define ENOTSUP EOPNOTSUPP /* Operation not supported */
#define EPFNOSUPPORT 46 /* Protocol family not supported */
#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
#define EADDRINUSE 48 /* Address already in use */
#define EADDRNOTAVAIL 49 /* Can't assign requested address */
/* ipc/network software -- operational errors */
#define ENETDOWN 50 /* Network is down */
#define ENETUNREACH 51 /* Network is unreachable */
#define ENETRESET 52 /* Network dropped connection on reset */
#define ECONNABORTED 53 /* Software caused connection abort */
#define ECONNRESET 54 /* Connection reset by peer */
#define ENOBUFS 55 /* No buffer space available */
#define EISCONN 56 /* Socket is already connected */
#define ENOTCONN 57 /* Socket is not connected */
#define ESHUTDOWN 58 /* Can't send after socket shutdown */
#define ETOOMANYREFS 59 /* Too many references: can't splice */
#define ETIMEDOUT 60 /* Operation timed out */
#define ECONNREFUSED 61 /* Connection refused */
#define ELOOP 62 /* Too many levels of symbolic links */
#endif /* _POSIX_SOURCE */
#define ENAMETOOLONG 63 /* File name too long */
/* should be rearranged */
#ifndef _POSIX_SOURCE
#define EHOSTDOWN 64 /* Host is down */
#define EHOSTUNREACH 65 /* No route to host */
#endif /* _POSIX_SOURCE */
#define ENOTEMPTY 66 /* Directory not empty */
/* quotas & mush */
#ifndef _POSIX_SOURCE
#define EPROCLIM 67 /* Too many processes */
#define EUSERS 68 /* Too many users */
#define EDQUOT 69 /* Disc quota exceeded */
/* Network File System */
#define ESTALE 70 /* Stale NFS file handle */
#define EREMOTE 71 /* Too many levels of remote in path */
#define EBADRPC 72 /* RPC struct is bad */
#define ERPCMISMATCH 73 /* RPC version wrong */
#define EPROGUNAVAIL 74 /* RPC prog. not avail */
#define EPROGMISMATCH 75 /* Program version wrong */
#define EPROCUNAVAIL 76 /* Bad procedure for program */
#endif /* _POSIX_SOURCE */
#define ENOLCK 77 /* No locks available */
#define ENOSYS 78 /* Function not implemented */
#ifndef _POSIX_SOURCE
#define EFTYPE 79 /* Inappropriate file type or format */
#define EAUTH 80 /* Authentication error */
#define ENEEDAUTH 81 /* Need authenticator */
#define EIDRM 82 /* Identifier removed */
#define ENOMSG 83 /* No message of desired type */
#define EOVERFLOW 84 /* Value too large to be stored in data type */
#define ECANCELED 85 /* Operation canceled */
#define EILSEQ 86 /* Illegal byte sequence */
#define ENOATTR 87 /* Attribute not found */
#define EDOOFUS 88 /* Programming error */
#endif /* _POSIX_SOURCE */
#define EBADMSG 89 /* Bad message */
#define EMULTIHOP 90 /* Multihop attempted */
#define ENOLINK 91 /* Link has been severed */
#define EPROTO 92 /* Protocol error */
#ifndef _POSIX_SOURCE
#define ELAST 92 /* Must be equal largest errno */
#endif /* _POSIX_SOURCE */
#ifdef _KERNEL
/* pseudo-errors returned inside kernel to modify return to process */
#define ERESTART (-1) /* restart syscall */
#define EJUSTRETURN (-2) /* don't modify regs, just return */
#define ENOIOCTL (-3) /* ioctl not handled by this layer */
#define EDIRIOCTL (-4) /* do direct ioctl in GEOM */
#endif
#endif

265
dist/events.in vendored Normal file
View file

@ -0,0 +1,265 @@
#
# dist/events.in - This description of Oracle Berkeley DB's internal
# events hierarchy is processes by dist/s_perfmon to generate the
# platform-specific files needed by the configured operating system.
#
# The entries starting in the first column are event class names, and consist
# of a single word. The class's individual function-like events follow.
#
# Some of these are included to enhance consistency; thse calls could be
# supported by pid$target::<function>:entry (DTrace) or
# probe process("$LIB").function("<function>").call (SystemTap) probes.
#
# For DTrace
# dist/bdb_provider.d
# util/dtrace/dbdefs.d
#
# Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
#
# The alloc class covers the allocation of "on disk" database pages.
alloc
# An attempt to allocate a database page of type 'type' for database 'db'
# returned 'ret'. If the allocation succeeded then ret is 0, pgno is the
# location of the new page, and pg is the address of the new page.
# Details of the page can be extracted from the pg pointer.
new(char *file, char *db, unsigned pgno, unsigned type,
struct _db_page *pg, int ret);
# An attempt to free the page 'pgno' of 'db' returned 'ret'.
# When successful the page is returned to the free list
# or the file is truncated.
free(char *file, char *db, unsigned pgno, unsigned ret);
# A btree split of pgno in db is being attempted. The parent page number
# and the level in the btree are also provided.
btree_split(char *file, char *db, unsigned pgno, unsigned parent,
unsigned level);
# These DB API calls provide the name of the file and database being accessed.
# In-memory databases will have a NULL (0) file name address. The db name will
# be null unless subdatabases are in use.
db
# The database or file name was opened. The 20 byte unique fileid can be
# used to keep track of databases as they are created and destroyed.
open(char *file, char *db, unsigned flags, uint8_t *fileid);
# The database or file name was closed.
close(char *file, char *db, unsigned flags, uint8_t *fileid);
# An attempt is being made to open a cursor on the database or file.
cursor(char *file, char *db, unsigned txnid, unsigned flags,
uint8_t *fileid);
# An attempt is being made to get data from a db.
get(char *file, char *db, unsigned txnid, DBT *key, DBT *data,
unsigned flags);
# An attempt is being made to put data to a db.
put(char *file, char *db, unsigned txnid, DBT *key, DBT *data,
unsigned flags);
# An attempt is being made to delete data from a db.
del(char *file, char *db, unsigned txnid, DBT *key, unsigned flags);
# The lock class monitors the transactional consistency locks: page, record,
# and database. It also monitors the non-transactional file handle locks.
lock
# The thread is about to suspend itself because another locker already has
# a conflicting lock on object 'lock'. The lock DBT's data points to
# a __db_ilock structure, except for the atypical program which uses
# application specific locking.
suspend(DBT *lock, db_lockmode_t lock_mode);
# The thread is awakening from a suspend.
resume(DBT *lock, db_lockmode_t lock_mode);
# The lock is being freed.
put(struct __sh_dbt *lock, unsigned flags);
# The lock would have been freed except that its refcount was greater
# than 1.
put_reduce_count(struct __sh_dbt *lock, unsigned flags);
# These lock counters are included by --enable-perfmon-statistics.
# The locker_id's lock request in lock_obj is about to be aborted in
# order to resolve a deadlock. The lock region's st_ndeadlocks has
# been incremented.
deadlock(unsigned st_ndeadlocks, unsigned locker_id,
struct __sh_dbt *lock_obj);
# A DB_LOCK_NOWAIT lock request by locker_id would have had to wait.
# The lock regions's st_lock_nowait has been incremented and
# the request returns DB_LOCK_NOTGRANTED.
nowait_notgranted(unsigned count, DBT *lock, unsigned locker_id);
request(unsigned request_count, DBT *lock, unsigned locker_id);
upgrade(unsigned upgrade_count, DBT *lock, unsigned locker_id);
# A lock is being stolen from one partition for another one
# The 'from' lock partition's st_locksteals has been incremented.
steal(unsigned st_locksteals, unsigned from, unsigned to);
# A lock object is being stolen from one partition for another one.
# The 'from' lock partition's st_objectsteals has been incremented.
object_steal(unsigned st_objectsteals, unsigned from, unsigned to);
# A lock wait expired due to the lock request timeout.
locktimeout(unsigned st_nlocktimeouts, const DBT *lock);
# A lock wait expired due to the transaction's timeout.
txntimeout(unsigned st_ntxntimeouts, const DBT *lock);
# The allocation or deallocation of the locker id changed the number
# of active locker identifiers.
nlockers(unsigned active, unsigned locker_id);
# The allocation of the locker id set a new maximum
# number of active locker identifiers.
maxnlockers(unsigned new_max_active, unsigned locker_id);
# Log - Transaction log
log
read(unsigned read_count, unsigned logfile);
# The mpool class monitors the allocation and management of memory,
# including the cache.
mpool
# Read a page from file into buf.
read(char *file, unsigned pgno, struct __bh *buf);
# Write a page from buf to file.
write(char *file, unsigned pgno, struct __bh *buf);
# This is an attempt to allocate size bytes from region_id.
# The reg_type is one of the reg_type_t enum values.
env_alloc(unsigned size, unsigned region_id, unsigned reg_type);
# The page is about to be removed from the cache.
evict(char *file, unsigned pgno, struct __bh *buf);
# The memory allocator has incremented wrap_count after searching through
# the entire region without being able to fulfill the request for
# alloc_len bytes. As wrap_count increases the library makes more effort
# to allocate space.
alloc_wrap(unsigned alloc_len, int region_id, int wrap_count,
int put_counter);
# These mpool counters are included by --enable-perfmon-statistics.
# The eviction of a clean page from a cache incremented st_ro_evict.
clean_eviction(unsigned st_ro_evict, unsigned region_id);
# The eviction of a dirty page from a cache incremented st_rw_evict.
# The page has already been written out.
dirty_eviction(unsigned st_rw_evict, unsigned region_id);
# An attempt to allocate memory from region_id failed.
fail(unsigned failure_count, unsigned alloc_len, unsigned region_id);
free(unsigned freed_count, unsigned alloc_len, unsigned region_id);
longest_search(unsigned count, unsigned alloc_len, unsigned region_id);
free_frozen(unsigned count, char *file, unsigned pgno);
freeze(unsigned hash_frozen, unsigned pgno);
# A search for pgno of file incremented st_hash_searches.
hash_search(unsigned st_hash_searches, char *file, unsigned pgno);
# A search for pgno of file increased st_hash_examined by the number
# of hash buckets examined.
hash_examined(unsigned st_hash_examined, char *file, unsigned pgno);
# A search for pgno of file set a new maximum st_hash_longest value.
hash_longest(unsigned st_hash_longest, char *file, unsigned pgno);
# A file's st_map count was incremented after a page was mapped into
# memory. The mapping might have caused disk I/O.
map(unsigned st_map, char *file, unsigned pgno);
# The hit count was incremented because pgno from file was found
# in the cache.
hit(unsigned st_cache_hit, char *file, unsigned pgno);
# The miss count was incremented because pgno from file was
# not already present in the cache.
miss(unsigned st_cache_miss, char *file, unsigned pgno);
# The st_page_create field was incremented because
# the pgno of file was created in the cache.
page_create(unsigned st_page_create, char *file, unsigned pgno);
# The st_page_in field was incremented because
# the pgno from file was read into the cache.
page_in(unsigned st_page_in, char *file, unsigned pgno);
# The st_page_out field was incremented because
# the pgno from file was written out.
page_out(unsigned st_page_out, char *file, unsigned pgno);
thaw(unsigned count, char *file, unsigned pgno);
alloc(unsigned success_count, unsigned len, unsigned region_id);
nallocs(unsigned st_alloc, unsigned alloc_len);
alloc_buckets(unsigned st_alloc_buckets, unsigned region_id);
alloc_max_buckets(unsigned max, unsigned region_id);
alloc_max_pages(unsigned max, unsigned region_id);
alloc_pages(unsigned count, unsigned region_id);
# The mutex category monitors includes shared latches. The alloc_id value
# is one of the MTX_XXX definitions from dbinc/mutex.h
mutex
# This thread is about to suspend itself because a thread has the
# mutex or shared latch locked in a mode which conflicts with the
# this request.
suspend(unsigned mutex, unsigned excl, unsigned alloc_id,
struct __db_mutex_t *mutexp);
# The thread is returning from a suspend and will attempt to obtain
# the mutex or shared latch again. It might need to suspend again.
resume(unsigned mutex, unsigned excl, unsigned alloc_id,
struct __db_mutex_t *mutexp);
# These mutex counters are included by --enable-perfmon-statistics.
# Increment the count of times that the mutex was free when trying
# to lock it.
set_nowait(unsigned mutex_set_nowait, unsigned mutex);
# Increment the count of times that the mutex was busy when trying
# to lock it.
set_wait(unsigned mutex_set_wait, unsigned mutex);
# Increment the count of times that the shared latch was free
# when trying to get a shared lock on it.
set_rd_nowait(unsigned mutex_set_rd_nowait, unsigned mutex);
# Increment the count of times that the shared latch was already
# exclusively latched when trying to get a shared lock on it.
set_rd_wait(unsigned mutex_set_rd_wait, unsigned mutex);
# Increment the count of times that a hybrid mutex had to block
# on its condition variable. n a busy system this might happen
# several times before the corresponding hybrid_wakeup.
hybrid_wait(unsigned hybrid_wait, unsigned mutex);
# Increment the count of times that a hybrid mutex finished
# one or more waits for its condition variable.
hybrid_wakeup(unsigned hybrid_wakeup, unsigned mutex);
# The race events are triggered when the interactions between two threads
# causes a rarely executed code path to be taken. They are used primarily
# to help test and diagnose race conditions, though if they are being
# triggered too frequently it could result in performance degradation.
# They are intended for use by Berkeley DB engineers.
race
# A Btree search needs to wait for a page lock and retry from the top.
bam_search(char *file, char *db, int errcode, struct _db_page *pg,
struct _db_page *parent, unsigned flags);
# A record was not found searching an off-page duplicate tree.
# Retry the search.
dbc_get(char *file, char *db, int errcode, unsigned flags, DBT *key);
# The thread could not immediately open and lock the file handle
# without waiting. The thread will close, wait, and retry.
fop_file_setup(char *file, int errcode, unsigned flags);
# A get next or previous in a recno db had to retry.
ramc_get(char *file, char *db, struct _db_page *pg, unsigned flags);
# The statistics counters for replication are for internal use.
rep
log_queued(unsigned count, DB_LSN *lsn);
pg_duplicated(unsigned eid, unsigned pgno, unsigned file, unsigned count);
pg_record(unsigned count, unsigned eid);
pg_request(unsigned count, unsigned eid);
election_won(unsigned count, unsigned generation);
election(unsigned count, unsigned generation);
log_request(unsigned count, unsigned eid);
master_change(unsigned count, unsigned eid);
# The txn category covers the basic transaction operations.
txn
# A transaction was successfully begun.
begin(unsigned txnid, unsigned flags);
# A transaction is starting to commit.
commit(unsigned txnid, unsigned flags);
# The transaction is starting to prepare, flushing the log
# so that a future commit can be guaranteed to succeed.
# The global identifier field is 128 bytes long.
prepare(unsigned txnid, uint8_t *gid);
# The transaction is about to abort.
abort(unsigned txnid);
# These txn counters are included by --enable-perfmon-statistics.
# Beginning the transaction incremented st_nbegins.
nbegins(unsigned st_nbegins, unsigned txnid);
# Aborting the transaction incremented st_naborts.
naborts(unsigned st_naborts, unsigned txnid);
# Committing the transaction incremented st_ncommits.
ncommits(unsigned st_ncommits, unsigned txnid);
# Beginning or ending the transaction updated the number of active
# transactions.
nactive(unsigned st_nactive, unsigned txnid);
# The creation of the transaction set a new maximum number
# of active transactions.
maxnactive(unsigned st_maxnactive, unsigned txnid);
nsnapshot(unsigned st_nsnapshot, unsigned txnid);
maxnsnapshot(unsigned st_maxnsnapshot, unsigned txnid);

69
dist/gen_inc.awk vendored Normal file
View file

@ -0,0 +1,69 @@
# This awk script parses C input files looking for lines marked "PUBLIC:"
# "EXTERN:", and "DB_LOG_RECSPEC". (PUBLIC lines are DB internal function
# prototypes and #defines, EXTERN lines are DB external function prototypes
# and #defines, and DB_LOG_RECSPEC lines are the definition of log record
# templates.)
#
# PUBLIC lines are put into two versions of per-directory include files:
# one file that contains the prototypes, and one file that contains a
# #define for the name to be processed during configuration when creating
# unique names for every global C-language symbol in the DB library.
#
# The EXTERN lines are put into two files: one of which contains prototypes
# which are always appended to the db.h file, and one of which contains a
# #define list for use when creating unique symbol names.
#
# DB_LOG_RECSPEC lines are put into PUBLIC's internal #define file.
#
# Four arguments:
# e_dfile list of EXTERN #defines
# e_pfile include file that contains EXTERN prototypes
# i_dfile list of internal (PUBLIC) #defines
# i_pfile include file that contains internal (PUBLIC) prototypes
/PUBLIC:/ {
sub(/^.*PUBLIC:[ ][ ]*/, "")
if ($0 ~ /^#if|^#ifdef|^#ifndef|^#else|^#endif/) {
print $0 >> i_pfile
print $0 >> i_dfile
next
}
pline = sprintf("%s %s", pline, $0)
if (pline ~ /\)\);/) {
sub(/^[ ]*/, "", pline)
print pline >> i_pfile
if (pline !~ db_version_unique_name) {
gsub(/[ ][ ]*__P.*/, "", pline)
sub(/^.*[ ][*]*/, "", pline)
printf("#define %s %s@DB_VERSION_UNIQUE_NAME@\n",
pline, pline) >> i_dfile
}
pline = ""
}
}
/EXTERN:/ {
sub(/^.*EXTERN:[ ][ ]*/, "")
if ($0 ~ /^#if|^#ifdef|^#ifndef|^#else|^#endif/) {
print $0 >> e_pfile
print $0 >> e_dfile
next
}
eline = sprintf("%s %s", eline, $0)
if (eline ~ /\)\);/) {
sub(/^[ ]*/, "", eline)
print eline >> e_pfile
if (eline !~ db_version_unique_name) {
gsub(/[ ][ ]*__P.*/, "", eline)
sub(/^.*[ ][*]*/, "", eline)
printf("#define %s %s@DB_VERSION_UNIQUE_NAME@\n",
eline, eline) >> e_dfile
}
eline = ""
}
}
/^DB_LOG_RECSPEC.*_desc\[\]/ {
sub(/DB_LOG_RECSPEC[ ]*/, "");
sub(/\[][ ]*=[ ]*{.*$/, "");
printf("#define\t%s %s@DB_VERSION_UNIQUE_NAME@\n", $0, $0) >> i_dfile
}

465
dist/gen_msg.awk vendored Normal file
View file

@ -0,0 +1,465 @@
#
# See the file LICENSE for redistribution information.
#
# Copyright (c) 1996, 2011 Oracle and/or its affiliates. All rights reserved.
#
# $Id$
#
BEGIN {
if (source_file == "" || header_file == "") {
print "Usage: gen_msg.awk requires these variables to be set:";
print "\theader_file\t-- the message #include file being created";
print "\tsource_file\t-- the message source file being created";
exit;
}
CFILE=source_file;
HFILE=header_file;
maxmsg = 0;
}
/^[ ]*PREFIX/ {
prefix = $2;
# Start .c files.
printf("/* Do not edit: automatically built by gen_msg.awk. */\n\n") \
> CFILE
printf("#include \"db_config.h\"\n\n") >> CFILE
# Start .h file, make the entire file conditional.
printf("/* Do not edit: automatically built by gen_msg.awk. */\n\n") \
> HFILE
printf("#ifndef\t%s_AUTOMSG_H\n#define\t%s_AUTOMSG_H\n\n", prefix, prefix) \
>> HFILE;
printf("/*\n") >> HFILE;
printf(" * Message sizes are simply the sum of field sizes (not\n") \
>> HFILE;
printf(" * counting variable size parts, when DBTs are present),\n") \
>> HFILE;
printf(" * and may be different from struct sizes due to padding.\n") \
>> HFILE;
printf(" */\n") >> HFILE;
}
/^[ ]*INCLUDE/ {
for (i = 2; i < NF; i++)
printf("%s ", $i) >> CFILE;
printf("%s\n", $i) >> CFILE;
}
/^[ ]*BEGIN_MSG/ {
if (in_begin) {
print "Invalid format: missing END statement";
exit;
}
in_begin = 1;
nvars = 0;
thismsg = $2;
for (i = 2; i<= NF; i++) {
if ($i == "alloc")
alloc = 1;
else if ($i == "check_length")
check_length = 1;
else if ($i == "version")
version = 1;
}
base_name = sprintf("%s_%s", prefix, thismsg);
typedef_name = sprintf("%s_args", base_name);
msg_size_name = toupper(sprintf("%s_SIZE", base_name));
max_name = toupper(sprintf("%s_MAXMSG_SIZE", prefix));
}
/^[ ]*ARG/ {
vars[nvars] = $2;
types[nvars] = $3;
if (types[nvars] == "DBT")
has_dbt = 1;
nvars++;
}
/^[ ]*END/ {
if (!in_begin) {
print "Invalid format: missing BEGIN statement";
exit;
}
if (nvars == 0) {
printf("%s needs at least one field\n", thismsg);
exit;
}
sum = 0;
for (i = 0; i < nvars; i++)
sum += type_length(types[i]);
printf("#define\t%s\t%d\n", msg_size_name, sum) >> HFILE;
if (sum > maxmsg)
maxmsg = sum;
printf("typedef struct _%s {\n", typedef_name) >> HFILE;
for (i = 0; i < nvars; i++) {
if (types[i] == "DB_LSN" || types[i] == "DBT")
printf("\t%s\t\t%s;\n", types[i], vars[i]) >> HFILE;
else
printf("\t%s\t%s;\n", types[i], vars[i]) >> HFILE;
}
printf("} %s;\n\n", typedef_name) >> HFILE;
emit_marshal();
emit_unmarshal();
# Reinitialize variables for next time.
in_begin = 0;
alloc = 0;
check_length = 0;
version = 0;
has_dbt = 0;
}
END {
# End the conditional for the HFILE
printf("#define\t%s\t%d\n", max_name, maxmsg) >> HFILE;
printf("#endif\n") >> HFILE;
}
# Length of fixed part of message. Does not count variable-length data portion
# of DBT.
#
function type_length(type)
{
if (type == "DB_LSN")
return (8);
if (type == "DBT" || type == "u_int32_t" || type == "db_pgno_t")
return (4);
if (type == "u_int16_t")
return (2);
if (type == "u_int8_t")
return (1);
printf("unknown field type: %s", type);
exit(1);
}
function emit_marshal()
{
pi = 1;
if (check_length)
p[pi++] = "int ";
else
p[pi++] = "void ";
function_name = sprintf("%s_marshal", base_name);
p[pi++] = function_name;
p[pi++] = " __P((ENV *, ";
if (version)
p[pi++] = "u_int32_t, ";
p[pi++] = sprintf("%s *, u_int8_t *", typedef_name);
if (check_length)
p[pi++] = ", size_t, size_t *";
p[pi++] = "));";
proto_format(p, CFILE);
if (check_length)
printf("int\n") >> CFILE;
else
printf("void\n") >> CFILE;
printf("%s(env", function_name) >> CFILE;
if (version)
printf(", version") >> CFILE;
printf(", argp, bp") >> CFILE;
if (check_length)
printf(", max, lenp") >> CFILE;
printf(")\n") >> CFILE;
printf("\tENV *env;\n") >> CFILE;
if (version)
printf("\tu_int32_t version;\n") >> CFILE;
printf("\t%s *argp;\n", typedef_name) >> CFILE;
printf("\tu_int8_t *bp;\n") >> CFILE;
if (check_length)
printf("\tsize_t *lenp, max;\n") >> CFILE;
printf("{\n") >> CFILE;
if (version)
printf("\tint copy_only;\n") >> CFILE;
if (check_length) {
printf("\tu_int8_t *start;\n\n") >> CFILE;
printf("\tif (max < %s", msg_size_name) >> CFILE;
for (i = 0; i < nvars; i++)
if (types[i] == "DBT")
printf("\n\t + (size_t)argp->%s.size", \
vars[i]) >> CFILE;
# add in dbt sizes
printf(")\n") >> CFILE;
printf("\t\treturn (ENOMEM);\n") >> CFILE;
printf("\tstart = bp;\n\n") >> CFILE;
}
if (version) {
printf("\tcopy_only = 0;\n") >> CFILE;
printf("\tif (version < DB_REPVERSION_47)\n") >> CFILE;
printf("\t\tcopy_only = 1;\n") >> CFILE;
}
for (i = 0; i < nvars; i++) {
if (types[i] == "u_int32_t" || types[i] == "db_pgno_t") {
if (version) {
printf("\tif (copy_only) {\n") >> CFILE;
printf(\
"\t\tmemcpy(bp, &argp->%s, sizeof(u_int32_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int32_t);\n") >> CFILE;
printf("\t} else\n\t") >> CFILE;
}
printf("\tDB_HTONL_COPYOUT(env, bp, argp->%s);\n", \
vars[i]) >> CFILE;
} else if (types[i] == "u_int16_t") {
if (version) {
printf("\tif (copy_only) {\n") >> CFILE;
printf(\
"\t\tmemcpy(bp, &argp->%s, sizeof(u_int16_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int16_t);\n") >> CFILE;
printf("\t} else\n\t") >> CFILE;
}
printf("\tDB_HTONS_COPYOUT(env, bp, argp->%s);\n", \
vars[i]) >> CFILE;
} else if (types[i] == "u_int8_t") {
printf(\
"\t*bp++ = argp->%s;\n", vars[i]) >> CFILE;
} else if (types[i] == "DB_LSN") {
if (version) {
printf("\tif (copy_only) {\n") >> CFILE;
printf(\
"\t\tmemcpy(bp, &argp->%s.file, sizeof(u_int32_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int32_t);\n") >> CFILE;
printf(\
"\t\tmemcpy(bp, &argp->%s.offset, sizeof(u_int32_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int32_t);\n") >> CFILE;
printf("\t} else {\n\t") >> CFILE;
}
printf("\tDB_HTONL_COPYOUT(env, bp, argp->%s.file);\n",\
vars[i]) >> CFILE;
if (version)
printf("\t") >> CFILE;
printf( \
"\tDB_HTONL_COPYOUT(env, bp, argp->%s.offset);\n", \
vars[i]) >> CFILE;
if (version)
printf("\t}\n") >> CFILE;
} else if (types[i] == "DBT") {
if (version) {
printf("\tif (copy_only) {\n") >> CFILE;
printf(\
"\t\tmemcpy(bp, &argp->%s.size, sizeof(u_int32_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int32_t);\n") >> CFILE;
printf("\t} else\n\t") >> CFILE;
}
printf("\tDB_HTONL_COPYOUT(env, bp, argp->%s.size);\n",\
vars[i]) >> CFILE;
printf("\tif (argp->%s.size > 0) {\n", vars[i]) \
>> CFILE;
printf( \
"\t\tmemcpy(bp, argp->%s.data, argp->%s.size);\n", \
vars[i], vars[i]) >> CFILE;
printf("\t\tbp += argp->%s.size;\n", vars[i]) >> CFILE;
printf("\t}\n") >> CFILE;
} else {
printf("unknown field type: %s", types[i]);
exit(1);
}
}
if (check_length) {
printf("\n\t*lenp = (size_t)(bp - start);\n") >> CFILE;
printf("\treturn (0);\n") >> CFILE;
}
printf("}\n\n") >> CFILE;
}
function emit_unmarshal()
{
pi = 1;
p[pi++] = "int ";
function_name = sprintf("%s_unmarshal", base_name);
p[pi++] = function_name;
p[pi++] = " __P((ENV *, ";
if (version)
p[pi++] = sprintf("u_int32_t, ");
if (alloc)
p[pi++] = sprintf("%s **, u_int8_t *, ", typedef_name);
else
p[pi++] = sprintf("%s *, u_int8_t *, ", typedef_name);
p[pi++] = sprintf("size_t, u_int8_t **));");
proto_format(p, CFILE);
printf("int\n") >> CFILE;
if (alloc)
arg_name = "argpp";
else
arg_name = "argp";
printf("%s(env, ", function_name) >> CFILE;
if (version)
printf("version, ") >> CFILE;
printf("%s, bp, ", arg_name) >> CFILE;
printf("max, nextp)\n") >> CFILE;
printf("\tENV *env;\n") >> CFILE;
if (version)
printf("\tu_int32_t version;\n") >> CFILE;
if (alloc)
printf("\t%s **argpp;\n", typedef_name) >> CFILE;
else
printf("\t%s *argp;\n", typedef_name) >> CFILE;
printf("\tu_int8_t *bp;\n") >> CFILE;
printf("\tsize_t max;\n") >> CFILE;
printf("\tu_int8_t **nextp;\n") >> CFILE;
printf("{\n") >> CFILE;
has_locals = 0;
if (has_dbt) {
printf("\tsize_t needed;\n") >> CFILE;
has_locals = 1;
}
if (alloc) {
printf("\t%s *argp;\n", typedef_name) >> CFILE;
printf("\tint ret;\n") >> CFILE;
has_locals = 1;
}
if (version) {
printf("\tint copy_only;\n") >> CFILE;
has_locals = 1;
}
if (has_locals)
printf("\n") >> CFILE;
# Check that input byte buffer is long enough.
#
if (has_dbt) {
printf("\tneeded = %s;\n", msg_size_name) >> CFILE;
printf("\tif (max < needed)\n") >> CFILE;
} else
printf("\tif (max < %s)\n", msg_size_name) >> CFILE;
printf("\t\tgoto too_few;\n") >> CFILE;
if (alloc) {
printf( \
"\tif ((ret = __os_malloc(env, sizeof(*argp), &argp)) != 0)\n") \
>> CFILE;
printf("\t\treturn (ret);\n\n") >> CFILE;
}
if (version) {
printf("\tcopy_only = 0;\n") >> CFILE;
printf("\tif (version < DB_REPVERSION_47)\n") >> CFILE;
printf("\t\tcopy_only = 1;\n") >> CFILE;
}
for (i = 0; i < nvars; i++) {
if (types[i] == "u_int32_t" || types[i] == "db_pgno_t") {
if (version) {
printf("\tif (copy_only) {\n") >> CFILE;
printf(\
"\t\tmemcpy(&argp->%s, bp, sizeof(u_int32_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int32_t);\n") >> CFILE;
printf("\t} else\n\t") >> CFILE;
}
printf("\tDB_NTOHL_COPYIN(env, argp->%s, bp);\n", \
vars[i]) >> CFILE;
} else if (types[i] == "u_int16_t") {
if (version) {
printf("\tif (copy_only) {\n") >> CFILE;
printf(\
"\t\tmemcpy(&argp->%s, bp, sizeof(u_int16_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int16_t);\n") >> CFILE;
printf("\t} else\n\t") >> CFILE;
}
printf("\tDB_NTOHS_COPYIN(env, argp->%s, bp);\n", \
vars[i]) >> CFILE;
} else if (types[i] == "u_int8_t") {
printf(\
"\targp->%s = *bp++;\n", vars[i]) >> CFILE;
} else if (types[i] == "DB_LSN") {
if (version) {
printf("\tif (copy_only) {\n") >> CFILE;
printf(\
"\t\tmemcpy(&argp->%s.file, bp, sizeof(u_int32_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int32_t);\n") >> CFILE;
printf(\
"\t\tmemcpy(&argp->%s.offset, bp, sizeof(u_int32_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int32_t);\n") >> CFILE;
printf("\t} else {\n\t") >> CFILE;
}
printf("\tDB_NTOHL_COPYIN(env, argp->%s.file, bp);\n", \
vars[i]) >> CFILE;
if (version)
printf("\t") >> CFILE;
printf( \
"\tDB_NTOHL_COPYIN(env, argp->%s.offset, bp);\n", \
vars[i]) >> CFILE;
if (version)
printf("\t}\n") >> CFILE;
} else if (types[i] == "DBT") {
if (version) {
printf("\tif (copy_only) {\n") >> CFILE;
printf(\
"\t\tmemcpy(&argp->%s.size, bp, sizeof(u_int32_t));\n", vars[i]) >> CFILE;
printf(\
"\t\tbp += sizeof(u_int32_t);\n") >> CFILE;
printf("\t} else\n\t") >> CFILE;
}
printf("\tDB_NTOHL_COPYIN(env, argp->%s.size, bp);\n", \
vars[i]) >> CFILE;
printf("\targp->%s.data = bp;\n", vars[i]) >> CFILE;
printf("\tneeded += (size_t)argp->%s.size;\n", \
vars[i]) >> CFILE;
printf("\tif (max < needed)\n") >> CFILE;
printf("\t\tgoto too_few;\n") >> CFILE;
printf("\tbp += argp->%s.size;\n", vars[i]) >> CFILE;
} else {
printf("unknown field type: %s", types[i]);
exit(1);
}
}
printf("\n\tif (nextp != NULL)\n") >> CFILE;
printf("\t\t*nextp = bp;\n") >> CFILE;
if (alloc) {
printf("\t*argpp = argp;\n") >> CFILE;
}
printf("\treturn (0);\n\n") >> CFILE;
printf("too_few:\n") >> CFILE;
printf("\t__db_errx(env, DB_STR(\"3675\",\n") >> CFILE;
printf("\t \"Not enough input bytes to fill a %s message\"));\n", \
base_name) >> CFILE;
printf("\treturn (EINVAL);\n") >> CFILE;
printf("}\n\n") >> CFILE;
}
# proto_format --
# Pretty-print a function prototype.
function proto_format(p, fp)
{
printf("/*\n") >> fp;
s = "";
for (i = 1; i in p; ++i)
s = s p[i];
t = " * PUBLIC: "
if (length(s) + length(t) < 80)
printf("%s%s", t, s) >> fp;
else {
split(s, p, "__P");
len = length(t) + length(p[1]);
printf("%s%s", t, p[1]) >> fp
n = split(p[2], comma, ",");
comma[1] = "__P" comma[1];
for (i = 1; i <= n; i++) {
if (len + length(comma[i]) > 70) {
printf("\n * PUBLIC: ") >> fp;
len = 0;
}
printf("%s%s", comma[i], i == n ? "" : ",") >> fp;
len += length(comma[i]) + 2;
}
}
printf("\n */\n") >> fp;
delete p;
}

86
dist/gen_provider.pl vendored Normal file
View file

@ -0,0 +1,86 @@
# Perl script to generate a DTrace provider specification from dist/events.in
$class = undef;
$continuing = 0;
$header_comment = 1;
$single_line = undef;
$multi_line = undef;
print "#include \"dbdefs.d\"\n\nprovider bdb {\n";
while (<>) {
$lineno++;
if (/^$/) {
# Always put the (required multi-line) header comment
# by itself. It ends at the first empty line.
if ($header_comment && defined($multi_line)) {
printf("%s*/\n", $multi_line);
$multi_line = undef;
}
printf("\n");
next;
}
chop;
# Translate single-line # comments to DTrace compatible /* ... */.
# Generate both single and multi-line version to match KNF standards.
if (/^([ ]*)#([ ]*)(.*)$/) {
if (defined($multi_line)) {
$single_line = undef;
$multi_line = "$multi_line* $3\n$1 ";
} else {
$single_line = "$1/* $3 */";
$multi_line = "$1/*\n$1 * $3\n$1 ";
}
next;
}
# It is not a comment line, see whether to output any pending comment
# that was saved up over the previous line(s).
if (defined($multi_line)) {
if (defined($single_line)) {
printf("%s\n", $single_line);
} else {
printf("%s*/\n", $multi_line);
}
$single_line = undef;
$multi_line = undef;
}
# A line starting with a letter is an event class name.
if (/^[a-z]/) {
$class = $_;
next;
}
if ($continuing) {
# End of a continued probe signature?
if (/([a-z0-9-_ ,)]*;)$/) {
printf("%s\n", $_);
$continuing = 0;
next;
} elsif (/([a-z0-9-_ ,]*,)$/) {
printf("%s\n", $_);
next;
}
}
if (/([ ]*)([a-z-_]*)[ ]*(\([^)]*,)$/) {
# printf("\tprobe %s__%s%s\n", $class, $1, $2);
printf("%sprobe %s__%s%s\n", $1, $class, $2, $3);
$continuing = 1;
} elsif (/([ ]*)([a-z-_]*)[ ]*(\([^)]*\);)/) {
printf("%sprobe %s__%s%s\n", $1, $class, $2, $3);
# printf("\tprobe %s__%s%s\n", $class, $1, $2);
} else {
printf("** Error in line %d: %s\n", $lineno, $_);
printf("** Missing or unrecognized parameter list under class %s\n", $class);
exit(1);
}
}
print "};\n\n";
if ($continuing) {
printf("** Unfinished probe under class %s\n", $class);
exit(1);
}
print "#pragma D attributes Evolving/Evolving/Common provider bdb provider\n";
print "#pragma D attributes Private/Private/Common provider bdb module\n";
print "#pragma D attributes Private/Private/Common provider bdb function\n";
print "#pragma D attributes Evolving/Evolving/Common provider bdb name\n";
print "#pragma D attributes Evolving/Evolving/Common provider bdb args\n\n";

611
dist/gen_rec.awk vendored Normal file
View file

@ -0,0 +1,611 @@
#!/bin/sh -
#
# See the file LICENSE for redistribution information.
#
# Copyright (c) 1996, 2011 Oracle and/or its affiliates. All rights reserved.
#
# $Id$
#
# 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 four variables be set when it is called:
#
# source_file -- the C source file being created
# header_file -- the C #include file being created
# template_file -- the template file being created
#
# And stdin must be the input file that defines the recovery setup.
#
# Within each file prefix.src, we use a number of public keywords (documented
# in the reference guide) as well as the following ones which are private to
# DB:
# DBPRIVATE Indicates that a file will be built as part of DB,
# rather than compiled independently, and so can use
# DB-private interfaces (such as DB_LOG_NOCOPY).
# DB A DB handle. Logs the dbreg fileid for that handle,
# and makes the *_log interface take a DB * instead of a
# DB_ENV *.
# OP The low byte contains the page type of the data
# that needs byte swapping. The rest is log record
# specific.
# PGDBT,PGDDBT Just like DBT, only we know it stores a page or page
# header, so we can byte-swap it (once we write the
# byte-swapping code, which doesn't exist yet).
# HDR,DATA Just like DBT, but we know that these contain database
# records that may need byte-swapping.
# LOCKS,PGLIST Just like DBT, but uses a print function for locks or
# page lists.
BEGIN {
if (source_file == "" ||
header_file == "" || template_file == "") {
print "Usage: gen_rec.awk requires three variables to be set:"
print "\theader_file\t-- the recover #include file being created"
print "\tprint_file\t-- the print source file being created"
print "\tsource_file\t-- the recover source file being created"
print "\ttemplate_file\t-- the template file being created"
exit
}
FS="[\t ][\t ]*"
CFILE=source_file
HFILE=header_file
PFILE=print_file
TFILE=template_file
# These are the variables we use to create code that calls into
# db routines and/or uses an environment.
dbprivate = 0
env_type = "DB_ENV"
env_var = "dbenv"
log_call = "dbenv->log_put_record"
}
/^[ ]*DBPRIVATE/ {
dbprivate = 1
env_type = "ENV"
env_var = "env"
log_call = "__log_put_record"
}
/^[ ]*PREFIX/ {
prefix = $2
num_funcs = 0;
# Start .c files.
printf("/* Do not edit: automatically built by gen_rec.awk. */\n\n")\
> CFILE
printf("#include \"db_config.h\"\n") >> CFILE
if (!dbprivate) {
printf("#include <errno.h>\n") >> CFILE
printf("#include <stdlib.h>\n") >> CFILE
printf("#include <string.h>\n") >> CFILE
printf("#include \"db_int.h\"\n") >> CFILE
printf("#include \"dbinc/db_swap.h\"\n") >> CFILE
}
printf("/* Do not edit: automatically built by gen_rec.awk. */\n\n")\
> PFILE
printf("#include \"db_config.h\"\n\n") >> PFILE
if (!dbprivate) {
printf("#include <ctype.h>\n") >> PFILE
printf("#include <stdio.h>\n") >> PFILE
printf("#include <stdlib.h>\n") >> PFILE
printf("#include \"db_int.h\"\n") >> PFILE
printf("#include \"dbinc/log.h\"\n") >> PFILE
}
if (prefix == "__ham")
printf("#ifdef HAVE_HASH\n") >> PFILE
if (prefix == "__heap")
printf("#ifdef HAVE_HEAP\n") >> PFILE
if (prefix == "__qam")
printf("#ifdef HAVE_QUEUE\n") >> PFILE
if (prefix == "__repmgr")
printf("#ifdef HAVE_REPLICATION_THREADS\n") >> PFILE
# 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
if (prefix == "__ham")
printf("#ifdef HAVE_HASH\n") >> HFILE
if (prefix == "__heap")
printf("#ifdef HAVE_HEAP\n") >> HFILE
if (prefix == "__qam")
printf("#ifdef HAVE_QUEUE\n") >> HFILE
if (prefix == "__repmgr")
printf("#ifdef HAVE_REPLICATION_THREADS\n") >> HFILE
if (dbprivate)
printf("#include \"dbinc/log.h\"\n") >> HFILE
# Write recovery template file headers
if (dbprivate) {
# This assumes we're doing DB recovery.
printf("#include \"db_config.h\"\n\n") > TFILE
printf("#include \"db_int.h\"\n") >> TFILE
printf("#include \"dbinc/db_page.h\"\n") >> TFILE
printf("#include \"dbinc/%s.h\"\n", prefix) >> TFILE
printf("#include \"dbinc/log.h\"\n\n") >> TFILE
} else {
printf("#include \"db.h\"\n\n") > TFILE
}
}
/^[ ]*INCLUDE/ {
for (i = 2; i < NF; i++)
printf("%s ", $i) >> CFILE
printf("%s\n", $i) >> CFILE
for (i = 2; i < NF; i++)
printf("%s ", $i) >> PFILE
printf("%s\n", $i) >> PFILE
}
/^[ ]*(BEGIN|BEGIN_COMPAT)/ {
if (in_begin) {
print "Invalid format: missing END statement"
exit
}
in_begin = 1;
is_duplicate = 0;
is_dbt = 0;
has_dbp = 0;
has_data = 0;
is_uint = 0;
hdrdbt = "NULL";
ddbt = "NULL";
#
# BEGIN_COMPAT does not need logging function or rec table entry.
#
need_log_function = ($1 == "BEGIN");
is_compat = ($1 == "BEGIN_COMPAT");
nvars = 0;
thisfunc = $2;
dup_thisfunc = $2;
version = $3;
rectype = $4;
make_name(thisfunc, thisfunc, version);
}
/^[ ]*(DB|ARG|DBOP|DBT|DATA|HDR|LOCKS|OP|PGDBT|PGDDBT|PGLIST|POINTER|TIME)/ {
vars[nvars] = $2;
types[nvars] = $3;
modes[nvars] = $1;
formats[nvars] = $NF;
for (i = 4; i < NF; i++)
types[nvars] = sprintf("%s %s", types[nvars], $i);
if ($1 == "DB") {
has_dbp = 1;
}
if ($1 == "DATA" || $1 == "PGDDBT") {
if (has_data == 1) {
print "Invalid format: multiple data fields"
exit
}
has_data = 1;
}
if ($1 == "DB" || $1 == "DBOP" || $1 == "ARG" || \
$1 == "OP" || $1 == "TIME") {
sizes[nvars] = sprintf("sizeof(u_int32_t)");
if ($3 != "u_int32_t")
is_uint = 1;
} else if ($1 == "POINTER")
sizes[nvars] = sprintf("sizeof(*%s)", $2);
else { # DBT, PGDBT, PGDDBT
sizes[nvars] = sprintf("LOG_DBT_SIZE(%s)", $2);
is_dbt = 1;
if ($1 == "PGDBT") {
if (hdrdbt != "NULL") {
print "Multiple PGDBTs in record"
exit;
}
if (ddbt != "NULL") {
print "PGDDBT must follow PGDBT"
exit;
}
hdrdbt = vars[nvars];
} else if ($1 == "PGDDBT") {
if (ddbt != "NULL") {
print "Multiple PGDDBTs in record"
exit;
}
if (hdrdbt == "NULL") {
print "PGDDBT must follow PGDBT"
exit;
}
ddbt = vars[nvars];
}
}
nvars++;
}
/^[ ]*DUPLICATE/ {
is_duplicate = 1;
dup_rectype = $4;
old_logfunc = logfunc;
old_funcname = funcname;
make_name($2, funcname, $3);
internal_name = sprintf("%s_%s_int", prefix, thisfunc);
dup_logfunc = logfunc;
dup_funcname = funcname;
dup_thisfunc = $2;
logfunc = old_logfunc;
funcname = old_funcname;
}
/^[ ]*END/ {
if (!in_begin) {
print "Invalid format: missing BEGIN statement"
exit;
}
# Declare the record type.
printf("#define\tDB_%s\t%d\n", funcname, rectype) >> HFILE
if (is_duplicate)
printf("#define\tDB_%s\t%d\n",\
dup_funcname, dup_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 *txnp;\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], 1, ndx - 2);
}
printf("\t%s\t%s;\n", t, vars[i]) >> HFILE
}
printf("} %s_args;\n\n", funcname) >> HFILE
# Output the read, log, and print functions (note that we must
# generate the required read function first, because we use its
# prototype in the print function).
log_function(funcname, funcname);
read_function(funcname, funcname);
if (is_duplicate) {
log_function(dup_funcname, funcname);
read_function(dup_funcname, funcname);
}
print_function();
# Recovery template
if (dbprivate)
f = "template/rec_ctemp"
else
f = "template/rec_utemp"
cmd = sprintf(\
"sed -e s/PREF/%s/ -e s/FUNC/%s/ -e s/DUP/%s/ < template/rec_%s >> %s",
prefix, thisfunc, dup_thisfunc,
dbprivate ? "ctemp" : "utemp", TFILE)
system(cmd);
# Done writing stuff, reset and continue.
in_begin = 0;
}
END {
# End the conditional for the HFILE
if (prefix == "__ham")
printf("#endif /* HAVE_HASH */\n") >> HFILE
if (prefix == "__heap")
printf("#endif /* HAVE_HEAP */\n") >> HFILE
if (prefix == "__qam")
printf("#endif /* HAVE_QUEUE */\n") >> HFILE
if (prefix == "__repmgr")
printf("#endif /* HAVE_REPLICATION_THREADS */\n") >> HFILE
printf("#endif\n") >> HFILE
# Print initialization routine; function prototype
p[1] = sprintf("int %s_init_print %s%s%s", prefix,
"__P((", env_type, " *, DB_DISTAB *));");
p[2] = "";
proto_format(p, PFILE);
# Create the routine to call __db_add_recovery(print_fn, id)
printf("int\n%s_init_print(%s, dtabp)\n",\
prefix, env_var) >> PFILE
printf("\t%s *%s;\n", env_type, env_var) >> PFILE
printf("\tDB_DISTAB *dtabp;\n{\n") >> PFILE
# If application-specific, the user will need a prototype for
# __db_add_recovery, since they won't have DB's.
if (!dbprivate) {
printf(\
"\tint __db_add_recovery __P((%s *, DB_DISTAB *,\n",\
env_type) >> PFILE
printf(\
"\t int (*)(%s *, DBT *, DB_LSN *, db_recops), u_int32_t));\n",\
env_type) >> PFILE
}
printf("\tint ret;\n\n") >> PFILE
for (i = 0; i < num_funcs; i++) {
if (functable[i] == 1)
continue;
printf("\tif ((ret = __db_add_recovery%s(%s, ",\
dbprivate ? "_int" : "", env_var) >> PFILE
printf("dtabp,\n") >> PFILE
printf("\t %s_print, DB_%s)) != 0)\n",\
dupfuncs[i], funcs[i]) >> PFILE
printf("\t\treturn (ret);\n") >> PFILE
}
printf("\treturn (0);\n}\n") >> PFILE
if (prefix == "__ham")
printf("#endif /* HAVE_HASH */\n") >> PFILE
if (prefix == "__heap")
printf("#endif /* HAVE_HEAP */\n") >> PFILE
if (prefix == "__qam")
printf("#endif /* HAVE_QUEUE */\n") >> PFILE
if (prefix == "__repmgr")
printf("#endif /* HAVE_REPLICATION_THREADS */\n") >> PFILE
# We only want to generate *_init_recover functions if this is a
# DB-private, rather than application-specific, set of recovery
# functions. Application-specific recovery functions should be
# dispatched using the DB_ENV->set_app_dispatch callback rather than
# a DB dispatch table ("dtab").
if (!dbprivate)
exit
# Everything below here is dbprivate, so it uses ENV instead of DB_ENV
# Recover initialization routine
p[1] = sprintf("int %s_init_recover %s", prefix,\
"__P((ENV *, DB_DISTAB *));");
p[2] = "";
proto_format(p, CFILE);
# Create the routine to call db_add_recovery(func, id)
printf("int\n%s_init_recover(env, dtabp)\n", prefix) >> CFILE
printf("\tENV *env;\n") >> CFILE
printf("\tDB_DISTAB *dtabp;\n{\n") >> CFILE
printf("\tint ret;\n\n") >> CFILE
for (i = 0; i < num_funcs; i++) {
if (functable[i] == 1)
continue;
printf("\tif ((ret = __db_add_recovery_int(env, ") >> CFILE
printf("dtabp,\n") >> CFILE
printf("\t %s_recover, DB_%s)) != 0)\n",\
funcs[i], funcs[i]) >> CFILE
printf("\t\treturn (ret);\n") >> CFILE
}
printf("\treturn (0);\n}\n") >> CFILE
}
function log_function(logfunc, arg)
{
# Descriptor array
printf("extern __DB_IMPORT DB_LOG_RECSPEC %s_desc[];\n", \
logfunc) >> HFILE;
printf("DB_LOG_RECSPEC %s_desc[] = {\n", logfunc) >> CFILE
# Function declaration
if (need_log_function) {
printf("static inline int\n%s_log(", logfunc) >> HFILE
# Now print the parameters
if (has_dbp) {
printf("DB *dbp, ") >> HFILE
} else {
printf("%s *%s, ", env_type, env_var) >> HFILE
}
printf("DB_TXN *txnp, DB_LSN *ret_lsnp, ") >> HFILE
printf("u_int32_t flags") >> HFILE
}
for (i = 0; i < nvars; i++) {
# Descriptor element
if (modes[i] == "ARG" || modes[i] == "OP")
printf(\
"\t{LOGREC_%s, SSZ(%s_args, %s), \"%s\", \"%%%s\"},\n",\
modes[i], arg, vars[i], \
vars[i], formats[i]) >> CFILE
else
printf( \
"\t{LOGREC_%s, SSZ(%s_args, %s), \"%s\", \"\"},\n",\
modes[i], arg, vars[i], vars[i]) >> CFILE
# Function argument
# We just skip for modes == DB.
if (!need_log_function || modes[i] == "DB")
continue;
printf(",") >> HFILE
if ((i % 5) == 0)
printf("\n ") >> HFILE
else
printf(" ") >> HFILE
if (modes[i] == "DBT" || modes[i] == "HDR" ||
modes[i] == "DATA" || modes[i] == "LOCKS" ||
modes[i] == "PGDBT" || modes[i] == "PGDDBT"||
modes[i] == "PGLIST")
printf("const %s *%s", types[i], vars[i]) >> HFILE
else
printf("%s %s", types[i], vars[i]) >> HFILE
}
# Descriptor termination
printf("\t{LOGREC_Done, 0, \"\", \"\"}\n};\n") >> CFILE
if (!need_log_function)
return;
# Function call
printf(")\n{\n\treturn (%s(", log_call) >> HFILE
if (dbprivate) {
if (has_dbp)
printf("(dbp)->env, dbp, ") >> HFILE
else
printf("env, NULL, ") >> HFILE
} else {
if (has_dbp)
printf("dbenv, dbp, ") >> HFILE
else
printf("dbenv, NULL, ") >> HFILE
}
printf("txnp, ret_lsnp,\n\t flags, DB_%s, %d,\n\t",
logfunc, has_data) >> HFILE
printf(" sizeof(u_int32_t) + sizeof(u_int32_t) + sizeof(DB_LSN)")\
>> HFILE
for (i = 0; i < nvars; i++) {
if (i % 3 == 0)
printf(" +\n\t %s", sizes[i]) >> HFILE
else
printf(" + %s", sizes[i]) >> HFILE
}
printf(",\n\t %s_desc", logfunc) >> HFILE
for (i = 0; i < nvars; i++) {
# We just skip for modes == DB.
if (modes[i] == "DB")
continue;
printf(",") >> HFILE
if ((i % 8) == 0)
printf("\n\t ") >> HFILE
else
printf(" ") >> HFILE
printf("%s", vars[i]) >> HFILE
}
printf("));\n}\n\n") >> HFILE
}
function read_function(logfunc, arg)
{
# Read function
printf("static inline int %s_read(%s *%s, \n ", \
logfunc, env_type, env_var) >> HFILE
if (has_dbp)
printf("DB **dbpp, void *td, ") >> HFILE
printf("void *data, ") >> HFILE
printf("%s_args **arg)\n{\n", arg) >> HFILE
if (dbprivate) {
printf("\t*arg = NULL;\n") >> HFILE
printf("\treturn (__log_read_record(env, \n") >> HFILE
if (has_dbp)
printf("\t dbpp, td, data, ") >> HFILE
else
printf("\t NULL, NULL, data, ") >> HFILE
} else {
printf("\treturn (dbenv->log_read_record(dbenv, \n") >> HFILE
if (has_dbp)
printf("\t dbpp, td, data, ") >> HFILE
else
printf("\t NULL, NULL, data, ") >> HFILE
}
printf("%s_desc, sizeof(%s_args), (void**)arg));\n}\n", logfunc, arg)\
>> HFILE;
}
function print_function()
{
# Write the print function; function prototype
p[1] = sprintf("int %s_print", funcname);
p[2] = " ";
if (dbprivate)
p[3] = "__P((ENV *, DBT *, DB_LSN *, db_recops, void *));";
else
p[3] = "__P((DB_ENV *, DBT *, DB_LSN *, db_recops));";
p[4] = "";
proto_format(p, PFILE);
# Function declaration
printf("int\n%s_print(%s, ", funcname, env_var) >> PFILE
printf("dbtp, lsnp, notused2") >> PFILE
if (dbprivate)
printf(", info") >> PFILE
printf(")\n") >> PFILE
printf("\t%s *%s;\n", env_type, env_var) >> PFILE
printf("\tDBT *dbtp;\n") >> PFILE
printf("\tDB_LSN *lsnp;\n") >> PFILE
printf("\tdb_recops notused2;\n") >> PFILE
if (dbprivate)
printf("\tvoid *info;\n") >> PFILE
printf("{\n") >> PFILE
# Get rid of complaints about unused parameters.
if (dbprivate) {
printf("\tCOMPQUIET(notused2, DB_TXN_PRINT);\n") >> PFILE
} else {
printf("\tnotused2 = DB_TXN_PRINT;\n") >> PFILE
}
printf("\n") >> PFILE
printf(\
"\treturn (__log_print_record(%senv, dbtp, lsnp, \"%s\", %s_desc",
dbprivate ? "" : "dbenv->", funcname, funcname) >> PFILE
if (dbprivate)
printf(", info));\n") >> PFILE
else
printf(", NULL));\n") >> PFILE
printf("}\n\n") >> PFILE
}
# proto_format --
# Pretty-print a function prototype.
function proto_format(p, fp)
{
printf("/*\n") >> fp;
s = "";
for (i = 1; i in p; ++i)
s = s p[i];
t = " * PUBLIC: "
if (length(s) + length(t) < 80)
printf("%s%s", t, s) >> fp;
else {
split(s, p, "__P");
len = length(t) + length(p[1]);
printf("%s%s", t, p[1]) >> fp
n = split(p[2], comma, ",");
comma[1] = "__P" comma[1];
for (i = 1; i <= n; i++) {
if (len + length(comma[i]) > 70) {
printf("\n * PUBLIC: ") >> fp;
len = 0;
}
printf("%s%s", comma[i], i == n ? "" : ",") >> fp;
len += length(comma[i]) + 2;
}
}
printf("\n */\n") >> fp;
delete p;
}
function make_name(unique_name, dup_name, p_version)
{
logfunc = sprintf("%s_%s", prefix, unique_name);
logname[num_funcs] = logfunc;
if (is_compat) {
funcname = sprintf("%s_%s_%s", prefix, unique_name, p_version);
} else {
funcname = logfunc;
}
if (is_duplicate)
dupfuncs[num_funcs] = dup_name;
else
dupfuncs[num_funcs] = funcname;
funcs[num_funcs] = funcname;
functable[num_funcs] = is_compat;
++num_funcs;
}

519
dist/install-sh vendored Executable file
View file

@ -0,0 +1,519 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# 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.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# 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 $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

9636
dist/ltmain.sh vendored Normal file

File diff suppressed because it is too large Load diff

545
dist/pubdef.in vendored Normal file
View file

@ -0,0 +1,545 @@
# $Id: pubdef.in,v 4d4a04145f28 2010/07/28 15:20:45 ben $
#
# Name
# D == documentation
# I == include file
# J == Java constant
# N == wrapped by the Java native layer
# C == C# constant
DB_AFTER D I J C
DB_AGGRESSIVE D I J C
DB_ALIGN8 * I * *
DB_ALREADY_ABORTED * I * *
DB_AM_CHKSUM * I * *
DB_AM_COMPENSATE * I * *
DB_AM_COMPRESS * I * *
DB_AM_CREATED * I * *
DB_AM_CREATED_MSTR * I * *
DB_AM_DBM_ERROR * I * *
DB_AM_DELIMITER * I * *
DB_AM_DISCARD * I * *
DB_AM_DUP * I * *
DB_AM_DUPSORT * I * *
DB_AM_ENCRYPT * I * *
DB_AM_FIXEDLEN * I * *
DB_AM_INMEM * I * *
DB_AM_INORDER * I * *
DB_AM_IN_RENAME * I * *
DB_AM_NOT_DURABLE * I * *
DB_AM_OPEN_CALLED * I * *
DB_AM_PAD * I * *
DB_AM_PGDEF * I * *
DB_AM_RDONLY * I * *
DB_AM_READ_UNCOMMITTED * I * *
DB_AM_RECNUM * I * *
DB_AM_RECOVER * I * *
DB_AM_RENUMBER * I * *
DB_AM_REVSPLITOFF * I * *
DB_AM_SECONDARY * I * *
DB_AM_SNAPSHOT * I * *
DB_AM_SUBDB * I * *
DB_AM_SWAP * I * *
DB_AM_TXN * I * *
DB_AM_VERIFYING * I * *
DB_APPEND D I J C
DB_ARCH_ABS D I J C
DB_ARCH_DATA D I J C
DB_ARCH_LOG D I J C
DB_ARCH_REMOVE D I J C
DB_ASSOC_IMMUTABLE_KEY * I J C
DB_ASSOC_CREATE * I J C
DB_AUTO_COMMIT D I J C
DB_BEFORE D I J C
DB_BOOTSTRAP_HELPER D I J C
DB_BTREE D I J C
DB_BTREEMAGIC * I * *
DB_BTREEOLDVER * I * *
DB_BTREEVERSION * I * *
DB_BUFFER_SMALL D I J C
DB_CDB_ALLDB D I J C
DB_CHKSUM D I J C
DB_CKP_INTERNAL * I * *
DB_CONFIG D * * *
DB_CONSUME D I J C
DB_CONSUME_WAIT D I J C
DB_CREATE D I J C
DB_CURRENT D I J C
DB_CURSOR_BULK D I J C
DB_CURSOR_TRANSIENT * I * *
DB_CXX_NO_EXCEPTIONS D I * *
DB_DATABASE_LOCK * I * *
DB_DATABASE_LOCKING * I * *
DB_DBM_HSEARCH * I * *
DB_DBT_APPMALLOC D I N C
DB_DBT_BULK D I J C
DB_DBT_DUPOK * I * *
DB_DBT_ISSET * I * *
DB_DBT_MALLOC D I J C
DB_DBT_MULTIPLE D I N C
DB_DBT_PARTIAL D I J C
DB_DBT_READONLY D I J C
DB_DBT_REALLOC D I N C
DB_DBT_STREAMING D I * *
DB_DBT_USERCOPY * I N C
DB_DBT_USERMEM D I J C
DB_DEGREE_2 * I * *
DB_DELETED * I * *
DB_DIRECT D I * *
DB_DIRECT_DB D I J C
DB_DIRTY_READ * I * *
DB_DONOTINDEX D I N C
DB_DSYNC_DB D I J C
DB_DUP D I J C
DB_DUPSORT D I J C
DB_DURABLE_UNKNOWN * I * *
DB_EID_BROADCAST D I J C
DB_EID_INVALID D I J C
DB_EID_MASTER D I J C
DB_ENCRYPT D I J C
DB_ENCRYPT_AES D I J C
DB_ENV_AUTO_COMMIT * I * *
DB_ENV_CDB_ALLDB * I * *
DB_ENV_DATABASE_LOCKING * I * *
DB_ENV_DIRECT_DB * I * *
DB_ENV_DSYNC_DB * I * *
DB_ENV_FAILCHK * I * *
DB_ENV_MULTIVERSION * I * *
DB_ENV_NOLOCKING * I * *
DB_ENV_NOMMAP * I * *
DB_ENV_NOPANIC * I * *
DB_ENV_OVERWRITE * I * *
DB_ENV_REGION_INIT * I * *
DB_ENV_TIME_NOTGRANTED * I * *
DB_ENV_TXN_NOSYNC * I * *
DB_ENV_TXN_NOWAIT * I * *
DB_ENV_TXN_SNAPSHOT * I * *
DB_ENV_TXN_WRITE_NOSYNC * I * *
DB_ENV_YIELDCPU * I * *
DB_EVENT_NOT_HANDLED * I * *
DB_EVENT_NO_SUCH_EVENT * I * *
DB_EVENT_PANIC D I N C
DB_EVENT_REG_ALIVE D I * *
DB_EVENT_REG_PANIC D I * *
DB_EVENT_REP_CLIENT D I N C
DB_EVENT_REP_CONNECT_BROKEN D I N C
DB_EVENT_REP_CONNECT_ESTD D I N C
DB_EVENT_REP_CONNECT_TRY_FAILED D I N C
DB_EVENT_REP_DUPMASTER D I N C
DB_EVENT_REP_ELECTED D I N C
DB_EVENT_REP_ELECTION_FAILED D I N C
DB_EVENT_REP_INIT_DONE D I N C
DB_EVENT_REP_JOIN_FAILURE D I N C
DB_EVENT_REP_LOCAL_SITE_REMOVED D I N C
DB_EVENT_REP_MASTER D I N C
DB_EVENT_REP_MASTER_FAILURE D I N C
DB_EVENT_REP_NEWMASTER D I N C
DB_EVENT_REP_PERM_FAILED D I N C
DB_EVENT_REP_SITE_ADDED D I N C
DB_EVENT_REP_SITE_REMOVED D I N C
DB_EVENT_REP_STARTUPDONE D I N C
DB_EVENT_REP_WOULD_ROLLBACK * I * *
DB_EVENT_WRITE_FAILED D I N C
DB_EXCL D I J C
DB_EXTENT * I * *
DB_FAILCHK D I * *
DB_FAILCHK_ISALIVE * I * *
DB_FAST_STAT D I J C
DB_FCNTL_LOCKING * I * *
DB_FILE_ID_LEN * I * *
DB_FIRST D I J C
DB_FLUSH D I J C
DB_FORCE D I J C
DB_FORCESYNC D I J C
DB_FOREIGN_ABORT * I J C
DB_FOREIGN_CASCADE * I J C
DB_FOREIGN_CONFLICT * I * C
DB_FOREIGN_NULLIFY * I J C
DB_FREELIST_ONLY D I J C
DB_FREE_SPACE D I J C
DB_GET_BOTH D I J C
DB_GET_BOTHC * I * *
DB_GET_BOTH_LTE D I * *
DB_GET_BOTH_RANGE D I J C
DB_GET_RECNO D I J C
DB_GID_SIZE * I N C
DB_GROUP_CREATOR D I J C
DB_HANDLE_LOCK * I * *
DB_HASH D I J C
DB_HASHMAGIC * I * *
DB_HASHOLDVER * I * *
DB_HASHVERSION * I * *
DB_HEAP D I J C
DB_HEAPMAGIC * I * *
DB_HEAPOLDVER * I * *
DB_HEAPVERSION * I * *
DB_HEAP_FULL D I J C
DB_HEAP_RID_SZ D I * *
DB_HOME D * * *
DB_HOTBACKUP_IN_PROGRESS D I J C
DB_IGNORE_LEASE D I J C
DB_IMMUTABLE_KEY D I J C
DB_INIT_CDB D I J C
DB_INIT_LOCK D I J C
DB_INIT_LOG D I J C
DB_INIT_MPOOL D I J C
DB_INIT_MUTEX * I * *
DB_INIT_REP D I J C
DB_INIT_TXN D I J C
DB_INORDER D I J C
DB_INTERNAL_DB * I * *
DB_JOINENV * I J C
DB_JOIN_ITEM D I J C
DB_JOIN_NOSORT D I J C
DB_KEYEMPTY D I J C
DB_KEYEXIST D I J C
DB_KEYFIRST D I J C
DB_KEYLAST D I J C
DB_LAST D I J C
DB_LEGACY D I J C
DB_LOCAL_SITE D I J C
DB_LOCKDOWN D I J C
DB_LOCKVERSION * I * *
DB_LOCK_CHECK * I * *
DB_LOCK_DEADLOCK D I N C
DB_LOCK_DEFAULT D I J C
DB_LOCK_DUMP * I * *
DB_LOCK_EXPIRE D I J C
DB_LOCK_GET D I J C
DB_LOCK_GET_TIMEOUT D I J C
DB_LOCK_INHERIT * I * *
DB_LOCK_IREAD D I J C
DB_LOCK_IWR D I J C
DB_LOCK_IWRITE D I J C
DB_LOCK_MAXLOCKS D I J C
DB_LOCK_MAXWRITE D I J C
DB_LOCK_MINLOCKS D I J C
DB_LOCK_MINWRITE D I J C
DB_LOCK_NG * I * *
DB_LOCK_NORUN * I * *
DB_LOCK_NOTGRANTED D I J C
DB_LOCK_NOWAIT D I J C
DB_LOCK_OLDEST D I J C
DB_LOCK_PUT D I J C
DB_LOCK_PUT_ALL D I J C
DB_LOCK_PUT_OBJ D I J C
DB_LOCK_PUT_READ * I * *
DB_LOCK_RANDOM D I J C
DB_LOCK_READ D I J C
DB_LOCK_READ_UNCOMMITTED * I * *
DB_LOCK_RECORD * I * *
DB_LOCK_SET_TIMEOUT * I * *
DB_LOCK_SWITCH * I * *
DB_LOCK_TIMEOUT D I J C
DB_LOCK_TRADE * I * *
DB_LOCK_UPGRADE * I * *
DB_LOCK_UPGRADE_WRITE * I * *
DB_LOCK_WAIT * I * *
DB_LOCK_WRITE D I J C
DB_LOCK_WWRITE * I * *
DB_LOCK_YOUNGEST D I J C
DB_LOGCHKSUM D I * *
DB_LOGFILEID_INVALID * I * *
DB_LOGMAGIC * I * *
DB_LOGOLDVER * I * *
DB_LOGVERSION * I * *
DB_LOGVERSION_LATCHING D I * *
DB_LOG_AUTO_REMOVE D I J C
DB_LOG_BUFFER_FULL D I * C
DB_LOG_CHKPNT * I * *
DB_LOG_COMMIT * I * *
DB_LOG_DIRECT D I J C
DB_LOG_DISK * I * *
DB_LOG_DSYNC D I J C
DB_LOG_IN_MEMORY D I J C
DB_LOG_LOCKED * I * *
DB_LOG_NOCOPY * I * *
DB_LOG_NO_DATA * I * *
DB_LOG_NOT_DURABLE * I * *
DB_LOG_SILENT_ERR * I * *
DB_LOG_WRNOSYNC * I * *
DB_LOG_VERIFY_BAD D I * *
DB_LOG_VERIFY_CAF D I * *
DB_LOG_VERIFY_ERR D I * *
DB_LOG_VERIFY_PARTIAL * I * *
DB_LOG_VERIFY_DBFILE * I * *
DB_LOG_VERIFY_FORWARD * I * *
DB_LOG_VERIFY_INTERR D I * *
DB_LOG_VERIFY_WARNING D I * *
DB_LOG_VERIFY_VERBOSE D I * *
DB_LOG_ZERO D I J C
DB_LSTAT_ABORTED * I * *
DB_LSTAT_EXPIRED * I * *
DB_LSTAT_FREE * I * *
DB_LSTAT_HELD * I * *
DB_LSTAT_PENDING * I * *
DB_LSTAT_WAITING * I * *
DB_MAX_PAGES * I * *
DB_MAX_RECORDS * I * *
DB_MEM_LOCK D I J C
DB_MEM_LOCKOBJECT D I J C
DB_MEM_LOCKER D I J C
DB_MEM_LOGID D I J C
DB_MEM_TRANSACTION D I J C
DB_MEM_THREAD D I J C
DB_MPOOL_CREATE D I * *
DB_MPOOL_DIRTY D I * *
DB_MPOOL_TRY D I * *
DB_MPOOL_DISCARD * I * *
DB_MPOOL_EDIT D I * *
DB_MPOOL_FREE * I * *
DB_MPOOL_LAST D I * *
DB_MPOOL_NEW D I * *
DB_MPOOL_NOFILE D I J C
DB_MPOOL_NOLOCK * I * *
DB_MPOOL_UNLINK D I J C
DB_MULTIPLE D I J C
DB_MULTIPLE_INIT D I * *
DB_MULTIPLE_KEY D I J C
DB_MULTIPLE_KEY_NEXT D I * *
DB_MULTIPLE_KEY_RESERVE_NEXT D I * *
DB_MULTIPLE_KEY_WRITE_NEXT D I * *
DB_MULTIPLE_NEXT D I * *
DB_MULTIPLE_RECNO_NEXT D I * *
DB_MULTIPLE_RECNO_RESERVE_NEXT D I * *
DB_MULTIPLE_RECNO_WRITE_INIT D I * *
DB_MULTIPLE_RECNO_WRITE_NEXT D I * *
DB_MULTIPLE_RESERVE_NEXT D I * *
DB_MULTIPLE_WRITE_INIT D I * *
DB_MULTIPLE_WRITE_NEXT D I * *
DB_MULTIVERSION D I J C
DB_MUTEX_ALLOCATED * I * *
DB_MUTEX_LOCKED * I * *
DB_MUTEX_LOGICAL_LOCK * I * *
DB_MUTEX_PROCESS_ONLY D I * C
DB_MUTEX_SELF_BLOCK D I * C
DB_MUTEX_SHARED D I * *
DB_NEEDSPLIT * I * *
DB_NEXT D I J C
DB_NEXT_DUP D I J C
DB_NEXT_NODUP D I J C
DB_NODUPDATA D I J C
DB_NOERROR * I * *
DB_NOFLUSH * I * *
DB_NOLOCKING D I J C
DB_NOMMAP D I J C
DB_NOORDERCHK D I J C
DB_NOOVERWRITE D I J C
DB_NOPANIC D I J C
DB_NOSERVER D I * C
DB_NOSYNC D I J C
DB_NOTFOUND D I J C
DB_NO_AUTO_COMMIT * I * *
DB_NO_CHECKPOINT * I * *
DB_ODDFILESIZE D I * *
DB_OK_BTREE * I * *
DB_OK_HASH * I * *
DB_OK_HEAP * I * *
DB_OK_QUEUE * I * *
DB_OK_RECNO * I * *
DB_OLD_VERSION D I * C
DB_OPFLAGS_MASK * I * *
DB_ORDERCHKONLY D I J C
DB_OVERWRITE D I J C
DB_OVERWRITE_DUP D I * *
DB_PAGE_LOCK * I * *
DB_PAGE_NOTFOUND D I * C
DB_PANIC_ENVIRONMENT D I J C
DB_POSITION D I J C
DB_PREV D I J C
DB_PREV_DUP D I J C
DB_PREV_NODUP D I J C
DB_PRINTABLE D I J C
DB_PRIORITY_DEFAULT D I J C
DB_PRIORITY_HIGH D I J C
DB_PRIORITY_LOW D I J C
DB_PRIORITY_UNCHANGED D I * *
DB_PRIORITY_VERY_HIGH D I J C
DB_PRIORITY_VERY_LOW D I J C
DB_PRIVATE D I J C
DB_PR_PAGE * I * *
DB_PR_RECOVERYTEST * I * *
DB_QAMMAGIC * I * *
DB_QAMOLDVER * I * *
DB_QAMVERSION * I * *
DB_QUEUE D I J C
DB_RDONLY D I J C
DB_RDWRMASTER * I * *
DB_READ_COMMITTED D I J C
DB_READ_UNCOMMITTED D I J C
DB_RECNO D I J C
DB_RECNUM D I J C
DB_RECORD_LOCK * I * *
DB_RECOVER D I J C
DB_RECOVER_FATAL D I J C
DB_REDO * I * *
DB_REGION_INIT D I J C
DB_REGION_MAGIC * I * *
DB_REGISTER D I J C
DB_RENAMEMAGIC * I * *
DB_RENUMBER D I J C
DB_REP_CONF_AUTOROLLBACK * I * *
DB_REP_WOULDROLLBACK * I * *
DB_REPMGR_ACKS_ALL D I J C
DB_REPMGR_ACKS_ALL_AVAILABLE D I J C
DB_REPMGR_ACKS_ALL_PEERS D I J C
DB_REPMGR_ACKS_NONE D I J C
DB_REPMGR_ACKS_ONE D I J C
DB_REPMGR_ACKS_ONE_PEER D I J C
DB_REPMGR_ACKS_QUORUM D I J C
DB_REPMGR_CONF_2SITE_STRICT D I J C
DB_REPMGR_CONF_ELECTIONS D I J C
DB_REPMGR_CONNECTED D I J C
DB_REPMGR_DISCONNECTED D I J C
DB_REPMGR_NEED_RESPONSE D I J C
DB_REPMGR_ISPEER D I J *
DB_REPMGR_PEER D I J C
DB_REP_ACK_TIMEOUT D I J C
DB_REP_ANYWHERE D I J C
DB_REP_BULKOVF * I * *
DB_REP_CHECKPOINT_DELAY D I J C
DB_REP_CLIENT D I J C
DB_REP_CONF_AUTOINIT D I J C
DB_REP_CONF_BULK D I J C
DB_REP_CONF_DELAYCLIENT D I J C
DB_REP_CONF_INMEM D I J C
DB_REP_CONF_LEASE D I J C
DB_REP_CONF_NOWAIT D I J C
DB_REP_CONNECTION_RETRY D I J C
DB_REP_DEFAULT_PRIORITY * I J C
DB_REP_DUPMASTER D I N C
DB_REP_ELECTION D I J C
DB_REP_ELECTION_RETRY D I J C
DB_REP_ELECTION_TIMEOUT D I J C
DB_REP_FULL_ELECTION_TIMEOUT D I J C
DB_REP_HANDLE_DEAD D I N C
DB_REP_HEARTBEAT_MONITOR D I J C
DB_REP_HEARTBEAT_SEND D I J C
DB_REP_HOLDELECTION D I N C
DB_REP_IGNORE D I J C
DB_REP_ISPERM D I J C
DB_REP_JOIN_FAILURE D I N C
DB_REP_LEASE_EXPIRED D I N C
DB_REP_LEASE_TIMEOUT D I J C
DB_REP_LOCKOUT D I N C
DB_REP_LOGREADY * I * *
DB_REP_MASTER D I J C
DB_REP_NEWMASTER * I * *
DB_REP_NEWSITE D I J C
DB_REP_NOBUFFER D I J C
DB_REP_NOTPERM D I J C
DB_REP_PAGEDONE * I * *
DB_REP_PERMANENT D I J C
DB_REP_REREQUEST D I J C
DB_REP_UNAVAIL D I N C
DB_REVSPLITOFF D I J C
DB_RMW D I J C
DB_RUNRECOVERY D I N C
DB_SALVAGE D I J C
DB_SA_SKIPFIRSTKEY * I * *
DB_SA_UNKNOWNKEY * I * *
DB_SECONDARY_BAD D I * C
DB_SEQUENCE_OLDVER * I * *
DB_SEQUENCE_VERSION * I * *
DB_SEQ_DEC D I J C
DB_SEQ_INC D I J C
DB_SEQ_RANGE_SET * I * *
DB_SEQ_WRAP D I J C
DB_SEQ_WRAPPED * I * *
DB_SET D I J C
DB_SET_LTE D I * *
DB_SET_LOCK_TIMEOUT D I J C
DB_SET_RANGE D I J C
DB_SET_REG_TIMEOUT D I * *
DB_SET_RECNO D I J C
DB_SET_TXN_LSNP * I * *
DB_SET_TXN_NOW * I * *
DB_SET_TXN_TIMEOUT D I J C
DB_SHALLOW_DUP * I * *
DB_SNAPSHOT D I J C
DB_STAT_ALL D I * C
DB_STAT_ALLOC * I * *
DB_STAT_CLEAR D I J C
DB_STAT_LOCK_CONF D I * C
DB_STAT_LOCK_LOCKERS D I * C
DB_STAT_LOCK_OBJECTS D I * C
DB_STAT_LOCK_PARAMS D I * C
DB_STAT_MEMP_HASH D I * C
DB_STAT_MEMP_NOERROR * I * *
DB_STAT_SUBSYSTEM D I * C
DB_STAT_SUMMARY * I * *
DB_ST_DUPOK * I * *
DB_ST_DUPSET * I * *
DB_ST_DUPSORT * I * *
DB_ST_IS_RECNO * I * *
DB_ST_OVFL_LEAF * I * *
DB_ST_RECNUM * I * *
DB_ST_RELEN * I * *
DB_ST_TOPLEVEL * I * *
DB_SURPRISE_KID * I * *
DB_SWAPBYTES * I * *
DB_SYSTEM_MEM D I J C
DB_THREAD D I J C
DB_THREADID_STRLEN D I * *
DB_TIMEOUT D I J C
DB_TIME_NOTGRANTED D I J C
DB_TRUNCATE D I J C
DB_TXNVERSION * I * *
DB_TXN_ABORT D I J C
DB_TXN_APPLY D I J C
DB_TXN_BACKWARD_ROLL D I J C
DB_TXN_BULK D I J C
DB_TXN_CKP * I * *
DB_TXN_FAMILY * I * *
DB_TXN_FORWARD_ROLL D I J C
DB_TXN_LOG_VERIFY D I * *
DB_TXN_NOSYNC D I J C
DB_TXN_NOT_DURABLE D I J C
DB_TXN_NOWAIT D I J C
DB_TXN_OPENFILES * I * *
DB_TXN_POPENFILES * I * *
DB_TXN_PRINT D I J C
DB_TXN_SNAPSHOT D I J C
DB_TXN_SYNC D I J C
DB_TXN_TOKEN_SIZE * I J C
DB_TXN_WAIT D I J C
DB_TXN_WRITE_NOSYNC D I J C
DB_UNDO * I * *
DB_UNKNOWN D I J C
DB_UNREF * I * *
DB_UPDATE_SECONDARY * I * *
DB_UPGRADE D I J C
DB_USE_ENVIRON D I J C
DB_USE_ENVIRON_ROOT D I J C
DB_VERB_DEADLOCK D I J C
DB_VERB_FILEOPS D I J C
DB_VERB_FILEOPS_ALL D I J C
DB_VERB_RECOVERY D I J C
DB_VERB_REGISTER D I J C
DB_VERB_REPLICATION D I J C
DB_VERB_REPMGR_CONNFAIL D I J C
DB_VERB_REPMGR_MISC D I J C
DB_VERB_REP_ELECT D I J C
DB_VERB_REP_LEASE D I J C
DB_VERB_REP_MISC D I J C
DB_VERB_REP_MSGS D I J C
DB_VERB_REP_SYNC D I J C
DB_VERB_REP_SYSTEM D I J C
DB_VERB_REP_TEST D I J C
DB_VERB_WAITSFOR D I J C
DB_VERIFY D I J C
DB_VERIFY_BAD D I N C
DB_VERIFY_FATAL * I * *
DB_VERIFY_PARTITION D I * *
DB_VERSION_FAMILY * I N C
DB_VERSION_RELEASE * I N C
DB_VERSION_MAJOR * I J C
DB_VERSION_MINOR * I J C
DB_VERSION_MISMATCH D I N C
DB_VERSION_PATCH * I J C
DB_VERSION_STRING * I N C
DB_VERSION_FULL_STRING * I N C
DB_WRITECURSOR D I J C
DB_WRITELOCK * I * *
DB_WRITEOPEN * I * *
DB_XA_CREATE D I * *
DB_YIELDCPU D I J C

39
dist/s_all vendored Executable file
View file

@ -0,0 +1,39 @@
#!/bin/sh -
# $Id$
sh s_readme # distribution README file.
sh s_config # autoconf.
sh s_apiflags # API flags.
sh s_sig # Structure signature.
sh s_recover # logging/recovery files.
sh s_message # replication and repmgr message files.
sh s_message_id # generate message id.
sh s_sql # regenerate sqlite3.c
sh s_php # PHP config files
#############################################################
# The following order is important, s_include must run after
# the other source files have been created.
#############################################################
sh s_include # standard include files.
sh s_java # Java support.
sh s_csharp # Csharp support.
sh s_test # Test suite support.
#sh s_tags # Tags files.
#############################################################
# We only build the Cscope file for releases, it's too big to
# commit into the CVS tree.
#############################################################
#sh s_cscope # Cscope files.
#############################################################
# Create the build environments last, they use files created
# by previous steps.
#############################################################
sh s_vxworks # VxWorks support.
sh s_windows # Windows support.
sh s_windows_dsp # Windows support: build environment.
sh s_android # Android support: drop-in build environment.

24
dist/s_apiflags vendored Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh -
# $Id$
#
# Build the automatically generated API flag #defines.
msgc="/* DO NOT EDIT: automatically built by dist/s_apiflags. */"
b=/tmp/api_flags_binary
t=/tmp/__db_a
trap 'rm -f $b $t; exit 0' 0
trap 'rm -f $b $t; exit 1' 1 2 3 13 15
cc api_flags.c -o $b || {
echo 's_apiflags: unable to compile api_flags.c'
exit 1
}
(echo "$msgc"
$b < api_flags) > $t
f=../src/dbinc_auto/api_flags.in
cmp $f $t > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f)

37
dist/s_config vendored Executable file
View file

@ -0,0 +1,37 @@
#!/bin/sh -
# $Id$
#
# Build the autoconfiguration files.
trap 'rm -f aclocal.m4 ; exit 0' 0 1 2 3 13 15
. ./RELEASE
echo "autoconf: building aclocal.m4..."
cat aclocal/*.m4 aclocal_java/*.m4 > aclocal.m4
echo "autoconf: running autoheader to build config.hin..."
rm -f config.hin
autoheader
chmod 644 config.hin
echo "autoconf: running autoconf to build configure"
rm -f configure
autoconf
# Edit version information we couldn't pre-compute.
sed -e "s/__EDIT_DB_VERSION_FAMILY__/$DB_VERSION_FAMILY/g" \
-e "s/__EDIT_DB_VERSION_RELEASE__/$DB_VERSION_RELEASE/g" \
-e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
-e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
-e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
-e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
-e "s/__EDIT_DB_VERSION_FULL_STRING__/$DB_VERSION_FULL_STRING/g" \
-e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
-e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure > configure.version
mv configure.version configure
rm -rf autom4te.cache
chmod 755 configure
chmod 755 config.guess config.sub install-sh

69
dist/s_crypto vendored Executable file
View file

@ -0,0 +1,69 @@
#!/bin/sh -
# $Id$
# Remove crypto from the DB source tree.
d=..
t=/tmp/__db_a
trap 'rm -f $t ; exit 0' 0
trap 'rm -f $t ; exit 1' 1 2 3 13 15
if ! test -d $d/src/crypto; then
echo "s_crypto: no crypto sources found in the source tree."
exit 1
fi
# Remove the crypto.
rm -rf $d/src/crypto
# Update the release splash page.
f=$d/docs/index.html
(echo '/DOES/' &&
echo 's/DOES/DOES NOT/' &&
echo 'w' &&
echo 'q') | ed $f
# Win/32.
f=win_config.in
(echo '/#define.HAVE_CRYPTO/' &&
echo 'c' &&
echo '/* #undef HAVE_CRYPTO */'
echo '.' &&
echo 'w' &&
echo 'q') | ed $f
f=srcfiles.in
r=`egrep crypto/crypto.c $f | awk 'BEGIN { FS="\t*" } { print $2 }'`
(echo 'g/^src\/crypto\//d' &&
echo '/crypto_stub\.c/' &&
echo "s/\$/ $r/" &&
echo 'w' &&
echo 'q') | ed $f
# Change out crypto/crypto.c for common/crypto_stub.c, remove all other
# references to crypto files.
f=win_projects/projects.template.xml
(echo '/crypto\/crypto\.c/' &&
echo 'c' &&
echo ' <file name="src/common/crypto_stub.c"/>' &&
echo '.' &&
echo 'g/"src\/crypto\//d' &&
echo "s/\$/ $r/" &&
echo ',' &&
echo 'w' &&
echo 'q') | ed $f
sh ./s_windows
sh ./s_windows_dsp
# VxWorks
f=vx_config.in
(echo '/#define.HAVE_CRYPTO/' &&
echo 'c' &&
echo '/* #undef HAVE_CRYPTO */'
echo '.' &&
echo 'w' &&
echo 'q') | ed $f
sh ./s_vxworks

17
dist/s_cscope vendored Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh -
# $Id$
#
# Build cscope files.
(
echo ../dbinc/*.in ../dbinc/*.h ../dbinc_auto/*.h;
cat srcfiles.in |
sed -e '/^#/d' \
-e '/^$/d' \
-e 's/^/..\//' \
-e '/\/csv_local.c/d' \
-e '/\/db_server_clnt.c/d' \
-e '/\/db_server_svc.c/d' \
-e '/\/db_server_xdr.c/d' \
-e '/\/gen_db_server.c/d' |
awk '{print $1}') | cscope -bkUu -i- 2>&1 | sed '/cannot find file/d'

175
dist/s_include vendored Executable file
View file

@ -0,0 +1,175 @@
#!/bin/sh -
# $Id$
#
# Build the automatically generated function prototype files.
msgc="/* DO NOT EDIT: automatically built by dist/s_include. */"
. ./RELEASE
AWK=${AWK:-awk}
head()
{
defonly=0
while :
do case "$1" in
space)
echo ""; shift;;
defonly)
defonly=1; shift;;
*)
name="$1"; break;;
esac
done
echo "$msgc"
echo "#ifndef $name"
echo "#define $name"
echo ""
if [ $defonly -eq 0 ]; then
echo "#if defined(__cplusplus)"
echo "extern \"C\" {"
echo "#endif"
echo ""
fi
}
tail()
{
defonly=0
while :
do case "$1" in
defonly)
defonly=1; shift;;
*)
name="$1"; break;;
esac
done
echo ""
if [ $defonly -eq 0 ]; then
echo "#if defined(__cplusplus)"
echo "}"
echo "#endif"
fi
echo "#endif /* !$name */"
}
# This script is run on a variety of systems. To avoid spurious changes, fix
# some variables that affect sort order of ls(1).
unset LANG
export LANG
LC_ALL="C"
export LC_ALL
# We are building several files:
# 1 external #define file
# 1 external prototype file
# 1 internal #define file
# N internal prototype files
e_dfile=/tmp/__db_c.$$
e_pfile=/tmp/__db_a.$$
i_dfile=/tmp/__db_d.$$
i_pfile=/tmp/__db_b.$$
trap 'rm -f $e_dfile $e_pfile $i_dfile $i_pfile; exit 0' 0 1 2 3 13 15
head defonly space _DB_EXT_DEF_IN_ > $e_dfile
head space _DB_EXT_PROT_IN_ > $e_pfile
head defonly _DB_INT_DEF_IN_ > $i_dfile
# Process the standard directories, creating per-directory prototype
# files and adding to the external prototype and #define files.
for i in db btree clib common crypto dbreg env fileops hash heap \
hmac lock log mp mutex os qam rep repmgr sequence tcl txn xa; do
head "_${i}_ext_h_" > $i_pfile
if [ $i = os ] ; then
f=`ls ../src/$i/*.c \
../src/os_qnx/*.c ../src/os_vxworks/*.c ../src/os_windows/*.c`
elif [ $i = crypto ] ; then
f=`ls ../src/$i/*.c ../src/$i/*/*.c`
elif [ $i = env ] ; then
f=`ls ../src/$i/*.c ../src/repmgr/repmgr_stub.c`
elif [ $i = tcl ] ; then
f=`ls ../lang/$i/*.c`
else
f=`ls ../src/$i/*.c`
fi
$AWK -f gen_inc.awk \
-v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \
-v e_dfile=$e_dfile \
-v e_pfile=$e_pfile \
-v i_dfile=$i_dfile \
-v i_pfile=$i_pfile $f
tail "_${i}_ext_h_" >> $i_pfile
f=../src/dbinc_auto/${i}_ext.h
cmp $i_pfile $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $i_pfile $f)
done
# Process directories which only add to the external prototype and #define
# files.
for i in dbm hsearch; do
f=`ls ../lang/$i/*.c`
$AWK -f gen_inc.awk \
-v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \
-v e_dfile=$e_dfile \
-v e_pfile=$e_pfile \
-v i_dfile="" \
-v i_pfile="" $f
done
# There are a few global variables in DB -- add them to the external/internal
# #define files.
(echo "#define __db_global_values __db_global_values@DB_VERSION_UNIQUE_NAME@";
echo "#define __repmgr_guesstimated_max __repmgr_guesstimated_max@DB_VERSION_UNIQUE_NAME@";
echo "#define db_xa_switch db_xa_switch@DB_VERSION_UNIQUE_NAME@"
) >> $i_dfile
# Wrap up the external #defines/prototypes, and internal #defines.
tail defonly _DB_EXT_DEF_IN_ >> $e_dfile
f=../src/dbinc_auto/ext_def.in
cmp $e_dfile $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $e_dfile $f)
tail _DB_EXT_PROT_IN_ >> $e_pfile
f=../src/dbinc_auto/ext_prot.in
cmp $e_pfile $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $e_pfile $f)
tail defonly _DB_INT_DEF_IN_ >> $i_dfile
f=../src/dbinc_auto/int_def.in
cmp $i_dfile $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $i_dfile $f)
# DB185 compatibility support.
head space defonly _DB_EXT_185_DEF_IN_ > $e_dfile
head space _DB_EXT_185_PROT_IN_ > $e_pfile
f=`ls ../lang/db185/*.c`
$AWK -f gen_inc.awk \
-v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \
-v e_dfile=$e_dfile \
-v e_pfile=$e_pfile \
-v i_dfile="" \
-v i_pfile="" $f
tail defonly _DB_EXT_185_DEF_IN_ >> $e_dfile
f=../src/dbinc_auto/ext_185_def.in
cmp $e_dfile $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $e_dfile $f)
tail _DB_EXT_185_PROT_IN_ >> $e_pfile
f=../src/dbinc_auto/ext_185_prot.in
cmp $e_pfile $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $e_pfile $f)
# Make the DTrace provider description file from events.in
rm -f db_provider.d
(echo "/*"; \
echo " * DO NOT EDIT: automatically built by dist/s_include."; \
echo " * Oracle Berkeley DB DTrace Provider"; \
echo " */"; \
perl gen_provider.pl events.in) > db_provider.d

31
dist/s_message vendored Executable file
View file

@ -0,0 +1,31 @@
#!/bin/sh -
# $Id$
#
# Build the automatically generated rep & repmgr message files.
header=/tmp/__db_a
source=/tmp/__db_b
trap 'rm -f /tmp/__db_[ab]; exit 1' 1 2 3 13 15
trap 'rm -f /tmp/__db_[ab]; exit 0' 0
DIR="rep repmgr"
# Build DB's message marshaling/unmarshaling routines.
for i in $DIR; do
for f in ../src/$i/*.msg; do
subsystem=`basename $f .msg`
awk -f gen_msg.awk \
-v header_file=$header \
-v source_file=$source < $f
f=../src/dbinc_auto/${subsystem}_automsg.h
cmp $header $f > /dev/null 2>&1 ||
(echo "Building $f" &&
rm -f $f && cp $header $f)
f=../src/$i/${subsystem}_automsg.c
cmp $source $f > /dev/null 2>&1 ||
(echo "Building $f" &&
rm -f $f && cp $source $f)
done
done

187
dist/s_message_id vendored Executable file
View file

@ -0,0 +1,187 @@
#!/bin/sh -
# $Id$
#
# Automatically generate message id.
# Usage: A BDB#### would be replaced with an unused message id in:
# 1) DB_STR(BDB####
# 2) DB_STR_A(BDB####
# NOTE: Do not add whitespace between DB_STR( or DB_STR_A( and the message ID.
# NOTE: Please update the MSG_DIRS if there is any new source dir.
MSG_DIRS="../src/ ../util/ ../lang/dbm/ ../dist/gen_msg.awk"
# Environment Configuration
GREP_CMDS="grep ggrep"
for i in $GREP_CMDS; do
if [ "`which $i`" = "" ]; then
continue
fi
echo "s_message_id test" > s_message_id.tmp
$i "s_message_id test" s_message_id.tmp -o --include=*.tmp | \
$i -v "s_message_id.txt" > s_message_id.tmp.out 2>&1
if [ `$i "unrecognized option" s_message_id.tmp.out | wc -l` \
-eq 0 ] && [ `$i "invalid option" s_message_id.tmp.out | \
wc -l` -eq 0 ] && [ `$i "can't open" s_message_id.tmp.out | \
wc -l` -eq 0 ]; then
GREP_CMD=$i
break
fi
rm s_message_id.tmp s_message_id.tmp.out
done
if [ "$GREP_CMD" = "" ]; then
echo "UNSUPPORTED COMMAND: (g)grep -o --include"
echo "Please try other platform"
exit
fi
pref=MSG_INDX
get_value() {
value=${1}${2}
eval "echo $`echo $value`"
}
get_max() {
if [ ${1} -gt ${2} ] ; then
eval "echo ${1}"
else
eval "echo ${2}"
fi
}
# Iterate source files and replace "BDB####" with the real message id.
for i in $MSG_DIRS; do
for f in `$GREP_CMD BDB#### -r $i -wl --include=*.c --include=*.h \
--include=*.in --include=*.awk | \
$GREP_CMD -v "../util/db_dump185.c" | \
$GREP_CMD -v "../util/db_sql_codegen"`; do
IFS='/'
set $f
# There are 11 categories in the MSG_DIRS:
# 1) COMMON; 2) DB; 3) AM; 4) ENV; 5) LOCK; 6) LOG;
# 7) MPOOL; 8) REP; 9) SEQUENCE; 10) TXN; 11) UTIL.
#
# NOTE: Please add a new block (see below) and assign the values
# of cat_indx and cat_dirs if there is new group, or update the
# existing block if there is new source tree under the existing
# group.
if [ "$i" = "../util/" ] || [ "$i" = "../lang/dbm/" ]; then
cat_indx=10
cat_dirs="../util/ ../lang/dbm/"
elif [ "$3" = "common" ] || [ "$3" = "crypto" ] || \
[ "$3" = "fileops" ] || [ "$3" = "hmac" ] || \
[ "$3" = "os" ] || [ "$3" = "os_qnx" ] || \
[ "$3" = "os_vxworks" ] || [ "$3" = "os_windows" ]; then
cat_indx=0
cat_dirs=$i"common "$i"crypto "$i"fileops "
cat_dirs=$cat_dirs$i"hmac "$i"os "$i"os_qnx "
cat_dirs=$cat_dirs$i"os_vxworks "$i"os_windows"
elif [ "$3" = "db" ] || [ "$3" = "dbinc" ] || \
[ "$3" = "dbinc_auto" ]; then
cat_indx=1
cat_dirs=$i"db "$i"dbinc "$i"dbinc_auto"
elif [ "$3" = "btree" ] || [ "$3" = "hash" ] || \
[ "$3" = "heap" ] || [ "$3" = "qam" ]; then
cat_indx=2
cat_dirs=$i"btree "$i"hash "$i"heap "$i"qam"
elif [ "$3" = "dbreg" ] || [ "$3" = "env" ] ; then
cat_indx=3
cat_dirs=$i"dbreg "$i"env"
elif [ "$3" = "lock" ] || [ "$3" = "mutex" ]; then
cat_indx=4
cat_dirs=$i"lock "$i"mutex"
elif [ "$3" = "log" ]; then
cat_indx=5
cat_dirs=$i"log"
elif [ "$3" = "mp" ]; then
cat_indx=6
cat_dirs=$i"mp"
elif [ "$3" = "rep" ] || [ "$3" = "repmgr" ] || \
[ "$3" = "gen_msg.awk" ] ; then
cat_indx=7
cat_dirs="../src/rep ../src/repmgr ../dist/gen_msg.awk"
elif [ "$3" = "sequence" ]; then
cat_indx=8
cat_dirs=$i"sequence"
elif [ "$3" = "txn" ] || [ "$3" = "xa" ]; then
cat_indx=9
cat_dirs=$i"txn "$i"xa"
else
echo "ERROR UNKNOWN PATH:" "$i""$3"
exit
fi
unset IFS
# Initialize MSG_INDX for each group if it is never initialized.
if [ "`get_value $pref $cat_indx`" = "" ]; then
# Get the start index, that is the next available number
# for the current group. If there is no existing message
# marked by DB_STR or DB_STR_A, the start index is the
# first available integer in its range. Unless, it is
# the next available integer in its range.
MSG_START_NUM=`expr $cat_indx \* 500 + 1`
DB_STR_NUM=`$GREP_CMD -E "DB_STR\(\"[0-9]{4}\"" -r \
$cat_dirs | wc -l`
if [ $DB_STR_NUM -eq 0 ]; then
DB_STR_NUM=`expr 0 + $MSG_START_NUM`
else
DB_STR_NUM=`$GREP_CMD -E "DB_STR\(\"[0-9]{4}\"" -oh \
-r $cat_dirs | sort | tail -n 1 | \
sed -e "s/DB_STR(//g" | sed -e "s/\"//g"`
DB_STR_NUM=`expr 1 + $DB_STR_NUM`
fi
DB_STR_A_NUM=`$GREP_CMD -E "DB_STR_A\(\"[0-9]{4}\"" -r \
$cat_dirs | wc -l`
if [ $DB_STR_A_NUM -eq 0 ]; then
DB_STR_A_NUM=`expr 0 + $MSG_START_NUM`
else
DB_STR_A_NUM=`$GREP_CMD -E \
"DB_STR_A\(\"[0-9]{4}\"" -oh -r $cat_dirs | \
sort | tail -n 1 | \
sed -e "s/DB_STR_A(//g" | sed -e "s/\"//g"`
DB_STR_A_NUM=`expr 1 + $DB_STR_A_NUM`
fi
MSG_START_INDX=`get_max $DB_STR_NUM $DB_STR_A_NUM`
eval "$pref$cat_indx=$MSG_START_INDX"
fi
cat $f | awk '{
if(num<max && sub(/BDB####/, fill(num))==1) num++;
print $0>"tmp.tmp"
}END{
printf("%s", num)>"tmp.num"}
function fill(i) {
s=""
j=4-length(i)
while(j) {
s=0""s
j--
}
return "\""s""i"\""
}' num=`get_value $pref $cat_indx` \
max=`expr \( $cat_indx + 1 \) \* 500`
cp tmp.tmp $f
eval "$pref$cat_indx=`sed 'q' tmp.num`"
if [ "$cat_indx" -lt 11 ]; then
if [ `get_value $pref $cat_indx` -ge \
`expr \( $cat_indx + 1 \) \* 500` ]; then
echo "RANGE FULL"
fi
else
echo "ERROR CATEGORY NUMBER: " $cat_indx
fi
rm tmp.tmp tmp.num
done
done
# Check if there is any remaining "BDB####".
# NOTE: If "BDB####" is not .c, .h, .in files, they won't be updated with the
# real message id.
if [ `$GREP_CMD "BDB####" -r $MSG_DIRS | wc -l` -gt 0 ]; then
echo "WARNING: There is remaining BDB####. Please check:"
$GREP_CMD "BDB####" -r $MSG_DIRS
fi

49
dist/s_perm vendored Executable file
View file

@ -0,0 +1,49 @@
#!/bin/sh -
# $Id$
#
# This script is designed to be run while packaging up releases, not during
# other s_all processing.
d=..
echo 'Updating Berkeley DB source tree permissions for a release package'
run()
{
if [ -f "$d/$1" ]; then
chmod "$2" "$d/$1"
else
echo "$d/$1: no such file or directory"
exit 1
fi
}
# Ensure all files in the package have consistent permissions.
find $d -type d | xargs chmod 775
find $d -type f | xargs chmod 644
# Assign execute permissions where necessary.
# ODBC and JDBC are only present in release packages.
if [ -d $d/lang/sql/odbc ]; then
chmod 755 $d/lang/sql/odbc/conf*
fi
if [ -d $d/lang/sql/jdbc ]; then
chmod 755 $d/lang/sql/jdbc/conf*
fi
chmod 755 $d/dist/s_*
run dist/config.guess 755
run dist/config.sub 755
run dist/configure 755
run dist/install-sh 755
run dist/vx_buildcd 755
run lang/perl/BerkeleyDB/dbinfo 755
run lang/perl/BerkeleyDB/mkpod 755
run lang/sql/sqlite/configure 755
for i in `cd $d && find build_vxworks \
-name '*.wsp' -o -name '*.cdf' -o -name '*.wpj'`; do
chmod 775 $d/$i
done
chmod 555 $d/util/dtrace/*.d
chmod 555 $d/util/systemtap/*.stp

23
dist/s_php vendored Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh -
# $Id$
#
# Build Windows include files.
. ./RELEASE
process()
{
src=$1.in
tdest=$1.out
dest=$1
sed -e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \
-e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" < $src > $tdest
cmp $tdest $dest > /dev/null 2>&1 ||
(echo "Building $dest" && rm -f $dest && cp $tdest $dest)
rm -f $tdest
}
process ../lang/php_db4/config.m4
process ../lang/php_db4/config.w32

25
dist/s_readme vendored Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh -
# $Id$
#
# Build the README.
echo 'Updating Berkeley DB README file...'
d=..
t=/tmp/__t
trap 'rm -f $t; exit 0' 0 1 2 3 13 15
. ./RELEASE
cat << END_OF_README>$t
$DB_VERSION_FULL_STRING
This is Berkeley DB $DB_VERSION_FAMILY$DB_VERSION_LETTER Release $DB_VERSION_RELEASE from Oracle. To view release and
installation documentation, load the distribution file docs/index.html
into your web browser.
END_OF_README
f=../README
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f)

71
dist/s_recover vendored Executable file
View file

@ -0,0 +1,71 @@
#!/bin/sh -
# $Id$
#
# Build the automatically generated logging/recovery files.
header=/tmp/__db_a
loglist=/tmp/__db_b
print=/tmp/__db_c
source=/tmp/__db_d
template=/tmp/__db_e
tmp=/tmp/__db_f
trap 'rm -f /tmp/__db_[abcdef]; exit 1' 1 2 3 13 15
trap 'rm -f /tmp/__db_[abcdef]; exit 0' 0
DIR="db dbreg btree fileops hash heap qam repmgr txn"
# Check to make sure we haven't duplicated a log record entry, and build
# the list of log record types that the test suite uses.
for i in $DIR; do
for f in ../src/$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 | sed q
egrep '^BEGIN[ ]|^IGNORED[ ]|^DEPRECATED[ ]' $f |
awk '{print $1 "\t" $2 "\t" $3 "\t" $4}'
done
done > $loglist
grep -v '^PREFIX' $loglist |
awk '{print $2 "\t" $3 "\t" $4}' | sort -n -k 3 | uniq -d -f 1 > $tmp
[ -s $tmp ] && {
echo "DUPLICATE LOG VALUES:"
cat $tmp
rm -f $tmp
exit 1
}
f=../test/logtrack.list
cmp $loglist $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $loglist $f)
# Build DB's recovery routines.
for i in $DIR; do
for f in ../src/$i/*.src; do
subsystem=`basename $f .src`
awk -f gen_rec.awk \
-v header_file=$header \
-v print_file=$print\
-v source_file=$source \
-v template_file=$template < $f
f=../src/dbinc_auto/${subsystem}_auto.h
cmp $header $f > /dev/null 2>&1 ||
(echo "Building $f" &&
rm -f $f && cp $header $f)
f=../src/$i/${subsystem}_auto.c
cmp $source $f > /dev/null 2>&1 ||
(echo "Building $f" &&
rm -f $f && cp $source $f)
f=../src/$i/${subsystem}_autop.c
cmp $print $f > /dev/null 2>&1 ||
(echo "Building $f" &&
rm -f $f && cp $print $f)
f=template/rec_${subsystem}
cmp $template $f > /dev/null 2>&1 ||
(echo "Building $f" &&
rm -f $f && cp $template $f)
done
done
# Build the example application's recovery routines.
(cd ../examples/c/ex_apprec && sh auto_rebuild)

119
dist/s_sig vendored Executable file
View file

@ -0,0 +1,119 @@
#!/bin/sh -
# $Id$
#
# Build structure signature code.
a=/tmp/__db_a.$$
b=/tmp/__db_b.$$
c=/tmp/__db_c.$$
trap 'rm -f $a $b $c; exit 0' 0 1 2 3 13 15
cat ../src/dbinc/db.in ../src/dbinc/db_int.in ../src/dbinc/*.h |
sed -e '/.*struct.*mutex.*{[ ]*\/\* SHARED \*\/.*/i\
#ifdef HAVE_MUTEX_SUPPORT' \
-e '/.*struct.*mutex.*{[ ]*\/\* SHARED \*\/.*/a\
#endif' \
-e 's/.*[ ]*\(__[a-z_]*\)[ ]*{[ ]*\/\* SHARED \*\/.*/ __ADD(\1);/p' \
-e d > $a
cat ../src/dbinc/db.in ../src/dbinc/db_int.in ../src/dbinc/*.h |
sed -e '/__addrinfo/d' \
-e '/__aes_cipher/d' \
-e '/__cipher/d' \
-e '/__channel/d' \
-e '/__queued_output/d' \
-e '/__repmgr_connection/d' \
-e '/__repmgr_message/d' \
-e '/__repmgr_response/d' \
-e '/__repmgr_retry/d' \
-e '/__repmgr_runnable/d' \
-e '/__repmgr_site/d' \
-e '/.*[ ]*\(__[a-z_]*\)[ ]*{[ ]*\/\* SHARED \*\/.*/d' \
-e '/struct.*mutex.*{/i\
#ifdef HAVE_MUTEX_SUPPORT' \
-e '/struct.*mutex.*{/a\
#endif' \
-e 's/.*[ ]*struct[ ]*\(__[a-z_]*\)[ ]*{.*/ __ADD(\1);/p' \
-e d > $c
cnt1=`sed -e '$=' -e d $a`
cnt2=`sed -e '$=' -e d $c`
cat << END_OF_TEXT > $b
/*-
* DO NOT EDIT: automatically built by dist/s_sig.
*
* \$Id$
*/
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/btree.h"
#include "dbinc/crypto.h"
#include "dbinc/db_join.h"
#include "dbinc/db_verify.h"
#include "dbinc/hash.h"
#include "dbinc/heap.h"
#include "dbinc/lock.h"
#include "dbinc/log_verify.h"
#include "dbinc/mp.h"
#include "dbinc/partition.h"
#include "dbinc/qam.h"
#include "dbinc/txn.h"
END_OF_TEXT
cat << END_OF_TEXT >> $b
/*
* For a pure 32bit/64bit environment, we check all structures and calculate a
* signature. For compatible environment, we only check the structures in
* shared memory.
*/
END_OF_TEXT
echo "#ifdef HAVE_MIXED_SIZE_ADDRESSING" >> $b
echo "#define __STRUCTURE_COUNT $cnt1" >> $b
echo "#else" >> $b
echo "#define __STRUCTURE_COUNT ($cnt1 + $cnt2)" >> $b
echo "#endif" >> $b
cat << END_OF_TEXT >> $b
/*
* __env_struct_sig --
* Compute signature of structures.
*
* PUBLIC: u_int32_t __env_struct_sig __P((void));
*/
u_int32_t
__env_struct_sig()
{
u_short t[__STRUCTURE_COUNT + 5];
u_int i;
i = 0;
#define __ADD(s) (t[i++] = sizeof(struct s))
END_OF_TEXT
cat $a >> $b
cat << END_OF_TEXT >> $b
#ifndef HAVE_MIXED_SIZE_ADDRESSING
END_OF_TEXT
cat $c >> $b
echo "#endif" >> $b
cat << END_OF_TEXT >> $b
return (__ham_func5(NULL, t, i * sizeof(t[0])));
}
END_OF_TEXT
f=../src/env/env_sig.c
cmp $b $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $b $f)

47
dist/s_symlink vendored Executable file
View file

@ -0,0 +1,47 @@
#!/bin/sh -
# $Id$
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 src/btree/tags ../../dist/tagdir/tags
build build_unix/tags ../dist/tagdir/tags
build src/clib/tags ../../dist/tagdir/tags
build src/common/tags ../../dist/tagdir/tags
build src/crypto/tags ../../dist/tagdir/tags
build lang/cxx/tags ../../dist/tagdir/tags
build src/db/tags ../../dist/tagdir/tags
build lang/db185/tags ../../dist/tagdir/tags
build util/tags ../dist/tagdir/tags
build src/dbinc/tags ../../dist/tagdir/tags
build src/dbinc_auto/tags ../../dist/tagdir/tags
build lang/dbm/tags ../../dist/tagdir/tags
build src/dbreg/tags ../../dist/tagdir/tags
build src/env/tags ../../dist/tagdir/tags
build examples/c/tags ../../dist/tagdir/tags
build examples/cxx/tags ../../dist/tagdir/tags
build src/fileops/tags ../../dist/tagdir/tags
build src/hash/tags ../../dist/tagdir/tags
build src/hmac/tags ../../dist/tagdir/tags
build lang/hsearch/tags ../../dist/tagdir/tags
build lang/java/libdb_java/tags ../../../dist/tagdir/tags
build src/lock/tags ../../dist/tagdir/tags
build src/log/tags ../../dist/tagdir/tags
build src/mp/tags ../../dist/tagdir/tags
build src/mutex/tags ../../dist/tagdir/tags
build src/os/tags ../../dist/tagdir/tags
build src/os_qnx/tags ../../dist/tagdir/tags
build src/os_vxworks/tags ../../dist/tagdir/tags
build src/os_windows/tags ../../dist/tagdir/tags
build src/qam/tags ../../dist/tagdir/tags
build src/rep/tags ../../dist/tagdir/tags
build src/repmgr/tags ../../dist/tagdir/tags
build src/sequence/tags ../../dist/tagdir/tags
build lang/tcl/tags ../../dist/tagdir/tags
build src/txn/tags ../../dist/tagdir/tags
build src/xa/tags ../../dist/tagdir/tags

64
dist/s_tags vendored Executable file
View file

@ -0,0 +1,64 @@
#!/bin/sh -
# $Id$
#
# Build tags files.
cd tagdir
files=`echo ../../src/dbinc/*.h \
../../src/dbinc/*.in \
../../src/btree/*.[ch] \
../../src/clib/*.[ch] \
../../src/common/*.[ch] \
../../src/crypto/*.[ch] \
../../src/crypto/mersenne/*.[ch] \
../../src/crypto/rijndael/*.[ch] \
../../src/db/*.[ch] \
../../lang/db185/*.[ch] \
../../lang/dbm/*.[ch] \
../../src/dbreg/*.[ch] \
../../src/env/*.[ch] \
../../src/fileops/*.[ch] \
../../src/hash/*.[ch] \
../../src/hmac/*.[ch] \
../../src/hsearch/*.[ch] \
../../src/lock/*.[ch] \
../../src/log/*.[ch] \
../../src/mp/*.[ch] \
../../src/mutex/*.[ch] \
../../src/os/*.[ch] \
../../src/os_qnx/*.[ch] \
../../src/qam/*.[ch] \
../../src/rep/*.[ch] \
../../src/repmgr/*.[ch] \
../../src/sequence/*.[ch] \
../../lang/tcl/*.[ch] \
../../src/txn/*.[ch] \
../../src/xa/*.[ch] \
../../lang/cxx/*.cpp \
../../lang/java/libdb_java/*.[ch] | sed 's/[^ ]*stub.c//g'`
f=tags
echo "Building $f"
rm -f $f
# Figure out what flags this ctags accepts.
flags=""
if ctags -d ../../src/db/db.c 2>/dev/null; then
flags="-d $flags"
fi
if ctags -t ../../src/db/db.c 2>/dev/null; then
flags="-t $flags"
fi
if ctags -w ../../src/db/db.c 2>/dev/null; then
flags="-w $flags"
fi
ctags $flags $files 2>/dev/null
for i in test/perf testrrepmgr testrserver; do
test -d ../../$i || continue
f=../../$i/tags
echo "Building $f"
(cd ../../$i && ctags $flags *.[ch] 2>/dev/null)
done

109
dist/s_test vendored Executable file
View file

@ -0,0 +1,109 @@
#!/bin/sh -
# $Id$
#
# Build the Tcl test files.
msg1="# Automatically built by dist/s_test; may require local editing."
msg2="# Automatically built by dist/s_test; may require local editing."
t=/tmp/__t
trap 'rm -f $t; exit 0' 0 1 2 3 13 15
. ./RELEASE
(echo "$msg1" && \
echo "" && \
echo "set tclsh_path @TCL_TCLSH@" && \
echo "set tcllib .libs/libdb_tcl-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@@LIBTSO_MODSUFFIX@" && \
echo "" && \
echo "set src_root @srcdir@/.." && \
echo "set test_path @srcdir@/../test/tcl" && \
echo "set je_root @srcdir@/../../je" && \
echo "" && \
echo "global testdir" && \
echo "set testdir ./TESTDIR" && \
echo "" && \
echo "global dict" && \
echo "global util_path" && \
echo "" && \
echo "global is_freebsd_test" && \
echo "global is_hp_test" && \
echo "global is_linux_test" && \
echo "global is_osx_test" && \
echo "global is_qnx_test" && \
echo "global is_sunos_test" && \
echo "global is_windows_test" && \
echo "global is_windows9x_test" && \
echo "" && \
echo "global valid_methods" && \
echo "global checking_valid_methods" && \
echo "global test_recopts" && \
echo "" && \
echo "set KILL \"@KILL@\"") > $t
f=../test/tcl/include.tcl
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f)
(echo "$msg1" && \
echo "" && \
echo "set tclsh_path SET_YOUR_TCLSH_PATH" && \
echo "set buildpath Win32/Debug" && \
echo "set tcllib libdb_tcl${DB_VERSION_MAJOR}${DB_VERSION_MINOR}d.dll" && \
echo "" && \
echo "set src_root .." && \
echo "set test_path ../test/tcl" && \
echo "set je_root ../../je" && \
echo "" && \
echo "global testdir" && \
echo "set testdir ./TESTDIR" && \
echo "" && \
echo "global dict" && \
echo "global util_path" && \
echo "" && \
echo "global is_freebsd_test" && \
echo "global is_hp_test" && \
echo "global is_linux_test" && \
echo "global is_osx_test" && \
echo "global is_qnx_test" && \
echo "global is_sunos_test" && \
echo "global is_windows_test" && \
echo "global is_windows9x_test" && \
echo "" && \
echo "global valid_methods" && \
echo "global checking_valid_methods" && \
echo "global test_recopts" && \
echo "" && \
echo "set KILL dbkill.exe") > $t
f=../build_windows/include.tcl
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f)
# Build the test directory TESTS file.
(echo $msg2;
cat `egrep -l '^#[ ][ ]*TEST' ../test/tcl/*.tcl` |
sed -e '/^#[ ][ ]*TEST/!{' \
-e 's/.*//' \
-e '}' |
cat -s |
sed -e '/TEST/{' \
-e 's/^#[ ][ ]*TEST[ ]*//' \
-e 's/^ //' \
-e 'H' \
-e 'd' \
-e '}' \
-e 's/.*//' \
-e x \
-e 's/\n/__LINEBREAK__/g' |
LANG=C sort |
sed -e 's/__LINEBREAK__/\
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\
/' \
-e 's/__LINEBREAK__/\
/g' |
sed -e 's/^[ ][ ]*$//') > $t
f=../test/tcl/TESTS
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f)

79
dist/s_validate vendored Executable file
View file

@ -0,0 +1,79 @@
#!/bin/sh -
# $Id$
#
# This script runs the various validation tests in the validate directory.
# Run everything, even those known to be invalid or useless.
all_tests=1
# Run all tests, even those that require odd env setup or a long time.
full=0
ignore_failures=0
nocleanup=0
verbose=1
while [ $# -gt 0 ]
do
case "$1" in
-a*) # all
all_tests=1; full=1; shift;;
-c*) # continue
ignore_failures=1; shift;;
-f*) # full
full=1; shift;;
-nocleanup)
nocleanup=1; shift;;
-q*)
verbose=0; shift;;
*)
echo "Unrecognized option: $1, ignoring"
shift;;
esac
done
# The set of full tests are those that have special env setup requirements
# or take a long time to run. They should be run at release time.
FULL_TESTS="s_chk_build_configs s_chk_vxworks"
EXCLUDE_TESTS="s_chk_logverify s_chk_srcfiles s_chk_java_samples"
# Run all s_chk scripts, files with extensions are used by the script with
# the shorter name, they shouldn't be run directly.
for t in `(cd validate && ls s_chk_* | grep -v "\.")`
do
excluded=0
for skip in $FULL_TESTS; do
if [ $full = 0 -a "$t" = "$skip" ]; then
echo "===!! Skipping $t ==="
echo "=== Add -full to the command line to enable ==="
excluded=1
break;
fi
done
for skip in $EXCLUDE_TESTS; do
if [ $all_tests != 0 -a "$t" = "$skip" ]; then
echo "===!! Skipping $t ==="
echo "=== Add -all to the command line to enable ==="
excluded=1
break;
fi
done
if [ $excluded != 0 ]; then
continue
fi
echo "=== Running $t ==="
if [ "$verbose" = 1 ]; then
(cd validate && sh $t)
else
(cd validate && sh $t > /dev/null)
fi
ret_val=$?
if [ "$ret_val" != 0 ]; then
echo "=== Test $t reported a failure $ret_val." >&2
if [ $ignore_failures = 0 ]; then
exit $ret_val
fi
else
echo "=== Test $t passed, $ret_val"
fi
rm -f validate/__?
done
echo "Finished running validate tests."

339
dist/srcfiles.in vendored Normal file
View file

@ -0,0 +1,339 @@
# $Id$
#
# This is an input file for the s_vxworks script. It lists the source files in
# the Berkeley DB tree and notes which are used to build the Android and
# VxWorks libraries.
#
# If you are adding a new file, putting the filename here in srcfiles.in and
# indicate which modules require the file. Also make sure to add the file to
# dist/win_projects/projects.template.xml for Windows, and
# dist/win_projects/projects_wince.template.xml for Windows CE.
#
# Please keep this list sorted alphabetically!
#
# Each non-blank, non-comment line is of the form
# filename module [ module ...]
src/btree/bt_compact.c android vx vxsmall
src/btree/bt_compare.c android vx vxsmall
src/btree/bt_compress.c android vx vxsmall
src/btree/bt_conv.c android vx vxsmall
src/btree/bt_curadj.c android vx vxsmall
src/btree/bt_cursor.c android vx vxsmall
src/btree/bt_delete.c android vx vxsmall
src/btree/bt_method.c android vx vxsmall
src/btree/bt_open.c android vx vxsmall
src/btree/bt_put.c android vx vxsmall
src/btree/bt_rec.c android vx vxsmall
src/btree/bt_reclaim.c android vx vxsmall
src/btree/bt_recno.c android vx vxsmall
src/btree/bt_rsearch.c android vx vxsmall
src/btree/bt_search.c android vx vxsmall
src/btree/bt_split.c android vx vxsmall
src/btree/bt_stat.c android vx vxsmall
src/btree/bt_upgrade.c android vx vxsmall
src/btree/bt_verify.c vx
src/btree/btree_auto.c android vx vxsmall
src/btree/btree_autop.c vx6
build_vxworks/util/db_archive.c vx6
build_vxworks/util/db_checkpoint.c vx6
build_vxworks/util/db_deadlock.c vx6
build_vxworks/util/db_dump.c vx6
build_vxworks/util/db_hotbackup.c vx6
build_vxworks/util/db_load.c vx6
build_vxworks/util/db_log_verify.c vx6
build_vxworks/util/db_printlog.c vx6
build_vxworks/util/db_recover.c vx6
build_vxworks/util/db_stat.c vx6
build_vxworks/util/db_tuner.c vx6
build_vxworks/util/db_upgrade.c vx6
build_vxworks/util/db_verify.c vx6
build_vxworks/dbdemo/dbdemo.c vx6
build_vxworks/test/micro/b_curalloc.c vx6
build_vxworks/test/micro/b_curwalk.c vx6
build_vxworks/test/micro/b_del.c vx6
build_vxworks/test/micro/b_get.c vx6
build_vxworks/test/micro/b_inmem.c vx6
build_vxworks/test/micro/b_latch.c vx6
build_vxworks/test/micro/b_load.c vx6
build_vxworks/test/micro/b_open.c vx6
build_vxworks/test/micro/b_put.c vx6
build_vxworks/test/micro/b_recover.c vx6
build_vxworks/test/micro/b_txn.c vx6
build_vxworks/test/micro/b_txn_write.c vx6
build_vxworks/test/micro/b_uname.c vx6
build_vxworks/test/micro/b_util.c vx6
build_vxworks/test/micro/b_workload.c vx6
build_vxworks/test/micro/test_micro.c vx6
src/clib/getopt.c vx vxsmall
src/clib/rand.c android
src/clib/snprintf.c android vx vxsmall
src/clib/strcasecmp.c vx vxsmall
src/clib/strdup.c vx vxsmall
src/clib/strsep.c vx vxsmall
src/common/clock.c android vx vxsmall
src/common/crypto_stub.c android vxsmall
src/common/db_byteorder.c android vx vxsmall
src/common/db_compint.c android vx vxsmall
src/common/db_err.c android vx vxsmall
src/common/db_getlong.c android vx vxsmall
src/common/db_idspace.c android vx vxsmall
src/common/db_log2.c android vx vxsmall
src/common/db_shash.c android vx vxsmall
src/common/dbt.c android vx vxsmall
src/common/mkpath.c android vx vxsmall
src/common/os_method.c android vx vxsmall
src/common/util_arg.c vx vxsmall
src/common/util_cache.c vx vxsmall
src/common/util_log.c vx vxsmall
src/common/util_sig.c vx vxsmall
src/common/zerofill.c android vx vxsmall
src/crypto/aes_method.c vx
src/crypto/crypto.c vx
src/crypto/mersenne/mt19937db.c vx
src/crypto/rijndael/rijndael-alg-fst.c vx
src/crypto/rijndael/rijndael-api-fst.c vx
lang/cxx/cxx_channel.cpp vx6
lang/cxx/cxx_db.cpp vx6
lang/cxx/cxx_dbc.cpp vx6
lang/cxx/cxx_dbt.cpp vx6
lang/cxx/cxx_env.cpp vx6
lang/cxx/cxx_except.cpp vx6
lang/cxx/cxx_lock.cpp vx6
lang/cxx/cxx_logc.cpp vx6
lang/cxx/cxx_mpool.cpp vx6
lang/cxx/cxx_multi.cpp vx6
lang/cxx/cxx_seq.cpp vx6
lang/cxx/cxx_site.cpp vx6
lang/cxx/cxx_txn.cpp vx6
src/db/crdel_auto.c android vx vxsmall
src/db/crdel_autop.c vx6
src/db/crdel_rec.c android vx vxsmall
src/db/db.c android vx vxsmall
src/db/db_am.c android vx vxsmall
src/db/db_auto.c android vx vxsmall
src/db/db_autop.c vx6
src/db/db_cam.c android vx vxsmall
src/db/db_cds.c android vx vxsmall
src/db/db_compact.c android vx vxsmall
src/db/db_conv.c android vx vxsmall
src/db/db_copy.c android vx vxsmall
src/db/db_dispatch.c android vx vxsmall
src/db/db_dup.c android vx vxsmall
src/db/db_iface.c android vx vxsmall
src/db/db_join.c android vx vxsmall
src/db/db_meta.c android vx vxsmall
src/db/db_method.c android vx vxsmall
src/db/db_open.c android vx vxsmall
src/db/db_overflow.c android vx vxsmall
src/db/db_ovfl_vrfy.c vx
src/db/db_pr.c android vx vxsmall
src/db/db_rec.c android vx vxsmall
src/db/db_reclaim.c android vx vxsmall
src/db/db_remove.c android vx vxsmall
src/db/db_rename.c android vx vxsmall
src/db/db_ret.c android vx vxsmall
src/db/db_setid.c android vx vxsmall
src/db/db_setlsn.c android vx vxsmall
src/db/db_sort_multiple.c android vx vxsmall
src/db/db_stati.c android vx vxsmall
src/db/db_truncate.c android vx vxsmall
src/db/db_upg.c android vx vxsmall
src/db/db_upg_opd.c android vx vxsmall
src/db/db_vrfy.c vx
src/db/db_vrfy_stub.c android vxsmall
src/db/db_vrfyutil.c vx
src/db/partition.c android vx
lang/db185/db185.c
src/dbreg/dbreg.c android vx vxsmall
src/dbreg/dbreg_auto.c android vx vxsmall
src/dbreg/dbreg_autop.c vx6
src/dbreg/dbreg_rec.c android vx vxsmall
src/dbreg/dbreg_stat.c android vx vxsmall
src/dbreg/dbreg_util.c android vx vxsmall
src/env/env_alloc.c android vx vxsmall
src/env/env_config.c android vx vxsmall
src/env/env_failchk.c android vx vxsmall
src/env/env_file.c android vx vxsmall
src/env/env_globals.c android vx vxsmall
src/env/env_method.c android vx vxsmall
src/env/env_name.c android vx vxsmall
src/env/env_open.c android vx vxsmall
src/env/env_recover.c android vx vxsmall
src/env/env_region.c android vx vxsmall
src/env/env_register.c android vx vxsmall
src/env/env_sig.c android vx vxsmall
src/env/env_stat.c android vx vxsmall
src/fileops/fileops_auto.c android vx vxsmall
src/fileops/fileops_autop.c vx6
src/fileops/fop_basic.c android vx vxsmall
src/fileops/fop_rec.c android vx vxsmall
src/fileops/fop_util.c android vx vxsmall
src/hash/hash.c vx
src/hash/hash_auto.c vx
src/hash/hash_autop.c vx6
src/hash/hash_compact.c vx
src/hash/hash_conv.c vx
src/hash/hash_dup.c vx
src/hash/hash_func.c android vx vxsmall
src/hash/hash_meta.c vx
src/hash/hash_method.c vx
src/hash/hash_open.c vx
src/hash/hash_page.c vx
src/hash/hash_rec.c vx
src/hash/hash_reclaim.c vx
src/hash/hash_stat.c vx
src/hash/hash_stub.c android vxsmall
src/hash/hash_upgrade.c vx
src/hash/hash_verify.c vx
src/heap/heap_auto.c vx
src/heap/heap_autop.c vx
src/heap/heap.c vx
src/heap/heap_conv.c vx
src/heap/heap_method.c vx
src/heap/heap_open.c vx
src/heap/heap_rec.c vx
src/heap/heap_reclaim.c vx
src/heap/heap_stat.c vx
src/heap/heap_stub.c android vxsmall
src/heap/heap_verify.c vx
src/hmac/hmac.c android vx vxsmall
src/hmac/sha1.c android vx vxsmall
src/lock/lock.c android vx vxsmall
src/lock/lock_deadlock.c android vx vxsmall
src/lock/lock_failchk.c android vx vxsmall
src/lock/lock_id.c android vx vxsmall
src/lock/lock_list.c android vx vxsmall
src/lock/lock_method.c android vx vxsmall
src/lock/lock_region.c android vx vxsmall
src/lock/lock_stat.c android vx vxsmall
src/lock/lock_timer.c android vx vxsmall
src/lock/lock_util.c android vx vxsmall
src/log/log.c android vx vxsmall
src/log/log_archive.c android vx vxsmall
src/log/log_compare.c android vx vxsmall
src/log/log_debug.c android vx vxsmall
src/log/log_get.c android vx vxsmall
src/log/log_method.c android vx vxsmall
src/log/log_print.c android vx vxsmall
src/log/log_put.c android vx vxsmall
src/log/log_stat.c android vx vxsmall
src/log/log_verify.c vx
src/log/log_verify_util.c vx
src/log/log_verify_auto.c vx
src/log/log_verify_int.c vx
src/log/log_verify_stub.c android vxsmall
src/mp/mp_alloc.c android vx vxsmall
src/mp/mp_bh.c android vx vxsmall
src/mp/mp_fget.c android vx vxsmall
src/mp/mp_fmethod.c android vx vxsmall
src/mp/mp_fopen.c android vx vxsmall
src/mp/mp_fput.c android vx vxsmall
src/mp/mp_fset.c android vx vxsmall
src/mp/mp_method.c android vx vxsmall
src/mp/mp_mvcc.c android vx vxsmall
src/mp/mp_region.c android vx vxsmall
src/mp/mp_register.c android vx vxsmall
src/mp/mp_resize.c android vx vxsmall
src/mp/mp_stat.c android vx vxsmall
src/mp/mp_sync.c android vx vxsmall
src/mp/mp_trickle.c android vx vxsmall
src/mutex/mut_alloc.c android vx vxsmall
src/mutex/mut_failchk.c android vx vxsmall
src/mutex/mut_fcntl.c
src/mutex/mut_method.c android vx vxsmall
src/mutex/mut_region.c android vx vxsmall
src/mutex/mut_stat.c android vx vxsmall
src/mutex/mut_tas.c android vx vxsmall
src/mutex/mut_win32.c ce_small
src/os/os_abort.c android vx vxsmall
src/os/os_abs.c android
src/os/os_addrinfo.c vx
src/os/os_alloc.c android vx vxsmall
src/os/os_clock.c android vx vxsmall
src/os/os_config.c android
src/os/os_cpu.c android vx vxsmall
src/os/os_ctime.c android vx vxsmall
src/os/os_dir.c android vx vxsmall
src/os/os_errno.c android vx vxsmall
src/os/os_fid.c android vx vxsmall
src/os/os_flock.c android vx vxsmall
src/os/os_fsync.c android vx vxsmall
src/os/os_getenv.c android vx vxsmall
src/os/os_handle.c android vx vxsmall
src/os/os_map.c android
src/os/os_mkdir.c android vx vxsmall
src/os/os_open.c android vx vxsmall
src/os/os_pid.c android vx vxsmall
src/os/os_rename.c android vx vxsmall
src/os/os_root.c android vx vxsmall
src/os/os_rpath.c android
src/os/os_rw.c android vx vxsmall
src/os/os_seek.c android vx vxsmall
src/os/os_stack.c android vx vxsmall
src/os/os_stat.c android vx vxsmall
src/os/os_tmpdir.c android vx vxsmall
src/os/os_truncate.c android vx vxsmall
src/os/os_uid.c android vx vxsmall
src/os/os_unlink.c android vx vxsmall
src/os/os_yield.c android
src/os_qnx/os_qnx_fsync.c
src/os_qnx/os_qnx_open.c
src/os_vxworks/os_vx_abs.c vx vxsmall
src/os_vxworks/os_vx_config.c vx vxsmall
src/os_vxworks/os_vx_map.c vx vxsmall
src/os_vxworks/os_vx_rpath.c vx vxsmall
src/os_vxworks/os_vx_yield.c vx vxsmall
src/qam/qam.c vx
src/qam/qam_auto.c vx
src/qam/qam_autop.c vx6
src/qam/qam_conv.c vx
src/qam/qam_files.c vx
src/qam/qam_method.c vx
src/qam/qam_open.c vx
src/qam/qam_rec.c vx
src/qam/qam_stat.c vx
src/qam/qam_stub.c android vxsmall
src/qam/qam_upgrade.c vx
src/qam/qam_verify.c vx
src/rep/rep_automsg.c vx
src/rep/rep_backup.c vx
src/rep/rep_elect.c vx
src/rep/rep_lease.c vx
src/rep/rep_log.c vx
src/rep/rep_method.c vx
src/rep/rep_record.c vx
src/rep/rep_region.c vx
src/rep/rep_stat.c vx
src/rep/rep_stub.c android vxsmall
src/rep/rep_util.c vx
src/rep/rep_verify.c vx
src/repmgr/repmgr_auto.c vx
src/repmgr/repmgr_autop.c vx6
src/repmgr/repmgr_automsg.c vx
src/repmgr/repmgr_elect.c vx
src/repmgr/repmgr_method.c vx
src/repmgr/repmgr_msg.c vx
src/repmgr/repmgr_net.c vx
src/repmgr/repmgr_posix.c vx
src/repmgr/repmgr_queue.c vx
src/repmgr/repmgr_rec.c vx
src/repmgr/repmgr_sel.c vx
src/repmgr/repmgr_stat.c vx
src/repmgr/repmgr_stub.c android vxsmall
src/repmgr/repmgr_util.c vx
src/sequence/seq_stat.c android vx6
src/sequence/sequence.c android vx6
src/txn/txn.c android vx vxsmall
src/txn/txn_auto.c android vx vxsmall
src/txn/txn_autop.c vx6
src/txn/txn_chkpt.c android vx vxsmall
src/txn/txn_failchk.c android vx vxsmall
src/txn/txn_method.c android vx vxsmall
src/txn/txn_rec.c android vx vxsmall
src/txn/txn_recover.c android vx vxsmall
src/txn/txn_region.c android vx vxsmall
src/txn/txn_stat.c android vx vxsmall
src/txn/txn_util.c android vx vxsmall
src/xa/xa.c vx
src/xa/xa_map.c vx

917
dist/template/rec_btree vendored Normal file
View file

@ -0,0 +1,917 @@
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/__bam.h"
#include "dbinc/log.h"
/*
* __bam_split_recover --
* Recovery function for split.
*
* PUBLIC: int __bam_split_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_split_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_split_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_split_print);
REC_INTRO(__bam_split_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_split_recover --
* Recovery function for split.
*
* PUBLIC: int __bam_split_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_split_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_split_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_split_print);
REC_INTRO(__bam_split_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_split_recover --
* Recovery function for split.
*
* PUBLIC: int __bam_split_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_split_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_split_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_split_print);
REC_INTRO(__bam_split_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_rsplit_recover --
* Recovery function for rsplit.
*
* PUBLIC: int __bam_rsplit_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_rsplit_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_rsplit_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_rsplit_print);
REC_INTRO(__bam_rsplit_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_adj_recover --
* Recovery function for adj.
*
* PUBLIC: int __bam_adj_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_adj_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_adj_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_adj_print);
REC_INTRO(__bam_adj_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_cadjust_recover --
* Recovery function for cadjust.
*
* PUBLIC: int __bam_cadjust_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_cadjust_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_cadjust_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_cadjust_print);
REC_INTRO(__bam_cadjust_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_cdel_recover --
* Recovery function for cdel.
*
* PUBLIC: int __bam_cdel_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_cdel_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_cdel_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_cdel_print);
REC_INTRO(__bam_cdel_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_repl_recover --
* Recovery function for repl.
*
* PUBLIC: int __bam_repl_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_repl_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_repl_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_repl_print);
REC_INTRO(__bam_repl_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_irep_recover --
* Recovery function for irep.
*
* PUBLIC: int __bam_irep_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_irep_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_irep_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_irep_print);
REC_INTRO(__bam_irep_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_root_recover --
* Recovery function for root.
*
* PUBLIC: int __bam_root_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_root_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_root_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_root_print);
REC_INTRO(__bam_root_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_curadj_recover --
* Recovery function for curadj.
*
* PUBLIC: int __bam_curadj_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_curadj_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_curadj_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_curadj_print);
REC_INTRO(__bam_curadj_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_rcuradj_recover --
* Recovery function for rcuradj.
*
* PUBLIC: int __bam_rcuradj_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_rcuradj_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_rcuradj_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_rcuradj_print);
REC_INTRO(__bam_rcuradj_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_relink_recover --
* Recovery function for relink.
*
* PUBLIC: int __bam_relink_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_relink_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_relink_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_relink_print);
REC_INTRO(__bam_relink_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __bam_merge_recover --
* Recovery function for merge.
*
* PUBLIC: int __bam_merge_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__bam_merge_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__bam_merge_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__bam_merge_print);
REC_INTRO(__bam_merge_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

267
dist/template/rec_crdel vendored Normal file
View file

@ -0,0 +1,267 @@
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/__crdel.h"
#include "dbinc/log.h"
/*
* __crdel_metasub_recover --
* Recovery function for metasub.
*
* PUBLIC: int __crdel_metasub_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__crdel_metasub_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__crdel_metasub_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__crdel_metasub_print);
REC_INTRO(__crdel_metasub_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __crdel_inmem_create_recover --
* Recovery function for inmem_create.
*
* PUBLIC: int __crdel_inmem_create_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__crdel_inmem_create_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__crdel_inmem_create_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__crdel_inmem_create_print);
REC_INTRO(__crdel_inmem_create_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __crdel_inmem_rename_recover --
* Recovery function for inmem_rename.
*
* PUBLIC: int __crdel_inmem_rename_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__crdel_inmem_rename_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__crdel_inmem_rename_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__crdel_inmem_rename_print);
REC_INTRO(__crdel_inmem_rename_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __crdel_inmem_remove_recover --
* Recovery function for inmem_remove.
*
* PUBLIC: int __crdel_inmem_remove_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__crdel_inmem_remove_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__crdel_inmem_remove_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__crdel_inmem_remove_print);
REC_INTRO(__crdel_inmem_remove_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

65
dist/template/rec_ctemp vendored Normal file
View file

@ -0,0 +1,65 @@
/*
* PREF_FUNC_recover --
* Recovery function for FUNC.
*
* PUBLIC: int PREF_FUNC_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
PREF_FUNC_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
PREF_DUP_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(PREF_DUP_print);
REC_INTRO(PREF_DUP_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

1437
dist/template/rec_db vendored Normal file

File diff suppressed because it is too large Load diff

72
dist/template/rec_dbreg vendored Normal file
View file

@ -0,0 +1,72 @@
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/__dbreg.h"
#include "dbinc/log.h"
/*
* __dbreg_register_recover --
* Recovery function for register.
*
* PUBLIC: int __dbreg_register_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__dbreg_register_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__dbreg_register_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__dbreg_register_print);
REC_INTRO(__dbreg_register_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

527
dist/template/rec_fileops vendored Normal file
View file

@ -0,0 +1,527 @@
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/__fop.h"
#include "dbinc/log.h"
/*
* __fop_create_recover --
* Recovery function for create.
*
* PUBLIC: int __fop_create_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__fop_create_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__fop_create_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__fop_create_print);
REC_INTRO(__fop_create_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __fop_create_recover --
* Recovery function for create.
*
* PUBLIC: int __fop_create_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__fop_create_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__fop_create_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__fop_create_print);
REC_INTRO(__fop_create_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __fop_remove_recover --
* Recovery function for remove.
*
* PUBLIC: int __fop_remove_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__fop_remove_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__fop_remove_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__fop_remove_print);
REC_INTRO(__fop_remove_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __fop_write_recover --
* Recovery function for write.
*
* PUBLIC: int __fop_write_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__fop_write_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__fop_write_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__fop_write_print);
REC_INTRO(__fop_write_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __fop_write_recover --
* Recovery function for write.
*
* PUBLIC: int __fop_write_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__fop_write_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__fop_write_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__fop_write_print);
REC_INTRO(__fop_write_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __fop_rename_recover --
* Recovery function for rename.
*
* PUBLIC: int __fop_rename_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__fop_rename_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__fop_rename_noundo_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__fop_rename_noundo_print);
REC_INTRO(__fop_rename_noundo_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __fop_rename_recover --
* Recovery function for rename.
*
* PUBLIC: int __fop_rename_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__fop_rename_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__fop_rename_noundo_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__fop_rename_noundo_print);
REC_INTRO(__fop_rename_noundo_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __fop_file_remove_recover --
* Recovery function for file_remove.
*
* PUBLIC: int __fop_file_remove_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__fop_file_remove_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__fop_file_remove_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__fop_file_remove_print);
REC_INTRO(__fop_file_remove_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

982
dist/template/rec_hash vendored Normal file
View file

@ -0,0 +1,982 @@
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/__ham.h"
#include "dbinc/log.h"
/*
* __ham_insdel_recover --
* Recovery function for insdel.
*
* PUBLIC: int __ham_insdel_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_insdel_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_insdel_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_insdel_print);
REC_INTRO(__ham_insdel_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_insdel_recover --
* Recovery function for insdel.
*
* PUBLIC: int __ham_insdel_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_insdel_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_insdel_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_insdel_print);
REC_INTRO(__ham_insdel_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_newpage_recover --
* Recovery function for newpage.
*
* PUBLIC: int __ham_newpage_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_newpage_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_newpage_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_newpage_print);
REC_INTRO(__ham_newpage_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_splitdata_recover --
* Recovery function for splitdata.
*
* PUBLIC: int __ham_splitdata_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_splitdata_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_splitdata_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_splitdata_print);
REC_INTRO(__ham_splitdata_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_replace_recover --
* Recovery function for replace.
*
* PUBLIC: int __ham_replace_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_replace_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_replace_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_replace_print);
REC_INTRO(__ham_replace_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_replace_recover --
* Recovery function for replace.
*
* PUBLIC: int __ham_replace_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_replace_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_replace_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_replace_print);
REC_INTRO(__ham_replace_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_copypage_recover --
* Recovery function for copypage.
*
* PUBLIC: int __ham_copypage_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_copypage_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_copypage_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_copypage_print);
REC_INTRO(__ham_copypage_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_metagroup_recover --
* Recovery function for metagroup.
*
* PUBLIC: int __ham_metagroup_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_metagroup_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_metagroup_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_metagroup_print);
REC_INTRO(__ham_metagroup_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_metagroup_recover --
* Recovery function for metagroup.
*
* PUBLIC: int __ham_metagroup_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_metagroup_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_metagroup_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_metagroup_print);
REC_INTRO(__ham_metagroup_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_groupalloc_recover --
* Recovery function for groupalloc.
*
* PUBLIC: int __ham_groupalloc_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_groupalloc_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_groupalloc_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_groupalloc_print);
REC_INTRO(__ham_groupalloc_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_groupalloc_recover --
* Recovery function for groupalloc.
*
* PUBLIC: int __ham_groupalloc_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_groupalloc_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_groupalloc_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_groupalloc_print);
REC_INTRO(__ham_groupalloc_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_changeslot_recover --
* Recovery function for changeslot.
*
* PUBLIC: int __ham_changeslot_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_changeslot_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_changeslot_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_changeslot_print);
REC_INTRO(__ham_changeslot_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_contract_recover --
* Recovery function for contract.
*
* PUBLIC: int __ham_contract_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_contract_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_contract_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_contract_print);
REC_INTRO(__ham_contract_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_curadj_recover --
* Recovery function for curadj.
*
* PUBLIC: int __ham_curadj_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_curadj_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_curadj_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_curadj_print);
REC_INTRO(__ham_curadj_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __ham_chgpg_recover --
* Recovery function for chgpg.
*
* PUBLIC: int __ham_chgpg_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__ham_chgpg_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__ham_chgpg_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__ham_chgpg_print);
REC_INTRO(__ham_chgpg_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

267
dist/template/rec_heap vendored Normal file
View file

@ -0,0 +1,267 @@
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/__heap.h"
#include "dbinc/log.h"
/*
* __heap_addrem_recover --
* Recovery function for addrem.
*
* PUBLIC: int __heap_addrem_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__heap_addrem_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__heap_addrem_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__heap_addrem_print);
REC_INTRO(__heap_addrem_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __heap_pg_alloc_recover --
* Recovery function for pg_alloc.
*
* PUBLIC: int __heap_pg_alloc_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__heap_pg_alloc_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__heap_pg_alloc_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__heap_pg_alloc_print);
REC_INTRO(__heap_pg_alloc_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __heap_trunc_meta_recover --
* Recovery function for trunc_meta.
*
* PUBLIC: int __heap_trunc_meta_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__heap_trunc_meta_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__heap_trunc_meta_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__heap_trunc_meta_print);
REC_INTRO(__heap_trunc_meta_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __heap_trunc_page_recover --
* Recovery function for trunc_page.
*
* PUBLIC: int __heap_trunc_page_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__heap_trunc_page_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__heap_trunc_page_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__heap_trunc_page_print);
REC_INTRO(__heap_trunc_page_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

332
dist/template/rec_qam vendored Normal file
View file

@ -0,0 +1,332 @@
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/__qam.h"
#include "dbinc/log.h"
/*
* __qam_incfirst_recover --
* Recovery function for incfirst.
*
* PUBLIC: int __qam_incfirst_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__qam_incfirst_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__qam_incfirst_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__qam_incfirst_print);
REC_INTRO(__qam_incfirst_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __qam_mvptr_recover --
* Recovery function for mvptr.
*
* PUBLIC: int __qam_mvptr_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__qam_mvptr_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__qam_mvptr_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__qam_mvptr_print);
REC_INTRO(__qam_mvptr_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __qam_del_recover --
* Recovery function for del.
*
* PUBLIC: int __qam_del_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__qam_del_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__qam_del_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__qam_del_print);
REC_INTRO(__qam_del_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __qam_add_recover --
* Recovery function for add.
*
* PUBLIC: int __qam_add_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__qam_add_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__qam_add_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__qam_add_print);
REC_INTRO(__qam_add_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __qam_delext_recover --
* Recovery function for delext.
*
* PUBLIC: int __qam_delext_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__qam_delext_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__qam_delext_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__qam_delext_print);
REC_INTRO(__qam_delext_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

72
dist/template/rec_repmgr vendored Normal file
View file

@ -0,0 +1,72 @@
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/__repmgr.h"
#include "dbinc/log.h"
/*
* __repmgr_member_recover --
* Recovery function for member.
*
* PUBLIC: int __repmgr_member_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__repmgr_member_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__repmgr_member_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__repmgr_member_print);
REC_INTRO(__repmgr_member_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

527
dist/template/rec_txn vendored Normal file
View file

@ -0,0 +1,527 @@
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/__txn.h"
#include "dbinc/log.h"
/*
* __txn_regop_recover --
* Recovery function for regop.
*
* PUBLIC: int __txn_regop_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__txn_regop_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__txn_regop_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__txn_regop_print);
REC_INTRO(__txn_regop_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __txn_regop_recover --
* Recovery function for regop.
*
* PUBLIC: int __txn_regop_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__txn_regop_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__txn_regop_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__txn_regop_print);
REC_INTRO(__txn_regop_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __txn_ckp_recover --
* Recovery function for ckp.
*
* PUBLIC: int __txn_ckp_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__txn_ckp_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__txn_ckp_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__txn_ckp_print);
REC_INTRO(__txn_ckp_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __txn_ckp_recover --
* Recovery function for ckp.
*
* PUBLIC: int __txn_ckp_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__txn_ckp_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__txn_ckp_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__txn_ckp_print);
REC_INTRO(__txn_ckp_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __txn_child_recover --
* Recovery function for child.
*
* PUBLIC: int __txn_child_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__txn_child_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__txn_child_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__txn_child_print);
REC_INTRO(__txn_child_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __txn_xa_regop_recover --
* Recovery function for xa_regop.
*
* PUBLIC: int __txn_xa_regop_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__txn_xa_regop_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__txn_xa_regop_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__txn_xa_regop_print);
REC_INTRO(__txn_xa_regop_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __txn_prepare_recover --
* Recovery function for prepare.
*
* PUBLIC: int __txn_prepare_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__txn_prepare_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__txn_prepare_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__txn_prepare_print);
REC_INTRO(__txn_prepare_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}
/*
* __txn_recycle_recover --
* Recovery function for recycle.
*
* PUBLIC: int __txn_recycle_recover
* PUBLIC: __P((env *, DBT *, DB_LSN *, db_recops, void *));
*/
int
__txn_recycle_recover(env, dbtp, lsnp, op, info)
env *env;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
void *info;
{
__txn_recycle_args *argp;
DB *file_dbp;
DBC *dbc;
DB_MPOOLFILE *mpf;
DB_THREAD_INFO *ip;
PAGE *pagep;
int cmp_n, cmp_p, modified, ret;
ip = ((DB_TXNHEAD *)info)->thread_info;
REC_PRINT(__txn_recycle_print);
REC_INTRO(__txn_recycle_read, ip, 0);
if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
if (DB_REDO(op)) {
if ((ret = mpf->get(mpf,
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
goto out;
} else {
*lsnp = argp->prev_lsn;
ret = 0;
goto out;
}
modified = 0;
cmp_n = log_compare(lsnp, &LSN(pagep));
/*
* Use this when there is something like "pagelsn" in the argp
* structure. Sometimes, you might need to compare meta-data
* lsn's instead.
*
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
*/
if (cmp_p == 0 && DB_REDO(op)) {
/* Need to redo update described. */
modified = 1;
} else if (cmp_n == 0 && !DB_REDO(op)) {
/* Need to undo update described. */
modified = 1;
}
if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
goto out;
*lsnp = argp->prev_lsn;
ret = 0;
out: REC_CLOSE;
}

68
dist/template/rec_utemp vendored Normal file
View file

@ -0,0 +1,68 @@
/*
* PREF_FUNC_recover --
* Recovery function for FUNC.
*
* PUBLIC: int PREF_FUNC_recover
* PUBLIC: __P((dbenv *, DBT *, DB_LSN *, db_recops));
*/
int
PREF_FUNC_recover(dbenv, dbtp, lsnp, op)
dbenv *dbenv;
DBT *dbtp;
DB_LSN *lsnp;
db_recops op;
{
PREF_DUP_args *argp;
int cmp_n, cmp_p, modified, ret;
#ifdef DEBUG_RECOVER
(void)PREF_DUP_print(dbenv, dbtp, lsnp, op);
#endif
argp = NULL;
if ((ret = PREF_DUP_read(dbenv, dbtp->data, &argp)) != 0)
goto out;
modified = 0;
cmp_n = 0;
cmp_p = 0;
/*
* The function now needs to calculate cmp_n and cmp_p based
* on whatever is in argp (usually an LSN representing the state
* of an object BEFORE the operation described in this record was
* applied) and whatever other information the function needs,
* e.g., the LSN of the object as it exists now.
*
* cmp_p should be set to 0 if the current state of the object
* is believed to be same as the state of the object BEFORE the
* described operation was applied. For example, if you had an
* LSN in the log record (argp->prevlsn) and a current LSN of the
* object (curlsn), you might want to do:
*
* cmp_p = log_compare(curlsn, argp->prevlsn);
*
* Similarly, cmp_n should be set to 0 if the current state
* of the object reflects the object AFTER this operation has
* been applied. Thus, if you can figure out an object's current
* LSN, yo might set cmp_n as:
*
* cmp_n = log_compare(lsnp, curlsn);
*/
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;
}
/* Allow for following LSN pointers through a transaction. */
*lsnp = argp->prev_lsn;
ret = 0;
out: if (argp != NULL)
free(argp);
return (ret);
}

10
dist/validate/README vendored Normal file
View file

@ -0,0 +1,10 @@
All the files in this folder implement test cases that validate some component
of the Berkeley DB system.
They are driven by script files, that are shell script based. They are not
generally designed to be run outside of the shell.
There is a "driver" script called s_validate in the dist directory of the
repository that can be used to run all the scripts in this directory.
Any new script will be automatically run by the s_validate driver.

118
dist/validate/s_chk_build_configs vendored Normal file
View file

@ -0,0 +1,118 @@
#!/bin/sh -
#
# $Id$
#
# Build a program that calls the run-time API configuration functions.
d=../..
b=tmp_build
trap 'rm -rf $b ; exit 0' 0
trap 'rm -rf $b ; exit 1' 1 2 3 13 15
[ -f $d/LICENSE ] || {
echo 'FAIL: Test must be run from scr directory.'
exit 1
}
# Flags to build Java.
JAVA_INC=/usr/local/diablo-jdk1.5.0/include
JAVA_FLAGS="-I$JAVA_INC -I$JAVA_INC/linux -I$JAVA_INC/freebsd"
# Configure and build.
# $1: config flags
config()
{
(echo `date`; echo "run: $1: $dir") | tee CONFIGURATION
$d/../dist/configure $1 > config.OUT 2>&1
if test $? -ne 0; then
echo "$i: FAILED in configure"
return 1
fi
if `echo "$1" | grep disable-statistics > /dev/null`; then
echo '#define __TEST_DB_NO_STATISTICS 1' >> db_config.h
fi
(echo /^CFLAGS=/ &&
# Configure gcc to complain about everything, and make warnings fatal
# errors.
# TODO: This used to -Werror, but that fails regularly now :(
echo \
's/-c /-c -W -Wall -Wpointer-arith -Wmissing-prototypes /' &&
# Warnings are fatal errors, so don't set gcc warning flags for files
# where we can't avoid warnings.
echo '/^db_java_wrap.*: .*db_java_wrap.c$/' &&
echo '+1s/\$(CFLAGS)/-c \$(CPPFLAGS)/' &&
echo '/^tcl_db_pkg.*: .*tcl_db_pkg.c$/' &&
echo '+1s/\$(CFLAGS)/-c \$(CPPFLAGS)/' &&
echo w &&
echo q) | ed Makefile > /dev/null
# If we're compiling Java, we'll need to set up the path.
echo "$1" | grep enable-java > /dev/null
if test $? -eq 0; then
(echo /^CPPFLAGS=/ &&
echo "s;\$; $JAVA_FLAGS;" &&
echo w &&
echo q) | ed Makefile > /dev/null
fi
make > mklog 2>&1 && make ex_access >> mklog 2>&1
if test $? -ne 0; then
echo "$i: FAILED in make"
return 1
fi
(echo a; echo b; echo c) | ./ex_access > /dev/null 2>&1
return $?
}
# Run a test.
# $1: config flags
count=0
r()
{
count=$(expr $count + 1)
dir="$b.$count"
(rm -rf $dir && mkdir $dir && cd $dir && config "$1")
if test $? -eq 0; then
rm -rf $dir
else
echo "$1: FAILED to build"
fi
}
# Run through all of the standard single options.
s="\
--disable-cryptography \
--disable-hash \
--disable-largefile \
--disable-mutexsupport \
--disable-queue \
--disable-replication \
--disable-statistics \
--disable-verify \
--enable-compat185 \
--enable-debug \
--enable-debug_rop \
--enable-debug_wop \
--enable-diagnostic \
--enable-dump185 \
--enable-posixmutexes \
--enable-smallbuild \
--enable-umrw \
--with-mutex=x86/gcc-assembly \
--with-uniquename=__KEITH__"
for i in $s; do
r "$i --disable-shared"
done
# Build specific runs of interest.
r
r "--disable-static"
r "--enable-cxx"
r "--enable-java"
r "--with-tcl=/usr/local/lib/tcl8.4"
r "--enable-test --with-tcl=/usr/local/lib/tcl8.4"
r "--enable-cxx --enable-java --with-tcl=/usr/local/lib/tcl8.4"

35
dist/validate/s_chk_comma vendored Normal file
View file

@ -0,0 +1,35 @@
#!/bin/sh -
#
# $Id$
#
# Look for trailing commas in declarations. Some compilers can't handle:
# enum {
# foo,
# bar,
# };
# mar 2010 added -D_GNU_SOURCE to compile on linux blade server
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
s=$d/src
if cc -g -Wall -D_GNU_SOURCE $0.c -o t; then
:
else
echo "FAIL: unable to compile test program $0.c"
exit 1
fi
if ./t $s/*/*.[ch] $s/*/*.in; then
:
else
echo "FAIL: test program failed"
exit 1
fi
rm -rf t
exit 0

53
dist/validate/s_chk_comma.c vendored Normal file
View file

@ -0,0 +1,53 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2002, 2011 Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
chk(f)
char *f;
{
int ch, l, r;
if (freopen(f, "r", stdin) == NULL) {
fprintf(stderr, "%s: %s\n", f, strerror(errno));
exit(EXIT_FAILURE);
}
for (l = 1, r = 0; (ch = getchar()) != EOF;) {
if (ch != ',')
goto next;
do { ch = getchar(); } while (isblank(ch));
if (ch != '\n')
goto next;
++l;
do { ch = getchar(); } while (isblank(ch));
if (ch != '}')
goto next;
r = 1;
printf("%s: line %d\n", f, l);
next: if (ch == '\n')
++l;
}
return (r);
}
int
main(int argc, char *argv[])
{
int r;
for (r = 0; *++argv != NULL;)
if (chk(*argv))
r = 1;
return (r);
}

53
dist/validate/s_chk_copyright vendored Normal file
View file

@ -0,0 +1,53 @@
#!/bin/sh -
#
# $Id$
#
# Check all source files for proper copyright notices.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
t1=__1
t2=__2
# create regex for Copyright notice using current year
COPYEXP='Copyright.*'`date +%C%y`'.*affiliates'
echo $COPYEXP
(cd $d && find . -name '*.[chys]' -o -name '*.cpp' -o -name '*.tcl' \
-o -name '*.java' -o -name '*.cs' -o -name '*.hpp' \
-o -name '*.src' | xargs egrep -l $COPYEXP) > $t1
# use sed to remove the files we do not care about, these are the ones
# from 3rd parties that are included in our distribution
(cd $d && find . -name '*.[chys]' -o -name '*.cpp' -o -name '*.tcl' \
-o -name '*.java' -o -name '*.cs' -o -name '*.hpp') | tee /tmp/o |
sed -e '/crypto\//d' \
-e '/dbinc_auto\//d' \
-e '/lang\/csharp\/src\/Internal\//d'\
-e '/lang\/java\/src\/com\/sleepycat\/db\/internal\//d' \
-e '/lang\/sql\/generated\//d' \
-e '/db_csharp_wrap.c$/d' \
-e '/db_java_wrap.c$/d' \
-e '/perl\//d' \
-e '/sha1.c$/d' \
-e '/sleepycat\/asm\//d' \
-e '/sqlite\//d' \
-e '/test\/stl\//d' > $t2
if diff $t1 $t2 > /dev/null; then
exit 0
else
echo "<<< source tree >>> missing copyright notices"
diff $t1 $t2 | grep '>' | awk '{print $2}'
exit 1
fi
rm -f $t1 $t2
exit 0

124
dist/validate/s_chk_defines vendored Normal file
View file

@ -0,0 +1,124 @@
#!/bin/sh -
#
# $Id$
#
# Check to make sure that all #defines are actually used.
# Check to make sure that all #defines start in column 1.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
exitv=0
t1=__1
t2=__2
t3=__3
find $d -name '*.c' -o -name '*.cpp' |
sed -e '/\/php_db4\//d' \
-e '/\/sql\//d'|
xargs egrep '^[ ][ ]*#' > $t1
test -s $t1 && {
echo "FAIL: found #defines with leading white space:"
cat $t1
exit 1
}
egrep '^#define' $d/src/dbinc/*.h $d/src/dbinc/*.in |
sed -e '/db_185.in/d' -e '/queue.h/d' |
awk '{print $2}' |
sed -e '/^AI_CANONNAME/d' \
-e '/^AI_NUMERICHOST/d' \
-e '/^B_DELETE/d' \
-e '/^B_MAX/d' \
-e '/^CHECK_THREAD/d' \
-e '/^DB_BTREEOLDVER/d' \
-e '/^DB_DEGREE_2/d' \
-e '/^DB_HASHOLDVER/d' \
-e '/^DB_LOCKVERSION/d' \
-e '/^DB_LOG_PERM_42_44/d' \
-e '/^DB_LOG_RESEND_42_44/d' \
-e '/^DB_MAX_PAGES/d' \
-e '/^DB_PAGE_QUEUE_LEN/d' \
-e '/^DB_QAMOLDVER/d' \
-e '/^DB_RETURNS_A_KEY_HASH/d' \
-e '/^DB_SPARE_FLAG/d' \
-e '/^DB_TXNVERSION/d' \
-e '/^DB_UNUSED/d' \
-e '/^DEFINE_DB_CLASS/d' \
-e '/^FHASH/d' \
-e '/^HASH_UNUSED/d' \
-e '/^HPUX_MUTEX_PAD/d' \
-e '/^LOG_OP/d' \
-e '/^MAX_ID/d' \
-e '/^MAXHOSTNAMELEN/d' \
-e '/^MINFILL/d' \
-e '/^MUTEX_FIELDS/d' \
-e '/^MUTEX_LOCK_PARTITION/d' \
-e '/^MUTEX_UNLOCK_PARTITION/d' \
-e '/^NAME_TO_SEQUENCE/d' \
-e '/^NCACHED2X/d' \
-e '/^NCACHED30/d' \
-e '/^PAIR_MASK/d' \
-e '/^P_16_COPY/d' \
-e '/^P_32_COPY/d' \
-e '/^P_32_SWAP/d' \
-e '/^P_64_COPY/d' \
-e '/^P_64_SWAP/d' \
-e '/^P_TO_UINT16/d' \
-e '/^QPAGE_CHKSUM/d' \
-e '/^QPAGE_NORMAL/d' \
-e '/^QPAGE_SEC/d' \
-e '/^SIZEOF_PAGE/d' \
-e '/^TAILQ_/d' \
-e '/^UINT64_FMT/d' \
-e '/^UINT64_MAX/d' \
-e '/^VM_PAGESIZE/d' \
-e '/^WRAPPED_CLASS/d' \
-e '/^_WIN32_WINNT/d' \
-e '/^__BIT_TYPES_DEFINED__/d' \
-e '/^__DBC_INTERNAL/d' \
-e '/^__STDC__/d' \
-e '/^__lock_locker_hash/d' \
-e '/^i_/d' \
-e '/_H_/d' \
-e '/__DB_IMPORT/d' \
-e '/ERR_ORIGIN/d' \
-e '/LOG_DBT_SIZE/d' \
-e '/__mutex_timedlock/d' \
-e '/__mutex_tryrdlock/d' \
-e '/OP_MODE_SHIFT/d' \
-e '/OP_PAGE_MASK/d' \
-e '/PAIR_/d' \
-e '/PERFMON/d' \
-e '/WARNING_ORIGIN/d' \
-e '/STAT_DEC/d' \
-e '/STAT_SET/d' \
-e '/MUTEX_SET/d' \
-e '/XA.*/d' \
-e '/TM[EM_].*/d' \
-e '/MAX[BGI].*SIZE/d' \
-e 's/(.*//' | sort > $t1
find $d -name '*.c' -o -name '*.cpp' > $t2
for i in `cat $t1`; do
if egrep -w $i `cat $t2` > /dev/null; then
:;
else
f=`egrep -l "#define.*$i" $d/src/dbinc/*.h $d/src/dbinc/*.in |
sed 's;\.\.\/\.\.\/src\/dbinc/;;' | tr -s "[:space:]" " "`
echo "FAIL: $i: $f"
fi
done | sort -k 2 > $t3
test -s $t3 && {
cat $t3
echo "FAIL: found unused #defines"
exit 1
}
rm -f $t1 $t2 $t3
exit $exitv

34
dist/validate/s_chk_err vendored Normal file
View file

@ -0,0 +1,34 @@
#!/bin/sh -
#
# $Id$
#
# Check to make sure all of the error values have corresponding error
# message strings in db_strerror().
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
s=$d/src
t1=__1
t2=__2
egrep -- "define.*DB_.*-309" $s/dbinc/db.in | awk '{print $2}' > $t1
sed -e '/^db_strerror/,/^}/{' \
-e '/ case DB_/{' \
-e 's/:.*//' \
-e 's/.* //' \
-e p \
-e '}' \
-e '}' \
-e d \
< $s/common/db_err.c > $t2
cmp $t1 $t2 > /dev/null ||
(echo "<<< db.h >>> db_strerror" && diff $t1 $t2 && exit 1)
rm -f $t1 $t2
exit 0

89
dist/validate/s_chk_ext_method_calls vendored Normal file
View file

@ -0,0 +1,89 @@
#!/bin/sh -
#
# $Id: s_chk_ext_method_calls,v 0f73af5ae3da 2010/05/10 05:38:40 alexander $
#
# Check that DB doesn't call DB or DB_ENV methods internally.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
s=$d/src
t=__1
echo ========================================================
echo "Check that DB doesn't call DB or DB_ENV methods internally."
echo ========================================================
m=`grep '(\*[a-z][_a-z]*)' $s/dbinc/db.in |
sed -e 's/^[^(]*(\*//' \
-e 's/).*//' \
-e '/alt_close/d' \
-e '/am_bulk/d' \
-e '/am_close/d' \
-e '/am_del/d' \
-e '/am_destroy/d' \
-e '/am_get/d' \
-e '/am_put/d' \
-e '/am_remove/d' \
-e '/am_rename/d' \
-e '/am_writelock/d' \
-e '/app_dispatch/d' \
-e '/db_append_recno/d' \
-e '/db_errcall/d' \
-e '/db_event_func/d' \
-e '/db_feedback/d' \
-e '/db_free/d' \
-e '/db_malloc/d' \
-e '/db_paniccall/d' \
-e '/db_realloc/d' \
-e '/dbt_usercopy/d' \
-e '/dup_compare/d' \
-e '/s_callback/d' |
sort -u`
(cd $s && for i in $m; do
#echo "$i..." > /dev/stderr
egrep -- "->$i\(" */*.[ch]
done) |
sed \
-e '/Wrapper function for/d' \
-e '/\/db.h:/d' \
-e '/^[^:]*:[ ]*\*[ ]/d' \
-e '/^common\/db_getlong.c:/d' \
-e '/^common\/util_cache.c:/d' \
-e '/^common\/util_log.c:/d' \
-e '/^common\/util_sig.c:/d' \
-e '/^dbm\//d' \
-e '/^hsearch\//d' \
-e '/^mutex\/tm.c:/d' \
-e '/closeme->close() is a wrapper;/d' \
-e '/crypto.c.*db_cipher->close/d' \
-e '/db_err.c:.*dbenv->db_msgcall(dbenv, buf);/d' \
-e '/db_iface.c:.*(txn->commit(txn, nosync ? DB_TXN_NOSYNC : 0));/d' \
-e '/db_iface.c:.*if ((t_ret = txn->abort(txn)) != 0)/d' \
-e '/db_iface.c:.*return (dbenv->txn_begin(dbenv, NULL, txnidp, 0));/d' \
-e '/db_iface.c:.*return (dbp->get(dbp, txn, key, &data, flags));/d' \
-e '/dbenv->is_alive(/d' \
-e '/dbenv->thread_id(/d' \
-e '/dbenv->thread_id_string(/d' \
-e '/rep_util.c:.*ret = dbenv->rep_send(/d' \
-e '/test_mutex.c:/d' \
-e '/xa.c:/d' \
-e '/repmgr\/repmgr_net.c.*env->close()/d'\
-e '/repmgr\/repmgr_method.c.*DB_CHANNEL->send_request()/d' \
-e '/dbinc\/repmgr.h.*set_config()/d' \
-e '/db_vrfyutil.c:.*vdp->txn->commit/d' \
>$t
test -s $t && {
cat $t
echo "FAIL: found DB/DB_ENV method calls DB library."
exit 1
}
rm -f $t
exit 0

186
dist/validate/s_chk_flags vendored Normal file
View file

@ -0,0 +1,186 @@
#!/bin/sh -
#
# $Id$
#
# Check flag name-spaces.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
t1=__1
t2=__2
if cc -g -Wall $0.c -o t; then
:
else
echo "FAIL: unable to compile test program $0.c"
exit 1
fi
if ./t $d/*/*.[ch] $d/*/*.in > $t1; then
:
else
echo "FAIL: test program failed"
exit 1
fi
echo 'Checking "dbenv" variables with flags other than DB_ENV_XXX'
grep 'dbenv,' $t1 |
sed -e '/DB_ENV_/d' \
-e '/env_method.c.*, mapped_flags*)/d' \
-e '/env_region.c.*, flags_orig*)/d' \
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
echo 'Checking DB_ENV_XXX flags with variables other than "dbenv"'
grep 'DB_ENV_' $t1 |
sed -e '/dbenv,/d' \
-e '/(dbenv),/d' \
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
echo 'Checking "env" variables with flags other than ENV_XXX'
grep '[^b]env,' $t1 |
sed -e '/[^B]ENV_/d' \
-e '/env_method.c.*, mapped_flags*)/d' \
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
echo 'Checking ENV_XXX flags with variables other than "env"'
grep '[^A-Z_]ENV_' $t1 |
sed -e '/[^b]env,/d' \
-e '/(env),/d' \
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
echo 'Checking dbenv "verbose" field with flags other than DB_VERB_XXX'
grep -- 'dbenv->verbose,' $t1 |
sed -e '/DB_VERB_/d' \
-e '/env_method.c.*, which)/d' \
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
# there are a few exceptions in rep_util.c
echo 'Checking DB_VER_XXX flags with other than dbenv "verbose" field'
grep -- 'DB_VERB_' $t1 |
sed -e '/dbenv->verbose,/d' \
-e '/rep_util.c.*(verbflag/d' \
-e '/rep_util.c.*(tmp_verbose/d' \
-e '/rep_util.c.*(verbose/d' \
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
echo 'Checking "db" variables with flags other than DB_AM_XXX'
cp $t1 /tmp/_f
grep 'dbp,' $t1 |
sed -e '/DB_AM_/d' \
-e '/dbp, mapped_flag)/d' \
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
echo 'Checking DB_AM_XXX flags with variables other than "db"'
grep 'DB_AM_' $t1 |
sed \
-e '/(&db,/d' \
-e '/(db,/d' \
-e '/log_get.c:.*dbpp,/d' \
-e '/_method.c:.*outflagsp,/d' \
-e '/partition.c:.*pdbp,/d' \
-e '/rep_backup.c:.*->flags,/d' \
-e /'rep_backup.c:.*->db_flags,/d' \
-e '/db.c:.*save_flags,/d' \
-e '/((*[ ]*db_rep->rep_db)*,/d' \
-e '/((*[ ]*dbc)*->dbp,/d' \
-e '/((*[ ]*dbc_arg->dbp)*,/d' \
-e '/((*[ ]*dbp)*,/d' \
-e '/((*[ ]*dbp)*->s_primary,/d' \
-e '/((D),/d' \
-e '/((sdbp),/d' \
-e '/(fdbp,/d' \
-e '/(file_dbp,/d' \
-e '/(ldbp,/d' \
-e '/(msgfp->db_flags,/d' \
-e '/(mdbp,/d' \
-e '/(pdbp,/d' \
-e '/(pginfo, /d' \
-e '/(rfp->db_flags,/d' \
-e '/(sdbp,/d' \
-e '/(subdbp,/d' \
-e '/fop_util.c:.*(t2dbp,/d' \
-e '/fop_util.c:.*(tmpdbp,/d' \
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
echo 'Checking "dbc" variables flags with flags other than DBC_XXX'
echo Checking DBC flags...
cat $t1 |
grep 'dbc,' |
sed -e '/DBC_/d' \
-e '/db_cam.c:.*tmp_read_locking)/d'
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
echo 'Checking DBC_XXX flags with variables other than "dbc"'
grep 'DBC_' $t1 |
sed -e '/((*dbc)*,/d' \
-e '/(dbc_arg,/d' \
-e '/(dbc_c,/d' \
-e '/(dbc_n,/d' \
-e '/(dbc_orig,/d' \
-e '/(opd,/d' \
-e '/(pdbc,/d' \
-e '/[(*]put_state[p]*,/d' \
-e '/(sdbc,/d' \
-e '/partition.c:.*_dbc,/d' \
-e '/partition.c:.*_cursor,/d'
> $t2
[ -s $t2 ] && {
cat $t2
exit 1
}
echo Checking for bad use of macros...
egrep 'case .*F_SET\(|case .*F_CLR\(' $d/*/*.c > $t1
egrep 'for .*F_SET\(|for .*F_CLR\(' $d/*/*.c >> $t1
egrep 'if .*F_SET\(|if .*F_CLR\(' $d/*/*.c >> $t1
egrep 'switch .*F_SET\(|switch .*F_CLR\(' $d/*/*.c >> $t1
egrep 'while .*F_SET\(|while .*F_CLR\(' $d/*/*.c >> $t1
[ -s $t1 ] && {
echo 'if statement followed by non-test macro'
cat $t1
exit 1
}
rm -f $t1 $t2 ./t
exit 0

79
dist/validate/s_chk_flags.c vendored Normal file
View file

@ -0,0 +1,79 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2002, 2011 Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void
chk(f, str)
char *f, *str;
{
char *s;
int ch, l, ok, pc;
if (freopen(f, "r", stdin) == NULL) {
fprintf(stderr, "%s: %s\n", f, strerror(errno));
exit(EXIT_FAILURE);
}
for (l = 1, ok = 1, s = str; (ch = getchar()) != EOF;) {
if (ch == '\n')
++l;
if (!ok || ch != *s) {
s = str;
ok = !isalpha(ch) && !isdigit(ch) && ch != '_';
continue;
}
if (*++s != '\0')
continue;
/* Match. */
printf("%s: %d: %s", f, l, str);
for (pc = 1; (ch = getchar()) != EOF;) {
switch (ch) {
case '(':
++pc;
break;
case ')':
--pc;
break;
case '\n':
++l;
break;
}
if (ch == '\n')
putchar(' ');
else
putchar(ch);
if (pc <= 0) {
putchar('\n');
break;
}
}
s = str;
}
}
int
main(int argc, char *argv[])
{
int r;
for (r = 0; *++argv != NULL;) {
chk(*argv, "FLD_CLR(");
chk(*argv, "FLD_ISSET(");
chk(*argv, "FLD_SET(");
chk(*argv, "F_CLR(");
chk(*argv, "F_ISSET(");
chk(*argv, "F_SET(");
}
return (0);
}

46
dist/validate/s_chk_inclconfig vendored Normal file
View file

@ -0,0 +1,46 @@
#!/bin/sh -
#
# $Id$
#
# Check for inclusion of db_config.h after "const" or other includes.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
t1=__1
t2=__2
(cd $d && find . -name '*.[chys]' -o -name '*.cpp' |
xargs egrep -l '#include.*db_config.h') | tee /tmp/o |
sed -e '/dbdemo.c$/d' \
-e '/db_java_wrap.c$/d' \
-e '/test\/stl\/base\/test.h$/d' \
-e '/ex_apprec.c$/d' > $t1
(for i in `cat $t1`; do
egrep -w 'db_config.h|const' /dev/null $d/$i | head -1
done) > $t2
if egrep const $t2 > /dev/null; then
echo 'FAIL: found const before include of db_config.h'
egrep const $t2
exit 1
fi
:> $t2
for i in `cat $t1`; do
egrep -w '#include' /dev/null $d/$i | head -1 >> $t2
done
if egrep -v db_config.h $t2 > /dev/null; then
echo 'FAIL: found includes before include of db_config.h'
egrep -v db_config.h $t2
exit 1
fi
rm -f $t1 $t2
exit 0

42
dist/validate/s_chk_include vendored Normal file
View file

@ -0,0 +1,42 @@
#!/bin/sh -
#
# $Id$
#
# Check for inclusion of files already included in db_int.h.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
s=$d/src
t1=__1
t2=__2
egrep -- '#include[ ]' $s/dbinc/db_int.in |
sed -e '/[ ]db\.h'/d \
-e 's/^#include.//' \
-e 's/[<>"]//g' \
-e 's/[ ].*//' > $t1
for i in `cat $t1`; do
(cd $s && egrep "^#include[ ].*[<\"]$i[>\"]" */*.[ch])
done |
sed -e '/^build/d' \
-e '/^clib\/getopt.c/d' \
-e '/^dbinc\/mutex_int.h.*<sys\/mman.h>/d' \
-e '/^dbinc\/win_db.h:/d' \
-e '/^mutex\/tm.c/d' \
-e '/^os\/os_map.c.*<sys\/mman.h>/d' \
> $t2
[ -s $t2 ] && {
echo 'FAIL: found extraneous includes in the source'
cat $t2
exit 1
}
rm -f $t1 $t2
exit 0

270
dist/validate/s_chk_logverify vendored Normal file
View file

@ -0,0 +1,270 @@
#!/bin/sh -
#
# $Id: s_chk_logverify,v 0f73af5ae3da 2010/05/10 05:38:40 alexander $
#
# Verify that the log verify code works as expected.
# Run from build_unix dir on linux blade server
d=..
[ -f $d/LICENSE ] || {
echo 'FAIL: Test must be run from scr directory.'
exit 1
}
b=./tmp_build/
s=$d/src
mkdir -p $b
opts="--disable-shared --enable-stl"
echo "Building DB library, this can take a while."
(cd $b && ../../dist/configure $opts > /dev/null && make > /dev/null) || {
echo 'FAIL: unable to build libdb.a'
exit 1
}
# if compile on linux blade server, add -D_GNU_SOURCE -pthread on cc
CINC="-I$b -I$s"
[ `uname` = "Linux" ] && CINC=" -D_GNU_SOURCE $CINC -pthread"
if cc -g -Wall $CINC $0.c $b/libdb.a -o t; then
:
else
echo "FAIL: unable to compile test program $0.c"
exit 1
fi
if ./t; then
:
else
echo "FAIL: test program failed"
exit 1
fi
rm -fr TESTDIR
mkdir -p TESTDIR
resdir=`pwd`/TESTDIR
# Running log verify internal functions test.
./t
cd $b
lv=./db_log_verify
# Running db_perf tests.
make db_perf
cmd=./db_perf
configs=../$d/test/perf/configs
echo Sanity Tests
echo "**** db_perf -c $configs/sanity_btree.conf ****"
rm -rf TESTDIR
mkdir TESTDIR
$cmd -I -hTESTDIR -c $configs/sanity_btree.conf 2>&1 > TESTDIR/OUTPUT
$cmd -hTESTDIR -c $configs/sanity_btree.conf 2>&1 >> TESTDIR/OUTPUT
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.1
echo "**** db_perf -c $configs/sanity_hash.conf ****"
rm -rf TESTDIR
mkdir TESTDIR
$cmd -I -hTESTDIR -c $configs/sanity_hash.conf 2>&1 > TESTDIR/OUTPUT
$cmd -hTESTDIR -c $configs/sanity_hash.conf 2>&1 >> TESTDIR/OUTPUT
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.2
echo Archive Tests
echo "**** db_perf -c $configs/archive_fatal_hash.conf -C ****"
rm -rf TESTDIR TESTDIR.A
rm -f logverify.ERR
mkdir TESTDIR TESTDIR.A
$cmd -I -hTESTDIR -c $configs/archive_fatal_hash.conf 2>&1 > TESTDIR/OUTPUT
$cmd -C -hTESTDIR -c $configs/archive_fatal_hash.conf 2>&1 >> TESTDIR/OUTPUT
$lv -hTESTDIR 2>logverify.ERR >> TESTDIR/OUTPUT || {
grep DB_NOTFOUND logverify.ERR >/dev/null 2>/dev/null || \
echo "ERROR: expect DB_NOTFOUND in the error output"
}
cp TESTDIR/OUTPUT $resdir/OUTPUT.3
echo "**** db_perf -c $configs/archive_fatal_btree.conf -C ****"
rm -rf TESTDIR TESTDIR.A
rm -f logverify.ERR
mkdir TESTDIR TESTDIR.A
$cmd -I -hTESTDIR -c $configs/archive_fatal_btree.conf 2>&1 > TESTDIR/OUTPUT
$cmd -C -hTESTDIR -c $configs/archive_fatal_btree.conf 2>&1 >> TESTDIR/OUTPUT
$lv -hTESTDIR 2>logverify.ERR >> TESTDIR/OUTPUT || {
grep DB_NOTFOUND logverify.ERR >/dev/null 2>/dev/null || \
echo "ERROR: expect DB_NOTFOUND in the error output"
}
cp TESTDIR/OUTPUT $resdir/OUTPUT.4
echo "**** db_perf -c $configs/archive_btree.conf -C ****"
rm -rf TESTDIR TESTDIR.A
mkdir TESTDIR TESTDIR.A
$cmd -I -hTESTDIR -c $configs/archive_btree.conf 2>&1 > TESTDIR/OUTPUT
$cmd -C -hTESTDIR -c $configs/archive_btree.conf 2>&1 >> TESTDIR/OUTPUT
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.5
echo Crash Tests
echo "**** db_perf -c $configs/crash_test_1.conf ****"
rm -rf TESTDIR TESTDIR.A
mkdir TESTDIR TESTDIR.A
$cmd -I -hTESTDIR -c $configs/crash_test_1.conf 2>&1 > TESTDIR/OUTPUT
$cmd -hTESTDIR -c $configs/crash_test_1.conf 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.6
echo "**** db_perf -c $configs/crash_test_2.conf ****"
rm -rf TESTDIR TESTDIR.A
rm -f logverify.ERR
mkdir TESTDIR TESTDIR.A
$cmd -I -hTESTDIR -c $configs/crash_test_2.conf 2>&1 > TESTDIR/OUTPUT
$cmd -hTESTDIR -c $configs/crash_test_2.conf 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -hTESTDIR 2>logverify.ERR >> TESTDIR/OUTPUT || {
grep DB_NOTFOUND logverify.ERR >/dev/null 2>/dev/null || \
echo "ERROR: expect DB_NOTFOUND in the error output"
}
cp TESTDIR/OUTPUT $resdir/OUTPUT.7
echo "**** db_perf -c $configs/crash_test_3.conf ****"
rm -rf TESTDIR TESTDIR.A
mkdir TESTDIR TESTDIR.A
$cmd -I -hTESTDIR -c $configs/crash_test_3.conf 2>&1 > TESTDIR/OUTPUT
$cmd -hTESTDIR -c $configs/crash_test_3.conf 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.8
echo "**** db_perf -S 2 -c $configs/crash_test_1.conf ****"
rm -rf TESTDIR TESTDIR.A
mkdir TESTDIR TESTDIR.A
$cmd -I -hTESTDIR -S 2 -c $configs/crash_test_1.conf 2>&1 > TESTDIR/OUTPUT
$cmd -hTESTDIR -S 2 -c $configs/crash_test_1.conf 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.9
echo "**** db_perf -S 1 -c $configs/crash_test_4.conf ****"
rm -rf TESTDIR TESTDIR.A
mkdir TESTDIR TESTDIR.A
$cmd -I -hTESTDIR -S 1 -c $configs/crash_test_4.conf 2>&1 > TESTDIR/OUTPUT
$cmd -hTESTDIR -S 1 -c $configs/crash_test_4.conf 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.10
# Running dbs tests.
cmd=./dbs
make dbs
echo Sanity Tests
echo "************* dbs *******************"
rm -rf TESTDIR
mkdir TESTDIR
$cmd -I -hTESTDIR 2>&1 > TESTDIR/OUTPUT
$cmd -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.11
echo "************* dbs -t btree *******************"
rm -rf TESTDIR
mkdir TESTDIR
$cmd -I -tbtree -hTESTDIR 2>&1 > TESTDIR/OUTPUT
$cmd -tbtree -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.12
echo Archive Tests
echo "************* dbs -CA *******************"
rm -rf TESTDIR T2
mkdir TESTDIR T2
$cmd -I -hTESTDIR 2>&1 > TESTDIR/OUTPUT
$cmd -CA T2 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.13
echo "************* dbs -CA -tbtree *******************"
rm -rf TESTDIR T2
mkdir TESTDIR T2
$cmd -I -tbtree -hTESTDIR 2>&1 > TESTDIR/OUTPUT
$cmd -CA T2 -tbtree -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.14
echo "************* dbs -Ca -tbtree *******************"
rm -rf TESTDIR T2
mkdir TESTDIR T2
$cmd -I -tbtree -c 10 2>&1 > TESTDIR/OUTPUT
$cmd -Ca T2 -tbtree -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.15
echo Crash Tests
echo "************ dbs -K30 -a T2 -tbtree -c 10 -k 4 -V"
rm -rf TESTDIR T2
mkdir TESTDIR T2
$cmd -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
$cmd -K30 -a T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.16
echo "************ dbs -K60 -A T2 -tbtree -c 10 -k 4 -V"
rm -rf TESTDIR T2
mkdir TESTDIR T2
$cmd -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
$cmd -K60 -A T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.17
echo "************ dbs -K180 -a T2 -tbtree -c 10 -k 4 -V"
rm -rf TESTDIR T2
mkdir TESTDIR T2
$cmd -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
$cmd -K180 -a T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.18
echo "************ dbs -s 2 -K30 -a T2 -tbtree -c 10 -k 4 -V"
rm -rf TESTDIR T2
mkdir TESTDIR T2
$cmd -s 2 -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
$cmd -s 2 -K30 -A T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.19
echo "************ dbs -s 1 -K60 -a T2 -tbtree -c 10 -k 4 -V"
rm -rf TESTDIR T2
mkdir TESTDIR T2
$cmd -s 1 -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
$cmd -s 1 -K60 -a T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
cp TESTDIR/OUTPUT $resdir/OUTPUT.20
# Running test_dbstl tests.
make test_dbstl
./test_dbstl -I -s b -m t -t a -T 200 -k 50 -l 100 -c 33554432
$lv -h dbenv
./test_dbstl -I -s h -m t -t e -T 200 -k 50 -l 100 -c 33554432
$lv -h dbenv
./test_dbstl -I -s b -m t -t e -T 200 -k 50 -l 100 -c 33554432 -M
$lv -h dbenv
./test_dbstl -I -s h -m t -t a -T 200 -k 50 -l 100 -c 33554432 -M
$lv -h dbenv

267
dist/validate/s_chk_logverify.c vendored Normal file
View file

@ -0,0 +1,267 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2009, 2011 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
#include "db_config.h"
#include "db_int.h"
#include "db.h"
#include "dbinc/log.h"
#include "dbinc/log_verify.h"
static int put_get_cmp_ckp __P((DB_LOG_VRFY_INFO *, VRFY_CKP_INFO *,
DB_LSN));
static int put_get_cmp_ts __P((DB_LOG_VRFY_INFO *, VRFY_TIMESTAMP_INFO *,
DB_LSN));
static int put_get_cmp_freg __P((DB_LOG_VRFY_INFO *, VRFY_FILEREG_INFO *,
const DBT *));
static int put_get_cmp __P((DB_LOG_VRFY_INFO *, VRFY_TXN_INFO *, u_int32_t));
static int dbt_cmp __P((const DBT *, const DBT *));
static int dbtarr_cmp __P((const DBT *, const DBT *, u_int32_t));
/*
* __rem_last_recycle_lsn , clear_fileups __put_filelife, __del_filelife
* __get_filelife __get_filereg_by_dbregid __add_dbregid __get_last_ckp_info
* __get_latest_timestamp_info _find_lsnrg_by_timerg __add_txnrange
* __get_aborttxn __txn_started __add_page_to_txn __del_txn_pages
*/
int
main(argc, argv)
int argc;
char **argv;
{
int i, ret;
DB_LOG_VERIFY_CONFIG cfg;
DB_LOG_VRFY_INFO *lvinfop;
VRFY_TXN_INFO txninfo;
VRFY_FILEREG_INFO freginfo;
VRFY_CKP_INFO ckpinfo;
VRFY_TIMESTAMP_INFO tsinfo;
DB_LSN rlsn;
char *buf;
u_int32_t bufsz;
DBT fid;
DB_THREAD_INFO *ip;
DB_ENV *dbenv;
memset(&cfg, 0, sizeof(cfg));
buf = malloc(bufsz = 2048);// trash bytes to make DBT fileids.
cfg.temp_envhome = NULL;
cfg.cachesize = 8 * 1024 * 1024;
lvinfop = NULL;
memset(&txninfo, 0, sizeof(txninfo));
memset(&freginfo, 0, sizeof(freginfo));
memset(&ckpinfo, 0, sizeof(ckpinfo));
memset(&tsinfo, 0, sizeof(tsinfo));
memset(&fid, 0, sizeof(fid));
db_env_create(&dbenv, 0);
dbenv->open(dbenv, NULL, DB_CREATE | DB_INIT_MPOOL, 0644);
ENV_ENTER(dbenv->env, ip);
if (__create_log_vrfy_info(&cfg, &lvinfop, ip))
return -1;
txninfo.txnid = 80000001;
rlsn.file = 1;
put_get_cmp(lvinfop, &txninfo, txninfo.txnid);
for (i = 1000; i <= 2000; i += 100) {
rlsn.offset = i;
if ((ret = __add_recycle_lsn_range(lvinfop, &rlsn, 80000000, 80000300)))
goto err;
if ((ret = put_get_cmp(lvinfop, &txninfo, txninfo.txnid)))
goto err;
if (i % 200) {
fid.data = buf + abs(rand()) % (bufsz / 2);
fid.size = (char *)fid.data - buf;
if ((ret = __add_file_updated(&txninfo, &fid, i)))
goto err;
}
if ((i % 200 == 0) && ((ret = __del_file_updated(&txninfo, &fid))))
goto err;
if ((ret = put_get_cmp(lvinfop, &txninfo, txninfo.txnid)))
goto err;
}
freginfo.fileid = fid;
freginfo.fname = "mydb.db";
if ((ret = put_get_cmp_freg(lvinfop, &freginfo, &freginfo.fileid)))
goto err;
ckpinfo.lsn.file = 2;
ckpinfo.lsn.offset = 3201;
ckpinfo.ckplsn.file = 2;
ckpinfo.ckplsn.offset = 2824;
if ((ret = put_get_cmp_ckp(lvinfop, &ckpinfo, ckpinfo.lsn)))
goto err;
tsinfo.lsn.file = 1;
tsinfo.lsn.offset = 829013;
tsinfo.timestamp = time(NULL);
tsinfo.logtype = 123;
if ((ret = put_get_cmp_ts(lvinfop, &tsinfo, tsinfo.lsn)))
goto err;
err:
__destroy_log_vrfy_info(lvinfop);
ENV_LEAVE(dbenv->env, ip);
dbenv->close(dbenv, 0);
return ret;
}
static int
put_get_cmp_ckp(lvinfop, ckp, lsn)
DB_LOG_VRFY_INFO *lvinfop;
VRFY_CKP_INFO *ckp;
DB_LSN lsn;
{
int ret;
VRFY_CKP_INFO *ckppp;
ckppp = NULL;
if ((ret = __put_ckp_info(lvinfop, ckp)))
goto err;
if ((ret = __get_ckp_info(lvinfop, lsn, &ckppp)))
goto err;
if (memcmp(ckp, ckppp, sizeof(VRFY_CKP_INFO))) {
fprintf(stderr,
"\n__get_ckp_info got different ckp info than the one put by __put_ckp_info");
goto err;
}
err:
if (ckppp)
__os_free(NULL, ckppp);
if (ret)
printf("\nError in put_get_cmp_ckp");
return ret;
}
static int
put_get_cmp_ts(lvinfop, ts, lsn)
DB_LOG_VRFY_INFO *lvinfop;
VRFY_TIMESTAMP_INFO *ts;
DB_LSN lsn;
{
int ret;
VRFY_TIMESTAMP_INFO *tsp;
tsp = NULL;
if ((ret = __put_timestamp_info(lvinfop, ts)))
goto err;
if ((ret = __get_timestamp_info(lvinfop, lsn, &tsp)))
goto err;
if (memcmp(ts, tsp, sizeof(VRFY_TIMESTAMP_INFO))) {
fprintf(stderr,
"\n__get_timestamp_info got different timestamp info than the one put by __put_timestamp_info");
goto err;
}
err:
if (tsp)
__os_free(NULL, tsp);
if (ret)
printf("\nError in put_get_cmp_ts");
return ret;
}
static int
put_get_cmp_freg(lvinfop, freg, fid)
DB_LOG_VRFY_INFO *lvinfop;
VRFY_FILEREG_INFO *freg;
const DBT *fid;
{
int ret;
VRFY_FILEREG_INFO *freginfop;
freginfop = NULL;
if ((ret = __put_filereg_info(lvinfop, freg)))
goto err;
if ((ret = __get_filereg_info(lvinfop, fid, &freginfop)))
goto err;
if (memcmp(freg, freginfop, FILE_REG_INFO_FIXSIZE) ||
dbt_cmp(&(freg->fileid), &(freginfop->fileid)) ||
strcmp(freg->fname, freginfop->fname)) {
fprintf(stderr,
"\n__get_filereg_info got different filereg info than the one put by __put_filereg_info");
goto err;
}
err:
if (freginfop)
__free_filereg_info(freginfop);
if (ret)
printf("\nError in put_get_cmp_freg");
return ret;
}
static int
dbt_cmp(d1, d2)
const DBT *d1;
const DBT *d2;
{
int ret;
if ((ret = d1->size - d2->size))
return ret;
if ((ret = memcmp(d1->data, d2->data, d1->size)))
return ret;
return 0;
}
static int
dbtarr_cmp(a1, a2, len)
const DBT *a1;
const DBT *a2;
u_int32_t len;
{
int i, ret;
for (i = 0; i < len; i++) {
if ((ret = a1[i].size - a2[i].size))
return ret;
if ((ret = memcmp(a1[i].data, a2[i].data, a1[i].size)))
return ret;
}
return 0;
}
static int
put_get_cmp(lvinfop, txninfo, tid)
DB_LOG_VRFY_INFO *lvinfop;
VRFY_TXN_INFO *txninfo;
u_int32_t tid;
{
int ret;
VRFY_TXN_INFO *txninfop;
txninfop = NULL;
if ((ret = __put_txn_vrfy_info(lvinfop, txninfo)))
goto err;
if ((ret = __get_txn_vrfy_info(lvinfop, tid, &txninfop)))
goto err;
if (memcmp(txninfo, txninfop, TXN_VERIFY_INFO_FIXSIZE) ||
memcmp(txninfo->recycle_lsns, txninfop->recycle_lsns,
sizeof(DB_LSN) * txninfo->num_recycle) ||
dbtarr_cmp(txninfo->fileups, txninfop->fileups,
txninfop->filenum)) {
fprintf(stderr,
"\n__get_txn_vrfy_info got different txinfo than the one put by __put_txn_vrfy_info");
goto err;
}
err:
if (txninfop)
__free_txninfo(txninfop);
if (ret)
printf("\nError in put_get_cmp");
return ret;
}

60
dist/validate/s_chk_message_id vendored Normal file
View file

@ -0,0 +1,60 @@
#!/bin/sh -
#
# $Id$
#
# Check ID generated for globalization support.
# TODO: Verify the positional parameters (like "%d") in the two strings
# to the macro.
# Get the list of all message ID
MSG_DIR="../../src/ ../../util/ ../../lang/dbm/"
grep -E "DB_STR\([^ ,]*" $MSG_DIR -r -h -o | sed "s/\"//g" | \
sed "s/DB_STR(//g" > msg_id_unsorted
grep -E "DB_STR_A\([^ ,]*" $MSG_DIR -r -h -o | sed "s/\"//g" | \
sed "s/DB_STR_A(//g" >> msg_id_unsorted
sort msg_id_unsorted > msg_id_list
rm msg_id_unsorted
maxline=`cat msg_id_list | wc -l`
# The exception for duplicate messages
rep_dup_msg_id=`grep -E "\"[0-9]{4}" -r ../../dist/gen_msg.awk -o | \
sed "s/\"//g"`
lastnum=""
for (( i = 1; i <= $maxline ; i++ ))
do
curnum=`sed -n -e $i"p" msg_id_list`
# "DB_STR(id" and "DB_STR_A(id" are from macros defination,
# should not be regarded as invalid message id.
if [ "$curnum" == "id" ]; then
continue
fi
# The message id should be 4 digit number.
if [ `echo $curnum | wc -c` -ne 5 ]; then
echo "[ERROR] size of message id should be 4: $curnum"
exit 1
fi
if [[ ! -z $(echo $curnum | sed 's/[0-9]//g') ]]; then
echo "[ERROR] message id should be digit number only: $curnum"
exit 1
fi
# There shouldn't be duplicate message id.
if [ "$curnum" == "$lastnum" ]; then
if [ "$curnum" == "$rep_dup_msg_id" ]; then
echo "[EXPECTED] duplicate message id: $curnum"
else
echo "[ERROR] duplicate message id: $curnum"
exit 1
fi
fi
lastnum=$curnum
done
rm -f msg_id_list
exit 0

36
dist/validate/s_chk_mutex_print vendored Normal file
View file

@ -0,0 +1,36 @@
#!/bin/sh -
#
# $Id$
#
# Check to make sure __mutex_print_id knows about all of the mutex types.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
s=$d/src
t1=__1
t2=__2
egrep 'case MTX_.*return' $s/mutex/mut_stat.c |
sed -e 's/.*case //' \
-e 's/:.*//' |
sort > $t1
egrep '#define.MTX_' $s/dbinc/mutex.h |
sed -e 's/#define.//' \
-e 's/ .*//' \
-e '/MTX_MAX_ENTRY/d' |
sort > $t2
cmp $t1 $t2 > /dev/null || {
echo "<<< mutex/mut_stat.c >>> dbinc/mutex.h"
diff $t1 $t2
exit 1
}
rm -f $t1 $t2
exit 0

116
dist/validate/s_chk_newline vendored Normal file
View file

@ -0,0 +1,116 @@
#!/bin/sh -
#
# $Id$
#
# Check to make sure that there are no trailing newlines in __db_err calls.
d=../..
[ -f $d/LICENSE ] || {
echo "FAIL: chk.nl can't find the source directory."
exit 1
}
cat << END_OF_CODE > t.c
#include <sys/types.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
int chk(FILE *, char *);
int
main(argc, argv)
int argc;
char *argv[];
{
FILE *fp;
int exitv;
for (exitv = 0; *++argv != NULL;) {
if ((fp = fopen(*argv, "r")) == NULL) {
fprintf(stderr, "%s: %s\n", *argv, strerror(errno));
return (1);
}
if (chk(fp, *argv))
exitv = 1;
(void)fclose(fp);
}
return (exitv);
}
int
chk(fp, name)
FILE *fp;
char *name;
{
int ch, exitv, line, q;
exitv = 0;
for (ch = 'a', line = 1;;) {
if ((ch = getc(fp)) == EOF)
return (exitv);
if (ch == '\n') {
++line;
continue;
}
if (!isspace(ch)) continue;
if ((ch = getc(fp)) != '_') continue;
if ((ch = getc(fp)) != '_') continue;
if ((ch = getc(fp)) != 'd') continue;
if ((ch = getc(fp)) != 'b') continue;
if ((ch = getc(fp)) != '_') continue;
if ((ch = getc(fp)) != 'e') continue;
if ((ch = getc(fp)) != 'r') continue;
if ((ch = getc(fp)) != 'r') continue;
if ((ch = getc(fp)) != '(') continue;
while ((ch = getc(fp)) != '"') {
if (ch == EOF)
return (exitv);
if (ch == '\n')
++line;
}
while ((ch = getc(fp)) != '"')
switch (ch) {
case EOF:
return (exitv);
case '\\n':
++line;
break;
case '.':
if ((ch = getc(fp)) != '"')
ungetc(ch, fp);
else {
fprintf(stderr,
"%s: <period> at line %d\n", name, line);
exitv = 1;
}
break;
case '\\\\':
if ((ch = getc(fp)) != 'n')
ungetc(ch, fp);
else if ((ch = getc(fp)) != '"')
ungetc(ch, fp);
else {
fprintf(stderr,
"%s: <newline> at line %d\n", name, line);
exitv = 1;
}
break;
}
}
return (exitv);
}
END_OF_CODE
cc t.c -o t
if ./t $d/*/*/*.[ch] $d/*/*/*.cpp $d/*/*/*.in ; then
:
else
echo "FAIL: found __db_err calls ending with periods/newlines."
exit 1
fi
rm t t.c
exit 0

66
dist/validate/s_chk_offt vendored Normal file
View file

@ -0,0 +1,66 @@
#!/bin/sh -
#
# $Id: s_chk_offt,v 0f73af5ae3da 2010/05/10 05:38:40 alexander $
#
# Make sure that no off_t's have snuck into the release.
# off_t check is done at runtime in env_sig.c We add a declaration for
# off_t to db.h, so it is always guaranteed to be available.
# MJC:We add a declaration for off_t to db.h, so it is always guaranteed to be
# available. There are already many many cases where data structures are
# different sizes on 64-bit systems than 32-bit systems (we have a runtime
# check for that in env_sig.c). Test is really obsolete.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
t=__1
egrep -w off_t $d/src/*/*.[ch] $d/util/*.[ch] $d/src/*/*.in |
sed -e "/#undef off_t/d" \
-e "/build_wince\//d" \
-e "/build_windows\//d" \
-e "/db_env_set_func_ftruncate/d" \
-e "/db_env_set_func_pread/d" \
-e "/db_env_set_func_pwrite/d" \
-e "/db_env_set_func_seek/d" \
-e "/env_register.c/d" \
-e "/j_ftruncate/d" \
-e "/j_pread/d" \
-e "/j_pwrite/d" \
-e "/j_seek/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 "/mutex\/tm.c:/d" \
-e "/off_t because its size depends on/d" \
-e "/os_ext.h/d" \
-e "/os.h/d" \
-e "/os_flock.c/d" \
-e "/rep.h/d" \
-e "/zerofill.c:.*stat_offset/d" \
-e "/zerofill.c:.*write_offset/d" \
-e "/os_map.c:.*(off_t)0))/d" \
-e "/os_method.c/d" \
-e "/os_rw.c:/d" \
-e "/os_seek.c:.*off_t offset;/d" \
-e "/os_seek.c:.*offset = /d" \
-e "/os_seek.c:.*off_t/d" \
-e "/os_truncate.c:.*off_t offset;/d" \
-e "/os_truncate.c:.*off_t stat_offset;/d" \
-e "/os_truncate.c:.*offset = /d" \
-e "/test_perf\/perf_misc.c:/d" \
-e "/test_server\/dbs.c:/d" \
-e "/test_vxworks\/vx_mutex.c:/d" > $t
test -s $t && {
cat $t
echo "FAIL: found questionable off_t usage"
exit 1
}
rm -f $t
exit 0

30
dist/validate/s_chk_osdir vendored Normal file
View file

@ -0,0 +1,30 @@
#!/bin/sh -
#
# $Id$
#
# Check to make sure the @OSDIR@ entries in the Makefile are correct.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
s=$d/src
t1=__1
t2=__2
egrep '/@OSDIR@/' $d/dist/Makefile.in | sed -e 's/@.*/.c/' > $t1
(cd $s/os_windows && ls os_*.c) > $t2
cmp $t1 $t2 || {
echo "Makefile @OSDIR@ mismatch with os_windows files"
echo "<<< Makefile >>> os_windows"
diff $t1 $t2
exit 1
}
rm -f $t1 $t2
exit 0

46
dist/validate/s_chk_proto vendored Normal file
View file

@ -0,0 +1,46 @@
#!/bin/sh -
#
# $Id$
#
# Check to make sure that prototypes are actually needed.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
t1=__1
t2=__2
t3=__3
egrep '__P' $d/src/dbinc_auto/*.h |
sed -e 's/[ ][ ]*__P.*//' \
-e 's/^.*[ *]//' \
-e 's/HANDLER)/HANDLER/' \
-e '/__db_cprint/d' \
-e '/__db_lprint/d' \
-e '/__db_noop_log/d' \
-e '/__db_prnpage/d' \
-e '/__db_txnlist_print/d' \
-e '/__db_util_arg/d' \
-e '/__ham_func2/d' \
-e '/__ham_func3/d' \
-e '/_print$/d' \
-e '/_read$/d' > $t1
find $d -name '*.in' -o -name '*.[ch]' -o -name '*.cpp' > $t2
for i in `cat $t1`; do
c=$(egrep -Hlw $i $(cat $t2) | wc -l)
echo "$i: $c"
done | egrep ' 1$' > $t3
test -s $t3 && {
cat $t3
echo "FAIL: found unnecessary prototypes."
exit 1
}
rm -f $t1 $t2 $t3
exit 0

189
dist/validate/s_chk_pubdef vendored Normal file
View file

@ -0,0 +1,189 @@
#!/bin/sh -
#
# Reconcile the list of public defines with the man pages and the Java files.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
docs=$d/docs_src
p=$d/dist/pubdef.in
exitv=0
# remove m4 doc tests, m4 has been removed for 4.8
# TODO: add test for csharp const
#cat <<END_OF_TEXT
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#Check that pubdef.in has everything listed in m4.links.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#END_OF_TEXT
#f=$docs/m4/m4.links
#sed -n \
# -e 's/^\$1, \(DB_[^,]*\).*/\1/p' \
# -e d < $f |
#while read name; do
# if `egrep -w "$name" $p > /dev/null`; then
# :
# else
# echo "$f: $name is missing from $p"
# exitv=1
# fi
#done
#cat <<END_OF_TEXT
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#Check that m4.links has everything listed in pubdef.in.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#END_OF_TEXT
#f=$docs/m4/m4.links
#sed '/^#/d' $p |
#while read name isdoc isinc isjava; do
# if `egrep -w "^.1, $name" $f > /dev/null`; then
# [ "X$isdoc" != "XD" ] && {
# echo "$name should not appear in $f"
# exitv=1
# }
# else
# [ "X$isdoc" = "XD" ] && {
# echo "$name does not appear in $f"
# exitv=1;
# }
# fi
#done
cat <<END_OF_TEXT
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Check that pubdef.in has everything listed in db.in plus api_flags.in.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
END_OF_TEXT
cat $d/src/dbinc/db.in $d/src/dbinc_auto/api_flags.in | sed -n \
-e 's/^#.*[ ]\(DB_[A-Z_0-9][A-Z_0-9]*\).*/\1/p' \
-e 's/[ ]\(DB_[A-Z_]*\)=[0-9].*/\1/p' \
-e d |
while read name; do
if `egrep -w "$name" $p > /dev/null`; then
:
else
echo "db.in/api_flags.in: $name is missing from $p"
exitv=1
fi
done
cat <<END_OF_TEXT
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Check that api_flags.in plus db.in has everything listed in pubdef.in.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
END_OF_TEXT
sed '/^#/d' $p |
while read name isdoc isinc isjava iscsharp; do
if `egrep -w "^#.*[ ]$name|[ ]$name=[0-9][0-9]*" \
$d/src/dbinc/db.in $d/src/dbinc_auto/api_flags.in > /dev/null`; then
[ "X$isinc" != "XI" ] && {
echo "$name should not appear in db.in/api_flags.in"
exitv=1
}
else
[ "X$isinc" = "XI" ] && {
echo "$name does not appear in db.in/api_flags.in"
exitv=1
}
fi
done
cat <<END_OF_TEXT
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Check that pubdef.in has everything listed in DbConstants.java.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
END_OF_TEXT
j=$d/lang/java/src/com/sleepycat/db
f=$j/internal/DbConstants.java
sed -n -e 's/.*int[ ]\([^ ]*\).*;/\1/p' < $f |
while read name; do
if `egrep -w "$name" $p > /dev/null`; then
:
else
echo "$f: $name is missing from $p"
exitv=1
fi
done
cat <<END_OF_TEXT
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Check that DbConstants.java has everything listed in pubdef.in.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
END_OF_TEXT
f=$j/internal/DbConstants.java
sed '/^#/d' $p |
while read name isdoc isinc isjava iscsharp; do
if `egrep -w "int[ ]$name =" $f > /dev/null`; then
[ "X$isjava" != "XJ" ] && {
echo "$name should not appear in $f"
exitv=1
}
else
[ "X$isjava" = "XJ" ] && {
echo "$name does not appear in $f"
exitv=1
}
fi
done
cat <<END_OF_TEXT
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Check that all constants in pubdef.in are wrapped by the Java API.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
END_OF_TEXT
#Strip out Javadoc comments
t=__1
cat $j/*.java $j/internal/Db.java $j/internal/DbEnv.java \
$j/internal/db_javaJNI.java | sed '/\/\*\*/,/\*\// d' > $t
sed '/^#/d' $p |
while read name isdoc isinc isjava iscsharp; do
if `egrep -w "$name" $t > /dev/null`; then
[ "X$isjava" != "XJ" ] && {
echo "$name should not appear in the Java API"
exitv=1
}
else
[ "X$isjava" = "XJ" ] && {
echo "$name does not appear in the Java API"
exitv=1
}
fi
done
cat <<END_OF_TEXT
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Check that all constants in pubdef.in are wrapped by the Java native layer.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
END_OF_TEXT
sed '/^#/d' $p |
while read name isdoc isinc isjava iscsharp; do
if `egrep -w "$name" $d/lang/java/libdb_java/db_java_wrap.c > /dev/null`; then
[ "X$isjava" != "XN" ] && [ "X$isjava" != "XJ" ] && {
echo "$name should not appear in the Java native layer"
exitv=1
}
else
[ "X$isjava" = "XN" ] && {
echo "$name does not appear in the Java native layer"
exitv=1
}
fi
done
rm -f $t
exit $exitv

44
dist/validate/s_chk_runrecovery vendored Normal file
View file

@ -0,0 +1,44 @@
#!/bin/sh -
#
# $Id$
# Check for DB_RUNRECOVERY being specified instead of a call to env_panic.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
s=$d/src
t1=__1
egrep DB_RUNRECOVERY $s/*/*.c |
sed -e '/__env_panic(.*, DB_RUNRECOVERY)/d' \
-e '/\/php_db4\//d' \
-e '/case DB_RUNRECOVERY:/d' \
-e '/db_dispatch.c:.*if (ret == DB_RUNRECOVERY/d' \
-e '/db_err.c:/d' \
-e '/env_open.c:.*ret = DB_RUNRECOVERY;/d' \
-e '/os_errno.c:.*evalue == DB_RUNRECOVERY/d' \
-e '/mut_fcntl.c:.*return (DB_RUNRECOVERY);/d' \
-e '/mut_pthread.c:.*return (DB_RUNRECOVERY);/d' \
-e '/mut_tas.c:.*return (DB_RUNRECOVERY);/d' \
-e '/mut_tas.c:.*Possibly DB_RUNRECOVERY if/d' \
-e '/mut_win32.c:.*return (DB_RUNRECOVERY);/d' \
-e '/mut_win32.c:.*ret = DB_RUNRECOVERY;/d' \
-e '/rep_backup.c:.*Panic the env and return DB_RUNRECOVERY/d' \
-e '/rep_backup.c:.*DB_RUNRECOVERY?/d' \
-e '/txn.c:.* \* DB_RUNRECOVERY and we need to/d' \
-e '/txn.c:.*returned DB_RUNRECOVERY and we need to/d' \
-e '/xa.c:.*(ret == DB_RUNRECOVERY)/d' \
> $t1
[ -s $t1 ] && {
echo "DB_RUNRECOVERY used; should be a call to env_panic."
cat $t1
exit 1
}
rm -f $t1
exit 0

43
dist/validate/s_chk_spell vendored Normal file
View file

@ -0,0 +1,43 @@
#!/bin/sh -
#
# $Id$
#
# Check spelling in quoted strings.
d=../..
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
exit 1
}
t1=__1
sed -e '/^#include/d' \
-e '/"/!d' \
-e 's/^[^"]*//' \
-e 's/%s/ /g' \
-e 's/[^"]*$//' \
-e 's/\\[nt]/ /g' \
`find $d -name '*.[ch]' -o -name '*.cpp' -o -name '*.java' |
sed -e '/\/perl\//d' -e '/\/test_erlang\//d'` |
spell | sort -u | comm -23 /dev/stdin s_chk_spell.dict > $t1
test -s $t1 && {
cat $t1
echo "FAIL: found questionable spelling in strings."
exit 1
}
egrep -h '/\* | \* ' \
`find $d -name '*.[ch]' -o -name '*.cpp' | sed -e '/\/perl\//d' -e '/\/test_erlang\//d'` |
spell | sort -u | comm -23 /dev/stdin s_chk_spell.dict > $t1
test -s $t1 && {
cat $t1
echo "FAIL: found questionable spelling in comments."
exit 1
}
rm -f $t1
exit 0

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