diff options
Diffstat (limited to 'db/perl/BerkeleyDB/mkconsts')
-rw-r--r-- | db/perl/BerkeleyDB/mkconsts | 837 |
1 files changed, 652 insertions, 185 deletions
diff --git a/db/perl/BerkeleyDB/mkconsts b/db/perl/BerkeleyDB/mkconsts index 24ef4fca7..dc90ea970 100644 --- a/db/perl/BerkeleyDB/mkconsts +++ b/db/perl/BerkeleyDB/mkconsts @@ -1,211 +1,678 @@ #!/usr/bin/perl +use ExtUtils::Constant qw(WriteConstants); + +use constant DEFINE => 'define' ; +use constant STRING => 'string' ; +use constant IGNORE => 'ignore' ; + %constants = ( - # Symbol 0 = define, 1 = enum - DB_AFTER => 0, - DB_APPEND => 0, - DB_ARCH_ABS => 0, - DB_ARCH_DATA => 0, - DB_ARCH_LOG => 0, - DB_BEFORE => 0, - DB_BTREE => 1, - DB_BTREEMAGIC => 0, - DB_BTREEOLDVER => 0, - DB_BTREEVERSION => 0, - DB_CHECKPOINT => 0, - DB_CONSUME => 0, - DB_CREATE => 0, - DB_CURLSN => 0, - DB_CURRENT => 0, - DB_DBT_MALLOC => 0, - DB_DBT_PARTIAL => 0, - DB_DBT_USERMEM => 0, - DB_DELETED => 0, - DB_DELIMITER => 0, - DB_DUP => 0, - DB_DUPSORT => 0, - DB_ENV_APPINIT => 0, - DB_ENV_STANDALONE => 0, - DB_ENV_THREAD => 0, - DB_EXCL => 0, - DB_FILE_ID_LEN => 0, - DB_FIRST => 0, - DB_FIXEDLEN => 0, - DB_FLUSH => 0, - DB_FORCE => 0, - DB_GET_BOTH => 0, - DB_GET_RECNO => 0, - DB_HASH => 1, - DB_HASHMAGIC => 0, - DB_HASHOLDVER => 0, - DB_HASHVERSION => 0, - DB_INCOMPLETE => 0, - DB_INIT_CDB => 0, - DB_INIT_LOCK => 0, - DB_INIT_LOG => 0, - DB_INIT_MPOOL => 0, - DB_INIT_TXN => 0, - DB_JOIN_ITEM => 0, - DB_KEYEMPTY => 0, - DB_KEYEXIST => 0, - DB_KEYFIRST => 0, - DB_KEYLAST => 0, - DB_LAST => 0, - DB_LOCK_CONFLICT => 0, - DB_LOCK_DEADLOCK => 0, - DB_LOCK_DEFAULT => 0, - DB_LOCK_GET => 1, - DB_LOCK_NORUN => 0, - DB_LOCK_NOTGRANTED => 0, - DB_LOCK_NOTHELD => 0, - DB_LOCK_NOWAIT => 0, - DB_LOCK_OLDEST => 0, - DB_LOCK_RANDOM => 0, - DB_LOCK_RIW_N => 0, - DB_LOCK_RW_N => 0, - DB_LOCK_YOUNGEST => 0, - DB_LOCKMAGIC => 0, - DB_LOCKVERSION => 0, - DB_LOGMAGIC => 0, - DB_LOGOLDVER => 0, - DB_MAX_PAGES => 0, - DB_MAX_RECORDS => 0, - DB_MPOOL_CLEAN => 0, - DB_MPOOL_CREATE => 0, - DB_MPOOL_DIRTY => 0, - DB_MPOOL_DISCARD => 0, - DB_MPOOL_LAST => 0, - DB_MPOOL_NEW => 0, - DB_MPOOL_PRIVATE => 0, - DB_MUTEXDEBUG => 0, - DB_MUTEXLOCKS => 0, - DB_NEEDSPLIT => 0, - DB_NEXT => 0, - DB_NEXT_DUP => 0, - DB_NOMMAP => 0, - DB_NOOVERWRITE => 0, - DB_NOSYNC => 0, - DB_NOTFOUND => 0, - DB_PAD => 0, - DB_PAGEYIELD => 0, - DB_POSITION => 0, - DB_PREV => 0, - DB_PRIVATE => 0, - DB_QUEUE => 1, - DB_RDONLY => 0, - DB_RECNO => 1, - DB_RECNUM => 0, - DB_RECORDCOUNT => 0, - DB_RECOVER => 0, - DB_RECOVER_FATAL => 0, - DB_REGISTERED => 0, - DB_RENUMBER => 0, - DB_RMW => 0, - DB_RUNRECOVERY => 0, - DB_SEQUENTIAL => 0, - DB_SET => 0, - DB_SET_RANGE => 0, - DB_SET_RECNO => 0, - DB_SNAPSHOT => 0, - DB_SWAPBYTES => 0, - DB_TEMPORARY => 0, - DB_THREAD => 0, - DB_TRUNCATE => 0, - DB_TXN_ABORT => 1, - DB_TXN_BACKWARD_ROLL => 1, - DB_TXN_CKP => 0, - DB_TXN_FORWARD_ROLL => 1, - DB_TXN_LOCK_2PL => 0, - DB_TXN_LOCK_MASK => 0, - DB_TXN_LOCK_OPTIMISTIC => 0, - DB_TXN_LOG_MASK => 0, - DB_TXN_LOG_REDO => 0, - DB_TXN_LOG_UNDO => 0, - DB_TXN_LOG_UNDOREDO => 0, - DB_TXN_NOSYNC => 0, - DB_TXN_NOWAIT => 0, - DB_TXN_SYNC => 0, - DB_TXN_OPENFILES => 1, - DB_TXN_REDO => 0, - DB_TXN_UNDO => 0, - DB_TXNMAGIC => 0, - DB_TXNVERSION => 0, - DB_TXN_LOCK_OPTIMIST => 0, - DB_UNKNOWN => 1, - DB_USE_ENVIRON => 0, - DB_USE_ENVIRON_ROOT => 0, - DB_VERSION_MAJOR => 0, - DB_VERSION_MINOR => 0, - DB_VERSION_PATCH => 0, - DB_WRITECURSOR => 0, + + ######### + # 2.0.0 + ######### + + DBM_INSERT => IGNORE, + DBM_REPLACE => IGNORE, + DBM_SUFFIX => IGNORE, + DB_AFTER => DEFINE, + DB_AM_DUP => IGNORE, + DB_AM_INMEM => IGNORE, + DB_AM_LOCKING => IGNORE, + DB_AM_LOGGING => IGNORE, + DB_AM_MLOCAL => IGNORE, + DB_AM_PGDEF => IGNORE, + DB_AM_RDONLY => IGNORE, + DB_AM_RECOVER => IGNORE, + DB_AM_SWAP => IGNORE, + DB_AM_TXN => IGNORE, + DB_APP_INIT => DEFINE, + DB_BEFORE => DEFINE, + DB_BTREEMAGIC => DEFINE, + DB_BTREEVERSION => DEFINE, + DB_BT_DELIMITER => IGNORE, + DB_BT_EOF => IGNORE, + DB_BT_FIXEDLEN => IGNORE, + DB_BT_PAD => IGNORE, + DB_BT_SNAPSHOT => IGNORE, + DB_CHECKPOINT => DEFINE, + DB_CREATE => DEFINE, + DB_CURRENT => DEFINE, + DB_DBT_INTERNAL => IGNORE, + DB_DBT_MALLOC => IGNORE, + DB_DBT_PARTIAL => IGNORE, + DB_DBT_USERMEM => IGNORE, + DB_DELETED => DEFINE, + DB_DELIMITER => DEFINE, + DB_DUP => DEFINE, + DB_EXCL => DEFINE, + DB_FIRST => DEFINE, + DB_FIXEDLEN => DEFINE, + DB_FLUSH => DEFINE, + DB_HASHMAGIC => DEFINE, + DB_HASHVERSION => DEFINE, + DB_HS_DIRTYMETA => IGNORE, + DB_INCOMPLETE => DEFINE, + DB_INIT_LOCK => DEFINE, + DB_INIT_LOG => DEFINE, + DB_INIT_MPOOL => DEFINE, + DB_INIT_TXN => DEFINE, + DB_KEYEXIST => DEFINE, + DB_KEYFIRST => DEFINE, + DB_KEYLAST => DEFINE, + DB_LAST => DEFINE, + DB_LOCKMAGIC => DEFINE, + DB_LOCKVERSION => DEFINE, + DB_LOCK_DEADLOCK => DEFINE, + DB_LOCK_NOTGRANTED => DEFINE, + DB_LOCK_NOTHELD => DEFINE, + DB_LOCK_NOWAIT => DEFINE, + DB_LOCK_RIW_N => DEFINE, + DB_LOCK_RW_N => DEFINE, + DB_LOGMAGIC => DEFINE, + DB_LOGVERSION => DEFINE, + DB_MAX_PAGES => DEFINE, + DB_MAX_RECORDS => DEFINE, + DB_MPOOL_CLEAN => DEFINE, + DB_MPOOL_CREATE => DEFINE, + DB_MPOOL_DIRTY => DEFINE, + DB_MPOOL_DISCARD => DEFINE, + DB_MPOOL_LAST => DEFINE, + DB_MPOOL_NEW => DEFINE, + DB_MPOOL_PRIVATE => DEFINE, + DB_MUTEXDEBUG => DEFINE, + DB_NEEDSPLIT => DEFINE, + DB_NEXT => DEFINE, + DB_NOOVERWRITE => DEFINE, + DB_NORECURSE => DEFINE, + DB_NOSYNC => DEFINE, + DB_NOTFOUND => DEFINE, + DB_PAD => DEFINE, + DB_PREV => DEFINE, + DB_RDONLY => DEFINE, + DB_REGISTERED => DEFINE, + DB_RE_MODIFIED => IGNORE, + DB_SET => DEFINE, + DB_SET_RANGE => DEFINE, + DB_SNAPSHOT => DEFINE, + DB_SWAPBYTES => DEFINE, + DB_TRUNCATE => DEFINE, + DB_TXNMAGIC => DEFINE, + DB_TXNVERSION => DEFINE, + DB_TXN_BACKWARD_ROLL => DEFINE, + DB_TXN_FORWARD_ROLL => DEFINE, + DB_TXN_LOCK_2PL => DEFINE, + DB_TXN_LOCK_MASK => DEFINE, + DB_TXN_LOCK_OPTIMISTIC => DEFINE, + DB_TXN_LOG_MASK => DEFINE, + DB_TXN_LOG_REDO => DEFINE, + DB_TXN_LOG_UNDO => DEFINE, + DB_TXN_LOG_UNDOREDO => DEFINE, + DB_TXN_OPENFILES => DEFINE, + DB_TXN_REDO => DEFINE, + DB_TXN_UNDO => DEFINE, + DB_USE_ENVIRON => DEFINE, + DB_USE_ENVIRON_ROOT => DEFINE, + DB_VERSION_MAJOR => DEFINE, + DB_VERSION_MINOR => DEFINE, + DB_VERSION_PATCH => DEFINE, + DB_VERSION_STRING => STRING, + _DB_H_ => IGNORE, + __BIT_TYPES_DEFINED__ => IGNORE, + const => IGNORE, + + # enum DBTYPE + DB_BTREE => '2.0.0', + DB_HASH => '2.0.0', + DB_RECNO => '2.0.0', + DB_UNKNOWN => '2.0.0', + + # enum db_lockop_t + DB_LOCK_DUMP => '2.0.0', + DB_LOCK_GET => '2.0.0', + DB_LOCK_PUT => '2.0.0', + DB_LOCK_PUT_ALL => '2.0.0', + DB_LOCK_PUT_OBJ => '2.0.0', + + # enum db_lockmode_t + DB_LOCK_NG => IGNORE, # 2.0.0 + DB_LOCK_READ => IGNORE, # 2.0.0 + DB_LOCK_WRITE => IGNORE, # 2.0.0 + DB_LOCK_IREAD => IGNORE, # 2.0.0 + DB_LOCK_IWRITE => IGNORE, # 2.0.0 + DB_LOCK_IWR => IGNORE, # 2.0.0 + + # enum ACTION + FIND => IGNORE, # 2.0.0 + ENTER => IGNORE, # 2.0.0 + + ######### + # 2.0.3 + ######### + + DB_SEQUENTIAL => DEFINE, + DB_TEMPORARY => DEFINE, + + ######### + # 2.1.0 + ######### + + DB_NOMMAP => DEFINE, + + ######### + # 2.2.6 + ######### + + DB_AM_THREAD => IGNORE, + DB_ARCH_ABS => DEFINE, + DB_ARCH_DATA => DEFINE, + DB_ARCH_LOG => DEFINE, + DB_LOCK_CONFLICT => DEFINE, + DB_LOCK_DEFAULT => DEFINE, + DB_LOCK_NORUN => DEFINE, + DB_LOCK_OLDEST => DEFINE, + DB_LOCK_RANDOM => DEFINE, + DB_LOCK_YOUNGEST => DEFINE, + DB_RECOVER => DEFINE, + DB_RECOVER_FATAL => DEFINE, + DB_THREAD => DEFINE, + DB_TXN_NOSYNC => DEFINE, + + ######### + # 2.3.0 + ######### + + DB_BTREEOLDVER => DEFINE, + DB_BT_RECNUM => IGNORE, + DB_FILE_ID_LEN => DEFINE, + DB_GETREC => DEFINE, + DB_HASHOLDVER => DEFINE, + DB_KEYEMPTY => DEFINE, + DB_LOGOLDVER => DEFINE, + DB_RECNUM => DEFINE, + DB_RECORDCOUNT => DEFINE, + DB_RENUMBER => DEFINE, + DB_RE_DELIMITER => IGNORE, + DB_RE_FIXEDLEN => IGNORE, + DB_RE_PAD => IGNORE, + DB_RE_RENUMBER => IGNORE, + DB_RE_SNAPSHOT => IGNORE, + + ######### + # 2.3.1 + ######### + + DB_GET_RECNO => DEFINE, + DB_SET_RECNO => DEFINE, + + ######### + # 2.3.3 + ######### + + DB_APPEND => DEFINE, + + ######### + # 2.3.6 + ######### + + DB_TXN_CKP => DEFINE, + + ######### + # 2.3.11 + ######### + + DB_ENV_APPINIT => DEFINE, + DB_ENV_STANDALONE => DEFINE, + DB_ENV_THREAD => DEFINE, + + ######### + # 2.3.12 + ######### + + DB_FUNC_CALLOC => IGNORE, + DB_FUNC_CLOSE => IGNORE, + DB_FUNC_DIRFREE => IGNORE, + DB_FUNC_DIRLIST => IGNORE, + DB_FUNC_EXISTS => IGNORE, + DB_FUNC_FREE => IGNORE, + DB_FUNC_FSYNC => IGNORE, + DB_FUNC_IOINFO => IGNORE, + DB_FUNC_MALLOC => IGNORE, + DB_FUNC_MAP => IGNORE, + DB_FUNC_OPEN => IGNORE, + DB_FUNC_READ => IGNORE, + DB_FUNC_REALLOC => IGNORE, + DB_FUNC_SEEK => IGNORE, + DB_FUNC_SLEEP => IGNORE, + DB_FUNC_STRDUP => IGNORE, + DB_FUNC_UNLINK => IGNORE, + DB_FUNC_UNMAP => IGNORE, + DB_FUNC_WRITE => IGNORE, + DB_FUNC_YIELD => IGNORE, + + ######### + # 2.3.14 + ######### + + DB_TSL_SPINS => IGNORE, + + ######### + # 2.3.16 + ######### + + DB_DBM_HSEARCH => IGNORE, + firstkey => IGNORE, + hdestroy => IGNORE, + + ######### + # 2.4.10 + ######### + + DB_CURLSN => DEFINE, + DB_FUNC_RUNLINK => IGNORE, + DB_REGION_ANON => DEFINE, + DB_REGION_INIT => DEFINE, + DB_REGION_NAME => DEFINE, + DB_TXN_LOCK_OPTIMIST => DEFINE, + __CURRENTLY_UNUSED => IGNORE, + + # enum db_status_t + DB_LSTAT_ABORTED => IGNORE, # 2.4.10 + DB_LSTAT_ERR => IGNORE, # 2.4.10 + DB_LSTAT_FREE => IGNORE, # 2.4.10 + DB_LSTAT_HELD => IGNORE, # 2.4.10 + DB_LSTAT_NOGRANT => IGNORE, # 2.4.10 + DB_LSTAT_PENDING => IGNORE, # 2.4.10 + DB_LSTAT_WAITING => IGNORE, # 2.4.10 + + ######### + # 2.4.14 + ######### + + DB_MUTEXLOCKS => DEFINE, + DB_PAGEYIELD => DEFINE, + __UNUSED_100 => IGNORE, + __UNUSED_4000 => IGNORE, + + ######### + # 2.5.2 + ######### + + DBC_CONTINUE => IGNORE, + DBC_KEYSET => IGNORE, + DBC_RECOVER => IGNORE, + DBC_RMW => IGNORE, + DB_DBM_ERROR => IGNORE, + DB_GET_BOTH => DEFINE, + DB_NEXT_DUP => DEFINE, + DB_OPFLAGS_MASK => DEFINE, + DB_RMW => DEFINE, + DB_RUNRECOVERY => DEFINE, + dbmclose => IGNORE, + + ######### + # 2.5.9 + ######### + + DB_DUPSORT => DEFINE, + DB_JOIN_ITEM => DEFINE, + + ######### + # 2.6.4 + ######### + + DBC_WRITER => IGNORE, + DB_AM_CDB => IGNORE, + DB_ENV_CDB => DEFINE, + DB_INIT_CDB => DEFINE, + DB_LOCK_UPGRADE => DEFINE, + DB_WRITELOCK => DEFINE, + + ######### + # 2.7.1 + ######### + + + # enum db_lockop_t + DB_LOCK_INHERIT => '2.7.1', + + ######### + # 2.7.7 + ######### + + DB_FCNTL_LOCKING => DEFINE, + + ######### + # 3.0.55 + ######### + + DBC_WRITECURSOR => IGNORE, + DB_AM_DISCARD => IGNORE, + DB_AM_SUBDB => IGNORE, + DB_BT_REVSPLIT => IGNORE, + DB_CONSUME => DEFINE, + DB_CXX_NO_EXCEPTIONS => DEFINE, + DB_DBT_REALLOC => IGNORE, + DB_DUPCURSOR => DEFINE, + DB_ENV_CREATE => DEFINE, + DB_ENV_DBLOCAL => DEFINE, + DB_ENV_LOCKDOWN => DEFINE, + DB_ENV_LOCKING => DEFINE, + DB_ENV_LOGGING => DEFINE, + DB_ENV_NOMMAP => DEFINE, + DB_ENV_OPEN_CALLED => DEFINE, + DB_ENV_PRIVATE => DEFINE, + DB_ENV_SYSTEM_MEM => DEFINE, + DB_ENV_TXN => DEFINE, + DB_ENV_TXN_NOSYNC => DEFINE, + DB_ENV_USER_ALLOC => DEFINE, + DB_FORCE => DEFINE, + DB_LOCKDOWN => DEFINE, + DB_LOCK_RECORD => DEFINE, + DB_LOGFILEID_INVALID => DEFINE, + DB_MPOOL_NEW_GROUP => DEFINE, + DB_NEXT_NODUP => DEFINE, + DB_OK_BTREE => DEFINE, + DB_OK_HASH => DEFINE, + DB_OK_QUEUE => DEFINE, + DB_OK_RECNO => DEFINE, + DB_OLD_VERSION => DEFINE, + DB_OPEN_CALLED => DEFINE, + DB_PAGE_LOCK => DEFINE, + DB_POSITION => DEFINE, + DB_POSITIONI => DEFINE, + DB_PRIVATE => DEFINE, + DB_QAMMAGIC => DEFINE, + DB_QAMOLDVER => DEFINE, + DB_QAMVERSION => DEFINE, + DB_RECORD_LOCK => DEFINE, + DB_REVSPLITOFF => DEFINE, + DB_SYSTEM_MEM => DEFINE, + DB_TEST_POSTLOG => DEFINE, + DB_TEST_POSTLOGMETA => DEFINE, + DB_TEST_POSTOPEN => DEFINE, + DB_TEST_POSTRENAME => DEFINE, + DB_TEST_POSTSYNC => DEFINE, + DB_TEST_PREOPEN => DEFINE, + DB_TEST_PRERENAME => DEFINE, + DB_TXN_NOWAIT => DEFINE, + DB_TXN_SYNC => DEFINE, + DB_UPGRADE => DEFINE, + DB_VERB_CHKPOINT => DEFINE, + DB_VERB_DEADLOCK => DEFINE, + DB_VERB_RECOVERY => DEFINE, + DB_VERB_WAITSFOR => DEFINE, + DB_WRITECURSOR => DEFINE, + DB_XA_CREATE => DEFINE, + + # enum DBTYPE + DB_QUEUE => '3.0.55', + + ######### + # 3.1.12 + ######### + + DBC_ACTIVE => IGNORE, + DBC_OPD => IGNORE, + DBC_TRANSIENT => IGNORE, + DBC_WRITEDUP => IGNORE, + DB_AGGRESSIVE => DEFINE, + DB_AM_DUPSORT => IGNORE, + DB_CACHED_COUNTS => DEFINE, + DB_CLIENT => DEFINE, + DB_DBT_DUPOK => IGNORE, + DB_DBT_ISSET => IGNORE, + DB_ENV_RPCCLIENT => DEFINE, + DB_GET_BOTHC => DEFINE, + DB_JOIN_NOSORT => DEFINE, + DB_NODUPDATA => DEFINE, + DB_NOORDERCHK => DEFINE, + DB_NOSERVER => DEFINE, + DB_NOSERVER_HOME => DEFINE, + DB_NOSERVER_ID => DEFINE, + DB_ODDFILESIZE => DEFINE, + DB_ORDERCHKONLY => DEFINE, + DB_PREV_NODUP => DEFINE, + DB_PR_HEADERS => DEFINE, + DB_PR_PAGE => DEFINE, + DB_PR_RECOVERYTEST => DEFINE, + DB_RDWRMASTER => DEFINE, + DB_SALVAGE => DEFINE, + DB_VERIFY_BAD => DEFINE, + DB_VERIFY_FATAL => DEFINE, + DB_VRFY_FLAGMASK => DEFINE, + + # enum db_recops + DB_TXN_ABORT => '3.1.12', + DB_TXN_BACKWARD_ROLL => '3.1.12', + DB_TXN_FORWARD_ROLL => '3.1.12', + DB_TXN_OPENFILES => '3.1.12', + + ######### + # 3.2.3 + ######### + + DBC_COMPENSATE => IGNORE, + DB_AM_VERIFYING => IGNORE, + DB_CDB_ALLDB => DEFINE, + DB_ENV_CDB_ALLDB => DEFINE, + DB_EXTENT => DEFINE, + DB_JOINENV => DEFINE, + DB_LOCK_SWITCH => DEFINE, + DB_MPOOL_EXTENT => DEFINE, + DB_REGION_MAGIC => DEFINE, + DB_UNRESOLVED_CHILD => DEFINE, + DB_VERIFY => DEFINE, + + # enum db_notices + DB_NOTICE_LOGFILE_CHANGED => IGNORE, # 3.2.3 + + ######### + # 3.2.6 + ######### + + DB_ALREADY_ABORTED => DEFINE, + DB_CONSUME_WAIT => DEFINE, + DB_JAVA_CALLBACK => DEFINE, + DB_TEST_POSTEXTDELETE => DEFINE, + DB_TEST_POSTEXTOPEN => DEFINE, + DB_TEST_POSTEXTUNLINK => DEFINE, + DB_TEST_PREEXTDELETE => DEFINE, + DB_TEST_PREEXTOPEN => DEFINE, + DB_TEST_PREEXTUNLINK => DEFINE, + + # enum db_lockmode_t + DB_LOCK_WAIT => IGNORE, # 3.2.6 + + ######### + # 3.3.4 + ######### + + DBC_DIRTY_READ => IGNORE, + DBC_MULTIPLE => IGNORE, + DBC_MULTIPLE_KEY => IGNORE, + DB_AM_DIRTY => IGNORE, + DB_AM_SECONDARY => IGNORE, + DB_COMMIT => DEFINE, + DB_DBT_APPMALLOC => IGNORE, + DB_DIRTY_READ => DEFINE, + DB_DONOTINDEX => DEFINE, + DB_ENV_PANIC_OK => DEFINE, + DB_ENV_RPCCLIENT_GIVEN => DEFINE, + DB_FAST_STAT => DEFINE, + DB_LOCK_MAXLOCKS => DEFINE, + DB_LOCK_MINLOCKS => DEFINE, + DB_LOCK_MINWRITE => DEFINE, + DB_MULTIPLE => DEFINE, + DB_MULTIPLE_KEY => DEFINE, + DB_PAGE_NOTFOUND => DEFINE, + DB_RPC_SERVERPROG => DEFINE, + DB_RPC_SERVERVERS => DEFINE, + DB_UPDATE_SECONDARY => DEFINE, + DB_XIDDATASIZE => DEFINE, + + # enum db_recops + DB_TXN_POPENFILES => '3.3.4', + + # enum db_lockop_t + DB_LOCK_UPGRADE_WRITE => '3.3.4', + + # enum db_lockmode_t + DB_LOCK_DIRTY => IGNORE, # 3.3.4 + DB_LOCK_WWRITE => IGNORE, # 3.3.4 + + ######### + # 3.3.11 + ######### + + DB_SECONDARY_BAD => DEFINE, + DB_SURPRISE_KID => DEFINE, + DB_TEST_POSTDESTROY => DEFINE, + DB_TEST_PREDESTROY => DEFINE, + + ######### + # 4.0.7 + ######### + + DB_APPLY_LOGREG => DEFINE, + DB_BROADCAST_EID => DEFINE, + DB_CL_WRITER => DEFINE, + DB_ENV_NOLOCKING => DEFINE, + DB_ENV_NOPANIC => DEFINE, + DB_ENV_REGION_INIT => DEFINE, + DB_ENV_REP_CLIENT => DEFINE, + DB_ENV_REP_LOGSONLY => DEFINE, + DB_ENV_REP_MASTER => DEFINE, + DB_ENV_YIELDCPU => DEFINE, + DB_GET_BOTH_RANGE => DEFINE, + DB_INVALID_EID => DEFINE, + DB_LOCK_EXPIRE => DEFINE, + DB_LOCK_FREE_LOCKER => DEFINE, + DB_LOCK_SET_TIMEOUT => DEFINE, + DB_LOGC_BUF_SIZE => DEFINE, + DB_LOG_DISK => DEFINE, + DB_LOG_LOCKED => DEFINE, + DB_LOG_SILENT_ERR => DEFINE, + DB_NOLOCKING => DEFINE, + DB_NOPANIC => DEFINE, + DB_PANIC_ENVIRONMENT => DEFINE, + DB_REP_CLIENT => DEFINE, + DB_REP_DUPMASTER => DEFINE, + DB_REP_HOLDELECTION => DEFINE, + DB_REP_LOGSONLY => DEFINE, + DB_REP_MASTER => DEFINE, + DB_REP_NEWMASTER => DEFINE, + DB_REP_NEWSITE => DEFINE, + DB_REP_OUTDATED => DEFINE, + DB_REP_PERMANENT => DEFINE, + DB_REP_UNAVAIL => DEFINE, + DB_SET_LOCK_TIMEOUT => DEFINE, + DB_SET_TXN_NOW => DEFINE, + DB_SET_TXN_TIMEOUT => DEFINE, + DB_STAT_CLEAR => DEFINE, + DB_TIMEOUT => DEFINE, + DB_YIELDCPU => DEFINE, + MP_FLUSH => IGNORE, + MP_OPEN_CALLED => IGNORE, + MP_READONLY => IGNORE, + MP_UPGRADE => IGNORE, + MP_UPGRADE_FAIL => IGNORE, + TXN_CHILDCOMMIT => IGNORE, + TXN_COMPENSATE => IGNORE, + TXN_DIRTY_READ => IGNORE, + TXN_LOCKTIMEOUT => IGNORE, + TXN_MALLOC => IGNORE, + TXN_NOSYNC => IGNORE, + TXN_NOWAIT => IGNORE, + TXN_SYNC => IGNORE, + + # enum db_recops + DB_TXN_APPLY => '4.0.7', + + # enum db_lockop_t + DB_LOCK_GET_TIMEOUT => '4.0.7', + DB_LOCK_PUT_READ => '4.0.7', + DB_LOCK_TIMEOUT => '4.0.7', + + # enum db_status_t + DB_LSTAT_EXPIRED => IGNORE, # 4.0.7 + ) ; +sub enum_Macro +{ + my $str = shift ; + my ($major, $minor, $patch) = split /\./, $str ; + + my $macro = + "#if (DB_VERSION_MAJOR > $major) || \\\n" . + " (DB_VERSION_MAJOR == $major && DB_VERSION_MINOR > $minor) || \\\n" . + " (DB_VERSION_MAJOR == $major && DB_VERSION_MINOR == $minor && \\\n" . + " DB_VERSION_PATCH >= $patch)\n" ; + + return $macro; + +} + sub OutputXS { - # skip to the marker - if (0) { - while (<>) - { - last if /^MARKER/ ; - print ; - } - } - + + my @names = () ; + foreach my $key (sort keys %constants) { - my $isEnum = $constants{$key} ; - - if ($isEnum) { - print <<EOM - if (strEQ(name, "$key")) - return $key; -EOM - } - else - { - print <<EOM - if (strEQ(name, "$key")) -#ifdef $key - return $key; -#else - goto not_there; -#endif -EOM - } - - } - - if (0) { - while (<>) - { - print ; - } + my $val = $constants{$key} ; + next if $val eq IGNORE; + + if ($val eq STRING) + { push @names, { name => $key, type => "PV" } } + elsif ($val eq DEFINE) + { push @names, $key } + else + { push @names, { name => $key, macro => [enum_Macro($val), "#endif\n"] } } } + + WriteConstants( + NAME => BerkeleyDB, + NAMES => \@names, + C_FILE => 'constants.h', + XS_FILE => 'constants.xs', + ) ; } sub OutputPM { - # skip to the marker - if (0) { - while (<>) + my $START = '@EXPORT = qw(' ; + my $START_re = quotemeta $START ; + my $END = ');'; + my $END_re = quotemeta $END ; + + # skip to the @EXPORT declaration + OUTER: while (<>) + { + if ( /^\s*$START_re/ ) { - last if /^MARKER/ ; - print ; + # skip to the end marker. + while (<>) + { last OUTER if /^\s*$END_re/ } } + print ; } + print "$START\n"; foreach my $key (sort keys %constants) { + next if $constants{$key} eq IGNORE; print "\t$key\n"; } + print "\t$END\n"; - if (0) { - while (<>) - { - print ; - } + while (<>) + { + print ; } } -OutputXS() if $ARGV[0] =~ /xs/i ; -OutputPM() if $ARGV[0] =~ /pm/i ; +my $opt = shift ; +OutputXS() if $opt =~ /^xs/i ; +OutputPM() if $opt =~ /^pm/i ; |