diff options
author | unknown <tim@threads.polyesthetic.msg> | 2001-04-05 15:33:16 -0400 |
---|---|---|
committer | unknown <tim@threads.polyesthetic.msg> | 2001-04-05 15:33:16 -0400 |
commit | 353d84d874c4a4c9bef89a1e19737ff7dd468a65 (patch) | |
tree | c89a2faa418ef1c4cd12af14af0a472e15c1dcc9 /bdb | |
parent | 9d10389a1238cfad6971236f55ee33d228f31cab (diff) | |
download | mariadb-git-353d84d874c4a4c9bef89a1e19737ff7dd468a65.tar.gz |
Remove generated files from bdb source code control.
BitKeeper/deleted/.del-btree_auto.c~a683156a176761f:
Delete: bdb/btree/btree_auto.c
BitKeeper/deleted/.del-chk.define~aa9a626e58631003:
Delete: bdb/dist/build/chk.define
BitKeeper/deleted/.del-chk.def~bb65b471d09f7c58:
Delete: bdb/dist/build/chk.def
BitKeeper/deleted/.del-chk.offt~25759c9294db634e:
Delete: bdb/dist/build/chk.offt
BitKeeper/deleted/.del-chk.srcfiles~ae884700cd110cbf:
Delete: bdb/dist/build/chk.srcfiles
BitKeeper/deleted/.del-chk.tags~7a5b14d33d4078cc:
Delete: bdb/dist/build/chk.tags
BitKeeper/deleted/.del-config.guess~ead1d91caeaa748c:
Delete: bdb/dist/config.guess
BitKeeper/deleted/.del-config.hin~fdecb7a06fa137a7:
Delete: bdb/dist/config.hin
BitKeeper/deleted/.del-config.sub~17e9990a298261a:
Delete: bdb/dist/config.sub
BitKeeper/deleted/.del-crdel_auto.c~ee4146a08fd175c1:
Delete: bdb/db/crdel_auto.c
BitKeeper/deleted/.del-db_auto.c~3186e950cc321ae7:
Delete: bdb/db/db_auto.c
BitKeeper/deleted/.del-db_int.h~40ba51edce41403f:
Delete: bdb/build_vxworks/db_int.h
BitKeeper/deleted/.del-db_int.h~9ee5645850a336a0:
Delete: bdb/build_win32/db_int.h
BitKeeper/deleted/.del-include.tcl~f8bffb5e2510f229:
Delete: bdb/build_win32/include.tcl
BitKeeper/deleted/.del-install-sh~1858c24340b72628:
Delete: bdb/dist/install-sh
BitKeeper/deleted/.del-libdb.rc~906f4936ec6a8398:
Delete: bdb/build_win32/libdb.rc
BitKeeper/deleted/.del-DbConstants.java~15fa87eda6b72302:
Delete: bdb/java/src/com/sleepycat/db/DbConstants.java
BitKeeper/deleted/.del-btree_auto.h~84d4451c78faf67e:
Delete: bdb/include/btree_auto.h
BitKeeper/deleted/.del-crdel_auto.h~1b8255da47550ece:
Delete: bdb/include/crdel_auto.h
BitKeeper/deleted/.del-db_auto.h~994ddc84db334345:
Delete: bdb/include/db_auto.h
BitKeeper/deleted/.del-db_server.h~61a33aa05bf368a7:
Delete: bdb/include/db_server.h
BitKeeper/deleted/.del-db_server_clnt.c~b548b860f765c597:
Delete: bdb/rpc_client/db_server_clnt.c
BitKeeper/deleted/.del-db_server_svc.c~35804eb82b953f49:
Delete: bdb/rpc_server/db_server_svc.c
BitKeeper/deleted/.del-gen_client.c~ad86f092d0996a68:
Delete: bdb/rpc_client/gen_client.c
BitKeeper/deleted/.del-hash_auto.c~d17c6a6ed4f181d1:
Delete: bdb/hash/hash_auto.c
BitKeeper/deleted/.del-hash_auto.h~1b79cdd426d7ef25:
Delete: bdb/include/hash_auto.h
BitKeeper/deleted/.del-log_auto.c~fe8c0369965f7151:
Delete: bdb/log/log_auto.c
BitKeeper/deleted/.del-log_auto.h~8d52dd0884d03051:
Delete: bdb/include/log_auto.h
BitKeeper/deleted/.del-qam_auto.c~361954d3f149feb0:
Delete: bdb/qam/qam_auto.c
BitKeeper/deleted/.del-qam_auto.h~96f6c045fd0d6cab:
Delete: bdb/include/qam_auto.h
BitKeeper/deleted/.del-rec_btree~65d6b0b2f5b7a6d2:
Delete: bdb/dist/template/rec_btree
BitKeeper/deleted/.del-rec_crdel~58795c0c5232f80d:
Delete: bdb/dist/template/rec_crdel
BitKeeper/deleted/.del-rec_db~52c5797539878fca:
Delete: bdb/dist/template/rec_db
BitKeeper/deleted/.del-rec_hash~dcbdd106ae17b865:
Delete: bdb/dist/template/rec_hash
BitKeeper/deleted/.del-rec_log~3fe6d62c43bc553a:
Delete: bdb/dist/template/rec_log
BitKeeper/deleted/.del-rec_qam~6eecf6833de0af98:
Delete: bdb/dist/template/rec_qam
BitKeeper/deleted/.del-rec_txn~1ff22b797deb0e1b:
Delete: bdb/dist/template/rec_txn
BitKeeper/deleted/.del-txn_auto.h~e3f49e94fd291c45:
Delete: bdb/include/txn_auto.h
BitKeeper/deleted/.del-db_server_xdr.c~336ef020b4a22c05:
Delete: bdb/rpc_server/db_server_xdr.c
BitKeeper/deleted/.del-gen_db_server.c~d5602f9bd5c930e:
Delete: bdb/rpc_server/gen_db_server.c
BitKeeper/deleted/.del-include.tcl~20fc297b040cbe2:
Delete: bdb/test/include.tcl
BitKeeper/deleted/.del-txn_auto.c~6eb282f016f606d9:
Delete: bdb/txn/txn_auto.c
Diffstat (limited to 'bdb')
42 files changed, 0 insertions, 24407 deletions
diff --git a/bdb/btree/btree_auto.c b/bdb/btree/btree_auto.c deleted file mode 100644 index fdb27b7d25e..00000000000 --- a/bdb/btree/btree_auto.c +++ /dev/null @@ -1,2284 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <ctype.h> -#include <errno.h> -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "db_dispatch.h" -#include "db_am.h" -#include "btree.h" -#include "txn.h" - -int -__bam_pg_alloc_log(dbenv, txnid, ret_lsnp, flags, - fileid, meta_lsn, page_lsn, pgno, ptype, next) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - DB_LSN * meta_lsn; - DB_LSN * page_lsn; - db_pgno_t pgno; - u_int32_t ptype; - db_pgno_t next; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_pg_alloc; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(*meta_lsn) - + sizeof(*page_lsn) - + sizeof(pgno) - + sizeof(ptype) - + sizeof(next); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (meta_lsn != NULL) - memcpy(bp, meta_lsn, sizeof(*meta_lsn)); - else - memset(bp, 0, sizeof(*meta_lsn)); - bp += sizeof(*meta_lsn); - if (page_lsn != NULL) - memcpy(bp, page_lsn, sizeof(*page_lsn)); - else - memset(bp, 0, sizeof(*page_lsn)); - bp += sizeof(*page_lsn); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &ptype, sizeof(ptype)); - bp += sizeof(ptype); - memcpy(bp, &next, sizeof(next)); - bp += sizeof(next); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_pg_alloc_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_pg_alloc_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_pg_alloc_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_pg_alloc: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tmeta_lsn: [%lu][%lu]\n", - (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); - printf("\tpage_lsn: [%lu][%lu]\n", - (u_long)argp->page_lsn.file, (u_long)argp->page_lsn.offset); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tptype: %lu\n", (u_long)argp->ptype); - printf("\tnext: %lu\n", (u_long)argp->next); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_pg_alloc_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_pg_alloc_args **argpp; -{ - __bam_pg_alloc_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_pg_alloc_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); - bp += sizeof(argp->meta_lsn); - memcpy(&argp->page_lsn, bp, sizeof(argp->page_lsn)); - bp += sizeof(argp->page_lsn); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->ptype, bp, sizeof(argp->ptype)); - bp += sizeof(argp->ptype); - memcpy(&argp->next, bp, sizeof(argp->next)); - bp += sizeof(argp->next); - *argpp = argp; - return (0); -} - -int -__bam_pg_alloc1_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_pg_alloc1_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_pg_alloc1_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_pg_alloc1: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tmeta_lsn: [%lu][%lu]\n", - (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); - printf("\talloc_lsn: [%lu][%lu]\n", - (u_long)argp->alloc_lsn.file, (u_long)argp->alloc_lsn.offset); - printf("\tpage_lsn: [%lu][%lu]\n", - (u_long)argp->page_lsn.file, (u_long)argp->page_lsn.offset); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tptype: %lu\n", (u_long)argp->ptype); - printf("\tnext: %lu\n", (u_long)argp->next); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_pg_alloc1_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_pg_alloc1_args **argpp; -{ - __bam_pg_alloc1_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_pg_alloc1_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); - bp += sizeof(argp->meta_lsn); - memcpy(&argp->alloc_lsn, bp, sizeof(argp->alloc_lsn)); - bp += sizeof(argp->alloc_lsn); - memcpy(&argp->page_lsn, bp, sizeof(argp->page_lsn)); - bp += sizeof(argp->page_lsn); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->ptype, bp, sizeof(argp->ptype)); - bp += sizeof(argp->ptype); - memcpy(&argp->next, bp, sizeof(argp->next)); - bp += sizeof(argp->next); - *argpp = argp; - return (0); -} - -int -__bam_pg_free_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, meta_lsn, header, next) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - DB_LSN * meta_lsn; - const DBT *header; - db_pgno_t next; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_pg_free; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(*meta_lsn) - + sizeof(u_int32_t) + (header == NULL ? 0 : header->size) - + sizeof(next); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (meta_lsn != NULL) - memcpy(bp, meta_lsn, sizeof(*meta_lsn)); - else - memset(bp, 0, sizeof(*meta_lsn)); - bp += sizeof(*meta_lsn); - if (header == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &header->size, sizeof(header->size)); - bp += sizeof(header->size); - memcpy(bp, header->data, header->size); - bp += header->size; - } - memcpy(bp, &next, sizeof(next)); - bp += sizeof(next); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_pg_free_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_pg_free_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_pg_free_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_pg_free: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tmeta_lsn: [%lu][%lu]\n", - (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); - printf("\theader: "); - for (i = 0; i < argp->header.size; i++) { - ch = ((u_int8_t *)argp->header.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tnext: %lu\n", (u_long)argp->next); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_pg_free_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_pg_free_args **argpp; -{ - __bam_pg_free_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_pg_free_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); - bp += sizeof(argp->meta_lsn); - memset(&argp->header, 0, sizeof(argp->header)); - memcpy(&argp->header.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->header.data = bp; - bp += argp->header.size; - memcpy(&argp->next, bp, sizeof(argp->next)); - bp += sizeof(argp->next); - *argpp = argp; - return (0); -} - -int -__bam_pg_free1_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_pg_free1_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_pg_free1_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_pg_free1: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tmeta_lsn: [%lu][%lu]\n", - (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); - printf("\talloc_lsn: [%lu][%lu]\n", - (u_long)argp->alloc_lsn.file, (u_long)argp->alloc_lsn.offset); - printf("\theader: "); - for (i = 0; i < argp->header.size; i++) { - ch = ((u_int8_t *)argp->header.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tnext: %lu\n", (u_long)argp->next); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_pg_free1_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_pg_free1_args **argpp; -{ - __bam_pg_free1_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_pg_free1_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); - bp += sizeof(argp->meta_lsn); - memcpy(&argp->alloc_lsn, bp, sizeof(argp->alloc_lsn)); - bp += sizeof(argp->alloc_lsn); - memset(&argp->header, 0, sizeof(argp->header)); - memcpy(&argp->header.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->header.data = bp; - bp += argp->header.size; - memcpy(&argp->next, bp, sizeof(argp->next)); - bp += sizeof(argp->next); - *argpp = argp; - return (0); -} - -int -__bam_split1_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_split1_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_split1_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_split1: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tleft: %lu\n", (u_long)argp->left); - printf("\tllsn: [%lu][%lu]\n", - (u_long)argp->llsn.file, (u_long)argp->llsn.offset); - printf("\tright: %lu\n", (u_long)argp->right); - printf("\trlsn: [%lu][%lu]\n", - (u_long)argp->rlsn.file, (u_long)argp->rlsn.offset); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\tnpgno: %lu\n", (u_long)argp->npgno); - printf("\tnlsn: [%lu][%lu]\n", - (u_long)argp->nlsn.file, (u_long)argp->nlsn.offset); - printf("\tpg: "); - for (i = 0; i < argp->pg.size; i++) { - ch = ((u_int8_t *)argp->pg.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_split1_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_split1_args **argpp; -{ - __bam_split1_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_split1_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->left, bp, sizeof(argp->left)); - bp += sizeof(argp->left); - memcpy(&argp->llsn, bp, sizeof(argp->llsn)); - bp += sizeof(argp->llsn); - memcpy(&argp->right, bp, sizeof(argp->right)); - bp += sizeof(argp->right); - memcpy(&argp->rlsn, bp, sizeof(argp->rlsn)); - bp += sizeof(argp->rlsn); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->npgno, bp, sizeof(argp->npgno)); - bp += sizeof(argp->npgno); - memcpy(&argp->nlsn, bp, sizeof(argp->nlsn)); - bp += sizeof(argp->nlsn); - memset(&argp->pg, 0, sizeof(argp->pg)); - memcpy(&argp->pg.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->pg.data = bp; - bp += argp->pg.size; - *argpp = argp; - return (0); -} - -int -__bam_split_log(dbenv, txnid, ret_lsnp, flags, - fileid, left, llsn, right, rlsn, indx, - npgno, nlsn, root_pgno, pg, opflags) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t left; - DB_LSN * llsn; - db_pgno_t right; - DB_LSN * rlsn; - u_int32_t indx; - db_pgno_t npgno; - DB_LSN * nlsn; - db_pgno_t root_pgno; - const DBT *pg; - u_int32_t opflags; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_split; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(left) - + sizeof(*llsn) - + sizeof(right) - + sizeof(*rlsn) - + sizeof(indx) - + sizeof(npgno) - + sizeof(*nlsn) - + sizeof(root_pgno) - + sizeof(u_int32_t) + (pg == NULL ? 0 : pg->size) - + sizeof(opflags); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &left, sizeof(left)); - bp += sizeof(left); - if (llsn != NULL) - memcpy(bp, llsn, sizeof(*llsn)); - else - memset(bp, 0, sizeof(*llsn)); - bp += sizeof(*llsn); - memcpy(bp, &right, sizeof(right)); - bp += sizeof(right); - if (rlsn != NULL) - memcpy(bp, rlsn, sizeof(*rlsn)); - else - memset(bp, 0, sizeof(*rlsn)); - bp += sizeof(*rlsn); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - memcpy(bp, &npgno, sizeof(npgno)); - bp += sizeof(npgno); - if (nlsn != NULL) - memcpy(bp, nlsn, sizeof(*nlsn)); - else - memset(bp, 0, sizeof(*nlsn)); - bp += sizeof(*nlsn); - memcpy(bp, &root_pgno, sizeof(root_pgno)); - bp += sizeof(root_pgno); - if (pg == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &pg->size, sizeof(pg->size)); - bp += sizeof(pg->size); - memcpy(bp, pg->data, pg->size); - bp += pg->size; - } - memcpy(bp, &opflags, sizeof(opflags)); - bp += sizeof(opflags); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_split_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_split_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_split_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_split: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tleft: %lu\n", (u_long)argp->left); - printf("\tllsn: [%lu][%lu]\n", - (u_long)argp->llsn.file, (u_long)argp->llsn.offset); - printf("\tright: %lu\n", (u_long)argp->right); - printf("\trlsn: [%lu][%lu]\n", - (u_long)argp->rlsn.file, (u_long)argp->rlsn.offset); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\tnpgno: %lu\n", (u_long)argp->npgno); - printf("\tnlsn: [%lu][%lu]\n", - (u_long)argp->nlsn.file, (u_long)argp->nlsn.offset); - printf("\troot_pgno: %lu\n", (u_long)argp->root_pgno); - printf("\tpg: "); - for (i = 0; i < argp->pg.size; i++) { - ch = ((u_int8_t *)argp->pg.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\topflags: %lu\n", (u_long)argp->opflags); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_split_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_split_args **argpp; -{ - __bam_split_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_split_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->left, bp, sizeof(argp->left)); - bp += sizeof(argp->left); - memcpy(&argp->llsn, bp, sizeof(argp->llsn)); - bp += sizeof(argp->llsn); - memcpy(&argp->right, bp, sizeof(argp->right)); - bp += sizeof(argp->right); - memcpy(&argp->rlsn, bp, sizeof(argp->rlsn)); - bp += sizeof(argp->rlsn); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->npgno, bp, sizeof(argp->npgno)); - bp += sizeof(argp->npgno); - memcpy(&argp->nlsn, bp, sizeof(argp->nlsn)); - bp += sizeof(argp->nlsn); - memcpy(&argp->root_pgno, bp, sizeof(argp->root_pgno)); - bp += sizeof(argp->root_pgno); - memset(&argp->pg, 0, sizeof(argp->pg)); - memcpy(&argp->pg.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->pg.data = bp; - bp += argp->pg.size; - memcpy(&argp->opflags, bp, sizeof(argp->opflags)); - bp += sizeof(argp->opflags); - *argpp = argp; - return (0); -} - -int -__bam_rsplit1_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_rsplit1_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_rsplit1_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_rsplit1: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tpgdbt: "); - for (i = 0; i < argp->pgdbt.size; i++) { - ch = ((u_int8_t *)argp->pgdbt.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tnrec: %lu\n", (u_long)argp->nrec); - printf("\trootent: "); - for (i = 0; i < argp->rootent.size; i++) { - ch = ((u_int8_t *)argp->rootent.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\trootlsn: [%lu][%lu]\n", - (u_long)argp->rootlsn.file, (u_long)argp->rootlsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_rsplit1_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_rsplit1_args **argpp; -{ - __bam_rsplit1_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_rsplit1_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memset(&argp->pgdbt, 0, sizeof(argp->pgdbt)); - memcpy(&argp->pgdbt.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->pgdbt.data = bp; - bp += argp->pgdbt.size; - memcpy(&argp->nrec, bp, sizeof(argp->nrec)); - bp += sizeof(argp->nrec); - memset(&argp->rootent, 0, sizeof(argp->rootent)); - memcpy(&argp->rootent.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->rootent.data = bp; - bp += argp->rootent.size; - memcpy(&argp->rootlsn, bp, sizeof(argp->rootlsn)); - bp += sizeof(argp->rootlsn); - *argpp = argp; - return (0); -} - -int -__bam_rsplit_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, pgdbt, root_pgno, nrec, rootent, - rootlsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - const DBT *pgdbt; - db_pgno_t root_pgno; - db_pgno_t nrec; - const DBT *rootent; - DB_LSN * rootlsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_rsplit; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(u_int32_t) + (pgdbt == NULL ? 0 : pgdbt->size) - + sizeof(root_pgno) - + sizeof(nrec) - + sizeof(u_int32_t) + (rootent == NULL ? 0 : rootent->size) - + sizeof(*rootlsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (pgdbt == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &pgdbt->size, sizeof(pgdbt->size)); - bp += sizeof(pgdbt->size); - memcpy(bp, pgdbt->data, pgdbt->size); - bp += pgdbt->size; - } - memcpy(bp, &root_pgno, sizeof(root_pgno)); - bp += sizeof(root_pgno); - memcpy(bp, &nrec, sizeof(nrec)); - bp += sizeof(nrec); - if (rootent == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &rootent->size, sizeof(rootent->size)); - bp += sizeof(rootent->size); - memcpy(bp, rootent->data, rootent->size); - bp += rootent->size; - } - if (rootlsn != NULL) - memcpy(bp, rootlsn, sizeof(*rootlsn)); - else - memset(bp, 0, sizeof(*rootlsn)); - bp += sizeof(*rootlsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_rsplit_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_rsplit_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_rsplit_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_rsplit: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tpgdbt: "); - for (i = 0; i < argp->pgdbt.size; i++) { - ch = ((u_int8_t *)argp->pgdbt.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\troot_pgno: %lu\n", (u_long)argp->root_pgno); - printf("\tnrec: %lu\n", (u_long)argp->nrec); - printf("\trootent: "); - for (i = 0; i < argp->rootent.size; i++) { - ch = ((u_int8_t *)argp->rootent.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\trootlsn: [%lu][%lu]\n", - (u_long)argp->rootlsn.file, (u_long)argp->rootlsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_rsplit_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_rsplit_args **argpp; -{ - __bam_rsplit_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_rsplit_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memset(&argp->pgdbt, 0, sizeof(argp->pgdbt)); - memcpy(&argp->pgdbt.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->pgdbt.data = bp; - bp += argp->pgdbt.size; - memcpy(&argp->root_pgno, bp, sizeof(argp->root_pgno)); - bp += sizeof(argp->root_pgno); - memcpy(&argp->nrec, bp, sizeof(argp->nrec)); - bp += sizeof(argp->nrec); - memset(&argp->rootent, 0, sizeof(argp->rootent)); - memcpy(&argp->rootent.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->rootent.data = bp; - bp += argp->rootent.size; - memcpy(&argp->rootlsn, bp, sizeof(argp->rootlsn)); - bp += sizeof(argp->rootlsn); - *argpp = argp; - return (0); -} - -int -__bam_adj_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, lsn, indx, indx_copy, is_insert) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - DB_LSN * lsn; - u_int32_t indx; - u_int32_t indx_copy; - u_int32_t is_insert; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_adj; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(*lsn) - + sizeof(indx) - + sizeof(indx_copy) - + sizeof(is_insert); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - memcpy(bp, &indx_copy, sizeof(indx_copy)); - bp += sizeof(indx_copy); - memcpy(bp, &is_insert, sizeof(is_insert)); - bp += sizeof(is_insert); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_adj_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_adj_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_adj_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_adj: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\tindx_copy: %lu\n", (u_long)argp->indx_copy); - printf("\tis_insert: %lu\n", (u_long)argp->is_insert); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_adj_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_adj_args **argpp; -{ - __bam_adj_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_adj_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->indx_copy, bp, sizeof(argp->indx_copy)); - bp += sizeof(argp->indx_copy); - memcpy(&argp->is_insert, bp, sizeof(argp->is_insert)); - bp += sizeof(argp->is_insert); - *argpp = argp; - return (0); -} - -int -__bam_cadjust_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, lsn, indx, adjust, opflags) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - DB_LSN * lsn; - u_int32_t indx; - int32_t adjust; - u_int32_t opflags; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_cadjust; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(*lsn) - + sizeof(indx) - + sizeof(adjust) - + sizeof(opflags); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - memcpy(bp, &adjust, sizeof(adjust)); - bp += sizeof(adjust); - memcpy(bp, &opflags, sizeof(opflags)); - bp += sizeof(opflags); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_cadjust_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_cadjust_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_cadjust_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_cadjust: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\tadjust: %ld\n", (long)argp->adjust); - printf("\topflags: %lu\n", (u_long)argp->opflags); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_cadjust_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_cadjust_args **argpp; -{ - __bam_cadjust_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_cadjust_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->adjust, bp, sizeof(argp->adjust)); - bp += sizeof(argp->adjust); - memcpy(&argp->opflags, bp, sizeof(argp->opflags)); - bp += sizeof(argp->opflags); - *argpp = argp; - return (0); -} - -int -__bam_cdel_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, lsn, indx) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - DB_LSN * lsn; - u_int32_t indx; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_cdel; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(*lsn) - + sizeof(indx); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_cdel_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_cdel_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_cdel_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_cdel: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_cdel_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_cdel_args **argpp; -{ - __bam_cdel_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_cdel_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - *argpp = argp; - return (0); -} - -int -__bam_repl_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, lsn, indx, isdeleted, orig, - repl, prefix, suffix) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - DB_LSN * lsn; - u_int32_t indx; - u_int32_t isdeleted; - const DBT *orig; - const DBT *repl; - u_int32_t prefix; - u_int32_t suffix; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_repl; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(*lsn) - + sizeof(indx) - + sizeof(isdeleted) - + sizeof(u_int32_t) + (orig == NULL ? 0 : orig->size) - + sizeof(u_int32_t) + (repl == NULL ? 0 : repl->size) - + sizeof(prefix) - + sizeof(suffix); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - memcpy(bp, &isdeleted, sizeof(isdeleted)); - bp += sizeof(isdeleted); - if (orig == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &orig->size, sizeof(orig->size)); - bp += sizeof(orig->size); - memcpy(bp, orig->data, orig->size); - bp += orig->size; - } - if (repl == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &repl->size, sizeof(repl->size)); - bp += sizeof(repl->size); - memcpy(bp, repl->data, repl->size); - bp += repl->size; - } - memcpy(bp, &prefix, sizeof(prefix)); - bp += sizeof(prefix); - memcpy(bp, &suffix, sizeof(suffix)); - bp += sizeof(suffix); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_repl_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_repl_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_repl_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_repl: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\tisdeleted: %lu\n", (u_long)argp->isdeleted); - printf("\torig: "); - for (i = 0; i < argp->orig.size; i++) { - ch = ((u_int8_t *)argp->orig.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\trepl: "); - for (i = 0; i < argp->repl.size; i++) { - ch = ((u_int8_t *)argp->repl.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tprefix: %lu\n", (u_long)argp->prefix); - printf("\tsuffix: %lu\n", (u_long)argp->suffix); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_repl_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_repl_args **argpp; -{ - __bam_repl_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_repl_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->isdeleted, bp, sizeof(argp->isdeleted)); - bp += sizeof(argp->isdeleted); - memset(&argp->orig, 0, sizeof(argp->orig)); - memcpy(&argp->orig.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->orig.data = bp; - bp += argp->orig.size; - memset(&argp->repl, 0, sizeof(argp->repl)); - memcpy(&argp->repl.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->repl.data = bp; - bp += argp->repl.size; - memcpy(&argp->prefix, bp, sizeof(argp->prefix)); - bp += sizeof(argp->prefix); - memcpy(&argp->suffix, bp, sizeof(argp->suffix)); - bp += sizeof(argp->suffix); - *argpp = argp; - return (0); -} - -int -__bam_root_log(dbenv, txnid, ret_lsnp, flags, - fileid, meta_pgno, root_pgno, meta_lsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t meta_pgno; - db_pgno_t root_pgno; - DB_LSN * meta_lsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_root; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(meta_pgno) - + sizeof(root_pgno) - + sizeof(*meta_lsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &meta_pgno, sizeof(meta_pgno)); - bp += sizeof(meta_pgno); - memcpy(bp, &root_pgno, sizeof(root_pgno)); - bp += sizeof(root_pgno); - if (meta_lsn != NULL) - memcpy(bp, meta_lsn, sizeof(*meta_lsn)); - else - memset(bp, 0, sizeof(*meta_lsn)); - bp += sizeof(*meta_lsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_root_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_root_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_root_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_root: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno); - printf("\troot_pgno: %lu\n", (u_long)argp->root_pgno); - printf("\tmeta_lsn: [%lu][%lu]\n", - (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_root_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_root_args **argpp; -{ - __bam_root_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_root_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->meta_pgno, bp, sizeof(argp->meta_pgno)); - bp += sizeof(argp->meta_pgno); - memcpy(&argp->root_pgno, bp, sizeof(argp->root_pgno)); - bp += sizeof(argp->root_pgno); - memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); - bp += sizeof(argp->meta_lsn); - *argpp = argp; - return (0); -} - -int -__bam_curadj_log(dbenv, txnid, ret_lsnp, flags, - fileid, mode, from_pgno, to_pgno, left_pgno, first_indx, - from_indx, to_indx) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_ca_mode mode; - db_pgno_t from_pgno; - db_pgno_t to_pgno; - db_pgno_t left_pgno; - u_int32_t first_indx; - u_int32_t from_indx; - u_int32_t to_indx; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_curadj; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(mode) - + sizeof(from_pgno) - + sizeof(to_pgno) - + sizeof(left_pgno) - + sizeof(first_indx) - + sizeof(from_indx) - + sizeof(to_indx); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &mode, sizeof(mode)); - bp += sizeof(mode); - memcpy(bp, &from_pgno, sizeof(from_pgno)); - bp += sizeof(from_pgno); - memcpy(bp, &to_pgno, sizeof(to_pgno)); - bp += sizeof(to_pgno); - memcpy(bp, &left_pgno, sizeof(left_pgno)); - bp += sizeof(left_pgno); - memcpy(bp, &first_indx, sizeof(first_indx)); - bp += sizeof(first_indx); - memcpy(bp, &from_indx, sizeof(from_indx)); - bp += sizeof(from_indx); - memcpy(bp, &to_indx, sizeof(to_indx)); - bp += sizeof(to_indx); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_curadj_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_curadj_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_curadj_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_curadj: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tmode: %ld\n", (long)argp->mode); - printf("\tfrom_pgno: %lu\n", (u_long)argp->from_pgno); - printf("\tto_pgno: %lu\n", (u_long)argp->to_pgno); - printf("\tleft_pgno: %lu\n", (u_long)argp->left_pgno); - printf("\tfirst_indx: %lu\n", (u_long)argp->first_indx); - printf("\tfrom_indx: %lu\n", (u_long)argp->from_indx); - printf("\tto_indx: %lu\n", (u_long)argp->to_indx); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_curadj_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_curadj_args **argpp; -{ - __bam_curadj_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_curadj_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->mode, bp, sizeof(argp->mode)); - bp += sizeof(argp->mode); - memcpy(&argp->from_pgno, bp, sizeof(argp->from_pgno)); - bp += sizeof(argp->from_pgno); - memcpy(&argp->to_pgno, bp, sizeof(argp->to_pgno)); - bp += sizeof(argp->to_pgno); - memcpy(&argp->left_pgno, bp, sizeof(argp->left_pgno)); - bp += sizeof(argp->left_pgno); - memcpy(&argp->first_indx, bp, sizeof(argp->first_indx)); - bp += sizeof(argp->first_indx); - memcpy(&argp->from_indx, bp, sizeof(argp->from_indx)); - bp += sizeof(argp->from_indx); - memcpy(&argp->to_indx, bp, sizeof(argp->to_indx)); - bp += sizeof(argp->to_indx); - *argpp = argp; - return (0); -} - -int -__bam_rcuradj_log(dbenv, txnid, ret_lsnp, flags, - fileid, mode, root, recno, order) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - ca_recno_arg mode; - db_pgno_t root; - db_recno_t recno; - u_int32_t order; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_bam_rcuradj; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(mode) - + sizeof(root) - + sizeof(recno) - + sizeof(order); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &mode, sizeof(mode)); - bp += sizeof(mode); - memcpy(bp, &root, sizeof(root)); - bp += sizeof(root); - memcpy(bp, &recno, sizeof(recno)); - bp += sizeof(recno); - memcpy(bp, &order, sizeof(order)); - bp += sizeof(order); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__bam_rcuradj_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __bam_rcuradj_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __bam_rcuradj_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]bam_rcuradj: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tmode: %ld\n", (long)argp->mode); - printf("\troot: %ld\n", (long)argp->root); - printf("\trecno: %ld\n", (long)argp->recno); - printf("\torder: %ld\n", (long)argp->order); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__bam_rcuradj_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __bam_rcuradj_args **argpp; -{ - __bam_rcuradj_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__bam_rcuradj_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->mode, bp, sizeof(argp->mode)); - bp += sizeof(argp->mode); - memcpy(&argp->root, bp, sizeof(argp->root)); - bp += sizeof(argp->root); - memcpy(&argp->recno, bp, sizeof(argp->recno)); - bp += sizeof(argp->recno); - memcpy(&argp->order, bp, sizeof(argp->order)); - bp += sizeof(argp->order); - *argpp = argp; - return (0); -} - -int -__bam_init_print(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __bam_pg_alloc_print, DB_bam_pg_alloc)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_pg_alloc1_print, DB_bam_pg_alloc1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_pg_free_print, DB_bam_pg_free)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_pg_free1_print, DB_bam_pg_free1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_split1_print, DB_bam_split1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_split_print, DB_bam_split)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_rsplit1_print, DB_bam_rsplit1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_rsplit_print, DB_bam_rsplit)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_adj_print, DB_bam_adj)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_cadjust_print, DB_bam_cadjust)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_cdel_print, DB_bam_cdel)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_repl_print, DB_bam_repl)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_root_print, DB_bam_root)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_curadj_print, DB_bam_curadj)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_rcuradj_print, DB_bam_rcuradj)) != 0) - return (ret); - return (0); -} - -int -__bam_init_recover(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __bam_pg_alloc_recover, DB_bam_pg_alloc)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_bam_pg_alloc1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_pg_free_recover, DB_bam_pg_free)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_bam_pg_free1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_bam_split1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_split_recover, DB_bam_split)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_bam_rsplit1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_rsplit_recover, DB_bam_rsplit)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_adj_recover, DB_bam_adj)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_cadjust_recover, DB_bam_cadjust)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_cdel_recover, DB_bam_cdel)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_repl_recover, DB_bam_repl)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_root_recover, DB_bam_root)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_curadj_recover, DB_bam_curadj)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __bam_rcuradj_recover, DB_bam_rcuradj)) != 0) - return (ret); - return (0); -} - diff --git a/bdb/build_vxworks/db_int.h b/bdb/build_vxworks/db_int.h deleted file mode 100644 index 99dc2932e92..00000000000 --- a/bdb/build_vxworks/db_int.h +++ /dev/null @@ -1,398 +0,0 @@ -/* DO NOT EDIT: automatically built by dist/s_vxworks. */ -/*- - * See the file LICENSE for redistribution information. - * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 - * Sleepycat Software. All rights reserved. - * - * $Id: db_int.src,v 11.42 2001/01/11 17:49:17 krinsky Exp $ - */ - -#ifndef _DB_INTERNAL_H_ -#define _DB_INTERNAL_H_ - -/******************************************************* - * General includes. - *******************************************************/ -#include "db.h" - -#ifndef NO_SYSTEM_INCLUDES -#if defined(__STDC__) || defined(__cplusplus) -#include <stdarg.h> -#else -#include <varargs.h> -#endif -#include <errno.h> -#endif - -#include "queue.h" -#include "shqueue.h" - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************* - * General purpose constants and macros. - *******************************************************/ -#define UINT16_T_MAX 0xffff /* Maximum 16 bit unsigned. */ -#define UINT32_T_MAX 0xffffffff /* Maximum 32 bit unsigned. */ - -#define MEGABYTE 1048576 -#define GIGABYTE 1073741824 - -#define MS_PER_SEC 1000 /* Milliseconds in a second. */ -#define USEC_PER_MS 1000 /* Microseconds in a millisecond. */ - -#define DB_MIN_PGSIZE 0x000200 /* Minimum page size (512). */ -#define DB_MAX_PGSIZE 0x010000 /* Maximum page size (65536). */ - -#define RECNO_OOB 0 /* Illegal record number. */ - -/* - * If we are unable to determine the underlying filesystem block size, use - * 8K on the grounds that most OS's use less than 8K for a VM page size. - */ -#define DB_DEF_IOSIZE (8 * 1024) - -/* - * Aligning items to particular sizes or in pages or memory. - * - * db_align_t -- - * Largest integral type, used to align structures in memory. We don't store - * floating point types in structures, so integral types should be sufficient - * (and we don't have to worry about systems that store floats in other than - * power-of-2 numbers of bytes). Additionally this fixes compiler that rewrite - * structure assignments and ANSI C memcpy calls to be in-line instructions - * that happen to require alignment. Note: this alignment isn't sufficient for - * mutexes, which depend on things like cache line alignment. Mutex alignment - * is handled separately, in mutex.h. - * - * db_alignp_t -- - * Integral type that's the same size as a pointer. There are places where - * DB modifies pointers by discarding the bottom bits to guarantee alignment. - * We can't use db_align_t, it may be larger than the pointer, and compilers - * get upset about that. So far we haven't run on any machine where there - * isn't an integral type the same size as a pointer -- here's hoping. - */ -typedef unsigned long db_align_t; -typedef unsigned long db_alignp_t; - -/* Align an integer to a specific boundary. */ -#undef ALIGN -#define ALIGN(value, bound) \ - (((value) + (bound) - 1) & ~(((u_int)bound) - 1)) - -/* Align a pointer to a specific boundary. */ -#undef ALIGNP -#define ALIGNP(value, bound) ALIGN((db_alignp_t)value, bound) - -/* - * There are several on-page structures that are declared to have a number of - * fields followed by a variable length array of items. The structure size - * without including the variable length array or the address of the first of - * those elements can be found using SSZ. - * - * This macro can also be used to find the offset of a structure element in a - * structure. This is used in various places to copy structure elements from - * unaligned memory references, e.g., pointers into a packed page. - * - * There are two versions because compilers object if you take the address of - * an array. - */ -#undef SSZ -#define SSZ(name, field) ((int)&(((name *)0)->field)) - -#undef SSZA -#define SSZA(name, field) ((int)&(((name *)0)->field[0])) - -/* - * Print an address as a u_long (a u_long is the largest type we can print - * portably). Most 64-bit systems have made longs 64-bits, so this should - * work. - */ -#define P_TO_ULONG(p) ((u_long)(db_alignp_t)(p)) - -/* Structure used to print flag values. */ -typedef struct __fn { - u_int32_t mask; /* Flag value. */ - const char *name; /* Flag name. */ -} FN; - -/* Set, clear and test flags. */ -#define FLD_CLR(fld, f) (fld) &= ~(f) -#define FLD_ISSET(fld, f) ((fld) & (f)) -#define FLD_SET(fld, f) (fld) |= (f) -#define F_CLR(p, f) (p)->flags &= ~(f) -#define F_ISSET(p, f) ((p)->flags & (f)) -#define F_SET(p, f) (p)->flags |= (f) -#define LF_CLR(f) (flags &= ~(f)) -#define LF_ISSET(f) (flags & (f)) -#define LF_SET(f) (flags |= (f)) - -/* Display separator string. */ -#undef DB_LINE -#define DB_LINE "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" - -/* Unused, or not-used-yet variable. "Shut that bloody compiler up!" */ -#define COMPQUIET(n, v) (n) = (v) - -/******************************************************* - * Files. - *******************************************************/ - /* - * We use 1024 as the maximum path length. It's too hard to figure out what - * the real path length is, as it was traditionally stored in <sys/param.h>, - * and that file isn't always available. - */ -#undef MAXPATHLEN -#define MAXPATHLEN 1024 - -#define PATH_DOT "." /* Current working directory. */ -#define PATH_SEPARATOR "/\\" /* Path separator character. */ - -/* - * Flags understood by __os_open. - */ -#define DB_OSO_CREATE 0x001 /* POSIX: O_CREAT */ -#define DB_OSO_EXCL 0x002 /* POSIX: O_EXCL */ -#define DB_OSO_LOG 0x004 /* Opening a log file. */ -#define DB_OSO_RDONLY 0x008 /* POSIX: O_RDONLY */ -#define DB_OSO_REGION 0x010 /* Opening a region file. */ -#define DB_OSO_SEQ 0x020 /* Expected sequential access. */ -#define DB_OSO_TEMP 0x040 /* Remove after last close. */ -#define DB_OSO_TRUNC 0x080 /* POSIX: O_TRUNC */ - -/* - * Seek options understood by __os_seek. - */ -typedef enum { - DB_OS_SEEK_CUR, /* POSIX: SEEK_CUR */ - DB_OS_SEEK_END, /* POSIX: SEEK_END */ - DB_OS_SEEK_SET /* POSIX: SEEK_SET */ -} DB_OS_SEEK; - -/******************************************************* - * Environment. - *******************************************************/ -/* Type passed to __db_appname(). */ -typedef enum { - DB_APP_NONE=0, /* No type (region). */ - DB_APP_DATA, /* Data file. */ - DB_APP_LOG, /* Log file. */ - DB_APP_TMP /* Temporary file. */ -} APPNAME; - -/* - * CDB_LOCKING CDB product locking. - * LOCKING_ON Locking has been configured. - * LOGGING_ON Logging has been configured. - * MPOOL_ON Memory pool has been configured. - * TXN_ON Transactions have been configured. - */ -#define CDB_LOCKING(dbenv) F_ISSET(dbenv, DB_ENV_CDB) -#define LOCKING_ON(dbenv) ((dbenv)->lk_handle != NULL) -#define LOGGING_ON(dbenv) ((dbenv)->lg_handle != NULL) -#define MPOOL_ON(dbenv) ((dbenv)->mp_handle != NULL) -#define TXN_ON(dbenv) ((dbenv)->tx_handle != NULL) - -/* - * STD_LOCKING Standard locking, that is, locking was configured and CDB - * was not. We do not do locking in off-page duplicate trees, - * so we check for that in the cursor first. - */ -#define STD_LOCKING(dbc) \ - (!F_ISSET(dbc, DBC_OPD) && \ - !CDB_LOCKING((dbc)->dbp->dbenv) && LOCKING_ON((dbc)->dbp->dbenv)) - -/* - * IS_RECOVERING The system is running recovery. - */ -#define IS_RECOVERING(dbenv) \ - (LOGGING_ON(dbenv) && \ - F_ISSET((DB_LOG *)(dbenv)->lg_handle, DBLOG_RECOVER)) - -/* Most initialization methods cannot be called after open is called. */ -#define ENV_ILLEGAL_AFTER_OPEN(dbenv, name) \ - if (F_ISSET((dbenv), DB_ENV_OPEN_CALLED)) \ - return (__db_mi_open(dbenv, name, 1)); - -/* We're not actually user hostile, honest. */ -#define ENV_REQUIRES_CONFIG(dbenv, handle, subsystem) \ - if (handle == NULL) \ - return (__db_env_config(dbenv, subsystem)); - -/******************************************************* - * Database Access Methods. - *******************************************************/ -/* - * DB_IS_THREADED -- - * The database handle is free-threaded (was opened with DB_THREAD). - */ -#define DB_IS_THREADED(dbp) \ - ((dbp)->mutexp != NULL) - -/* Initialization methods are often illegal before/after open is called. */ -#define DB_ILLEGAL_AFTER_OPEN(dbp, name) \ - if (F_ISSET((dbp), DB_OPEN_CALLED)) \ - return (__db_mi_open(dbp->dbenv, name, 1)); -#define DB_ILLEGAL_BEFORE_OPEN(dbp, name) \ - if (!F_ISSET((dbp), DB_OPEN_CALLED)) \ - return (__db_mi_open(dbp->dbenv, name, 0)); -/* Some initialization methods are illegal if environment isn't local. */ -#define DB_ILLEGAL_IN_ENV(dbp, name) \ - if (!F_ISSET(dbp->dbenv, DB_ENV_DBLOCAL)) \ - return (__db_mi_env(dbp->dbenv, name)); -#define DB_ILLEGAL_METHOD(dbp, flags) { \ - int __ret; \ - if ((__ret = __dbh_am_chk(dbp, flags)) != 0) \ - return (__ret); \ -} - -/* - * Common DBC->internal fields. Each access method adds additional fields - * to this list, but the initial fields are common. - */ -#define __DBC_INTERNAL \ - DBC *opd; /* Off-page duplicate cursor. */\ - \ - void *page; /* Referenced page. */ \ - db_pgno_t root; /* Tree root. */ \ - db_pgno_t pgno; /* Referenced page number. */ \ - db_indx_t indx; /* Referenced key item index. */\ - \ - DB_LOCK lock; /* Cursor lock. */ \ - db_lockmode_t lock_mode; /* Lock mode. */ - -struct __dbc_internal { - __DBC_INTERNAL -}; - -/* - * Access-method-common macro for determining whether a cursor - * has been initialized. - */ -#define IS_INITIALIZED(dbc) ((dbc)->internal->pgno != PGNO_INVALID) - -/******************************************************* - * Mpool. - *******************************************************/ -/* - * File types for DB access methods. Negative numbers are reserved to DB. - */ -#define DB_FTYPE_SET -1 /* Call pgin/pgout functions. */ -#define DB_FTYPE_NOTSET 0 /* Don't call... */ - -/* Structure used as the DB pgin/pgout pgcookie. */ -typedef struct __dbpginfo { - size_t db_pagesize; /* Underlying page size. */ - int needswap; /* If swapping required. */ -} DB_PGINFO; - -/******************************************************* - * Log. - *******************************************************/ -/* Initialize an LSN to 'zero'. */ -#define ZERO_LSN(LSN) do { \ - (LSN).file = 0; \ - (LSN).offset = 0; \ -} while (0) - -/* Return 1 if LSN is a 'zero' lsn, otherwise return 0. */ -#define IS_ZERO_LSN(LSN) ((LSN).file == 0) - -/* Test if we need to log a change. */ -#define DB_LOGGING(dbc) \ - (LOGGING_ON((dbc)->dbp->dbenv) && !F_ISSET(dbc, DBC_RECOVER)) - -/* Internal flag for use with internal __log_unregister. */ -#define DB_LOGONLY 0x01 -/******************************************************* - * Txn. - *******************************************************/ -#define DB_NONBLOCK(C) ((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT)) -#define IS_SUBTRANSACTION(txn) \ - ((txn) != NULL && (txn)->parent != NULL) - -/******************************************************* - * Global variables. - *******************************************************/ -#ifdef HAVE_VXWORKS -#include "semLib.h" -#endif - -/* - * DB global variables. Done in a single structure to minimize the name-space - * pollution. - */ -typedef struct __db_globals { - u_int32_t db_pageyield; /* db_set_pageyield */ - u_int32_t db_panic; /* db_set_panic */ - u_int32_t db_region_init; /* db_set_region_init */ - u_int32_t db_tas_spins; /* db_set_tas_spins */ -#ifdef HAVE_VXWORKS - u_int32_t db_global_init; /* VxWorks: inited */ - SEM_ID db_global_lock; /* VxWorks: global semaphore */ -#endif - /* XA: list of opened environments. */ - TAILQ_HEAD(__db_envq, __db_env) db_envq; -} DB_GLOBALS; - -#ifdef DB_INITIALIZE_DB_GLOBALS -DB_GLOBALS __db_global_values = { - 0, /* db_set_pageyield */ - 1, /* db_set_panic */ - 0, /* db_set_region_init */ - 0, /* db_set_tas_spins */ -#ifdef HAVE_VXWORKS - 0, /* db_global_init */ - NULL, /* db_global_lock */ -#endif - /* XA environment queue */ - {NULL, &__db_global_values.db_envq.tqh_first} -}; -#else -extern DB_GLOBALS __db_global_values; -#endif -#define DB_GLOBAL(v) __db_global_values.v - -/* Forward structure declarations. */ -struct __db_reginfo_t; typedef struct __db_reginfo_t REGINFO; -struct __mutex_t; typedef struct __mutex_t MUTEX; -struct __vrfy_childinfo; typedef struct __vrfy_childinfo VRFY_CHILDINFO; -struct __vrfy_dbinfo; typedef struct __vrfy_dbinfo VRFY_DBINFO; -struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO; -struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST; -struct __db_txnhead; typedef struct __db_txnhead DB_TXNHEAD; -typedef enum { - TXNLIST_DELETE, - TXNLIST_LSN, - TXNLIST_TXNID, - TXNLIST_PGNO -} db_txnlist_type; - -/* - * Currently, region offsets are limited to 32-bits. I expect that's going - * to have to be fixed in the not-too-distant future, since we won't want to - * split 100Gb memory pools into that many different regions. It's typedef'd - * so it won't be too painful to upgrade. - */ -typedef u_int32_t roff_t; - -#if defined(__cplusplus) -} -#endif - -/******************************************************* - * More general includes. - *******************************************************/ -#include "debug.h" -#include "mutex.h" -#include "region.h" -#include "mutex_ext.h" -#include "env_ext.h" -#include "os.h" -#include "os_ext.h" -#include "common_ext.h" - -#endif /* !_DB_INTERNAL_H_ */ diff --git a/bdb/build_win32/db_int.h b/bdb/build_win32/db_int.h deleted file mode 100644 index 0eb4309fc7c..00000000000 --- a/bdb/build_win32/db_int.h +++ /dev/null @@ -1,398 +0,0 @@ -/* DO NOT EDIT: automatically built by dist/s_win32. */ -/*- - * See the file LICENSE for redistribution information. - * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 - * Sleepycat Software. All rights reserved. - * - * $Id: db_int.src,v 11.42 2001/01/11 17:49:17 krinsky Exp $ - */ - -#ifndef _DB_INTERNAL_H_ -#define _DB_INTERNAL_H_ - -/******************************************************* - * General includes. - *******************************************************/ -#include "db.h" - -#ifndef NO_SYSTEM_INCLUDES -#if defined(__STDC__) || defined(__cplusplus) -#include <stdarg.h> -#else -#include <varargs.h> -#endif -#include <errno.h> -#endif - -#include "queue.h" -#include "shqueue.h" - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************* - * General purpose constants and macros. - *******************************************************/ -#define UINT16_T_MAX 0xffff /* Maximum 16 bit unsigned. */ -#define UINT32_T_MAX 0xffffffff /* Maximum 32 bit unsigned. */ - -#define MEGABYTE 1048576 -#define GIGABYTE 1073741824 - -#define MS_PER_SEC 1000 /* Milliseconds in a second. */ -#define USEC_PER_MS 1000 /* Microseconds in a millisecond. */ - -#define DB_MIN_PGSIZE 0x000200 /* Minimum page size (512). */ -#define DB_MAX_PGSIZE 0x010000 /* Maximum page size (65536). */ - -#define RECNO_OOB 0 /* Illegal record number. */ - -/* - * If we are unable to determine the underlying filesystem block size, use - * 8K on the grounds that most OS's use less than 8K for a VM page size. - */ -#define DB_DEF_IOSIZE (8 * 1024) - -/* - * Aligning items to particular sizes or in pages or memory. - * - * db_align_t -- - * Largest integral type, used to align structures in memory. We don't store - * floating point types in structures, so integral types should be sufficient - * (and we don't have to worry about systems that store floats in other than - * power-of-2 numbers of bytes). Additionally this fixes compiler that rewrite - * structure assignments and ANSI C memcpy calls to be in-line instructions - * that happen to require alignment. Note: this alignment isn't sufficient for - * mutexes, which depend on things like cache line alignment. Mutex alignment - * is handled separately, in mutex.h. - * - * db_alignp_t -- - * Integral type that's the same size as a pointer. There are places where - * DB modifies pointers by discarding the bottom bits to guarantee alignment. - * We can't use db_align_t, it may be larger than the pointer, and compilers - * get upset about that. So far we haven't run on any machine where there - * isn't an integral type the same size as a pointer -- here's hoping. - */ -typedef unsigned long db_align_t; -typedef unsigned long db_alignp_t; - -/* Align an integer to a specific boundary. */ -#undef ALIGN -#define ALIGN(value, bound) \ - (((value) + (bound) - 1) & ~(((u_int)bound) - 1)) - -/* Align a pointer to a specific boundary. */ -#undef ALIGNP -#define ALIGNP(value, bound) ALIGN((db_alignp_t)value, bound) - -/* - * There are several on-page structures that are declared to have a number of - * fields followed by a variable length array of items. The structure size - * without including the variable length array or the address of the first of - * those elements can be found using SSZ. - * - * This macro can also be used to find the offset of a structure element in a - * structure. This is used in various places to copy structure elements from - * unaligned memory references, e.g., pointers into a packed page. - * - * There are two versions because compilers object if you take the address of - * an array. - */ -#undef SSZ -#define SSZ(name, field) ((int)&(((name *)0)->field)) - -#undef SSZA -#define SSZA(name, field) ((int)&(((name *)0)->field[0])) - -/* - * Print an address as a u_long (a u_long is the largest type we can print - * portably). Most 64-bit systems have made longs 64-bits, so this should - * work. - */ -#define P_TO_ULONG(p) ((u_long)(db_alignp_t)(p)) - -/* Structure used to print flag values. */ -typedef struct __fn { - u_int32_t mask; /* Flag value. */ - const char *name; /* Flag name. */ -} FN; - -/* Set, clear and test flags. */ -#define FLD_CLR(fld, f) (fld) &= ~(f) -#define FLD_ISSET(fld, f) ((fld) & (f)) -#define FLD_SET(fld, f) (fld) |= (f) -#define F_CLR(p, f) (p)->flags &= ~(f) -#define F_ISSET(p, f) ((p)->flags & (f)) -#define F_SET(p, f) (p)->flags |= (f) -#define LF_CLR(f) (flags &= ~(f)) -#define LF_ISSET(f) (flags & (f)) -#define LF_SET(f) (flags |= (f)) - -/* Display separator string. */ -#undef DB_LINE -#define DB_LINE "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" - -/* Unused, or not-used-yet variable. "Shut that bloody compiler up!" */ -#define COMPQUIET(n, v) (n) = (v) - -/******************************************************* - * Files. - *******************************************************/ - /* - * We use 1024 as the maximum path length. It's too hard to figure out what - * the real path length is, as it was traditionally stored in <sys/param.h>, - * and that file isn't always available. - */ -#undef MAXPATHLEN -#define MAXPATHLEN 1024 - -#define PATH_DOT "." /* Current working directory. */ -#define PATH_SEPARATOR "\\/:" /* Path separator character. */ - -/* - * Flags understood by __os_open. - */ -#define DB_OSO_CREATE 0x001 /* POSIX: O_CREAT */ -#define DB_OSO_EXCL 0x002 /* POSIX: O_EXCL */ -#define DB_OSO_LOG 0x004 /* Opening a log file. */ -#define DB_OSO_RDONLY 0x008 /* POSIX: O_RDONLY */ -#define DB_OSO_REGION 0x010 /* Opening a region file. */ -#define DB_OSO_SEQ 0x020 /* Expected sequential access. */ -#define DB_OSO_TEMP 0x040 /* Remove after last close. */ -#define DB_OSO_TRUNC 0x080 /* POSIX: O_TRUNC */ - -/* - * Seek options understood by __os_seek. - */ -typedef enum { - DB_OS_SEEK_CUR, /* POSIX: SEEK_CUR */ - DB_OS_SEEK_END, /* POSIX: SEEK_END */ - DB_OS_SEEK_SET /* POSIX: SEEK_SET */ -} DB_OS_SEEK; - -/******************************************************* - * Environment. - *******************************************************/ -/* Type passed to __db_appname(). */ -typedef enum { - DB_APP_NONE=0, /* No type (region). */ - DB_APP_DATA, /* Data file. */ - DB_APP_LOG, /* Log file. */ - DB_APP_TMP /* Temporary file. */ -} APPNAME; - -/* - * CDB_LOCKING CDB product locking. - * LOCKING_ON Locking has been configured. - * LOGGING_ON Logging has been configured. - * MPOOL_ON Memory pool has been configured. - * TXN_ON Transactions have been configured. - */ -#define CDB_LOCKING(dbenv) F_ISSET(dbenv, DB_ENV_CDB) -#define LOCKING_ON(dbenv) ((dbenv)->lk_handle != NULL) -#define LOGGING_ON(dbenv) ((dbenv)->lg_handle != NULL) -#define MPOOL_ON(dbenv) ((dbenv)->mp_handle != NULL) -#define TXN_ON(dbenv) ((dbenv)->tx_handle != NULL) - -/* - * STD_LOCKING Standard locking, that is, locking was configured and CDB - * was not. We do not do locking in off-page duplicate trees, - * so we check for that in the cursor first. - */ -#define STD_LOCKING(dbc) \ - (!F_ISSET(dbc, DBC_OPD) && \ - !CDB_LOCKING((dbc)->dbp->dbenv) && LOCKING_ON((dbc)->dbp->dbenv)) - -/* - * IS_RECOVERING The system is running recovery. - */ -#define IS_RECOVERING(dbenv) \ - (LOGGING_ON(dbenv) && \ - F_ISSET((DB_LOG *)(dbenv)->lg_handle, DBLOG_RECOVER)) - -/* Most initialization methods cannot be called after open is called. */ -#define ENV_ILLEGAL_AFTER_OPEN(dbenv, name) \ - if (F_ISSET((dbenv), DB_ENV_OPEN_CALLED)) \ - return (__db_mi_open(dbenv, name, 1)); - -/* We're not actually user hostile, honest. */ -#define ENV_REQUIRES_CONFIG(dbenv, handle, subsystem) \ - if (handle == NULL) \ - return (__db_env_config(dbenv, subsystem)); - -/******************************************************* - * Database Access Methods. - *******************************************************/ -/* - * DB_IS_THREADED -- - * The database handle is free-threaded (was opened with DB_THREAD). - */ -#define DB_IS_THREADED(dbp) \ - ((dbp)->mutexp != NULL) - -/* Initialization methods are often illegal before/after open is called. */ -#define DB_ILLEGAL_AFTER_OPEN(dbp, name) \ - if (F_ISSET((dbp), DB_OPEN_CALLED)) \ - return (__db_mi_open(dbp->dbenv, name, 1)); -#define DB_ILLEGAL_BEFORE_OPEN(dbp, name) \ - if (!F_ISSET((dbp), DB_OPEN_CALLED)) \ - return (__db_mi_open(dbp->dbenv, name, 0)); -/* Some initialization methods are illegal if environment isn't local. */ -#define DB_ILLEGAL_IN_ENV(dbp, name) \ - if (!F_ISSET(dbp->dbenv, DB_ENV_DBLOCAL)) \ - return (__db_mi_env(dbp->dbenv, name)); -#define DB_ILLEGAL_METHOD(dbp, flags) { \ - int __ret; \ - if ((__ret = __dbh_am_chk(dbp, flags)) != 0) \ - return (__ret); \ -} - -/* - * Common DBC->internal fields. Each access method adds additional fields - * to this list, but the initial fields are common. - */ -#define __DBC_INTERNAL \ - DBC *opd; /* Off-page duplicate cursor. */\ - \ - void *page; /* Referenced page. */ \ - db_pgno_t root; /* Tree root. */ \ - db_pgno_t pgno; /* Referenced page number. */ \ - db_indx_t indx; /* Referenced key item index. */\ - \ - DB_LOCK lock; /* Cursor lock. */ \ - db_lockmode_t lock_mode; /* Lock mode. */ - -struct __dbc_internal { - __DBC_INTERNAL -}; - -/* - * Access-method-common macro for determining whether a cursor - * has been initialized. - */ -#define IS_INITIALIZED(dbc) ((dbc)->internal->pgno != PGNO_INVALID) - -/******************************************************* - * Mpool. - *******************************************************/ -/* - * File types for DB access methods. Negative numbers are reserved to DB. - */ -#define DB_FTYPE_SET -1 /* Call pgin/pgout functions. */ -#define DB_FTYPE_NOTSET 0 /* Don't call... */ - -/* Structure used as the DB pgin/pgout pgcookie. */ -typedef struct __dbpginfo { - size_t db_pagesize; /* Underlying page size. */ - int needswap; /* If swapping required. */ -} DB_PGINFO; - -/******************************************************* - * Log. - *******************************************************/ -/* Initialize an LSN to 'zero'. */ -#define ZERO_LSN(LSN) do { \ - (LSN).file = 0; \ - (LSN).offset = 0; \ -} while (0) - -/* Return 1 if LSN is a 'zero' lsn, otherwise return 0. */ -#define IS_ZERO_LSN(LSN) ((LSN).file == 0) - -/* Test if we need to log a change. */ -#define DB_LOGGING(dbc) \ - (LOGGING_ON((dbc)->dbp->dbenv) && !F_ISSET(dbc, DBC_RECOVER)) - -/* Internal flag for use with internal __log_unregister. */ -#define DB_LOGONLY 0x01 -/******************************************************* - * Txn. - *******************************************************/ -#define DB_NONBLOCK(C) ((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT)) -#define IS_SUBTRANSACTION(txn) \ - ((txn) != NULL && (txn)->parent != NULL) - -/******************************************************* - * Global variables. - *******************************************************/ -#ifdef HAVE_VXWORKS -#include "semLib.h" -#endif - -/* - * DB global variables. Done in a single structure to minimize the name-space - * pollution. - */ -typedef struct __db_globals { - u_int32_t db_pageyield; /* db_set_pageyield */ - u_int32_t db_panic; /* db_set_panic */ - u_int32_t db_region_init; /* db_set_region_init */ - u_int32_t db_tas_spins; /* db_set_tas_spins */ -#ifdef HAVE_VXWORKS - u_int32_t db_global_init; /* VxWorks: inited */ - SEM_ID db_global_lock; /* VxWorks: global semaphore */ -#endif - /* XA: list of opened environments. */ - TAILQ_HEAD(__db_envq, __db_env) db_envq; -} DB_GLOBALS; - -#ifdef DB_INITIALIZE_DB_GLOBALS -DB_GLOBALS __db_global_values = { - 0, /* db_set_pageyield */ - 1, /* db_set_panic */ - 0, /* db_set_region_init */ - 0, /* db_set_tas_spins */ -#ifdef HAVE_VXWORKS - 0, /* db_global_init */ - NULL, /* db_global_lock */ -#endif - /* XA environment queue */ - {NULL, &__db_global_values.db_envq.tqh_first} -}; -#else -extern DB_GLOBALS __db_global_values; -#endif -#define DB_GLOBAL(v) __db_global_values.v - -/* Forward structure declarations. */ -struct __db_reginfo_t; typedef struct __db_reginfo_t REGINFO; -struct __mutex_t; typedef struct __mutex_t MUTEX; -struct __vrfy_childinfo; typedef struct __vrfy_childinfo VRFY_CHILDINFO; -struct __vrfy_dbinfo; typedef struct __vrfy_dbinfo VRFY_DBINFO; -struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO; -struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST; -struct __db_txnhead; typedef struct __db_txnhead DB_TXNHEAD; -typedef enum { - TXNLIST_DELETE, - TXNLIST_LSN, - TXNLIST_TXNID, - TXNLIST_PGNO -} db_txnlist_type; - -/* - * Currently, region offsets are limited to 32-bits. I expect that's going - * to have to be fixed in the not-too-distant future, since we won't want to - * split 100Gb memory pools into that many different regions. It's typedef'd - * so it won't be too painful to upgrade. - */ -typedef u_int32_t roff_t; - -#if defined(__cplusplus) -} -#endif - -/******************************************************* - * More general includes. - *******************************************************/ -#include "debug.h" -#include "mutex.h" -#include "region.h" -#include "mutex_ext.h" -#include "env_ext.h" -#include "os.h" -#include "os_ext.h" -#include "common_ext.h" - -#endif /* !_DB_INTERNAL_H_ */ diff --git a/bdb/build_win32/include.tcl b/bdb/build_win32/include.tcl deleted file mode 100644 index 4f123413020..00000000000 --- a/bdb/build_win32/include.tcl +++ /dev/null @@ -1,16 +0,0 @@ -set tclsh_path SET_YOUR_TCLSH_PATH -set test_path ../test -set tcllib ./Debug/libdb_tcl32d.dll - -set KILL ./dbkill.exe - -# DO NOT EDIT BELOW THIS LINE: automatically built by dist/s_tcl. - -global dict -global testdir -global util_path -set testdir ./TESTDIR - -global is_hp_test -global is_qnx_test -global is_windows_test diff --git a/bdb/build_win32/libdb.rc b/bdb/build_win32/libdb.rc deleted file mode 100644 index 2261d69ce14..00000000000 --- a/bdb/build_win32/libdb.rc +++ /dev/null @@ -1,33 +0,0 @@ -1 VERSIONINFO - FILEVERSION 3,0,2,9 - PRODUCTVERSION 3,0,2,9 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L - -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Sleepycat Software\0" - VALUE "FileDescription", "Berkeley DB 3.0 DLL\0" - VALUE "FileVersion", "3.2.9\0" - VALUE "InternalName", "libdb.dll\0" - VALUE "LegalCopyright", "Copyright © Sleepycat Software Inc. 1997, 1998, 1999, 2000\0" - VALUE "OriginalFilename", "libdb.dll\0" - VALUE "ProductName", "Sleepycat Software libdb\0" - VALUE "ProductVersion", "3.2.9\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END diff --git a/bdb/db/crdel_auto.c b/bdb/db/crdel_auto.c deleted file mode 100644 index f2204410ee8..00000000000 --- a/bdb/db/crdel_auto.c +++ /dev/null @@ -1,900 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <ctype.h> -#include <errno.h> -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "db_dispatch.h" -#include "db_am.h" -#include "txn.h" - -int -__crdel_fileopen_log(dbenv, txnid, ret_lsnp, flags, - name, mode) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - const DBT *name; - u_int32_t mode; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_crdel_fileopen; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(u_int32_t) + (name == NULL ? 0 : name->size) - + sizeof(mode); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - if (name == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &name->size, sizeof(name->size)); - bp += sizeof(name->size); - memcpy(bp, name->data, name->size); - bp += name->size; - } - memcpy(bp, &mode, sizeof(mode)); - bp += sizeof(mode); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__crdel_fileopen_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __crdel_fileopen_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __crdel_fileopen_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]crdel_fileopen: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tname: "); - for (i = 0; i < argp->name.size; i++) { - ch = ((u_int8_t *)argp->name.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tmode: %o\n", argp->mode); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__crdel_fileopen_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __crdel_fileopen_args **argpp; -{ - __crdel_fileopen_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__crdel_fileopen_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memset(&argp->name, 0, sizeof(argp->name)); - memcpy(&argp->name.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->name.data = bp; - bp += argp->name.size; - memcpy(&argp->mode, bp, sizeof(argp->mode)); - bp += sizeof(argp->mode); - *argpp = argp; - return (0); -} - -int -__crdel_metasub_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, page, lsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - const DBT *page; - DB_LSN * lsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_crdel_metasub; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(u_int32_t) + (page == NULL ? 0 : page->size) - + sizeof(*lsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (page == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &page->size, sizeof(page->size)); - bp += sizeof(page->size); - memcpy(bp, page->data, page->size); - bp += page->size; - } - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__crdel_metasub_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __crdel_metasub_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __crdel_metasub_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]crdel_metasub: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %d\n", argp->pgno); - printf("\tpage: "); - for (i = 0; i < argp->page.size; i++) { - ch = ((u_int8_t *)argp->page.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__crdel_metasub_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __crdel_metasub_args **argpp; -{ - __crdel_metasub_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__crdel_metasub_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memset(&argp->page, 0, sizeof(argp->page)); - memcpy(&argp->page.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->page.data = bp; - bp += argp->page.size; - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - *argpp = argp; - return (0); -} - -int -__crdel_metapage_log(dbenv, txnid, ret_lsnp, flags, - fileid, name, pgno, page) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - const DBT *name; - db_pgno_t pgno; - const DBT *page; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_crdel_metapage; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(u_int32_t) + (name == NULL ? 0 : name->size) - + sizeof(pgno) - + sizeof(u_int32_t) + (page == NULL ? 0 : page->size); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (name == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &name->size, sizeof(name->size)); - bp += sizeof(name->size); - memcpy(bp, name->data, name->size); - bp += name->size; - } - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (page == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &page->size, sizeof(page->size)); - bp += sizeof(page->size); - memcpy(bp, page->data, page->size); - bp += page->size; - } - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__crdel_metapage_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __crdel_metapage_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __crdel_metapage_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]crdel_metapage: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tname: "); - for (i = 0; i < argp->name.size; i++) { - ch = ((u_int8_t *)argp->name.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tpgno: %d\n", argp->pgno); - printf("\tpage: "); - for (i = 0; i < argp->page.size; i++) { - ch = ((u_int8_t *)argp->page.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__crdel_metapage_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __crdel_metapage_args **argpp; -{ - __crdel_metapage_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__crdel_metapage_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memset(&argp->name, 0, sizeof(argp->name)); - memcpy(&argp->name.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->name.data = bp; - bp += argp->name.size; - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memset(&argp->page, 0, sizeof(argp->page)); - memcpy(&argp->page.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->page.data = bp; - bp += argp->page.size; - *argpp = argp; - return (0); -} - -int -__crdel_old_delete_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __crdel_old_delete_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __crdel_old_delete_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]crdel_old_delete: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tname: "); - for (i = 0; i < argp->name.size; i++) { - ch = ((u_int8_t *)argp->name.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__crdel_old_delete_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __crdel_old_delete_args **argpp; -{ - __crdel_old_delete_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__crdel_old_delete_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memset(&argp->name, 0, sizeof(argp->name)); - memcpy(&argp->name.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->name.data = bp; - bp += argp->name.size; - *argpp = argp; - return (0); -} - -int -__crdel_rename_log(dbenv, txnid, ret_lsnp, flags, - fileid, name, newname) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - const DBT *name; - const DBT *newname; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_crdel_rename; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(u_int32_t) + (name == NULL ? 0 : name->size) - + sizeof(u_int32_t) + (newname == NULL ? 0 : newname->size); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (name == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &name->size, sizeof(name->size)); - bp += sizeof(name->size); - memcpy(bp, name->data, name->size); - bp += name->size; - } - if (newname == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &newname->size, sizeof(newname->size)); - bp += sizeof(newname->size); - memcpy(bp, newname->data, newname->size); - bp += newname->size; - } - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__crdel_rename_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __crdel_rename_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __crdel_rename_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]crdel_rename: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tname: "); - for (i = 0; i < argp->name.size; i++) { - ch = ((u_int8_t *)argp->name.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tnewname: "); - for (i = 0; i < argp->newname.size; i++) { - ch = ((u_int8_t *)argp->newname.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__crdel_rename_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __crdel_rename_args **argpp; -{ - __crdel_rename_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__crdel_rename_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memset(&argp->name, 0, sizeof(argp->name)); - memcpy(&argp->name.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->name.data = bp; - bp += argp->name.size; - memset(&argp->newname, 0, sizeof(argp->newname)); - memcpy(&argp->newname.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->newname.data = bp; - bp += argp->newname.size; - *argpp = argp; - return (0); -} - -int -__crdel_delete_log(dbenv, txnid, ret_lsnp, flags, - fileid, name) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - const DBT *name; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_crdel_delete; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(u_int32_t) + (name == NULL ? 0 : name->size); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (name == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &name->size, sizeof(name->size)); - bp += sizeof(name->size); - memcpy(bp, name->data, name->size); - bp += name->size; - } - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__crdel_delete_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __crdel_delete_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __crdel_delete_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]crdel_delete: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tname: "); - for (i = 0; i < argp->name.size; i++) { - ch = ((u_int8_t *)argp->name.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__crdel_delete_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __crdel_delete_args **argpp; -{ - __crdel_delete_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__crdel_delete_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memset(&argp->name, 0, sizeof(argp->name)); - memcpy(&argp->name.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->name.data = bp; - bp += argp->name.size; - *argpp = argp; - return (0); -} - -int -__crdel_init_print(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __crdel_fileopen_print, DB_crdel_fileopen)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __crdel_metasub_print, DB_crdel_metasub)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __crdel_metapage_print, DB_crdel_metapage)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __crdel_old_delete_print, DB_crdel_old_delete)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __crdel_rename_print, DB_crdel_rename)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __crdel_delete_print, DB_crdel_delete)) != 0) - return (ret); - return (0); -} - -int -__crdel_init_recover(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __crdel_fileopen_recover, DB_crdel_fileopen)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __crdel_metasub_recover, DB_crdel_metasub)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __crdel_metapage_recover, DB_crdel_metapage)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_crdel_old_delete)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __crdel_rename_recover, DB_crdel_rename)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __crdel_delete_recover, DB_crdel_delete)) != 0) - return (ret); - return (0); -} - diff --git a/bdb/db/db_auto.c b/bdb/db/db_auto.c deleted file mode 100644 index 23540adc2e6..00000000000 --- a/bdb/db/db_auto.c +++ /dev/null @@ -1,1270 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <ctype.h> -#include <errno.h> -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "db_dispatch.h" -#include "db_am.h" -#include "txn.h" - -int -__db_addrem_log(dbenv, txnid, ret_lsnp, flags, - opcode, fileid, pgno, indx, nbytes, hdr, - dbt, pagelsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - u_int32_t indx; - size_t nbytes; - const DBT *hdr; - const DBT *dbt; - DB_LSN * pagelsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_db_addrem; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(opcode) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(indx) - + sizeof(nbytes) - + sizeof(u_int32_t) + (hdr == NULL ? 0 : hdr->size) - + sizeof(u_int32_t) + (dbt == NULL ? 0 : dbt->size) - + sizeof(*pagelsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - memcpy(bp, &nbytes, sizeof(nbytes)); - bp += sizeof(nbytes); - if (hdr == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &hdr->size, sizeof(hdr->size)); - bp += sizeof(hdr->size); - memcpy(bp, hdr->data, hdr->size); - bp += hdr->size; - } - if (dbt == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &dbt->size, sizeof(dbt->size)); - bp += sizeof(dbt->size); - memcpy(bp, dbt->data, dbt->size); - bp += dbt->size; - } - if (pagelsn != NULL) - memcpy(bp, pagelsn, sizeof(*pagelsn)); - else - memset(bp, 0, sizeof(*pagelsn)); - bp += sizeof(*pagelsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__db_addrem_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __db_addrem_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __db_addrem_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]db_addrem: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\tnbytes: %lu\n", (u_long)argp->nbytes); - printf("\thdr: "); - for (i = 0; i < argp->hdr.size; i++) { - ch = ((u_int8_t *)argp->hdr.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tdbt: "); - for (i = 0; i < argp->dbt.size; i++) { - ch = ((u_int8_t *)argp->dbt.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__db_addrem_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __db_addrem_args **argpp; -{ - __db_addrem_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__db_addrem_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->nbytes, bp, sizeof(argp->nbytes)); - bp += sizeof(argp->nbytes); - memset(&argp->hdr, 0, sizeof(argp->hdr)); - memcpy(&argp->hdr.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->hdr.data = bp; - bp += argp->hdr.size; - memset(&argp->dbt, 0, sizeof(argp->dbt)); - memcpy(&argp->dbt.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->dbt.data = bp; - bp += argp->dbt.size; - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - *argpp = argp; - return (0); -} - -int -__db_split_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __db_split_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __db_split_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]db_split: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tpageimage: "); - for (i = 0; i < argp->pageimage.size; i++) { - ch = ((u_int8_t *)argp->pageimage.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__db_split_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __db_split_args **argpp; -{ - __db_split_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__db_split_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memset(&argp->pageimage, 0, sizeof(argp->pageimage)); - memcpy(&argp->pageimage.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->pageimage.data = bp; - bp += argp->pageimage.size; - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - *argpp = argp; - return (0); -} - -int -__db_big_log(dbenv, txnid, ret_lsnp, flags, - opcode, fileid, pgno, prev_pgno, next_pgno, dbt, - pagelsn, prevlsn, nextlsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - db_pgno_t prev_pgno; - db_pgno_t next_pgno; - const DBT *dbt; - DB_LSN * pagelsn; - DB_LSN * prevlsn; - DB_LSN * nextlsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_db_big; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(opcode) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(prev_pgno) - + sizeof(next_pgno) - + sizeof(u_int32_t) + (dbt == NULL ? 0 : dbt->size) - + sizeof(*pagelsn) - + sizeof(*prevlsn) - + sizeof(*nextlsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &prev_pgno, sizeof(prev_pgno)); - bp += sizeof(prev_pgno); - memcpy(bp, &next_pgno, sizeof(next_pgno)); - bp += sizeof(next_pgno); - if (dbt == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &dbt->size, sizeof(dbt->size)); - bp += sizeof(dbt->size); - memcpy(bp, dbt->data, dbt->size); - bp += dbt->size; - } - if (pagelsn != NULL) - memcpy(bp, pagelsn, sizeof(*pagelsn)); - else - memset(bp, 0, sizeof(*pagelsn)); - bp += sizeof(*pagelsn); - if (prevlsn != NULL) - memcpy(bp, prevlsn, sizeof(*prevlsn)); - else - memset(bp, 0, sizeof(*prevlsn)); - bp += sizeof(*prevlsn); - if (nextlsn != NULL) - memcpy(bp, nextlsn, sizeof(*nextlsn)); - else - memset(bp, 0, sizeof(*nextlsn)); - bp += sizeof(*nextlsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__db_big_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __db_big_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __db_big_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]db_big: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tprev_pgno: %lu\n", (u_long)argp->prev_pgno); - printf("\tnext_pgno: %lu\n", (u_long)argp->next_pgno); - printf("\tdbt: "); - for (i = 0; i < argp->dbt.size; i++) { - ch = ((u_int8_t *)argp->dbt.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\tprevlsn: [%lu][%lu]\n", - (u_long)argp->prevlsn.file, (u_long)argp->prevlsn.offset); - printf("\tnextlsn: [%lu][%lu]\n", - (u_long)argp->nextlsn.file, (u_long)argp->nextlsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__db_big_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __db_big_args **argpp; -{ - __db_big_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__db_big_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->prev_pgno, bp, sizeof(argp->prev_pgno)); - bp += sizeof(argp->prev_pgno); - memcpy(&argp->next_pgno, bp, sizeof(argp->next_pgno)); - bp += sizeof(argp->next_pgno); - memset(&argp->dbt, 0, sizeof(argp->dbt)); - memcpy(&argp->dbt.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->dbt.data = bp; - bp += argp->dbt.size; - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - memcpy(&argp->prevlsn, bp, sizeof(argp->prevlsn)); - bp += sizeof(argp->prevlsn); - memcpy(&argp->nextlsn, bp, sizeof(argp->nextlsn)); - bp += sizeof(argp->nextlsn); - *argpp = argp; - return (0); -} - -int -__db_ovref_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, adjust, lsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - int32_t adjust; - DB_LSN * lsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_db_ovref; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(adjust) - + sizeof(*lsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &adjust, sizeof(adjust)); - bp += sizeof(adjust); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__db_ovref_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __db_ovref_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __db_ovref_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]db_ovref: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tadjust: %ld\n", (long)argp->adjust); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__db_ovref_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __db_ovref_args **argpp; -{ - __db_ovref_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__db_ovref_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->adjust, bp, sizeof(argp->adjust)); - bp += sizeof(argp->adjust); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - *argpp = argp; - return (0); -} - -int -__db_relink_log(dbenv, txnid, ret_lsnp, flags, - opcode, fileid, pgno, lsn, prev, lsn_prev, - next, lsn_next) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - DB_LSN * lsn; - db_pgno_t prev; - DB_LSN * lsn_prev; - db_pgno_t next; - DB_LSN * lsn_next; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_db_relink; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(opcode) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(*lsn) - + sizeof(prev) - + sizeof(*lsn_prev) - + sizeof(next) - + sizeof(*lsn_next); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - memcpy(bp, &prev, sizeof(prev)); - bp += sizeof(prev); - if (lsn_prev != NULL) - memcpy(bp, lsn_prev, sizeof(*lsn_prev)); - else - memset(bp, 0, sizeof(*lsn_prev)); - bp += sizeof(*lsn_prev); - memcpy(bp, &next, sizeof(next)); - bp += sizeof(next); - if (lsn_next != NULL) - memcpy(bp, lsn_next, sizeof(*lsn_next)); - else - memset(bp, 0, sizeof(*lsn_next)); - bp += sizeof(*lsn_next); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__db_relink_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __db_relink_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __db_relink_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]db_relink: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\tprev: %lu\n", (u_long)argp->prev); - printf("\tlsn_prev: [%lu][%lu]\n", - (u_long)argp->lsn_prev.file, (u_long)argp->lsn_prev.offset); - printf("\tnext: %lu\n", (u_long)argp->next); - printf("\tlsn_next: [%lu][%lu]\n", - (u_long)argp->lsn_next.file, (u_long)argp->lsn_next.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__db_relink_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __db_relink_args **argpp; -{ - __db_relink_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__db_relink_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - memcpy(&argp->prev, bp, sizeof(argp->prev)); - bp += sizeof(argp->prev); - memcpy(&argp->lsn_prev, bp, sizeof(argp->lsn_prev)); - bp += sizeof(argp->lsn_prev); - memcpy(&argp->next, bp, sizeof(argp->next)); - bp += sizeof(argp->next); - memcpy(&argp->lsn_next, bp, sizeof(argp->lsn_next)); - bp += sizeof(argp->lsn_next); - *argpp = argp; - return (0); -} - -int -__db_addpage_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __db_addpage_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __db_addpage_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]db_addpage: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\tnextpgno: %lu\n", (u_long)argp->nextpgno); - printf("\tnextlsn: [%lu][%lu]\n", - (u_long)argp->nextlsn.file, (u_long)argp->nextlsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__db_addpage_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __db_addpage_args **argpp; -{ - __db_addpage_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__db_addpage_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - memcpy(&argp->nextpgno, bp, sizeof(argp->nextpgno)); - bp += sizeof(argp->nextpgno); - memcpy(&argp->nextlsn, bp, sizeof(argp->nextlsn)); - bp += sizeof(argp->nextlsn); - *argpp = argp; - return (0); -} - -int -__db_debug_log(dbenv, txnid, ret_lsnp, flags, - op, fileid, key, data, arg_flags) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - const DBT *op; - int32_t fileid; - const DBT *key; - const DBT *data; - u_int32_t arg_flags; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_db_debug; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(u_int32_t) + (op == NULL ? 0 : op->size) - + sizeof(fileid) - + sizeof(u_int32_t) + (key == NULL ? 0 : key->size) - + sizeof(u_int32_t) + (data == NULL ? 0 : data->size) - + sizeof(arg_flags); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - if (op == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &op->size, sizeof(op->size)); - bp += sizeof(op->size); - memcpy(bp, op->data, op->size); - bp += op->size; - } - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (key == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &key->size, sizeof(key->size)); - bp += sizeof(key->size); - memcpy(bp, key->data, key->size); - bp += key->size; - } - if (data == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &data->size, sizeof(data->size)); - bp += sizeof(data->size); - memcpy(bp, data->data, data->size); - bp += data->size; - } - memcpy(bp, &arg_flags, sizeof(arg_flags)); - bp += sizeof(arg_flags); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__db_debug_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __db_debug_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __db_debug_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]db_debug: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\top: "); - for (i = 0; i < argp->op.size; i++) { - ch = ((u_int8_t *)argp->op.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tkey: "); - for (i = 0; i < argp->key.size; i++) { - ch = ((u_int8_t *)argp->key.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tdata: "); - for (i = 0; i < argp->data.size; i++) { - ch = ((u_int8_t *)argp->data.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\targ_flags: %lu\n", (u_long)argp->arg_flags); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__db_debug_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __db_debug_args **argpp; -{ - __db_debug_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__db_debug_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memset(&argp->op, 0, sizeof(argp->op)); - memcpy(&argp->op.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->op.data = bp; - bp += argp->op.size; - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memset(&argp->key, 0, sizeof(argp->key)); - memcpy(&argp->key.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->key.data = bp; - bp += argp->key.size; - memset(&argp->data, 0, sizeof(argp->data)); - memcpy(&argp->data.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->data.data = bp; - bp += argp->data.size; - memcpy(&argp->arg_flags, bp, sizeof(argp->arg_flags)); - bp += sizeof(argp->arg_flags); - *argpp = argp; - return (0); -} - -int -__db_noop_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, prevlsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - DB_LSN * prevlsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_db_noop; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(*prevlsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (prevlsn != NULL) - memcpy(bp, prevlsn, sizeof(*prevlsn)); - else - memset(bp, 0, sizeof(*prevlsn)); - bp += sizeof(*prevlsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__db_noop_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __db_noop_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __db_noop_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]db_noop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tprevlsn: [%lu][%lu]\n", - (u_long)argp->prevlsn.file, (u_long)argp->prevlsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__db_noop_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __db_noop_args **argpp; -{ - __db_noop_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__db_noop_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->prevlsn, bp, sizeof(argp->prevlsn)); - bp += sizeof(argp->prevlsn); - *argpp = argp; - return (0); -} - -int -__db_init_print(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __db_addrem_print, DB_db_addrem)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_split_print, DB_db_split)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_big_print, DB_db_big)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_ovref_print, DB_db_ovref)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_relink_print, DB_db_relink)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_addpage_print, DB_db_addpage)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_debug_print, DB_db_debug)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_noop_print, DB_db_noop)) != 0) - return (ret); - return (0); -} - -int -__db_init_recover(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __db_addrem_recover, DB_db_addrem)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_db_split)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_big_recover, DB_db_big)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_ovref_recover, DB_db_ovref)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_relink_recover, DB_db_relink)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_db_addpage)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_debug_recover, DB_db_debug)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __db_noop_recover, DB_db_noop)) != 0) - return (ret); - return (0); -} - diff --git a/bdb/dist/build/chk.def b/bdb/dist/build/chk.def deleted file mode 100755 index abd12b83908..00000000000 --- a/bdb/dist/build/chk.def +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -# -# $Id: chk.def,v 1.4 2000/12/12 18:20:59 bostic Exp $ -# -# Check to make sure we haven't forgotten to add any interfaces -# to the Win32 libdb.def file. - -# Run from the top-level directory. -[ -f db_config.h ] && cd .. - -f=build_win32/libdb.def -t1=/tmp/__1 -t2=/tmp/__2 - -sed '/; /d' $f | - egrep @ | - awk '{print $1}' | - sed -e '/db_xa_switch/d' \ - -e '/^__/d' -e '/^;/d' | - sort > ${t1} - -egrep __P include/db.src | - sed '/^[a-z]/!d' | - awk '{print $2}' | - sed 's/^\*//' | - sed '/^__/d' | sort > ${t2} - -if cmp -s ${t1} ${t2} ; then - : -else - echo "<<< libdb.def" - echo ">>> DB include files" - diff ${t1} ${t2} -fi - -# Check to make sure we don't have any extras in the libdb.def file. -sed '/; /d' $f | - egrep @ | - awk '{print $1}' | - sed -e '/__db_global_values/d' > ${t1} - -for i in `cat ${t1}`; do - if egrep $i */*.c > /dev/null; then - : - else - echo "$f: $i not found in DB sources" - fi -done - -rm -f ${t1} ${t2} diff --git a/bdb/dist/build/chk.define b/bdb/dist/build/chk.define deleted file mode 100755 index 9e2aa0db498..00000000000 --- a/bdb/dist/build/chk.define +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -# -# $Id: chk.define,v 1.8 2000/12/12 18:20:59 bostic Exp $ -# -# Check to make sure that all #defines are actually used. - -# Run from the top-level directory. -[ -f db_config.h ] && cd .. - -t1=/tmp/__1 - -egrep '^#define' include/*.h | - sed -e '/db_185.h/d' -e '/xa.h/d' | - awk '{print $2}' | - sed -e '/^B_DELETE/d' \ - -e '/^B_MAX/d' \ - -e '/^CIRCLEQ/d' \ - -e '/^DB_RO_ACCESS/d' \ - -e '/^DEFINE_DB_CLASS/d' \ - -e '/^LIST/d' \ - -e '/^LOG_OP/d' \ - -e '/^MINFILL/d' \ - -e '/^MUTEX_FIELDS/d' \ - -e '/^NCACHED2X/d' \ - -e '/^NCACHED30/d' \ - -e '/^PAIR_MASK/d' \ - -e '/^POWER_OF_TWO/d' \ - -e '/^P_16_COPY/d' \ - -e '/^P_32_COPY/d' \ - -e '/^P_32_SWAP/d' \ - -e '/^SH_CIRCLEQ/d' \ - -e '/^SH_LIST/d' \ - -e '/^SH_TAILQ/d' \ - -e '/^TAILQ/d' \ - -e '/UNUSED/d' \ - -e '/^WRAPPED_CLASS/d' \ - -e '/^XA_$/d' \ - -e '/^_DB_SERVER_H_RPCGEN/d' \ - -e '/_AUTO_H$/d' \ - -e '/_H_$/d' \ - -e '/ext_h_/d' \ - -e '/^i_/d' \ - -e 's/(.*//' | sort > ${t1} - -for i in `cat ${t1}`; do - if egrep -w $i */*.c */*.cpp > /dev/null; then - :; - else - f=`egrep -l $i include/*.h | - sed 's;include/;;' | tr -s "[:space:]" " "` - echo "$i: $f" - fi -done | sort +1 - -rm -f ${t1} diff --git a/bdb/dist/build/chk.offt b/bdb/dist/build/chk.offt deleted file mode 100755 index ea7f0b914fc..00000000000 --- a/bdb/dist/build/chk.offt +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# -# $Id: chk.offt,v 1.3 2000/12/12 18:20:59 bostic Exp $ -# -# Make sure that no off_t's have snuck into the release. - -# Run from the top-level directory. -[ -f db_config.h ] && cd .. - -egrep -w off_t */*.[ch] | -sed -e "/#undef off_t/d" \ - -e "/mp_fopen.c:.*can't use off_t's here/d" \ - -e "/mp_fopen.c:.*size or type off_t's or/d" \ - -e "/mp_fopen.c:.*where an off_t is 32-bits/d" \ - -e "/os_map.c:.*(off_t)0))/d" \ - -e "/os_rw.c:.*(off_t)db_iop->pgno/d" \ - -e "/os_seek.c:.*off_t offset;/d" \ - -e "/os_seek.c:.*offset = /d" \ - -e "/test_vxworks\/vx_mutex.c:/d" diff --git a/bdb/dist/build/chk.srcfiles b/bdb/dist/build/chk.srcfiles deleted file mode 100755 index cfd6f955ea7..00000000000 --- a/bdb/dist/build/chk.srcfiles +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -# -# $Id: chk.srcfiles,v 1.3 2000/12/12 18:20:59 bostic Exp $ -# -# Check to make sure we haven't forgotten to add any files to the list -# of source files Win32 uses to build its dsp files. - -# Run from the top-level directory. -[ -f db_config.h ] && cd .. - -f=dist/srcfiles.in -t1=/tmp/__1 -t2=/tmp/__2 - -sed -e '/^[ #]/d' \ - -e '/^$/d' < $f | - awk '{print $1}' > ${t1} -find . -type f | - sed -e 's/^\.\///' | - egrep '\.c$|\.cpp$|\.def$|\.rc$' | - sed -e '/dist\/build\/chk.def/d' \ - -e '/perl.DB_File\/version.c/d' | - sort > ${t2} - -cmp ${t1} ${t2} > /dev/null || -(echo "<<< srcfiles.in >>> existing files" && \ - diff ${t1} ${t2} | tee /tmp/_f) - -rm -f ${t1} ${t2} diff --git a/bdb/dist/build/chk.tags b/bdb/dist/build/chk.tags deleted file mode 100755 index fa67927e731..00000000000 --- a/bdb/dist/build/chk.tags +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# -# $Id: chk.tags,v 1.5 2000/12/22 15:35:32 bostic Exp $ -# -# Check to make sure we don't need any more symbolic links to tags files. - -# Run from the top-level directory. -[ -f db_config.h ] && cd .. - -t1=/tmp/__1 -t2=/tmp/__2 - -(ls -F | egrep / | sort | - sed -e 's/\///' \ - -e '/^CVS$/d' \ - -e '/^build_vxworks$/d' \ - -e '/^build_win32$/d' \ - -e '/^docs$/d' \ - -e '/^docs.text$/d' \ - -e '/^docs_src$/d' \ - -e '/^docs_text$/d' \ - -e '/^java$/d' \ - -e '/^perl.BerkeleyDB$/d' \ - -e '/^perl.DB_File$/d' \ - -e '/^test$/d' \ - -e '/^test_purify$/d' \ - -e '/^test_thread$/d' \ - -e '/^test_vxworks$/d') > ${t1} - -(ls */tags | sed 's/\/tags$//' | sort) > ${t2} -if diff ${t1} ${t2} > /dev/null; then - : -else - echo "<<< source tree" - echo ">>> tags files" - diff ${t1} ${t2} -fi - -rm -f ${t1} ${t2} diff --git a/bdb/dist/config.guess b/bdb/dist/config.guess deleted file mode 100755 index 08e8a750ac6..00000000000 --- a/bdb/dist/config.guess +++ /dev/null @@ -1,1289 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. - -version='2000-09-05' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Written by Per Bothner <bothner@cygnus.com>. -# Please send patches to <config-patches@gnu.org>. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of this system. - -Operation modes: - -h, --help print this help, then exit - -V, --version print version number, then exit" - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case "$1" in - --version | --vers* | -V ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - exec >&2 - echo "$me: invalid option $1" - echo "$help" - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi -fi - - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # Netbsd (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # Determine the machine/vendor (is the vendor relevant). - case "${UNAME_MACHINE}" in - amiga) machine=m68k-unknown ;; - arm32) machine=arm-unknown ;; - atari*) machine=m68k-atari ;; - sun3*) machine=m68k-sun ;; - mac68k) machine=m68k-apple ;; - macppc) machine=powerpc-apple ;; - hp3[0-9][05]) machine=m68k-hp ;; - ibmrt|romp-ibm) machine=romp-ibm ;; - *) machine=${UNAME_MACHINE}-unknown ;; - esac - # The Operating System including object format. - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - cat <<EOF >$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:4) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=4.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - rm -f $dummy.c $dummy - esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i?86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - *:Linux:*:*) - - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d - s/[ ][ ]*/ /g - s/.*supported emulations: *// - s/ .*// - p'` - case "$ld_supported_emulations" in - *ia64) - echo "${UNAME_MACHINE}-unknown-linux" - exit 0 - ;; - i?86linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 - ;; - elf_i?86) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - i?86coff) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 - ;; - sparclinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - armlinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32arm*) - echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" - exit 0 - ;; - armelf_linux*) - echo "${UNAME_MACHINE}-unknown-linux-gnu" - exit 0 - ;; - m68klinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32ppc | elf32ppclinux) - # Determine Lib Version - cat >$dummy.c <<EOF -#include <features.h> -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unkown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} - exit 0 - ;; - shelf_linux) - echo "${UNAME_MACHINE}-unknown-linux-gnu" - exit 0 - ;; - esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - cat <<EOF >$dummy.s - .data - \$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main - main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c <<EOF -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - elif test "${UNAME_MACHINE}" = "s390"; then - echo s390-ibm-linux && exit 0 - elif test "${UNAME_MACHINE}" = "x86_64"; then - echo x86_64-unknown-linux-gnu && exit 0 - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >$dummy.c <<EOF -#include <features.h> -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - fi ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) - echo i386-sequent-sysv4 - exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i?86:*:5:7*) - # Fixed at (any) Pentium or better - UNAME_MACHINE=i586 - if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then - echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi - exit 0 ;; - i?86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - i?86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - if test "${UNAME_MACHINE}" = "x86pc"; then - UNAME_MACHINE=pc - fi - echo `uname -p`-${UNAME_MACHINE}-nto-qnx - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[KW]:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -The $version version of this script cannot recognize your system type. -Please download the most up to date version of the config scripts: - - ftp://ftp.gnu.org/pub/gnu/config/ - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. - -config.guess version = $version - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "version='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/bdb/dist/config.hin b/bdb/dist/config.hin deleted file mode 100644 index d153bc0f872..00000000000 --- a/bdb/dist/config.hin +++ /dev/null @@ -1,231 +0,0 @@ -/* config.hin. Generated automatically from configure.in by autoheader. */ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define if your struct stat has st_blksize. */ -#undef HAVE_ST_BLKSIZE - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef mode_t - -/* Define to `long' if <sys/types.h> doesn't define. */ -#undef off_t - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef pid_t - -/* Define to `unsigned' if <sys/types.h> doesn't define. */ -#undef size_t - -/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ -#undef STAT_MACROS_BROKEN - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if you can safely include both <sys/time.h> and <time.h>. */ -#undef TIME_WITH_SYS_TIME - -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Define if you are building a version for running the test suite. */ -#undef CONFIG_TEST - -/* Define if you want a debugging version. */ -#undef DEBUG - -/* Define if you want a version that logs read operations. */ -#undef DEBUG_ROP - -/* Define if you want a version that logs write operations. */ -#undef DEBUG_WOP - -/* Define if you want a version with run-time diagnostic checking. */ -#undef DIAGNOSTIC - -/* Define if you want to mask harmless unitialized memory read/writes. */ -#undef UMRW - -/* Define if fcntl/F_SETFD denies child access to file descriptors. */ -#undef HAVE_FCNTL_F_SETFD - -/* Define if building big-file environment (e.g., AIX, HP/UX, Solaris). */ -#undef HAVE_FILE_OFFSET_BITS - -/* Mutex possibilities. */ -#undef HAVE_MUTEX_68K_GCC_ASSEMBLY -#undef HAVE_MUTEX_AIX_CHECK_LOCK -#undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY -#undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY -#undef HAVE_MUTEX_HPPA_MSEM_INIT -#undef HAVE_MUTEX_IA64_GCC_ASSEMBLY -#undef HAVE_MUTEX_MACOS -#undef HAVE_MUTEX_MSEM_INIT -#undef HAVE_MUTEX_PPC_GCC_ASSEMBLY -#undef HAVE_MUTEX_PTHREADS -#undef HAVE_MUTEX_RELIANTUNIX_INITSPIN -#undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY -#undef HAVE_MUTEX_SEMA_INIT -#undef HAVE_MUTEX_SGI_INIT_LOCK -#undef HAVE_MUTEX_SOLARIS_LOCK_TRY -#undef HAVE_MUTEX_SOLARIS_LWP -#undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY -#undef HAVE_MUTEX_THREADS -#undef HAVE_MUTEX_UI_THREADS -#undef HAVE_MUTEX_UTS_CC_ASSEMBLY -#undef HAVE_MUTEX_VMS -#undef HAVE_MUTEX_VXWORKS -#undef HAVE_MUTEX_WIN16 -#undef HAVE_MUTEX_WIN32 -#undef HAVE_MUTEX_X86_GCC_ASSEMBLY - -/* Define if building on QNX. */ -#undef HAVE_QNX - -/* Define if building RPC client/server. */ -#undef HAVE_RPC - -/* Define if your sprintf returns a pointer, not a length. */ -#undef SPRINTF_RET_CHARPNT - -/* Define if you have the getcwd function. */ -#undef HAVE_GETCWD - -/* Define if you have the getopt function. */ -#undef HAVE_GETOPT - -/* Define if you have the getuid function. */ -#undef HAVE_GETUID - -/* Define if you have the memcmp function. */ -#undef HAVE_MEMCMP - -/* Define if you have the memcpy function. */ -#undef HAVE_MEMCPY - -/* Define if you have the memmove function. */ -#undef HAVE_MEMMOVE - -/* Define if you have the mlock function. */ -#undef HAVE_MLOCK - -/* Define if you have the mmap function. */ -#undef HAVE_MMAP - -/* Define if you have the munlock function. */ -#undef HAVE_MUNLOCK - -/* Define if you have the munmap function. */ -#undef HAVE_MUNMAP - -/* Define if you have the pread function. */ -#undef HAVE_PREAD - -/* Define if you have the pstat_getdynamic function. */ -#undef HAVE_PSTAT_GETDYNAMIC - -/* Define if you have the pwrite function. */ -#undef HAVE_PWRITE - -/* Define if you have the qsort function. */ -#undef HAVE_QSORT - -/* Define if you have the raise function. */ -#undef HAVE_RAISE - -/* Define if you have the sched_yield function. */ -#undef HAVE_SCHED_YIELD - -/* Define if you have the select function. */ -#undef HAVE_SELECT - -/* Define if you have the shmget function. */ -#undef HAVE_SHMGET - -/* Define if you have the snprintf function. */ -#undef HAVE_SNPRINTF - -/* Define if you have the strcasecmp function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the strerror function. */ -#undef HAVE_STRERROR - -/* Define if you have the strtoul function. */ -#undef HAVE_STRTOUL - -/* Define if you have the sysconf function. */ -#undef HAVE_SYSCONF - -/* Define if you have the vsnprintf function. */ -#undef HAVE_VSNPRINTF - -/* Define if you have the yield function. */ -#undef HAVE_YIELD - -/* Define if you have the <dirent.h> header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the <ndir.h> header file. */ -#undef HAVE_NDIR_H - -/* Define if you have the <sys/dir.h> header file. */ -#undef HAVE_SYS_DIR_H - -/* Define if you have the <sys/ndir.h> header file. */ -#undef HAVE_SYS_NDIR_H - -/* Define if you have the <sys/select.h> header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define if you have the <sys/time.h> header file. */ -#undef HAVE_SYS_TIME_H - -/* Define if you have the nsl library (-lnsl). */ -#undef HAVE_LIBNSL - -/* - * Big-file configuration. - */ -#ifdef HAVE_FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 64 -#endif - -/* - * Don't step on the namespace. Other libraries may have their own - * implementations of these functions, we don't want to use their - * implementations or force them to use ours based on the load order. - */ -#ifndef HAVE_GETCWD -#define getcwd __db_Cgetcwd -#endif -#ifndef HAVE_GETOPT -#define getopt __db_Cgetopt -#endif -#ifndef HAVE_MEMCMP -#define memcmp __db_Cmemcmp -#endif -#ifndef HAVE_MEMCPY -#define memcpy __db_Cmemcpy -#endif -#ifndef HAVE_MEMMOVE -#define memmove __db_Cmemmove -#endif -#ifndef HAVE_RAISE -#define raise __db_Craise -#endif -#ifndef HAVE_SNPRINTF -#define snprintf __db_Csnprintf -#endif -#ifndef HAVE_STRCASECMP -#define strcasecmp __db_Cstrcasecmp -#endif -#ifndef HAVE_STRERROR -#define strerror __db_Cstrerror -#endif -#ifndef HAVE_VSNPRINTF -#define vsnprintf __db_Cvsnprintf -#endif diff --git a/bdb/dist/config.sub b/bdb/dist/config.sub deleted file mode 100755 index 42fc991d08a..00000000000 --- a/bdb/dist/config.sub +++ /dev/null @@ -1,1328 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. - -version='2000-09-11' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Please send patches to <config-patches@gnu.org>. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -V, --version print version number, then exit" - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case "$1" in - --version | --vers* | -V ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - exec >&2 - echo "$me: invalid option $1" - echo "$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | armv[2345] | armv[345][lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | hppa64 \ - | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ - | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | sh[34] \ - | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el | mcore \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | d30v | fr30 | avr) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i[234567]86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ - | hppa2.0n-* | hppa64-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ - | alphaev6[78]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ - | bs2000-* | tic54x-* | c54x-* | x86_64-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i[34567]86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i[34567]86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i[34567]86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; - i[34567]86-pw32 | pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - msdos) - basic_machine=i386-unknown - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexen) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=rs6000-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sparclite-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=t3e-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xmp) - basic_machine=xmp-cray - os=-unicos - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4) - base_machine=sh-unknown - ;; - sparc | sparcv9) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i[34567]86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto*) - os=-nto-qnx - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -*MiNT) - os=-mint - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f301-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -*MiNT) - vendor=atari - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "version='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/bdb/dist/install-sh b/bdb/dist/install-sh deleted file mode 100755 index b41a2459161..00000000000 --- a/bdb/dist/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=$mkdirprog - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/bdb/dist/template/rec_btree b/bdb/dist/template/rec_btree deleted file mode 100644 index 6c954db1afb..00000000000 --- a/bdb/dist/template/rec_btree +++ /dev/null @@ -1,943 +0,0 @@ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "bam.h" -#include "log.h" - -/* - * __bam_pg_alloc_recover -- - * Recovery function for pg_alloc. - * - * PUBLIC: int __bam_pg_alloc_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_pg_alloc_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_pg_alloc_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_pg_alloc_print); - REC_INTRO(__bam_pg_alloc_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_pg_alloc1_recover -- - * Recovery function for pg_alloc1. - * - * PUBLIC: int __bam_pg_alloc1_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_pg_alloc1_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_pg_alloc1_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_pg_alloc1_print); - REC_INTRO(__bam_pg_alloc1_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_pg_free_recover -- - * Recovery function for pg_free. - * - * PUBLIC: int __bam_pg_free_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_pg_free_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_pg_free_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_pg_free_print); - REC_INTRO(__bam_pg_free_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_pg_free1_recover -- - * Recovery function for pg_free1. - * - * PUBLIC: int __bam_pg_free1_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_pg_free1_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_pg_free1_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_pg_free1_print); - REC_INTRO(__bam_pg_free1_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_split1_recover -- - * Recovery function for split1. - * - * PUBLIC: int __bam_split1_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_split1_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_split1_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_split1_print); - REC_INTRO(__bam_split1_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_split_recover -- - * Recovery function for split. - * - * PUBLIC: int __bam_split_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_split_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_split_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_split_print); - REC_INTRO(__bam_split_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_rsplit1_recover -- - * Recovery function for rsplit1. - * - * PUBLIC: int __bam_rsplit1_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_rsplit1_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_rsplit1_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_rsplit1_print); - REC_INTRO(__bam_rsplit1_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_rsplit_recover -- - * Recovery function for rsplit. - * - * PUBLIC: int __bam_rsplit_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_rsplit_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_rsplit_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_rsplit_print); - REC_INTRO(__bam_rsplit_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_adj_recover -- - * Recovery function for adj. - * - * PUBLIC: int __bam_adj_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_adj_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_adj_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_adj_print); - REC_INTRO(__bam_adj_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_cadjust_recover -- - * Recovery function for cadjust. - * - * PUBLIC: int __bam_cadjust_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_cadjust_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_cadjust_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_cadjust_print); - REC_INTRO(__bam_cadjust_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_cdel_recover -- - * Recovery function for cdel. - * - * PUBLIC: int __bam_cdel_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_cdel_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_cdel_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_cdel_print); - REC_INTRO(__bam_cdel_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_repl_recover -- - * Recovery function for repl. - * - * PUBLIC: int __bam_repl_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_repl_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_repl_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_repl_print); - REC_INTRO(__bam_repl_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_root_recover -- - * Recovery function for root. - * - * PUBLIC: int __bam_root_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_root_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_root_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_root_print); - REC_INTRO(__bam_root_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_curadj_recover -- - * Recovery function for curadj. - * - * PUBLIC: int __bam_curadj_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_curadj_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_curadj_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_curadj_print); - REC_INTRO(__bam_curadj_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __bam_rcuradj_recover -- - * Recovery function for rcuradj. - * - * PUBLIC: int __bam_rcuradj_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__bam_rcuradj_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __bam_rcuradj_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__bam_rcuradj_print); - REC_INTRO(__bam_rcuradj_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - diff --git a/bdb/dist/template/rec_crdel b/bdb/dist/template/rec_crdel deleted file mode 100644 index 352e9ae5f22..00000000000 --- a/bdb/dist/template/rec_crdel +++ /dev/null @@ -1,385 +0,0 @@ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "crdel.h" -#include "log.h" - -/* - * __crdel_fileopen_recover -- - * Recovery function for fileopen. - * - * PUBLIC: int __crdel_fileopen_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__crdel_fileopen_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __crdel_fileopen_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__crdel_fileopen_print); - REC_INTRO(__crdel_fileopen_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __crdel_metasub_recover -- - * Recovery function for metasub. - * - * PUBLIC: int __crdel_metasub_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__crdel_metasub_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __crdel_metasub_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__crdel_metasub_print); - REC_INTRO(__crdel_metasub_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __crdel_metapage_recover -- - * Recovery function for metapage. - * - * PUBLIC: int __crdel_metapage_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__crdel_metapage_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __crdel_metapage_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__crdel_metapage_print); - REC_INTRO(__crdel_metapage_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __crdel_old_delete_recover -- - * Recovery function for old_delete. - * - * PUBLIC: int __crdel_old_delete_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__crdel_old_delete_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __crdel_old_delete_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__crdel_old_delete_print); - REC_INTRO(__crdel_old_delete_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __crdel_rename_recover -- - * Recovery function for rename. - * - * PUBLIC: int __crdel_rename_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__crdel_rename_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __crdel_rename_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__crdel_rename_print); - REC_INTRO(__crdel_rename_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __crdel_delete_recover -- - * Recovery function for delete. - * - * PUBLIC: int __crdel_delete_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__crdel_delete_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __crdel_delete_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__crdel_delete_print); - REC_INTRO(__crdel_delete_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - diff --git a/bdb/dist/template/rec_db b/bdb/dist/template/rec_db deleted file mode 100644 index 69d941351c5..00000000000 --- a/bdb/dist/template/rec_db +++ /dev/null @@ -1,509 +0,0 @@ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "db.h" -#include "log.h" - -/* - * __db_addrem_recover -- - * Recovery function for addrem. - * - * PUBLIC: int __db_addrem_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__db_addrem_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __db_addrem_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__db_addrem_print); - REC_INTRO(__db_addrem_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __db_split_recover -- - * Recovery function for split. - * - * PUBLIC: int __db_split_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__db_split_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __db_split_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__db_split_print); - REC_INTRO(__db_split_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __db_big_recover -- - * Recovery function for big. - * - * PUBLIC: int __db_big_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__db_big_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __db_big_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__db_big_print); - REC_INTRO(__db_big_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __db_ovref_recover -- - * Recovery function for ovref. - * - * PUBLIC: int __db_ovref_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__db_ovref_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __db_ovref_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__db_ovref_print); - REC_INTRO(__db_ovref_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __db_relink_recover -- - * Recovery function for relink. - * - * PUBLIC: int __db_relink_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__db_relink_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __db_relink_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__db_relink_print); - REC_INTRO(__db_relink_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __db_addpage_recover -- - * Recovery function for addpage. - * - * PUBLIC: int __db_addpage_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__db_addpage_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __db_addpage_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__db_addpage_print); - REC_INTRO(__db_addpage_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __db_debug_recover -- - * Recovery function for debug. - * - * PUBLIC: int __db_debug_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__db_debug_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __db_debug_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__db_debug_print); - REC_INTRO(__db_debug_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __db_noop_recover -- - * Recovery function for noop. - * - * PUBLIC: int __db_noop_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__db_noop_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __db_noop_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__db_noop_print); - REC_INTRO(__db_noop_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - diff --git a/bdb/dist/template/rec_hash b/bdb/dist/template/rec_hash deleted file mode 100644 index bcee2131cdc..00000000000 --- a/bdb/dist/template/rec_hash +++ /dev/null @@ -1,881 +0,0 @@ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "ham.h" -#include "log.h" - -/* - * __ham_insdel_recover -- - * Recovery function for insdel. - * - * PUBLIC: int __ham_insdel_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_insdel_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_insdel_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_insdel_print); - REC_INTRO(__ham_insdel_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_newpage_recover -- - * Recovery function for newpage. - * - * PUBLIC: int __ham_newpage_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_newpage_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_newpage_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_newpage_print); - REC_INTRO(__ham_newpage_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_splitmeta_recover -- - * Recovery function for splitmeta. - * - * PUBLIC: int __ham_splitmeta_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_splitmeta_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_splitmeta_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_splitmeta_print); - REC_INTRO(__ham_splitmeta_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_splitdata_recover -- - * Recovery function for splitdata. - * - * PUBLIC: int __ham_splitdata_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_splitdata_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_splitdata_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_splitdata_print); - REC_INTRO(__ham_splitdata_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_replace_recover -- - * Recovery function for replace. - * - * PUBLIC: int __ham_replace_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_replace_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_replace_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_replace_print); - REC_INTRO(__ham_replace_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_newpgno_recover -- - * Recovery function for newpgno. - * - * PUBLIC: int __ham_newpgno_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_newpgno_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_newpgno_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_newpgno_print); - REC_INTRO(__ham_newpgno_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_ovfl_recover -- - * Recovery function for ovfl. - * - * PUBLIC: int __ham_ovfl_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_ovfl_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_ovfl_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_ovfl_print); - REC_INTRO(__ham_ovfl_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_copypage_recover -- - * Recovery function for copypage. - * - * PUBLIC: int __ham_copypage_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_copypage_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_copypage_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_copypage_print); - REC_INTRO(__ham_copypage_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_metagroup_recover -- - * Recovery function for metagroup. - * - * PUBLIC: int __ham_metagroup_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_metagroup_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_metagroup_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_metagroup_print); - REC_INTRO(__ham_metagroup_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_groupalloc1_recover -- - * Recovery function for groupalloc1. - * - * PUBLIC: int __ham_groupalloc1_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_groupalloc1_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_groupalloc1_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_groupalloc1_print); - REC_INTRO(__ham_groupalloc1_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_groupalloc2_recover -- - * Recovery function for groupalloc2. - * - * PUBLIC: int __ham_groupalloc2_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_groupalloc2_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_groupalloc2_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_groupalloc2_print); - REC_INTRO(__ham_groupalloc2_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_groupalloc_recover -- - * Recovery function for groupalloc. - * - * PUBLIC: int __ham_groupalloc_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_groupalloc_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_groupalloc_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_groupalloc_print); - REC_INTRO(__ham_groupalloc_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_curadj_recover -- - * Recovery function for curadj. - * - * PUBLIC: int __ham_curadj_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_curadj_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_curadj_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_curadj_print); - REC_INTRO(__ham_curadj_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __ham_chgpg_recover -- - * Recovery function for chgpg. - * - * PUBLIC: int __ham_chgpg_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__ham_chgpg_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __ham_chgpg_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__ham_chgpg_print); - REC_INTRO(__ham_chgpg_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - diff --git a/bdb/dist/template/rec_log b/bdb/dist/template/rec_log deleted file mode 100644 index 1ce40b37804..00000000000 --- a/bdb/dist/template/rec_log +++ /dev/null @@ -1,137 +0,0 @@ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "log.h" -#include "log.h" - -/* - * __log_register1_recover -- - * Recovery function for register1. - * - * PUBLIC: int __log_register1_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__log_register1_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __log_register1_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__log_register1_print); - REC_INTRO(__log_register1_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __log_register_recover -- - * Recovery function for register. - * - * PUBLIC: int __log_register_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__log_register_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __log_register_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__log_register_print); - REC_INTRO(__log_register_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - diff --git a/bdb/dist/template/rec_qam b/bdb/dist/template/rec_qam deleted file mode 100644 index fcd24d6a28e..00000000000 --- a/bdb/dist/template/rec_qam +++ /dev/null @@ -1,509 +0,0 @@ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "qam.h" -#include "log.h" - -/* - * __qam_inc_recover -- - * Recovery function for inc. - * - * PUBLIC: int __qam_inc_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__qam_inc_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __qam_inc_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__qam_inc_print); - REC_INTRO(__qam_inc_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __qam_incfirst_recover -- - * Recovery function for incfirst. - * - * PUBLIC: int __qam_incfirst_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__qam_incfirst_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __qam_incfirst_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__qam_incfirst_print); - REC_INTRO(__qam_incfirst_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __qam_mvptr_recover -- - * Recovery function for mvptr. - * - * PUBLIC: int __qam_mvptr_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__qam_mvptr_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __qam_mvptr_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__qam_mvptr_print); - REC_INTRO(__qam_mvptr_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __qam_del_recover -- - * Recovery function for del. - * - * PUBLIC: int __qam_del_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__qam_del_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __qam_del_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__qam_del_print); - REC_INTRO(__qam_del_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __qam_add_recover -- - * Recovery function for add. - * - * PUBLIC: int __qam_add_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__qam_add_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __qam_add_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__qam_add_print); - REC_INTRO(__qam_add_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __qam_delete_recover -- - * Recovery function for delete. - * - * PUBLIC: int __qam_delete_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__qam_delete_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __qam_delete_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__qam_delete_print); - REC_INTRO(__qam_delete_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __qam_rename_recover -- - * Recovery function for rename. - * - * PUBLIC: int __qam_rename_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__qam_rename_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __qam_rename_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__qam_rename_print); - REC_INTRO(__qam_rename_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __qam_delext_recover -- - * Recovery function for delext. - * - * PUBLIC: int __qam_delext_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__qam_delext_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __qam_delext_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__qam_delext_print); - REC_INTRO(__qam_delext_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - diff --git a/bdb/dist/template/rec_txn b/bdb/dist/template/rec_txn deleted file mode 100644 index c66d604f578..00000000000 --- a/bdb/dist/template/rec_txn +++ /dev/null @@ -1,509 +0,0 @@ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "txn.h" -#include "log.h" - -/* - * __txn_old_regop_recover -- - * Recovery function for old_regop. - * - * PUBLIC: int __txn_old_regop_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__txn_old_regop_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __txn_old_regop_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__txn_old_regop_print); - REC_INTRO(__txn_old_regop_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __txn_regop_recover -- - * Recovery function for regop. - * - * PUBLIC: int __txn_regop_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__txn_regop_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __txn_regop_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__txn_regop_print); - REC_INTRO(__txn_regop_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __txn_old_ckp_recover -- - * Recovery function for old_ckp. - * - * PUBLIC: int __txn_old_ckp_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__txn_old_ckp_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __txn_old_ckp_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__txn_old_ckp_print); - REC_INTRO(__txn_old_ckp_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __txn_ckp_recover -- - * Recovery function for ckp. - * - * PUBLIC: int __txn_ckp_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__txn_ckp_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __txn_ckp_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__txn_ckp_print); - REC_INTRO(__txn_ckp_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __txn_xa_regop_old_recover -- - * Recovery function for xa_regop_old. - * - * PUBLIC: int __txn_xa_regop_old_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__txn_xa_regop_old_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __txn_xa_regop_old_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__txn_xa_regop_old_print); - REC_INTRO(__txn_xa_regop_old_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __txn_xa_regop_recover -- - * Recovery function for xa_regop. - * - * PUBLIC: int __txn_xa_regop_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__txn_xa_regop_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __txn_xa_regop_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__txn_xa_regop_print); - REC_INTRO(__txn_xa_regop_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __txn_child_old_recover -- - * Recovery function for child_old. - * - * PUBLIC: int __txn_child_old_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__txn_child_old_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __txn_child_old_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__txn_child_old_print); - REC_INTRO(__txn_child_old_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __txn_child_recover -- - * Recovery function for child. - * - * PUBLIC: int __txn_child_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__txn_child_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __txn_child_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__txn_child_print); - REC_INTRO(__txn_child_read); - - if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = memp_fget(mpf, - &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) - goto out; - } else { - *lsnp = argp->prev_lsn; - ret = 0; - goto out; - } - - modified = 0; - cmp_n = log_compare(lsnp, &LSN(pagep)); - - /* - * Use this when there is something like "pagelsn" in the argp - * structure. Sometimes, you might need to compare meta-data - * lsn's instead. - * - * cmp_p = log_compare(&LSN(pagep), argp->pagelsn); - */ - if (cmp_p == 0 && DB_REDO(op)) { - /* Need to redo update described. */ - modified = 1; - } else if (cmp_n == 0 && !DB_REDO(op)) { - /* Need to undo update described. */ - modified = 1; - } - if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - diff --git a/bdb/hash/hash_auto.c b/bdb/hash/hash_auto.c deleted file mode 100644 index b6faf4f5645..00000000000 --- a/bdb/hash/hash_auto.c +++ /dev/null @@ -1,2023 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <ctype.h> -#include <errno.h> -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "db_dispatch.h" -#include "db_am.h" -#include "hash.h" -#include "txn.h" - -int -__ham_insdel_log(dbenv, txnid, ret_lsnp, flags, - opcode, fileid, pgno, ndx, pagelsn, key, - data) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - u_int32_t ndx; - DB_LSN * pagelsn; - const DBT *key; - const DBT *data; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_ham_insdel; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(opcode) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(ndx) - + sizeof(*pagelsn) - + sizeof(u_int32_t) + (key == NULL ? 0 : key->size) - + sizeof(u_int32_t) + (data == NULL ? 0 : data->size); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &ndx, sizeof(ndx)); - bp += sizeof(ndx); - if (pagelsn != NULL) - memcpy(bp, pagelsn, sizeof(*pagelsn)); - else - memset(bp, 0, sizeof(*pagelsn)); - bp += sizeof(*pagelsn); - if (key == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &key->size, sizeof(key->size)); - bp += sizeof(key->size); - memcpy(bp, key->data, key->size); - bp += key->size; - } - if (data == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &data->size, sizeof(data->size)); - bp += sizeof(data->size); - memcpy(bp, data->data, data->size); - bp += data->size; - } - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__ham_insdel_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_insdel_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_insdel_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_insdel: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tndx: %lu\n", (u_long)argp->ndx); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\tkey: "); - for (i = 0; i < argp->key.size; i++) { - ch = ((u_int8_t *)argp->key.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tdata: "); - for (i = 0; i < argp->data.size; i++) { - ch = ((u_int8_t *)argp->data.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_insdel_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_insdel_args **argpp; -{ - __ham_insdel_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_insdel_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->ndx, bp, sizeof(argp->ndx)); - bp += sizeof(argp->ndx); - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - memset(&argp->key, 0, sizeof(argp->key)); - memcpy(&argp->key.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->key.data = bp; - bp += argp->key.size; - memset(&argp->data, 0, sizeof(argp->data)); - memcpy(&argp->data.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->data.data = bp; - bp += argp->data.size; - *argpp = argp; - return (0); -} - -int -__ham_newpage_log(dbenv, txnid, ret_lsnp, flags, - opcode, fileid, prev_pgno, prevlsn, new_pgno, pagelsn, - next_pgno, nextlsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t opcode; - int32_t fileid; - db_pgno_t prev_pgno; - DB_LSN * prevlsn; - db_pgno_t new_pgno; - DB_LSN * pagelsn; - db_pgno_t next_pgno; - DB_LSN * nextlsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_ham_newpage; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(opcode) - + sizeof(fileid) - + sizeof(prev_pgno) - + sizeof(*prevlsn) - + sizeof(new_pgno) - + sizeof(*pagelsn) - + sizeof(next_pgno) - + sizeof(*nextlsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &prev_pgno, sizeof(prev_pgno)); - bp += sizeof(prev_pgno); - if (prevlsn != NULL) - memcpy(bp, prevlsn, sizeof(*prevlsn)); - else - memset(bp, 0, sizeof(*prevlsn)); - bp += sizeof(*prevlsn); - memcpy(bp, &new_pgno, sizeof(new_pgno)); - bp += sizeof(new_pgno); - if (pagelsn != NULL) - memcpy(bp, pagelsn, sizeof(*pagelsn)); - else - memset(bp, 0, sizeof(*pagelsn)); - bp += sizeof(*pagelsn); - memcpy(bp, &next_pgno, sizeof(next_pgno)); - bp += sizeof(next_pgno); - if (nextlsn != NULL) - memcpy(bp, nextlsn, sizeof(*nextlsn)); - else - memset(bp, 0, sizeof(*nextlsn)); - bp += sizeof(*nextlsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__ham_newpage_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_newpage_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_newpage_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_newpage: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tprev_pgno: %lu\n", (u_long)argp->prev_pgno); - printf("\tprevlsn: [%lu][%lu]\n", - (u_long)argp->prevlsn.file, (u_long)argp->prevlsn.offset); - printf("\tnew_pgno: %lu\n", (u_long)argp->new_pgno); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\tnext_pgno: %lu\n", (u_long)argp->next_pgno); - printf("\tnextlsn: [%lu][%lu]\n", - (u_long)argp->nextlsn.file, (u_long)argp->nextlsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_newpage_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_newpage_args **argpp; -{ - __ham_newpage_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_newpage_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->prev_pgno, bp, sizeof(argp->prev_pgno)); - bp += sizeof(argp->prev_pgno); - memcpy(&argp->prevlsn, bp, sizeof(argp->prevlsn)); - bp += sizeof(argp->prevlsn); - memcpy(&argp->new_pgno, bp, sizeof(argp->new_pgno)); - bp += sizeof(argp->new_pgno); - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - memcpy(&argp->next_pgno, bp, sizeof(argp->next_pgno)); - bp += sizeof(argp->next_pgno); - memcpy(&argp->nextlsn, bp, sizeof(argp->nextlsn)); - bp += sizeof(argp->nextlsn); - *argpp = argp; - return (0); -} - -int -__ham_splitmeta_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_splitmeta_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_splitmeta_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_splitmeta: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tbucket: %lu\n", (u_long)argp->bucket); - printf("\tovflpoint: %lu\n", (u_long)argp->ovflpoint); - printf("\tspares: %lu\n", (u_long)argp->spares); - printf("\tmetalsn: [%lu][%lu]\n", - (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_splitmeta_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_splitmeta_args **argpp; -{ - __ham_splitmeta_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_splitmeta_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->bucket, bp, sizeof(argp->bucket)); - bp += sizeof(argp->bucket); - memcpy(&argp->ovflpoint, bp, sizeof(argp->ovflpoint)); - bp += sizeof(argp->ovflpoint); - memcpy(&argp->spares, bp, sizeof(argp->spares)); - bp += sizeof(argp->spares); - memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); - bp += sizeof(argp->metalsn); - *argpp = argp; - return (0); -} - -int -__ham_splitdata_log(dbenv, txnid, ret_lsnp, flags, - fileid, opcode, pgno, pageimage, pagelsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - u_int32_t opcode; - db_pgno_t pgno; - const DBT *pageimage; - DB_LSN * pagelsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_ham_splitdata; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(opcode) - + sizeof(pgno) - + sizeof(u_int32_t) + (pageimage == NULL ? 0 : pageimage->size) - + sizeof(*pagelsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (pageimage == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &pageimage->size, sizeof(pageimage->size)); - bp += sizeof(pageimage->size); - memcpy(bp, pageimage->data, pageimage->size); - bp += pageimage->size; - } - if (pagelsn != NULL) - memcpy(bp, pagelsn, sizeof(*pagelsn)); - else - memset(bp, 0, sizeof(*pagelsn)); - bp += sizeof(*pagelsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__ham_splitdata_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_splitdata_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_splitdata_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_splitdata: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tpageimage: "); - for (i = 0; i < argp->pageimage.size; i++) { - ch = ((u_int8_t *)argp->pageimage.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_splitdata_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_splitdata_args **argpp; -{ - __ham_splitdata_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_splitdata_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memset(&argp->pageimage, 0, sizeof(argp->pageimage)); - memcpy(&argp->pageimage.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->pageimage.data = bp; - bp += argp->pageimage.size; - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - *argpp = argp; - return (0); -} - -int -__ham_replace_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, ndx, pagelsn, off, olditem, - newitem, makedup) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - u_int32_t ndx; - DB_LSN * pagelsn; - int32_t off; - const DBT *olditem; - const DBT *newitem; - u_int32_t makedup; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_ham_replace; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(ndx) - + sizeof(*pagelsn) - + sizeof(off) - + sizeof(u_int32_t) + (olditem == NULL ? 0 : olditem->size) - + sizeof(u_int32_t) + (newitem == NULL ? 0 : newitem->size) - + sizeof(makedup); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &ndx, sizeof(ndx)); - bp += sizeof(ndx); - if (pagelsn != NULL) - memcpy(bp, pagelsn, sizeof(*pagelsn)); - else - memset(bp, 0, sizeof(*pagelsn)); - bp += sizeof(*pagelsn); - memcpy(bp, &off, sizeof(off)); - bp += sizeof(off); - if (olditem == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &olditem->size, sizeof(olditem->size)); - bp += sizeof(olditem->size); - memcpy(bp, olditem->data, olditem->size); - bp += olditem->size; - } - if (newitem == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &newitem->size, sizeof(newitem->size)); - bp += sizeof(newitem->size); - memcpy(bp, newitem->data, newitem->size); - bp += newitem->size; - } - memcpy(bp, &makedup, sizeof(makedup)); - bp += sizeof(makedup); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__ham_replace_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_replace_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_replace_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_replace: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tndx: %lu\n", (u_long)argp->ndx); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\toff: %ld\n", (long)argp->off); - printf("\tolditem: "); - for (i = 0; i < argp->olditem.size; i++) { - ch = ((u_int8_t *)argp->olditem.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tnewitem: "); - for (i = 0; i < argp->newitem.size; i++) { - ch = ((u_int8_t *)argp->newitem.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tmakedup: %lu\n", (u_long)argp->makedup); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_replace_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_replace_args **argpp; -{ - __ham_replace_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_replace_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->ndx, bp, sizeof(argp->ndx)); - bp += sizeof(argp->ndx); - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - memcpy(&argp->off, bp, sizeof(argp->off)); - bp += sizeof(argp->off); - memset(&argp->olditem, 0, sizeof(argp->olditem)); - memcpy(&argp->olditem.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->olditem.data = bp; - bp += argp->olditem.size; - memset(&argp->newitem, 0, sizeof(argp->newitem)); - memcpy(&argp->newitem.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->newitem.data = bp; - bp += argp->newitem.size; - memcpy(&argp->makedup, bp, sizeof(argp->makedup)); - bp += sizeof(argp->makedup); - *argpp = argp; - return (0); -} - -int -__ham_newpgno_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_newpgno_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_newpgno_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_newpgno: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tfree_pgno: %lu\n", (u_long)argp->free_pgno); - printf("\told_type: %lu\n", (u_long)argp->old_type); - printf("\told_pgno: %lu\n", (u_long)argp->old_pgno); - printf("\tnew_type: %lu\n", (u_long)argp->new_type); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\tmetalsn: [%lu][%lu]\n", - (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_newpgno_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_newpgno_args **argpp; -{ - __ham_newpgno_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_newpgno_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->free_pgno, bp, sizeof(argp->free_pgno)); - bp += sizeof(argp->free_pgno); - memcpy(&argp->old_type, bp, sizeof(argp->old_type)); - bp += sizeof(argp->old_type); - memcpy(&argp->old_pgno, bp, sizeof(argp->old_pgno)); - bp += sizeof(argp->old_pgno); - memcpy(&argp->new_type, bp, sizeof(argp->new_type)); - bp += sizeof(argp->new_type); - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); - bp += sizeof(argp->metalsn); - *argpp = argp; - return (0); -} - -int -__ham_ovfl_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_ovfl_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_ovfl_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_ovfl: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tstart_pgno: %lu\n", (u_long)argp->start_pgno); - printf("\tnpages: %lu\n", (u_long)argp->npages); - printf("\tfree_pgno: %lu\n", (u_long)argp->free_pgno); - printf("\tovflpoint: %lu\n", (u_long)argp->ovflpoint); - printf("\tmetalsn: [%lu][%lu]\n", - (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_ovfl_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_ovfl_args **argpp; -{ - __ham_ovfl_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_ovfl_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->start_pgno, bp, sizeof(argp->start_pgno)); - bp += sizeof(argp->start_pgno); - memcpy(&argp->npages, bp, sizeof(argp->npages)); - bp += sizeof(argp->npages); - memcpy(&argp->free_pgno, bp, sizeof(argp->free_pgno)); - bp += sizeof(argp->free_pgno); - memcpy(&argp->ovflpoint, bp, sizeof(argp->ovflpoint)); - bp += sizeof(argp->ovflpoint); - memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); - bp += sizeof(argp->metalsn); - *argpp = argp; - return (0); -} - -int -__ham_copypage_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, pagelsn, next_pgno, nextlsn, nnext_pgno, - nnextlsn, page) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - DB_LSN * pagelsn; - db_pgno_t next_pgno; - DB_LSN * nextlsn; - db_pgno_t nnext_pgno; - DB_LSN * nnextlsn; - const DBT *page; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_ham_copypage; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(*pagelsn) - + sizeof(next_pgno) - + sizeof(*nextlsn) - + sizeof(nnext_pgno) - + sizeof(*nnextlsn) - + sizeof(u_int32_t) + (page == NULL ? 0 : page->size); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (pagelsn != NULL) - memcpy(bp, pagelsn, sizeof(*pagelsn)); - else - memset(bp, 0, sizeof(*pagelsn)); - bp += sizeof(*pagelsn); - memcpy(bp, &next_pgno, sizeof(next_pgno)); - bp += sizeof(next_pgno); - if (nextlsn != NULL) - memcpy(bp, nextlsn, sizeof(*nextlsn)); - else - memset(bp, 0, sizeof(*nextlsn)); - bp += sizeof(*nextlsn); - memcpy(bp, &nnext_pgno, sizeof(nnext_pgno)); - bp += sizeof(nnext_pgno); - if (nnextlsn != NULL) - memcpy(bp, nnextlsn, sizeof(*nnextlsn)); - else - memset(bp, 0, sizeof(*nnextlsn)); - bp += sizeof(*nnextlsn); - if (page == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &page->size, sizeof(page->size)); - bp += sizeof(page->size); - memcpy(bp, page->data, page->size); - bp += page->size; - } - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__ham_copypage_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_copypage_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_copypage_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_copypage: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\tnext_pgno: %lu\n", (u_long)argp->next_pgno); - printf("\tnextlsn: [%lu][%lu]\n", - (u_long)argp->nextlsn.file, (u_long)argp->nextlsn.offset); - printf("\tnnext_pgno: %lu\n", (u_long)argp->nnext_pgno); - printf("\tnnextlsn: [%lu][%lu]\n", - (u_long)argp->nnextlsn.file, (u_long)argp->nnextlsn.offset); - printf("\tpage: "); - for (i = 0; i < argp->page.size; i++) { - ch = ((u_int8_t *)argp->page.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_copypage_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_copypage_args **argpp; -{ - __ham_copypage_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_copypage_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - memcpy(&argp->next_pgno, bp, sizeof(argp->next_pgno)); - bp += sizeof(argp->next_pgno); - memcpy(&argp->nextlsn, bp, sizeof(argp->nextlsn)); - bp += sizeof(argp->nextlsn); - memcpy(&argp->nnext_pgno, bp, sizeof(argp->nnext_pgno)); - bp += sizeof(argp->nnext_pgno); - memcpy(&argp->nnextlsn, bp, sizeof(argp->nnextlsn)); - bp += sizeof(argp->nnextlsn); - memset(&argp->page, 0, sizeof(argp->page)); - memcpy(&argp->page.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->page.data = bp; - bp += argp->page.size; - *argpp = argp; - return (0); -} - -int -__ham_metagroup_log(dbenv, txnid, ret_lsnp, flags, - fileid, bucket, pgno, metalsn, pagelsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - u_int32_t bucket; - db_pgno_t pgno; - DB_LSN * metalsn; - DB_LSN * pagelsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_ham_metagroup; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(bucket) - + sizeof(pgno) - + sizeof(*metalsn) - + sizeof(*pagelsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &bucket, sizeof(bucket)); - bp += sizeof(bucket); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - if (metalsn != NULL) - memcpy(bp, metalsn, sizeof(*metalsn)); - else - memset(bp, 0, sizeof(*metalsn)); - bp += sizeof(*metalsn); - if (pagelsn != NULL) - memcpy(bp, pagelsn, sizeof(*pagelsn)); - else - memset(bp, 0, sizeof(*pagelsn)); - bp += sizeof(*pagelsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__ham_metagroup_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_metagroup_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_metagroup_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_metagroup: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tbucket: %lu\n", (u_long)argp->bucket); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tmetalsn: [%lu][%lu]\n", - (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); - printf("\tpagelsn: [%lu][%lu]\n", - (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_metagroup_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_metagroup_args **argpp; -{ - __ham_metagroup_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_metagroup_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->bucket, bp, sizeof(argp->bucket)); - bp += sizeof(argp->bucket); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); - bp += sizeof(argp->metalsn); - memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); - bp += sizeof(argp->pagelsn); - *argpp = argp; - return (0); -} - -int -__ham_groupalloc1_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_groupalloc1_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_groupalloc1_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_groupalloc1: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tmetalsn: [%lu][%lu]\n", - (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); - printf("\tmmetalsn: [%lu][%lu]\n", - (u_long)argp->mmetalsn.file, (u_long)argp->mmetalsn.offset); - printf("\tstart_pgno: %lu\n", (u_long)argp->start_pgno); - printf("\tnum: %lu\n", (u_long)argp->num); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_groupalloc1_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_groupalloc1_args **argpp; -{ - __ham_groupalloc1_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_groupalloc1_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); - bp += sizeof(argp->metalsn); - memcpy(&argp->mmetalsn, bp, sizeof(argp->mmetalsn)); - bp += sizeof(argp->mmetalsn); - memcpy(&argp->start_pgno, bp, sizeof(argp->start_pgno)); - bp += sizeof(argp->start_pgno); - memcpy(&argp->num, bp, sizeof(argp->num)); - bp += sizeof(argp->num); - *argpp = argp; - return (0); -} - -int -__ham_groupalloc2_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_groupalloc2_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_groupalloc2_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_groupalloc2: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tmeta_lsn: [%lu][%lu]\n", - (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); - printf("\talloc_lsn: [%lu][%lu]\n", - (u_long)argp->alloc_lsn.file, (u_long)argp->alloc_lsn.offset); - printf("\tstart_pgno: %lu\n", (u_long)argp->start_pgno); - printf("\tnum: %lu\n", (u_long)argp->num); - printf("\tfree: %lu\n", (u_long)argp->free); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_groupalloc2_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_groupalloc2_args **argpp; -{ - __ham_groupalloc2_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_groupalloc2_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); - bp += sizeof(argp->meta_lsn); - memcpy(&argp->alloc_lsn, bp, sizeof(argp->alloc_lsn)); - bp += sizeof(argp->alloc_lsn); - memcpy(&argp->start_pgno, bp, sizeof(argp->start_pgno)); - bp += sizeof(argp->start_pgno); - memcpy(&argp->num, bp, sizeof(argp->num)); - bp += sizeof(argp->num); - memcpy(&argp->free, bp, sizeof(argp->free)); - bp += sizeof(argp->free); - *argpp = argp; - return (0); -} - -int -__ham_groupalloc_log(dbenv, txnid, ret_lsnp, flags, - fileid, meta_lsn, start_pgno, num, free) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - DB_LSN * meta_lsn; - db_pgno_t start_pgno; - u_int32_t num; - db_pgno_t free; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_ham_groupalloc; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(*meta_lsn) - + sizeof(start_pgno) - + sizeof(num) - + sizeof(free); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (meta_lsn != NULL) - memcpy(bp, meta_lsn, sizeof(*meta_lsn)); - else - memset(bp, 0, sizeof(*meta_lsn)); - bp += sizeof(*meta_lsn); - memcpy(bp, &start_pgno, sizeof(start_pgno)); - bp += sizeof(start_pgno); - memcpy(bp, &num, sizeof(num)); - bp += sizeof(num); - memcpy(bp, &free, sizeof(free)); - bp += sizeof(free); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__ham_groupalloc_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_groupalloc_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_groupalloc_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_groupalloc: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tmeta_lsn: [%lu][%lu]\n", - (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); - printf("\tstart_pgno: %lu\n", (u_long)argp->start_pgno); - printf("\tnum: %lu\n", (u_long)argp->num); - printf("\tfree: %lu\n", (u_long)argp->free); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_groupalloc_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_groupalloc_args **argpp; -{ - __ham_groupalloc_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_groupalloc_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); - bp += sizeof(argp->meta_lsn); - memcpy(&argp->start_pgno, bp, sizeof(argp->start_pgno)); - bp += sizeof(argp->start_pgno); - memcpy(&argp->num, bp, sizeof(argp->num)); - bp += sizeof(argp->num); - memcpy(&argp->free, bp, sizeof(argp->free)); - bp += sizeof(argp->free); - *argpp = argp; - return (0); -} - -int -__ham_curadj_log(dbenv, txnid, ret_lsnp, flags, - fileid, pgno, indx, len, dup_off, add, - is_dup, order) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_pgno_t pgno; - u_int32_t indx; - u_int32_t len; - u_int32_t dup_off; - int add; - int is_dup; - u_int32_t order; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_ham_curadj; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(pgno) - + sizeof(indx) - + sizeof(len) - + sizeof(dup_off) - + sizeof(add) - + sizeof(is_dup) - + sizeof(order); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - memcpy(bp, &len, sizeof(len)); - bp += sizeof(len); - memcpy(bp, &dup_off, sizeof(dup_off)); - bp += sizeof(dup_off); - memcpy(bp, &add, sizeof(add)); - bp += sizeof(add); - memcpy(bp, &is_dup, sizeof(is_dup)); - bp += sizeof(is_dup); - memcpy(bp, &order, sizeof(order)); - bp += sizeof(order); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__ham_curadj_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_curadj_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_curadj_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_curadj: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\tlen: %lu\n", (u_long)argp->len); - printf("\tdup_off: %lu\n", (u_long)argp->dup_off); - printf("\tadd: %ld\n", (long)argp->add); - printf("\tis_dup: %ld\n", (long)argp->is_dup); - printf("\torder: %lu\n", (u_long)argp->order); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_curadj_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_curadj_args **argpp; -{ - __ham_curadj_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_curadj_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->len, bp, sizeof(argp->len)); - bp += sizeof(argp->len); - memcpy(&argp->dup_off, bp, sizeof(argp->dup_off)); - bp += sizeof(argp->dup_off); - memcpy(&argp->add, bp, sizeof(argp->add)); - bp += sizeof(argp->add); - memcpy(&argp->is_dup, bp, sizeof(argp->is_dup)); - bp += sizeof(argp->is_dup); - memcpy(&argp->order, bp, sizeof(argp->order)); - bp += sizeof(argp->order); - *argpp = argp; - return (0); -} - -int -__ham_chgpg_log(dbenv, txnid, ret_lsnp, flags, - fileid, mode, old_pgno, new_pgno, old_indx, new_indx) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_ham_mode mode; - db_pgno_t old_pgno; - db_pgno_t new_pgno; - u_int32_t old_indx; - u_int32_t new_indx; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_ham_chgpg; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(mode) - + sizeof(old_pgno) - + sizeof(new_pgno) - + sizeof(old_indx) - + sizeof(new_indx); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &mode, sizeof(mode)); - bp += sizeof(mode); - memcpy(bp, &old_pgno, sizeof(old_pgno)); - bp += sizeof(old_pgno); - memcpy(bp, &new_pgno, sizeof(new_pgno)); - bp += sizeof(new_pgno); - memcpy(bp, &old_indx, sizeof(old_indx)); - bp += sizeof(old_indx); - memcpy(bp, &new_indx, sizeof(new_indx)); - bp += sizeof(new_indx); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__ham_chgpg_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __ham_chgpg_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __ham_chgpg_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]ham_chgpg: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tmode: %ld\n", (long)argp->mode); - printf("\told_pgno: %lu\n", (u_long)argp->old_pgno); - printf("\tnew_pgno: %lu\n", (u_long)argp->new_pgno); - printf("\told_indx: %lu\n", (u_long)argp->old_indx); - printf("\tnew_indx: %lu\n", (u_long)argp->new_indx); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__ham_chgpg_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __ham_chgpg_args **argpp; -{ - __ham_chgpg_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__ham_chgpg_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->mode, bp, sizeof(argp->mode)); - bp += sizeof(argp->mode); - memcpy(&argp->old_pgno, bp, sizeof(argp->old_pgno)); - bp += sizeof(argp->old_pgno); - memcpy(&argp->new_pgno, bp, sizeof(argp->new_pgno)); - bp += sizeof(argp->new_pgno); - memcpy(&argp->old_indx, bp, sizeof(argp->old_indx)); - bp += sizeof(argp->old_indx); - memcpy(&argp->new_indx, bp, sizeof(argp->new_indx)); - bp += sizeof(argp->new_indx); - *argpp = argp; - return (0); -} - -int -__ham_init_print(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __ham_insdel_print, DB_ham_insdel)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_newpage_print, DB_ham_newpage)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_splitmeta_print, DB_ham_splitmeta)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_splitdata_print, DB_ham_splitdata)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_replace_print, DB_ham_replace)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_newpgno_print, DB_ham_newpgno)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_ovfl_print, DB_ham_ovfl)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_copypage_print, DB_ham_copypage)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_metagroup_print, DB_ham_metagroup)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_groupalloc1_print, DB_ham_groupalloc1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_groupalloc2_print, DB_ham_groupalloc2)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_groupalloc_print, DB_ham_groupalloc)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_curadj_print, DB_ham_curadj)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_chgpg_print, DB_ham_chgpg)) != 0) - return (ret); - return (0); -} - -int -__ham_init_recover(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __ham_insdel_recover, DB_ham_insdel)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_newpage_recover, DB_ham_newpage)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_ham_splitmeta)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_splitdata_recover, DB_ham_splitdata)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_replace_recover, DB_ham_replace)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_ham_newpgno)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_ham_ovfl)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_copypage_recover, DB_ham_copypage)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_metagroup_recover, DB_ham_metagroup)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_ham_groupalloc1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_ham_groupalloc2)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_groupalloc_recover, DB_ham_groupalloc)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_curadj_recover, DB_ham_curadj)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __ham_chgpg_recover, DB_ham_chgpg)) != 0) - return (ret); - return (0); -} - diff --git a/bdb/include/btree_auto.h b/bdb/include/btree_auto.h deleted file mode 100644 index 214f84332cf..00000000000 --- a/bdb/include/btree_auto.h +++ /dev/null @@ -1,267 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ - -#ifndef bam_AUTO_H -#define bam_AUTO_H - -#define DB_bam_pg_alloc 51 -typedef struct _bam_pg_alloc_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DB_LSN meta_lsn; - DB_LSN page_lsn; - db_pgno_t pgno; - u_int32_t ptype; - db_pgno_t next; -} __bam_pg_alloc_args; - -int __bam_pg_alloc_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t)); -int __bam_pg_alloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_pg_alloc_read __P((DB_ENV *, void *, __bam_pg_alloc_args **)); - -#define DB_bam_pg_alloc1 60 -typedef struct _bam_pg_alloc1_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DB_LSN meta_lsn; - DB_LSN alloc_lsn; - DB_LSN page_lsn; - db_pgno_t pgno; - u_int32_t ptype; - db_pgno_t next; -} __bam_pg_alloc1_args; - -int __bam_pg_alloc1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_pg_alloc1_read __P((DB_ENV *, void *, __bam_pg_alloc1_args **)); - -#define DB_bam_pg_free 52 -typedef struct _bam_pg_free_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN meta_lsn; - DBT header; - db_pgno_t next; -} __bam_pg_free_args; - -int __bam_pg_free_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, const DBT *, db_pgno_t)); -int __bam_pg_free_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_pg_free_read __P((DB_ENV *, void *, __bam_pg_free_args **)); - -#define DB_bam_pg_free1 61 -typedef struct _bam_pg_free1_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN meta_lsn; - DB_LSN alloc_lsn; - DBT header; - db_pgno_t next; -} __bam_pg_free1_args; - -int __bam_pg_free1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_pg_free1_read __P((DB_ENV *, void *, __bam_pg_free1_args **)); - -#define DB_bam_split1 53 -typedef struct _bam_split1_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t left; - DB_LSN llsn; - db_pgno_t right; - DB_LSN rlsn; - u_int32_t indx; - db_pgno_t npgno; - DB_LSN nlsn; - DBT pg; -} __bam_split1_args; - -int __bam_split1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_split1_read __P((DB_ENV *, void *, __bam_split1_args **)); - -#define DB_bam_split 62 -typedef struct _bam_split_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t left; - DB_LSN llsn; - db_pgno_t right; - DB_LSN rlsn; - u_int32_t indx; - db_pgno_t npgno; - DB_LSN nlsn; - db_pgno_t root_pgno; - DBT pg; - u_int32_t opflags; -} __bam_split_args; - -int __bam_split_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, u_int32_t)); -int __bam_split_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_split_read __P((DB_ENV *, void *, __bam_split_args **)); - -#define DB_bam_rsplit1 54 -typedef struct _bam_rsplit1_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DBT pgdbt; - db_pgno_t nrec; - DBT rootent; - DB_LSN rootlsn; -} __bam_rsplit1_args; - -int __bam_rsplit1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_rsplit1_read __P((DB_ENV *, void *, __bam_rsplit1_args **)); - -#define DB_bam_rsplit 63 -typedef struct _bam_rsplit_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DBT pgdbt; - db_pgno_t root_pgno; - db_pgno_t nrec; - DBT rootent; - DB_LSN rootlsn; -} __bam_rsplit_args; - -int __bam_rsplit_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, const DBT *, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *)); -int __bam_rsplit_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_rsplit_read __P((DB_ENV *, void *, __bam_rsplit_args **)); - -#define DB_bam_adj 55 -typedef struct _bam_adj_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN lsn; - u_int32_t indx; - u_int32_t indx_copy; - u_int32_t is_insert; -} __bam_adj_args; - -int __bam_adj_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, u_int32_t)); -int __bam_adj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_adj_read __P((DB_ENV *, void *, __bam_adj_args **)); - -#define DB_bam_cadjust 56 -typedef struct _bam_cadjust_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN lsn; - u_int32_t indx; - int32_t adjust; - u_int32_t opflags; -} __bam_cadjust_args; - -int __bam_cadjust_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t, int32_t, u_int32_t)); -int __bam_cadjust_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_cadjust_read __P((DB_ENV *, void *, __bam_cadjust_args **)); - -#define DB_bam_cdel 57 -typedef struct _bam_cdel_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN lsn; - u_int32_t indx; -} __bam_cdel_args; - -int __bam_cdel_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t)); -int __bam_cdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_cdel_read __P((DB_ENV *, void *, __bam_cdel_args **)); - -#define DB_bam_repl 58 -typedef struct _bam_repl_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN lsn; - u_int32_t indx; - u_int32_t isdeleted; - DBT orig; - DBT repl; - u_int32_t prefix; - u_int32_t suffix; -} __bam_repl_args; - -int __bam_repl_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, u_int32_t, u_int32_t)); -int __bam_repl_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_repl_read __P((DB_ENV *, void *, __bam_repl_args **)); - -#define DB_bam_root 59 -typedef struct _bam_root_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t meta_pgno; - db_pgno_t root_pgno; - DB_LSN meta_lsn; -} __bam_root_args; - -int __bam_root_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, db_pgno_t, DB_LSN *)); -int __bam_root_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_root_read __P((DB_ENV *, void *, __bam_root_args **)); - -#define DB_bam_curadj 64 -typedef struct _bam_curadj_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_ca_mode mode; - db_pgno_t from_pgno; - db_pgno_t to_pgno; - db_pgno_t left_pgno; - u_int32_t first_indx; - u_int32_t from_indx; - u_int32_t to_indx; -} __bam_curadj_args; - -int __bam_curadj_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_ca_mode, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t)); -int __bam_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_curadj_read __P((DB_ENV *, void *, __bam_curadj_args **)); - -#define DB_bam_rcuradj 65 -typedef struct _bam_rcuradj_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - ca_recno_arg mode; - db_pgno_t root; - db_recno_t recno; - u_int32_t order; -} __bam_rcuradj_args; - -int __bam_rcuradj_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, ca_recno_arg, db_pgno_t, db_recno_t, u_int32_t)); -int __bam_rcuradj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __bam_rcuradj_read __P((DB_ENV *, void *, __bam_rcuradj_args **)); -int __bam_init_print __P((DB_ENV *)); -int __bam_init_recover __P((DB_ENV *)); -#endif diff --git a/bdb/include/crdel_auto.h b/bdb/include/crdel_auto.h deleted file mode 100644 index 409c256811f..00000000000 --- a/bdb/include/crdel_auto.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ - -#ifndef crdel_AUTO_H -#define crdel_AUTO_H - -#define DB_crdel_fileopen 141 -typedef struct _crdel_fileopen_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - DBT name; - u_int32_t mode; -} __crdel_fileopen_args; - -int __crdel_fileopen_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, u_int32_t)); -int __crdel_fileopen_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __crdel_fileopen_read __P((DB_ENV *, void *, __crdel_fileopen_args **)); - -#define DB_crdel_metasub 142 -typedef struct _crdel_metasub_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DBT page; - DB_LSN lsn; -} __crdel_metasub_args; - -int __crdel_metasub_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, const DBT *, DB_LSN *)); -int __crdel_metasub_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __crdel_metasub_read __P((DB_ENV *, void *, __crdel_metasub_args **)); - -#define DB_crdel_metapage 143 -typedef struct _crdel_metapage_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DBT name; - db_pgno_t pgno; - DBT page; -} __crdel_metapage_args; - -int __crdel_metapage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, const DBT *, db_pgno_t, const DBT *)); -int __crdel_metapage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __crdel_metapage_read __P((DB_ENV *, void *, __crdel_metapage_args **)); - -#define DB_crdel_old_delete 144 -typedef struct _crdel_old_delete_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - DBT name; -} __crdel_old_delete_args; - -int __crdel_old_delete_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __crdel_old_delete_read __P((DB_ENV *, void *, __crdel_old_delete_args **)); - -#define DB_crdel_rename 145 -typedef struct _crdel_rename_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DBT name; - DBT newname; -} __crdel_rename_args; - -int __crdel_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, const DBT *, const DBT *)); -int __crdel_rename_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __crdel_rename_read __P((DB_ENV *, void *, __crdel_rename_args **)); - -#define DB_crdel_delete 146 -typedef struct _crdel_delete_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DBT name; -} __crdel_delete_args; - -int __crdel_delete_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, const DBT *)); -int __crdel_delete_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __crdel_delete_read __P((DB_ENV *, void *, __crdel_delete_args **)); -int __crdel_init_print __P((DB_ENV *)); -int __crdel_init_recover __P((DB_ENV *)); -#endif diff --git a/bdb/include/db_auto.h b/bdb/include/db_auto.h deleted file mode 100644 index 88bf7419bea..00000000000 --- a/bdb/include/db_auto.h +++ /dev/null @@ -1,140 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ - -#ifndef db_AUTO_H -#define db_AUTO_H - -#define DB_db_addrem 41 -typedef struct _db_addrem_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - u_int32_t indx; - size_t nbytes; - DBT hdr; - DBT dbt; - DB_LSN pagelsn; -} __db_addrem_args; - -int __db_addrem_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, u_int32_t, size_t, const DBT *, const DBT *, DB_LSN *)); -int __db_addrem_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __db_addrem_read __P((DB_ENV *, void *, __db_addrem_args **)); - -#define DB_db_split 42 -typedef struct _db_split_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - DBT pageimage; - DB_LSN pagelsn; -} __db_split_args; - -int __db_split_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __db_split_read __P((DB_ENV *, void *, __db_split_args **)); - -#define DB_db_big 43 -typedef struct _db_big_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - db_pgno_t prev_pgno; - db_pgno_t next_pgno; - DBT dbt; - DB_LSN pagelsn; - DB_LSN prevlsn; - DB_LSN nextlsn; -} __db_big_args; - -int __db_big_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *, DB_LSN *, DB_LSN *)); -int __db_big_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __db_big_read __P((DB_ENV *, void *, __db_big_args **)); - -#define DB_db_ovref 44 -typedef struct _db_ovref_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - int32_t adjust; - DB_LSN lsn; -} __db_ovref_args; - -int __db_ovref_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, int32_t, DB_LSN *)); -int __db_ovref_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __db_ovref_read __P((DB_ENV *, void *, __db_ovref_args **)); - -#define DB_db_relink 45 -typedef struct _db_relink_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - DB_LSN lsn; - db_pgno_t prev; - DB_LSN lsn_prev; - db_pgno_t next; - DB_LSN lsn_next; -} __db_relink_args; - -int __db_relink_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *)); -int __db_relink_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __db_relink_read __P((DB_ENV *, void *, __db_relink_args **)); - -#define DB_db_addpage 46 -typedef struct _db_addpage_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN lsn; - db_pgno_t nextpgno; - DB_LSN nextlsn; -} __db_addpage_args; - -int __db_addpage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __db_addpage_read __P((DB_ENV *, void *, __db_addpage_args **)); - -#define DB_db_debug 47 -typedef struct _db_debug_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - DBT op; - int32_t fileid; - DBT key; - DBT data; - u_int32_t arg_flags; -} __db_debug_args; - -int __db_debug_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, int32_t, const DBT *, const DBT *, u_int32_t)); -int __db_debug_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __db_debug_read __P((DB_ENV *, void *, __db_debug_args **)); - -#define DB_db_noop 48 -typedef struct _db_noop_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN prevlsn; -} __db_noop_args; - -int __db_noop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *)); -int __db_noop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __db_noop_read __P((DB_ENV *, void *, __db_noop_args **)); -int __db_init_print __P((DB_ENV *)); -int __db_init_recover __P((DB_ENV *)); -#endif diff --git a/bdb/include/db_server.h b/bdb/include/db_server.h deleted file mode 100644 index e12fdb212d3..00000000000 --- a/bdb/include/db_server.h +++ /dev/null @@ -1,762 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _DB_SERVER_H_RPCGEN -#define _DB_SERVER_H_RPCGEN - -#include <rpc/rpc.h> - -struct __env_cachesize_msg { - u_int dbenvcl_id; - u_int gbytes; - u_int bytes; - u_int ncache; -}; -typedef struct __env_cachesize_msg __env_cachesize_msg; - -struct __env_cachesize_reply { - u_int status; -}; -typedef struct __env_cachesize_reply __env_cachesize_reply; - -struct __env_close_msg { - u_int dbenvcl_id; - u_int flags; -}; -typedef struct __env_close_msg __env_close_msg; - -struct __env_close_reply { - u_int status; -}; -typedef struct __env_close_reply __env_close_reply; - -struct __env_create_msg { - u_int timeout; -}; -typedef struct __env_create_msg __env_create_msg; - -struct __env_create_reply { - u_int status; - u_int envcl_id; -}; -typedef struct __env_create_reply __env_create_reply; - -struct __env_flags_msg { - u_int dbenvcl_id; - u_int flags; - u_int onoff; -}; -typedef struct __env_flags_msg __env_flags_msg; - -struct __env_flags_reply { - u_int status; -}; -typedef struct __env_flags_reply __env_flags_reply; - -struct __env_open_msg { - u_int dbenvcl_id; - char *home; - u_int flags; - u_int mode; -}; -typedef struct __env_open_msg __env_open_msg; - -struct __env_open_reply { - u_int status; -}; -typedef struct __env_open_reply __env_open_reply; - -struct __env_remove_msg { - u_int dbenvcl_id; - char *home; - u_int flags; -}; -typedef struct __env_remove_msg __env_remove_msg; - -struct __env_remove_reply { - u_int status; -}; -typedef struct __env_remove_reply __env_remove_reply; - -struct __txn_abort_msg { - u_int txnpcl_id; -}; -typedef struct __txn_abort_msg __txn_abort_msg; - -struct __txn_abort_reply { - u_int status; -}; -typedef struct __txn_abort_reply __txn_abort_reply; - -struct __txn_begin_msg { - u_int envpcl_id; - u_int parentcl_id; - u_int flags; -}; -typedef struct __txn_begin_msg __txn_begin_msg; - -struct __txn_begin_reply { - u_int status; - u_int txnidcl_id; -}; -typedef struct __txn_begin_reply __txn_begin_reply; - -struct __txn_commit_msg { - u_int txnpcl_id; - u_int flags; -}; -typedef struct __txn_commit_msg __txn_commit_msg; - -struct __txn_commit_reply { - u_int status; -}; -typedef struct __txn_commit_reply __txn_commit_reply; - -struct __db_bt_maxkey_msg { - u_int dbpcl_id; - u_int maxkey; -}; -typedef struct __db_bt_maxkey_msg __db_bt_maxkey_msg; - -struct __db_bt_maxkey_reply { - u_int status; -}; -typedef struct __db_bt_maxkey_reply __db_bt_maxkey_reply; - -struct __db_bt_minkey_msg { - u_int dbpcl_id; - u_int minkey; -}; -typedef struct __db_bt_minkey_msg __db_bt_minkey_msg; - -struct __db_bt_minkey_reply { - u_int status; -}; -typedef struct __db_bt_minkey_reply __db_bt_minkey_reply; - -struct __db_close_msg { - u_int dbpcl_id; - u_int flags; -}; -typedef struct __db_close_msg __db_close_msg; - -struct __db_close_reply { - u_int status; -}; -typedef struct __db_close_reply __db_close_reply; - -struct __db_create_msg { - u_int flags; - u_int envpcl_id; -}; -typedef struct __db_create_msg __db_create_msg; - -struct __db_create_reply { - u_int status; - u_int dbpcl_id; -}; -typedef struct __db_create_reply __db_create_reply; - -struct __db_del_msg { - u_int dbpcl_id; - u_int txnpcl_id; - u_int keydlen; - u_int keydoff; - u_int keyflags; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; - u_int flags; -}; -typedef struct __db_del_msg __db_del_msg; - -struct __db_del_reply { - u_int status; -}; -typedef struct __db_del_reply __db_del_reply; - -struct __db_extentsize_msg { - u_int dbpcl_id; - u_int extentsize; -}; -typedef struct __db_extentsize_msg __db_extentsize_msg; - -struct __db_extentsize_reply { - u_int status; -}; -typedef struct __db_extentsize_reply __db_extentsize_reply; - -struct __db_flags_msg { - u_int dbpcl_id; - u_int flags; -}; -typedef struct __db_flags_msg __db_flags_msg; - -struct __db_flags_reply { - u_int status; -}; -typedef struct __db_flags_reply __db_flags_reply; - -struct __db_get_msg { - u_int dbpcl_id; - u_int txnpcl_id; - u_int keydlen; - u_int keydoff; - u_int keyflags; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; - u_int datadlen; - u_int datadoff; - u_int dataflags; - struct { - u_int datadata_len; - char *datadata_val; - } datadata; - u_int flags; -}; -typedef struct __db_get_msg __db_get_msg; - -struct __db_get_reply { - u_int status; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; - struct { - u_int datadata_len; - char *datadata_val; - } datadata; -}; -typedef struct __db_get_reply __db_get_reply; - -struct __db_h_ffactor_msg { - u_int dbpcl_id; - u_int ffactor; -}; -typedef struct __db_h_ffactor_msg __db_h_ffactor_msg; - -struct __db_h_ffactor_reply { - u_int status; -}; -typedef struct __db_h_ffactor_reply __db_h_ffactor_reply; - -struct __db_h_nelem_msg { - u_int dbpcl_id; - u_int nelem; -}; -typedef struct __db_h_nelem_msg __db_h_nelem_msg; - -struct __db_h_nelem_reply { - u_int status; -}; -typedef struct __db_h_nelem_reply __db_h_nelem_reply; - -struct __db_key_range_msg { - u_int dbpcl_id; - u_int txnpcl_id; - u_int keydlen; - u_int keydoff; - u_int keyflags; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; - u_int flags; -}; -typedef struct __db_key_range_msg __db_key_range_msg; - -struct __db_key_range_reply { - u_int status; - double less; - double equal; - double greater; -}; -typedef struct __db_key_range_reply __db_key_range_reply; - -struct __db_lorder_msg { - u_int dbpcl_id; - u_int lorder; -}; -typedef struct __db_lorder_msg __db_lorder_msg; - -struct __db_lorder_reply { - u_int status; -}; -typedef struct __db_lorder_reply __db_lorder_reply; - -struct __db_open_msg { - u_int dbpcl_id; - char *name; - char *subdb; - u_int type; - u_int flags; - u_int mode; -}; -typedef struct __db_open_msg __db_open_msg; - -struct __db_open_reply { - u_int status; - u_int type; - u_int dbflags; -}; -typedef struct __db_open_reply __db_open_reply; - -struct __db_pagesize_msg { - u_int dbpcl_id; - u_int pagesize; -}; -typedef struct __db_pagesize_msg __db_pagesize_msg; - -struct __db_pagesize_reply { - u_int status; -}; -typedef struct __db_pagesize_reply __db_pagesize_reply; - -struct __db_put_msg { - u_int dbpcl_id; - u_int txnpcl_id; - u_int keydlen; - u_int keydoff; - u_int keyflags; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; - u_int datadlen; - u_int datadoff; - u_int dataflags; - struct { - u_int datadata_len; - char *datadata_val; - } datadata; - u_int flags; -}; -typedef struct __db_put_msg __db_put_msg; - -struct __db_put_reply { - u_int status; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; -}; -typedef struct __db_put_reply __db_put_reply; - -struct __db_re_delim_msg { - u_int dbpcl_id; - u_int delim; -}; -typedef struct __db_re_delim_msg __db_re_delim_msg; - -struct __db_re_delim_reply { - u_int status; -}; -typedef struct __db_re_delim_reply __db_re_delim_reply; - -struct __db_re_len_msg { - u_int dbpcl_id; - u_int len; -}; -typedef struct __db_re_len_msg __db_re_len_msg; - -struct __db_re_len_reply { - u_int status; -}; -typedef struct __db_re_len_reply __db_re_len_reply; - -struct __db_re_pad_msg { - u_int dbpcl_id; - u_int pad; -}; -typedef struct __db_re_pad_msg __db_re_pad_msg; - -struct __db_re_pad_reply { - u_int status; -}; -typedef struct __db_re_pad_reply __db_re_pad_reply; - -struct __db_remove_msg { - u_int dbpcl_id; - char *name; - char *subdb; - u_int flags; -}; -typedef struct __db_remove_msg __db_remove_msg; - -struct __db_remove_reply { - u_int status; -}; -typedef struct __db_remove_reply __db_remove_reply; - -struct __db_rename_msg { - u_int dbpcl_id; - char *name; - char *subdb; - char *newname; - u_int flags; -}; -typedef struct __db_rename_msg __db_rename_msg; - -struct __db_rename_reply { - u_int status; -}; -typedef struct __db_rename_reply __db_rename_reply; - -struct __db_stat_msg { - u_int dbpcl_id; - u_int flags; -}; -typedef struct __db_stat_msg __db_stat_msg; - -struct __db_stat_statsreplist { - struct { - u_int ent_len; - char *ent_val; - } ent; - struct __db_stat_statsreplist *next; -}; -typedef struct __db_stat_statsreplist __db_stat_statsreplist; - -struct __db_stat_reply { - u_int status; - __db_stat_statsreplist *statslist; -}; -typedef struct __db_stat_reply __db_stat_reply; - -struct __db_swapped_msg { - u_int dbpcl_id; -}; -typedef struct __db_swapped_msg __db_swapped_msg; - -struct __db_swapped_reply { - u_int status; -}; -typedef struct __db_swapped_reply __db_swapped_reply; - -struct __db_sync_msg { - u_int dbpcl_id; - u_int flags; -}; -typedef struct __db_sync_msg __db_sync_msg; - -struct __db_sync_reply { - u_int status; -}; -typedef struct __db_sync_reply __db_sync_reply; - -struct __db_cursor_msg { - u_int dbpcl_id; - u_int txnpcl_id; - u_int flags; -}; -typedef struct __db_cursor_msg __db_cursor_msg; - -struct __db_cursor_reply { - u_int status; - u_int dbcidcl_id; -}; -typedef struct __db_cursor_reply __db_cursor_reply; - -struct __db_join_curslist { - struct { - u_int ent_len; - char *ent_val; - } ent; - struct __db_join_curslist *next; -}; -typedef struct __db_join_curslist __db_join_curslist; - -struct __db_join_msg { - u_int dbpcl_id; - __db_join_curslist *curslist; - u_int flags; -}; -typedef struct __db_join_msg __db_join_msg; - -struct __db_join_reply { - u_int status; - u_int dbcidcl_id; -}; -typedef struct __db_join_reply __db_join_reply; - -struct __dbc_close_msg { - u_int dbccl_id; -}; -typedef struct __dbc_close_msg __dbc_close_msg; - -struct __dbc_close_reply { - u_int status; -}; -typedef struct __dbc_close_reply __dbc_close_reply; - -struct __dbc_count_msg { - u_int dbccl_id; - u_int flags; -}; -typedef struct __dbc_count_msg __dbc_count_msg; - -struct __dbc_count_reply { - u_int status; - u_int dupcount; -}; -typedef struct __dbc_count_reply __dbc_count_reply; - -struct __dbc_del_msg { - u_int dbccl_id; - u_int flags; -}; -typedef struct __dbc_del_msg __dbc_del_msg; - -struct __dbc_del_reply { - u_int status; -}; -typedef struct __dbc_del_reply __dbc_del_reply; - -struct __dbc_dup_msg { - u_int dbccl_id; - u_int flags; -}; -typedef struct __dbc_dup_msg __dbc_dup_msg; - -struct __dbc_dup_reply { - u_int status; - u_int dbcidcl_id; -}; -typedef struct __dbc_dup_reply __dbc_dup_reply; - -struct __dbc_get_msg { - u_int dbccl_id; - u_int keydlen; - u_int keydoff; - u_int keyflags; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; - u_int datadlen; - u_int datadoff; - u_int dataflags; - struct { - u_int datadata_len; - char *datadata_val; - } datadata; - u_int flags; -}; -typedef struct __dbc_get_msg __dbc_get_msg; - -struct __dbc_get_reply { - u_int status; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; - struct { - u_int datadata_len; - char *datadata_val; - } datadata; -}; -typedef struct __dbc_get_reply __dbc_get_reply; - -struct __dbc_put_msg { - u_int dbccl_id; - u_int keydlen; - u_int keydoff; - u_int keyflags; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; - u_int datadlen; - u_int datadoff; - u_int dataflags; - struct { - u_int datadata_len; - char *datadata_val; - } datadata; - u_int flags; -}; -typedef struct __dbc_put_msg __dbc_put_msg; - -struct __dbc_put_reply { - u_int status; - struct { - u_int keydata_len; - char *keydata_val; - } keydata; -}; -typedef struct __dbc_put_reply __dbc_put_reply; - -#define DB_SERVERPROG ((unsigned long)(351457)) -#define DB_SERVERVERS ((unsigned long)(1)) -#define __DB_env_cachesize ((unsigned long)(1)) -extern __env_cachesize_reply * __db_env_cachesize_1(); -#define __DB_env_close ((unsigned long)(2)) -extern __env_close_reply * __db_env_close_1(); -#define __DB_env_create ((unsigned long)(3)) -extern __env_create_reply * __db_env_create_1(); -#define __DB_env_flags ((unsigned long)(4)) -extern __env_flags_reply * __db_env_flags_1(); -#define __DB_env_open ((unsigned long)(5)) -extern __env_open_reply * __db_env_open_1(); -#define __DB_env_remove ((unsigned long)(6)) -extern __env_remove_reply * __db_env_remove_1(); -#define __DB_txn_abort ((unsigned long)(7)) -extern __txn_abort_reply * __db_txn_abort_1(); -#define __DB_txn_begin ((unsigned long)(8)) -extern __txn_begin_reply * __db_txn_begin_1(); -#define __DB_txn_commit ((unsigned long)(9)) -extern __txn_commit_reply * __db_txn_commit_1(); -#define __DB_db_bt_maxkey ((unsigned long)(10)) -extern __db_bt_maxkey_reply * __db_db_bt_maxkey_1(); -#define __DB_db_bt_minkey ((unsigned long)(11)) -extern __db_bt_minkey_reply * __db_db_bt_minkey_1(); -#define __DB_db_close ((unsigned long)(12)) -extern __db_close_reply * __db_db_close_1(); -#define __DB_db_create ((unsigned long)(13)) -extern __db_create_reply * __db_db_create_1(); -#define __DB_db_del ((unsigned long)(14)) -extern __db_del_reply * __db_db_del_1(); -#define __DB_db_extentsize ((unsigned long)(15)) -extern __db_extentsize_reply * __db_db_extentsize_1(); -#define __DB_db_flags ((unsigned long)(16)) -extern __db_flags_reply * __db_db_flags_1(); -#define __DB_db_get ((unsigned long)(17)) -extern __db_get_reply * __db_db_get_1(); -#define __DB_db_h_ffactor ((unsigned long)(18)) -extern __db_h_ffactor_reply * __db_db_h_ffactor_1(); -#define __DB_db_h_nelem ((unsigned long)(19)) -extern __db_h_nelem_reply * __db_db_h_nelem_1(); -#define __DB_db_key_range ((unsigned long)(20)) -extern __db_key_range_reply * __db_db_key_range_1(); -#define __DB_db_lorder ((unsigned long)(21)) -extern __db_lorder_reply * __db_db_lorder_1(); -#define __DB_db_open ((unsigned long)(22)) -extern __db_open_reply * __db_db_open_1(); -#define __DB_db_pagesize ((unsigned long)(23)) -extern __db_pagesize_reply * __db_db_pagesize_1(); -#define __DB_db_put ((unsigned long)(24)) -extern __db_put_reply * __db_db_put_1(); -#define __DB_db_re_delim ((unsigned long)(25)) -extern __db_re_delim_reply * __db_db_re_delim_1(); -#define __DB_db_re_len ((unsigned long)(26)) -extern __db_re_len_reply * __db_db_re_len_1(); -#define __DB_db_re_pad ((unsigned long)(27)) -extern __db_re_pad_reply * __db_db_re_pad_1(); -#define __DB_db_remove ((unsigned long)(28)) -extern __db_remove_reply * __db_db_remove_1(); -#define __DB_db_rename ((unsigned long)(29)) -extern __db_rename_reply * __db_db_rename_1(); -#define __DB_db_stat ((unsigned long)(30)) -extern __db_stat_reply * __db_db_stat_1(); -#define __DB_db_swapped ((unsigned long)(31)) -extern __db_swapped_reply * __db_db_swapped_1(); -#define __DB_db_sync ((unsigned long)(32)) -extern __db_sync_reply * __db_db_sync_1(); -#define __DB_db_cursor ((unsigned long)(33)) -extern __db_cursor_reply * __db_db_cursor_1(); -#define __DB_db_join ((unsigned long)(34)) -extern __db_join_reply * __db_db_join_1(); -#define __DB_dbc_close ((unsigned long)(35)) -extern __dbc_close_reply * __db_dbc_close_1(); -#define __DB_dbc_count ((unsigned long)(36)) -extern __dbc_count_reply * __db_dbc_count_1(); -#define __DB_dbc_del ((unsigned long)(37)) -extern __dbc_del_reply * __db_dbc_del_1(); -#define __DB_dbc_dup ((unsigned long)(38)) -extern __dbc_dup_reply * __db_dbc_dup_1(); -#define __DB_dbc_get ((unsigned long)(39)) -extern __dbc_get_reply * __db_dbc_get_1(); -#define __DB_dbc_put ((unsigned long)(40)) -extern __dbc_put_reply * __db_dbc_put_1(); -extern int db_serverprog_1_freeresult(); - -/* the xdr functions */ -extern bool_t xdr___env_cachesize_msg(); -extern bool_t xdr___env_cachesize_reply(); -extern bool_t xdr___env_close_msg(); -extern bool_t xdr___env_close_reply(); -extern bool_t xdr___env_create_msg(); -extern bool_t xdr___env_create_reply(); -extern bool_t xdr___env_flags_msg(); -extern bool_t xdr___env_flags_reply(); -extern bool_t xdr___env_open_msg(); -extern bool_t xdr___env_open_reply(); -extern bool_t xdr___env_remove_msg(); -extern bool_t xdr___env_remove_reply(); -extern bool_t xdr___txn_abort_msg(); -extern bool_t xdr___txn_abort_reply(); -extern bool_t xdr___txn_begin_msg(); -extern bool_t xdr___txn_begin_reply(); -extern bool_t xdr___txn_commit_msg(); -extern bool_t xdr___txn_commit_reply(); -extern bool_t xdr___db_bt_maxkey_msg(); -extern bool_t xdr___db_bt_maxkey_reply(); -extern bool_t xdr___db_bt_minkey_msg(); -extern bool_t xdr___db_bt_minkey_reply(); -extern bool_t xdr___db_close_msg(); -extern bool_t xdr___db_close_reply(); -extern bool_t xdr___db_create_msg(); -extern bool_t xdr___db_create_reply(); -extern bool_t xdr___db_del_msg(); -extern bool_t xdr___db_del_reply(); -extern bool_t xdr___db_extentsize_msg(); -extern bool_t xdr___db_extentsize_reply(); -extern bool_t xdr___db_flags_msg(); -extern bool_t xdr___db_flags_reply(); -extern bool_t xdr___db_get_msg(); -extern bool_t xdr___db_get_reply(); -extern bool_t xdr___db_h_ffactor_msg(); -extern bool_t xdr___db_h_ffactor_reply(); -extern bool_t xdr___db_h_nelem_msg(); -extern bool_t xdr___db_h_nelem_reply(); -extern bool_t xdr___db_key_range_msg(); -extern bool_t xdr___db_key_range_reply(); -extern bool_t xdr___db_lorder_msg(); -extern bool_t xdr___db_lorder_reply(); -extern bool_t xdr___db_open_msg(); -extern bool_t xdr___db_open_reply(); -extern bool_t xdr___db_pagesize_msg(); -extern bool_t xdr___db_pagesize_reply(); -extern bool_t xdr___db_put_msg(); -extern bool_t xdr___db_put_reply(); -extern bool_t xdr___db_re_delim_msg(); -extern bool_t xdr___db_re_delim_reply(); -extern bool_t xdr___db_re_len_msg(); -extern bool_t xdr___db_re_len_reply(); -extern bool_t xdr___db_re_pad_msg(); -extern bool_t xdr___db_re_pad_reply(); -extern bool_t xdr___db_remove_msg(); -extern bool_t xdr___db_remove_reply(); -extern bool_t xdr___db_rename_msg(); -extern bool_t xdr___db_rename_reply(); -extern bool_t xdr___db_stat_msg(); -extern bool_t xdr___db_stat_statsreplist(); -extern bool_t xdr___db_stat_reply(); -extern bool_t xdr___db_swapped_msg(); -extern bool_t xdr___db_swapped_reply(); -extern bool_t xdr___db_sync_msg(); -extern bool_t xdr___db_sync_reply(); -extern bool_t xdr___db_cursor_msg(); -extern bool_t xdr___db_cursor_reply(); -extern bool_t xdr___db_join_curslist(); -extern bool_t xdr___db_join_msg(); -extern bool_t xdr___db_join_reply(); -extern bool_t xdr___dbc_close_msg(); -extern bool_t xdr___dbc_close_reply(); -extern bool_t xdr___dbc_count_msg(); -extern bool_t xdr___dbc_count_reply(); -extern bool_t xdr___dbc_del_msg(); -extern bool_t xdr___dbc_del_reply(); -extern bool_t xdr___dbc_dup_msg(); -extern bool_t xdr___dbc_dup_reply(); -extern bool_t xdr___dbc_get_msg(); -extern bool_t xdr___dbc_get_reply(); -extern bool_t xdr___dbc_put_msg(); -extern bool_t xdr___dbc_put_reply(); - -#endif /* !_DB_SERVER_H_RPCGEN */ diff --git a/bdb/include/hash_auto.h b/bdb/include/hash_auto.h deleted file mode 100644 index 5d816d5bbd4..00000000000 --- a/bdb/include/hash_auto.h +++ /dev/null @@ -1,248 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ - -#ifndef ham_AUTO_H -#define ham_AUTO_H - -#define DB_ham_insdel 21 -typedef struct _ham_insdel_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - u_int32_t ndx; - DB_LSN pagelsn; - DBT key; - DBT data; -} __ham_insdel_args; - -int __ham_insdel_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, u_int32_t, DB_LSN *, const DBT *, const DBT *)); -int __ham_insdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_insdel_read __P((DB_ENV *, void *, __ham_insdel_args **)); - -#define DB_ham_newpage 22 -typedef struct _ham_newpage_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - int32_t fileid; - db_pgno_t prev_pgno; - DB_LSN prevlsn; - db_pgno_t new_pgno; - DB_LSN pagelsn; - db_pgno_t next_pgno; - DB_LSN nextlsn; -} __ham_newpage_args; - -int __ham_newpage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *)); -int __ham_newpage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_newpage_read __P((DB_ENV *, void *, __ham_newpage_args **)); - -#define DB_ham_splitmeta 23 -typedef struct _ham_splitmeta_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - u_int32_t bucket; - u_int32_t ovflpoint; - u_int32_t spares; - DB_LSN metalsn; -} __ham_splitmeta_args; - -int __ham_splitmeta_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_splitmeta_read __P((DB_ENV *, void *, __ham_splitmeta_args **)); - -#define DB_ham_splitdata 24 -typedef struct _ham_splitdata_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - u_int32_t opcode; - db_pgno_t pgno; - DBT pageimage; - DB_LSN pagelsn; -} __ham_splitdata_args; - -int __ham_splitdata_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, u_int32_t, db_pgno_t, const DBT *, DB_LSN *)); -int __ham_splitdata_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_splitdata_read __P((DB_ENV *, void *, __ham_splitdata_args **)); - -#define DB_ham_replace 25 -typedef struct _ham_replace_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - u_int32_t ndx; - DB_LSN pagelsn; - int32_t off; - DBT olditem; - DBT newitem; - u_int32_t makedup; -} __ham_replace_args; - -int __ham_replace_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, u_int32_t, DB_LSN *, int32_t, const DBT *, const DBT *, u_int32_t)); -int __ham_replace_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_replace_read __P((DB_ENV *, void *, __ham_replace_args **)); - -#define DB_ham_newpgno 26 -typedef struct _ham_newpgno_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - int32_t fileid; - db_pgno_t pgno; - db_pgno_t free_pgno; - u_int32_t old_type; - db_pgno_t old_pgno; - u_int32_t new_type; - DB_LSN pagelsn; - DB_LSN metalsn; -} __ham_newpgno_args; - -int __ham_newpgno_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_newpgno_read __P((DB_ENV *, void *, __ham_newpgno_args **)); - -#define DB_ham_ovfl 27 -typedef struct _ham_ovfl_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t start_pgno; - u_int32_t npages; - db_pgno_t free_pgno; - u_int32_t ovflpoint; - DB_LSN metalsn; -} __ham_ovfl_args; - -int __ham_ovfl_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_ovfl_read __P((DB_ENV *, void *, __ham_ovfl_args **)); - -#define DB_ham_copypage 28 -typedef struct _ham_copypage_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN pagelsn; - db_pgno_t next_pgno; - DB_LSN nextlsn; - db_pgno_t nnext_pgno; - DB_LSN nnextlsn; - DBT page; -} __ham_copypage_args; - -int __ham_copypage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, const DBT *)); -int __ham_copypage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_copypage_read __P((DB_ENV *, void *, __ham_copypage_args **)); - -#define DB_ham_metagroup 29 -typedef struct _ham_metagroup_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - u_int32_t bucket; - db_pgno_t pgno; - DB_LSN metalsn; - DB_LSN pagelsn; -} __ham_metagroup_args; - -int __ham_metagroup_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, u_int32_t, db_pgno_t, DB_LSN *, DB_LSN *)); -int __ham_metagroup_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_metagroup_read __P((DB_ENV *, void *, __ham_metagroup_args **)); - -#define DB_ham_groupalloc1 30 -typedef struct _ham_groupalloc1_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - DB_LSN metalsn; - DB_LSN mmetalsn; - db_pgno_t start_pgno; - u_int32_t num; -} __ham_groupalloc1_args; - -int __ham_groupalloc1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_groupalloc1_read __P((DB_ENV *, void *, __ham_groupalloc1_args **)); - -#define DB_ham_groupalloc2 31 -typedef struct _ham_groupalloc2_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DB_LSN meta_lsn; - DB_LSN alloc_lsn; - db_pgno_t start_pgno; - u_int32_t num; - db_pgno_t free; -} __ham_groupalloc2_args; - -int __ham_groupalloc2_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_groupalloc2_read __P((DB_ENV *, void *, __ham_groupalloc2_args **)); - -#define DB_ham_groupalloc 32 -typedef struct _ham_groupalloc_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DB_LSN meta_lsn; - db_pgno_t start_pgno; - u_int32_t num; - db_pgno_t free; -} __ham_groupalloc_args; - -int __ham_groupalloc_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t)); -int __ham_groupalloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_groupalloc_read __P((DB_ENV *, void *, __ham_groupalloc_args **)); - -#define DB_ham_curadj 33 -typedef struct _ham_curadj_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_pgno_t pgno; - u_int32_t indx; - u_int32_t len; - u_int32_t dup_off; - int add; - int is_dup; - u_int32_t order; -} __ham_curadj_args; - -int __ham_curadj_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t, int, int, u_int32_t)); -int __ham_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_curadj_read __P((DB_ENV *, void *, __ham_curadj_args **)); - -#define DB_ham_chgpg 34 -typedef struct _ham_chgpg_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_ham_mode mode; - db_pgno_t old_pgno; - db_pgno_t new_pgno; - u_int32_t old_indx; - u_int32_t new_indx; -} __ham_chgpg_args; - -int __ham_chgpg_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_ham_mode, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t)); -int __ham_chgpg_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __ham_chgpg_read __P((DB_ENV *, void *, __ham_chgpg_args **)); -int __ham_init_print __P((DB_ENV *)); -int __ham_init_recover __P((DB_ENV *)); -#endif diff --git a/bdb/include/log_auto.h b/bdb/include/log_auto.h deleted file mode 100644 index ddbcbcb3ec6..00000000000 --- a/bdb/include/log_auto.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ - -#ifndef log_AUTO_H -#define log_AUTO_H - -#define DB_log_register1 1 -typedef struct _log_register1_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - DBT name; - DBT uid; - int32_t fileid; - DBTYPE ftype; -} __log_register1_args; - -int __log_register1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __log_register1_read __P((DB_ENV *, void *, __log_register1_args **)); - -#define DB_log_register 2 -typedef struct _log_register_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - DBT name; - DBT uid; - int32_t fileid; - DBTYPE ftype; - db_pgno_t meta_pgno; -} __log_register_args; - -int __log_register_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, int32_t, DBTYPE, db_pgno_t)); -int __log_register_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __log_register_read __P((DB_ENV *, void *, __log_register_args **)); -int __log_init_print __P((DB_ENV *)); -int __log_init_recover __P((DB_ENV *)); -#endif diff --git a/bdb/include/qam_auto.h b/bdb/include/qam_auto.h deleted file mode 100644 index 8362b2118f4..00000000000 --- a/bdb/include/qam_auto.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ - -#ifndef qam_AUTO_H -#define qam_AUTO_H - -#define DB_qam_inc 76 -typedef struct _qam_inc_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DB_LSN lsn; -} __qam_inc_args; - -int __qam_inc_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *)); -int __qam_inc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __qam_inc_read __P((DB_ENV *, void *, __qam_inc_args **)); - -#define DB_qam_incfirst 77 -typedef struct _qam_incfirst_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - db_recno_t recno; -} __qam_incfirst_args; - -int __qam_incfirst_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_recno_t)); -int __qam_incfirst_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __qam_incfirst_read __P((DB_ENV *, void *, __qam_incfirst_args **)); - -#define DB_qam_mvptr 78 -typedef struct _qam_mvptr_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - int32_t fileid; - db_recno_t old_first; - db_recno_t new_first; - db_recno_t old_cur; - db_recno_t new_cur; - DB_LSN metalsn; -} __qam_mvptr_args; - -int __qam_mvptr_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_recno_t, db_recno_t, db_recno_t, db_recno_t, DB_LSN *)); -int __qam_mvptr_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __qam_mvptr_read __P((DB_ENV *, void *, __qam_mvptr_args **)); - -#define DB_qam_del 79 -typedef struct _qam_del_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DB_LSN lsn; - db_pgno_t pgno; - u_int32_t indx; - db_recno_t recno; -} __qam_del_args; - -int __qam_del_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t)); -int __qam_del_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __qam_del_read __P((DB_ENV *, void *, __qam_del_args **)); - -#define DB_qam_add 80 -typedef struct _qam_add_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DB_LSN lsn; - db_pgno_t pgno; - u_int32_t indx; - db_recno_t recno; - DBT data; - u_int32_t vflag; - DBT olddata; -} __qam_add_args; - -int __qam_add_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *, u_int32_t, const DBT *)); -int __qam_add_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __qam_add_read __P((DB_ENV *, void *, __qam_add_args **)); - -#define DB_qam_delete 81 -typedef struct _qam_delete_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - DBT name; - DB_LSN lsn; -} __qam_delete_args; - -int __qam_delete_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, DB_LSN *)); -int __qam_delete_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __qam_delete_read __P((DB_ENV *, void *, __qam_delete_args **)); - -#define DB_qam_rename 82 -typedef struct _qam_rename_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - DBT name; - DBT newname; -} __qam_rename_args; - -int __qam_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *)); -int __qam_rename_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __qam_rename_read __P((DB_ENV *, void *, __qam_rename_args **)); - -#define DB_qam_delext 83 -typedef struct _qam_delext_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - int32_t fileid; - DB_LSN lsn; - db_pgno_t pgno; - u_int32_t indx; - db_recno_t recno; - DBT data; -} __qam_delext_args; - -int __qam_delext_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *)); -int __qam_delext_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __qam_delext_read __P((DB_ENV *, void *, __qam_delext_args **)); -int __qam_init_print __P((DB_ENV *)); -int __qam_init_recover __P((DB_ENV *)); -#endif diff --git a/bdb/include/txn_auto.h b/bdb/include/txn_auto.h deleted file mode 100644 index c9cb5cfae4c..00000000000 --- a/bdb/include/txn_auto.h +++ /dev/null @@ -1,114 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ - -#ifndef txn_AUTO_H -#define txn_AUTO_H - -#define DB_txn_old_regop 6 -typedef struct _txn_old_regop_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; -} __txn_old_regop_args; - -int __txn_old_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __txn_old_regop_read __P((DB_ENV *, void *, __txn_old_regop_args **)); - -#define DB_txn_regop 10 -typedef struct _txn_regop_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - int32_t timestamp; -} __txn_regop_args; - -int __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t)); -int __txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __txn_regop_read __P((DB_ENV *, void *, __txn_regop_args **)); - -#define DB_txn_old_ckp 7 -typedef struct _txn_old_ckp_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - DB_LSN ckp_lsn; - DB_LSN last_ckp; -} __txn_old_ckp_args; - -int __txn_old_ckp_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __txn_old_ckp_read __P((DB_ENV *, void *, __txn_old_ckp_args **)); - -#define DB_txn_ckp 11 -typedef struct _txn_ckp_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - DB_LSN ckp_lsn; - DB_LSN last_ckp; - int32_t timestamp; -} __txn_ckp_args; - -int __txn_ckp_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, DB_LSN *, int32_t)); -int __txn_ckp_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __txn_ckp_read __P((DB_ENV *, void *, __txn_ckp_args **)); - -#define DB_txn_xa_regop_old 8 -typedef struct _txn_xa_regop_old_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - DBT xid; - int32_t formatID; - u_int32_t gtrid; - u_int32_t bqual; -} __txn_xa_regop_old_args; - -int __txn_xa_regop_old_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __txn_xa_regop_old_read __P((DB_ENV *, void *, __txn_xa_regop_old_args **)); - -#define DB_txn_xa_regop 13 -typedef struct _txn_xa_regop_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - DBT xid; - int32_t formatID; - u_int32_t gtrid; - u_int32_t bqual; - DB_LSN begin_lsn; -} __txn_xa_regop_args; - -int __txn_xa_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, int32_t, u_int32_t, u_int32_t, DB_LSN *)); -int __txn_xa_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __txn_xa_regop_read __P((DB_ENV *, void *, __txn_xa_regop_args **)); - -#define DB_txn_child_old 9 -typedef struct _txn_child_old_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t opcode; - u_int32_t parent; -} __txn_child_old_args; - -int __txn_child_old_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __txn_child_old_read __P((DB_ENV *, void *, __txn_child_old_args **)); - -#define DB_txn_child 12 -typedef struct _txn_child_args { - u_int32_t type; - DB_TXN *txnid; - DB_LSN prev_lsn; - u_int32_t child; - DB_LSN c_lsn; -} __txn_child_args; - -int __txn_child_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, DB_LSN *)); -int __txn_child_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); -int __txn_child_read __P((DB_ENV *, void *, __txn_child_args **)); -int __txn_init_print __P((DB_ENV *)); -int __txn_init_recover __P((DB_ENV *)); -#endif diff --git a/bdb/java/src/com/sleepycat/db/DbConstants.java b/bdb/java/src/com/sleepycat/db/DbConstants.java deleted file mode 100644 index 491b1fce2e8..00000000000 --- a/bdb/java/src/com/sleepycat/db/DbConstants.java +++ /dev/null @@ -1,217 +0,0 @@ -// DO NOT EDIT: automatically built by dist/s_java. - -package com.sleepycat.db; - -public class DbConstants -{ - public static final int DB_MAX_PAGES = 0xffffffff; - public static final int DB_MAX_RECORDS = 0xffffffff; - public static final int DB_DBT_ISSET = 0x001; - public static final int DB_DBT_MALLOC = 0x002; - public static final int DB_DBT_PARTIAL = 0x004; - public static final int DB_DBT_REALLOC = 0x008; - public static final int DB_DBT_USERMEM = 0x010; - public static final int DB_DBT_DUPOK = 0x020; - public static final int DB_CREATE = 0x000001; - public static final int DB_CXX_NO_EXCEPTIONS = 0x000002; - public static final int DB_FORCE = 0x000004; - public static final int DB_NOMMAP = 0x000008; - public static final int DB_RDONLY = 0x000010; - public static final int DB_RECOVER = 0x000020; - public static final int DB_THREAD = 0x000040; - public static final int DB_TXN_NOSYNC = 0x000080; - public static final int DB_USE_ENVIRON = 0x000100; - public static final int DB_USE_ENVIRON_ROOT = 0x000200; - public static final int DB_CLIENT = 0x000400; - public static final int DB_XA_CREATE = 0x000400; - public static final int DB_INIT_CDB = 0x000400; - public static final int DB_INIT_LOCK = 0x000800; - public static final int DB_INIT_LOG = 0x001000; - public static final int DB_INIT_MPOOL = 0x002000; - public static final int DB_INIT_TXN = 0x004000; - public static final int DB_JOINENV = 0x008000; - public static final int DB_LOCKDOWN = 0x010000; - public static final int DB_PRIVATE = 0x020000; - public static final int DB_RECOVER_FATAL = 0x040000; - public static final int DB_SYSTEM_MEM = 0x080000; - public static final int DB_EXCL = 0x000400; - public static final int DB_FCNTL_LOCKING = 0x000800; - public static final int DB_ODDFILESIZE = 0x001000; - public static final int DB_RDWRMASTER = 0x002000; - public static final int DB_TRUNCATE = 0x004000; - public static final int DB_EXTENT = 0x008000; - public static final int DB_TXN_NOWAIT = 0x000400; - public static final int DB_TXN_SYNC = 0x000800; - public static final int DB_CDB_ALLDB = 0x000400; - public static final int DB_UPGRADE = 0x000400; - public static final int DB_VERIFY = 0x000800; - public static final int DB_DUP = 0x0001; - public static final int DB_DUPSORT = 0x0002; - public static final int DB_RECNUM = 0x0004; - public static final int DB_RENUMBER = 0x0008; - public static final int DB_REVSPLITOFF = 0x0010; - public static final int DB_SNAPSHOT = 0x0020; - public static final int DB_JOIN_NOSORT = 0x0001; - public static final int DB_AGGRESSIVE = 0x0001; - public static final int DB_NOORDERCHK = 0x0002; - public static final int DB_ORDERCHKONLY = 0x0004; - public static final int DB_PR_PAGE = 0x0008; - public static final int DB_PR_HEADERS = 0x0010; - public static final int DB_PR_RECOVERYTEST = 0x0020; - public static final int DB_SALVAGE = 0x0040; - public static final int DB_VRFY_FLAGMASK = 0xffff; - public static final int DB_LOCK_NORUN = 0; - public static final int DB_LOCK_DEFAULT = 1; - public static final int DB_LOCK_OLDEST = 2; - public static final int DB_LOCK_RANDOM = 3; - public static final int DB_LOCK_YOUNGEST = 4; - public static final int DB_REGION_MAGIC = 0x120897; - public static final int DB_VERB_CHKPOINT = 0x0001; - public static final int DB_VERB_DEADLOCK = 0x0002; - public static final int DB_VERB_RECOVERY = 0x0004; - public static final int DB_VERB_WAITSFOR = 0x0008; - public static final int DB_TEST_PREOPEN = 1; - public static final int DB_TEST_POSTOPEN = 2; - public static final int DB_TEST_POSTLOGMETA = 3; - public static final int DB_TEST_POSTLOG = 4; - public static final int DB_TEST_POSTSYNC = 5; - public static final int DB_TEST_PRERENAME = 6; - public static final int DB_TEST_POSTRENAME = 7; - public static final int DB_ENV_CDB = 0x00001; - public static final int DB_ENV_CDB_ALLDB = 0x00002; - public static final int DB_ENV_CREATE = 0x00004; - public static final int DB_ENV_DBLOCAL = 0x00008; - public static final int DB_ENV_LOCKDOWN = 0x00010; - public static final int DB_ENV_NOMMAP = 0x00020; - public static final int DB_ENV_OPEN_CALLED = 0x00040; - public static final int DB_ENV_PRIVATE = 0x00080; - public static final int DB_ENV_RPCCLIENT = 0x00100; - public static final int DB_ENV_STANDALONE = 0x00200; - public static final int DB_ENV_SYSTEM_MEM = 0x00400; - public static final int DB_ENV_THREAD = 0x00800; - public static final int DB_ENV_TXN_NOSYNC = 0x01000; - public static final int DB_ENV_USER_ALLOC = 0x02000; - public static final int DB_BTREEVERSION = 8; - public static final int DB_BTREEOLDVER = 6; - public static final int DB_BTREEMAGIC = 0x053162; - public static final int DB_HASHVERSION = 7; - public static final int DB_HASHOLDVER = 4; - public static final int DB_HASHMAGIC = 0x061561; - public static final int DB_QAMVERSION = 3; - public static final int DB_QAMOLDVER = 1; - public static final int DB_QAMMAGIC = 0x042253; - public static final int DB_LOGVERSION = 3; - public static final int DB_LOGOLDVER = 3; - public static final int DB_LOGMAGIC = 0x040988; - public static final int DB_AFTER = 1; - public static final int DB_APPEND = 2; - public static final int DB_BEFORE = 3; - public static final int DB_CACHED_COUNTS = 4; - public static final int DB_CHECKPOINT = 5; - public static final int DB_CONSUME = 6; - public static final int DB_CONSUME_WAIT = 7; - public static final int DB_CURLSN = 8; - public static final int DB_CURRENT = 9; - public static final int DB_FIRST = 10; - public static final int DB_FLUSH = 11; - public static final int DB_GET_BOTH = 12; - public static final int DB_GET_BOTHC = 13; - public static final int DB_GET_RECNO = 14; - public static final int DB_JOIN_ITEM = 15; - public static final int DB_KEYFIRST = 16; - public static final int DB_KEYLAST = 17; - public static final int DB_LAST = 18; - public static final int DB_NEXT = 19; - public static final int DB_NEXT_DUP = 20; - public static final int DB_NEXT_NODUP = 21; - public static final int DB_NODUPDATA = 22; - public static final int DB_NOOVERWRITE = 23; - public static final int DB_NOSYNC = 24; - public static final int DB_POSITION = 25; - public static final int DB_POSITIONI = 26; - public static final int DB_PREV = 27; - public static final int DB_PREV_NODUP = 28; - public static final int DB_RECORDCOUNT = 29; - public static final int DB_SET = 30; - public static final int DB_SET_RANGE = 31; - public static final int DB_SET_RECNO = 32; - public static final int DB_WRITECURSOR = 33; - public static final int DB_WRITELOCK = 34; - public static final int DB_OPFLAGS_MASK = 0x000000ff; - public static final int DB_RMW = 0x80000000; - public static final int DB_INCOMPLETE = -30999; - public static final int DB_KEYEMPTY = -30998; - public static final int DB_KEYEXIST = -30997; - public static final int DB_LOCK_DEADLOCK = -30996; - public static final int DB_LOCK_NOTGRANTED = -30995; - public static final int DB_NOSERVER = -30994; - public static final int DB_NOSERVER_HOME = -30993; - public static final int DB_NOSERVER_ID = -30992; - public static final int DB_NOTFOUND = -30991; - public static final int DB_OLD_VERSION = -30990; - public static final int DB_RUNRECOVERY = -30989; - public static final int DB_VERIFY_BAD = -30988; - public static final int DB_ALREADY_ABORTED = -30899; - public static final int DB_DELETED = -30898; - public static final int DB_JAVA_CALLBACK = -30897; - public static final int DB_NEEDSPLIT = -30896; - public static final int DB_SWAPBYTES = -30895; - public static final int DB_TXN_CKP = -30894; - public static final int DB_VERIFY_FATAL = -30893; - public static final int DB_FILE_ID_LEN = 20; - public static final int DB_LOGFILEID_INVALID = -1; - public static final int DB_OK_BTREE = 0x01; - public static final int DB_OK_HASH = 0x02; - public static final int DB_OK_QUEUE = 0x04; - public static final int DB_OK_RECNO = 0x08; - public static final int DB_AM_DISCARD = 0x00001; - public static final int DB_AM_DUP = 0x00002; - public static final int DB_AM_DUPSORT = 0x00004; - public static final int DB_AM_INMEM = 0x00008; - public static final int DB_AM_PGDEF = 0x00010; - public static final int DB_AM_RDONLY = 0x00020; - public static final int DB_AM_RECOVER = 0x00040; - public static final int DB_AM_SUBDB = 0x00080; - public static final int DB_AM_SWAP = 0x00100; - public static final int DB_AM_TXN = 0x00200; - public static final int DB_AM_VERIFYING = 0x00400; - public static final int DB_BT_RECNUM = 0x00800; - public static final int DB_BT_REVSPLIT = 0x01000; - public static final int DB_DBM_ERROR = 0x02000; - public static final int DB_OPEN_CALLED = 0x04000; - public static final int DB_RE_DELIMITER = 0x08000; - public static final int DB_RE_FIXEDLEN = 0x10000; - public static final int DB_RE_PAD = 0x20000; - public static final int DB_RE_RENUMBER = 0x40000; - public static final int DB_RE_SNAPSHOT = 0x80000; - public static final int DB_RECORD_LOCK = 1; - public static final int DB_PAGE_LOCK = 2; - public static final int DB_LOCKVERSION = 1; - public static final int DB_LOCK_NOWAIT = 0x01; - public static final int DB_LOCK_RECORD = 0x02; - public static final int DB_LOCK_UPGRADE = 0x04; - public static final int DB_LOCK_SWITCH = 0x08; - public static final int DB_LOCK_CONFLICT = 0x01; - public static final int DB_LOCK_RIW_N = 7; - public static final int DB_ARCH_ABS = 0x001; - public static final int DB_ARCH_DATA = 0x002; - public static final int DB_ARCH_LOG = 0x004; - public static final int DB_MPOOL_CREATE = 0x001; - public static final int DB_MPOOL_LAST = 0x002; - public static final int DB_MPOOL_NEW = 0x004; - public static final int DB_MPOOL_NEW_GROUP = 0x008; - public static final int DB_MPOOL_EXTENT = 0x010; - public static final int DB_MPOOL_CLEAN = 0x001; - public static final int DB_MPOOL_DIRTY = 0x002; - public static final int DB_MPOOL_DISCARD = 0x004; - public static final int DB_TXNVERSION = 1; - public static final int DB_TXN_BACKWARD_ROLL = 1; - public static final int DB_TXN_FORWARD_ROLL = 2; - public static final int DB_TXN_OPENFILES = 3; - public static final int DB_TXN_REDO = 4; - public static final int DB_TXN_UNDO = 5; - public static final int DB_DBM_HSEARCH = 0; - public static final int DB_VERSION_MAJOR = 3; - public static final int DB_VERSION_MINOR = 2; - public static final int DB_VERSION_PATCH = 9; -} diff --git a/bdb/log/log_auto.c b/bdb/log/log_auto.c deleted file mode 100644 index 281296cc238..00000000000 --- a/bdb/log/log_auto.c +++ /dev/null @@ -1,326 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <ctype.h> -#include <errno.h> -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "db_dispatch.h" -#include "db_am.h" -#include "log.h" -#include "txn.h" - -int -__log_register1_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __log_register1_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __log_register1_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]log_register1: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tname: "); - for (i = 0; i < argp->name.size; i++) { - ch = ((u_int8_t *)argp->name.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tuid: "); - for (i = 0; i < argp->uid.size; i++) { - ch = ((u_int8_t *)argp->uid.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tftype: 0x%lx\n", (u_long)argp->ftype); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__log_register1_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __log_register1_args **argpp; -{ - __log_register1_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__log_register1_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memset(&argp->name, 0, sizeof(argp->name)); - memcpy(&argp->name.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->name.data = bp; - bp += argp->name.size; - memset(&argp->uid, 0, sizeof(argp->uid)); - memcpy(&argp->uid.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->uid.data = bp; - bp += argp->uid.size; - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->ftype, bp, sizeof(argp->ftype)); - bp += sizeof(argp->ftype); - *argpp = argp; - return (0); -} - -int -__log_register_log(dbenv, txnid, ret_lsnp, flags, - opcode, name, uid, fileid, ftype, meta_pgno) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t opcode; - const DBT *name; - const DBT *uid; - int32_t fileid; - DBTYPE ftype; - db_pgno_t meta_pgno; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_log_register; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(opcode) - + sizeof(u_int32_t) + (name == NULL ? 0 : name->size) - + sizeof(u_int32_t) + (uid == NULL ? 0 : uid->size) - + sizeof(fileid) - + sizeof(ftype) - + sizeof(meta_pgno); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - if (name == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &name->size, sizeof(name->size)); - bp += sizeof(name->size); - memcpy(bp, name->data, name->size); - bp += name->size; - } - if (uid == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &uid->size, sizeof(uid->size)); - bp += sizeof(uid->size); - memcpy(bp, uid->data, uid->size); - bp += uid->size; - } - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &ftype, sizeof(ftype)); - bp += sizeof(ftype); - memcpy(bp, &meta_pgno, sizeof(meta_pgno)); - bp += sizeof(meta_pgno); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = __log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__log_register_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __log_register_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __log_register_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]log_register: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tname: "); - for (i = 0; i < argp->name.size; i++) { - ch = ((u_int8_t *)argp->name.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tuid: "); - for (i = 0; i < argp->uid.size; i++) { - ch = ((u_int8_t *)argp->uid.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tftype: 0x%lx\n", (u_long)argp->ftype); - printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__log_register_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __log_register_args **argpp; -{ - __log_register_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__log_register_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memset(&argp->name, 0, sizeof(argp->name)); - memcpy(&argp->name.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->name.data = bp; - bp += argp->name.size; - memset(&argp->uid, 0, sizeof(argp->uid)); - memcpy(&argp->uid.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->uid.data = bp; - bp += argp->uid.size; - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->ftype, bp, sizeof(argp->ftype)); - bp += sizeof(argp->ftype); - memcpy(&argp->meta_pgno, bp, sizeof(argp->meta_pgno)); - bp += sizeof(argp->meta_pgno); - *argpp = argp; - return (0); -} - -int -__log_init_print(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __log_register1_print, DB_log_register1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __log_register_print, DB_log_register)) != 0) - return (ret); - return (0); -} - -int -__log_init_recover(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_log_register1)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __log_register_recover, DB_log_register)) != 0) - return (ret); - return (0); -} - diff --git a/bdb/qam/qam_auto.c b/bdb/qam/qam_auto.c deleted file mode 100644 index cfdba3195eb..00000000000 --- a/bdb/qam/qam_auto.c +++ /dev/null @@ -1,1282 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <ctype.h> -#include <errno.h> -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "db_dispatch.h" -#include "db_am.h" -#include "qam.h" -#include "txn.h" - -int -__qam_inc_log(dbenv, txnid, ret_lsnp, flags, - fileid, lsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - DB_LSN * lsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_qam_inc; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(*lsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__qam_inc_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __qam_inc_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __qam_inc_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]qam_inc: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__qam_inc_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __qam_inc_args **argpp; -{ - __qam_inc_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__qam_inc_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - *argpp = argp; - return (0); -} - -int -__qam_incfirst_log(dbenv, txnid, ret_lsnp, flags, - fileid, recno) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - db_recno_t recno; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_qam_incfirst; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(recno); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &recno, sizeof(recno)); - bp += sizeof(recno); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__qam_incfirst_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __qam_incfirst_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __qam_incfirst_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]qam_incfirst: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\trecno: %lu\n", (u_long)argp->recno); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__qam_incfirst_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __qam_incfirst_args **argpp; -{ - __qam_incfirst_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__qam_incfirst_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->recno, bp, sizeof(argp->recno)); - bp += sizeof(argp->recno); - *argpp = argp; - return (0); -} - -int -__qam_mvptr_log(dbenv, txnid, ret_lsnp, flags, - opcode, fileid, old_first, new_first, old_cur, new_cur, - metalsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t opcode; - int32_t fileid; - db_recno_t old_first; - db_recno_t new_first; - db_recno_t old_cur; - db_recno_t new_cur; - DB_LSN * metalsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_qam_mvptr; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(opcode) - + sizeof(fileid) - + sizeof(old_first) - + sizeof(new_first) - + sizeof(old_cur) - + sizeof(new_cur) - + sizeof(*metalsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - memcpy(bp, &old_first, sizeof(old_first)); - bp += sizeof(old_first); - memcpy(bp, &new_first, sizeof(new_first)); - bp += sizeof(new_first); - memcpy(bp, &old_cur, sizeof(old_cur)); - bp += sizeof(old_cur); - memcpy(bp, &new_cur, sizeof(new_cur)); - bp += sizeof(new_cur); - if (metalsn != NULL) - memcpy(bp, metalsn, sizeof(*metalsn)); - else - memset(bp, 0, sizeof(*metalsn)); - bp += sizeof(*metalsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__qam_mvptr_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __qam_mvptr_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __qam_mvptr_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]qam_mvptr: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\told_first: %lu\n", (u_long)argp->old_first); - printf("\tnew_first: %lu\n", (u_long)argp->new_first); - printf("\told_cur: %lu\n", (u_long)argp->old_cur); - printf("\tnew_cur: %lu\n", (u_long)argp->new_cur); - printf("\tmetalsn: [%lu][%lu]\n", - (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__qam_mvptr_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __qam_mvptr_args **argpp; -{ - __qam_mvptr_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__qam_mvptr_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->old_first, bp, sizeof(argp->old_first)); - bp += sizeof(argp->old_first); - memcpy(&argp->new_first, bp, sizeof(argp->new_first)); - bp += sizeof(argp->new_first); - memcpy(&argp->old_cur, bp, sizeof(argp->old_cur)); - bp += sizeof(argp->old_cur); - memcpy(&argp->new_cur, bp, sizeof(argp->new_cur)); - bp += sizeof(argp->new_cur); - memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); - bp += sizeof(argp->metalsn); - *argpp = argp; - return (0); -} - -int -__qam_del_log(dbenv, txnid, ret_lsnp, flags, - fileid, lsn, pgno, indx, recno) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - DB_LSN * lsn; - db_pgno_t pgno; - u_int32_t indx; - db_recno_t recno; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_qam_del; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(*lsn) - + sizeof(pgno) - + sizeof(indx) - + sizeof(recno); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - memcpy(bp, &recno, sizeof(recno)); - bp += sizeof(recno); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__qam_del_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __qam_del_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __qam_del_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]qam_del: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\trecno: %lu\n", (u_long)argp->recno); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__qam_del_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __qam_del_args **argpp; -{ - __qam_del_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__qam_del_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->recno, bp, sizeof(argp->recno)); - bp += sizeof(argp->recno); - *argpp = argp; - return (0); -} - -int -__qam_add_log(dbenv, txnid, ret_lsnp, flags, - fileid, lsn, pgno, indx, recno, data, - vflag, olddata) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - DB_LSN * lsn; - db_pgno_t pgno; - u_int32_t indx; - db_recno_t recno; - const DBT *data; - u_int32_t vflag; - const DBT *olddata; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_qam_add; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(*lsn) - + sizeof(pgno) - + sizeof(indx) - + sizeof(recno) - + sizeof(u_int32_t) + (data == NULL ? 0 : data->size) - + sizeof(vflag) - + sizeof(u_int32_t) + (olddata == NULL ? 0 : olddata->size); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - memcpy(bp, &recno, sizeof(recno)); - bp += sizeof(recno); - if (data == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &data->size, sizeof(data->size)); - bp += sizeof(data->size); - memcpy(bp, data->data, data->size); - bp += data->size; - } - memcpy(bp, &vflag, sizeof(vflag)); - bp += sizeof(vflag); - if (olddata == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &olddata->size, sizeof(olddata->size)); - bp += sizeof(olddata->size); - memcpy(bp, olddata->data, olddata->size); - bp += olddata->size; - } - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__qam_add_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __qam_add_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __qam_add_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]qam_add: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\trecno: %lu\n", (u_long)argp->recno); - printf("\tdata: "); - for (i = 0; i < argp->data.size; i++) { - ch = ((u_int8_t *)argp->data.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tvflag: %lu\n", (u_long)argp->vflag); - printf("\tolddata: "); - for (i = 0; i < argp->olddata.size; i++) { - ch = ((u_int8_t *)argp->olddata.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__qam_add_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __qam_add_args **argpp; -{ - __qam_add_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__qam_add_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->recno, bp, sizeof(argp->recno)); - bp += sizeof(argp->recno); - memset(&argp->data, 0, sizeof(argp->data)); - memcpy(&argp->data.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->data.data = bp; - bp += argp->data.size; - memcpy(&argp->vflag, bp, sizeof(argp->vflag)); - bp += sizeof(argp->vflag); - memset(&argp->olddata, 0, sizeof(argp->olddata)); - memcpy(&argp->olddata.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->olddata.data = bp; - bp += argp->olddata.size; - *argpp = argp; - return (0); -} - -int -__qam_delete_log(dbenv, txnid, ret_lsnp, flags, - name, lsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - const DBT *name; - DB_LSN * lsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_qam_delete; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(u_int32_t) + (name == NULL ? 0 : name->size) - + sizeof(*lsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - if (name == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &name->size, sizeof(name->size)); - bp += sizeof(name->size); - memcpy(bp, name->data, name->size); - bp += name->size; - } - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__qam_delete_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __qam_delete_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __qam_delete_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]qam_delete: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tname: "); - for (i = 0; i < argp->name.size; i++) { - ch = ((u_int8_t *)argp->name.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__qam_delete_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __qam_delete_args **argpp; -{ - __qam_delete_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__qam_delete_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memset(&argp->name, 0, sizeof(argp->name)); - memcpy(&argp->name.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->name.data = bp; - bp += argp->name.size; - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - *argpp = argp; - return (0); -} - -int -__qam_rename_log(dbenv, txnid, ret_lsnp, flags, - name, newname) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - const DBT *name; - const DBT *newname; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_qam_rename; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(u_int32_t) + (name == NULL ? 0 : name->size) - + sizeof(u_int32_t) + (newname == NULL ? 0 : newname->size); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - if (name == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &name->size, sizeof(name->size)); - bp += sizeof(name->size); - memcpy(bp, name->data, name->size); - bp += name->size; - } - if (newname == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &newname->size, sizeof(newname->size)); - bp += sizeof(newname->size); - memcpy(bp, newname->data, newname->size); - bp += newname->size; - } - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__qam_rename_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __qam_rename_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __qam_rename_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]qam_rename: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tname: "); - for (i = 0; i < argp->name.size; i++) { - ch = ((u_int8_t *)argp->name.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tnewname: "); - for (i = 0; i < argp->newname.size; i++) { - ch = ((u_int8_t *)argp->newname.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__qam_rename_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __qam_rename_args **argpp; -{ - __qam_rename_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__qam_rename_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memset(&argp->name, 0, sizeof(argp->name)); - memcpy(&argp->name.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->name.data = bp; - bp += argp->name.size; - memset(&argp->newname, 0, sizeof(argp->newname)); - memcpy(&argp->newname.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->newname.data = bp; - bp += argp->newname.size; - *argpp = argp; - return (0); -} - -int -__qam_delext_log(dbenv, txnid, ret_lsnp, flags, - fileid, lsn, pgno, indx, recno, data) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - int32_t fileid; - DB_LSN * lsn; - db_pgno_t pgno; - u_int32_t indx; - db_recno_t recno; - const DBT *data; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_qam_delext; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(fileid) - + sizeof(*lsn) - + sizeof(pgno) - + sizeof(indx) - + sizeof(recno) - + sizeof(u_int32_t) + (data == NULL ? 0 : data->size); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &fileid, sizeof(fileid)); - bp += sizeof(fileid); - if (lsn != NULL) - memcpy(bp, lsn, sizeof(*lsn)); - else - memset(bp, 0, sizeof(*lsn)); - bp += sizeof(*lsn); - memcpy(bp, &pgno, sizeof(pgno)); - bp += sizeof(pgno); - memcpy(bp, &indx, sizeof(indx)); - bp += sizeof(indx); - memcpy(bp, &recno, sizeof(recno)); - bp += sizeof(recno); - if (data == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &data->size, sizeof(data->size)); - bp += sizeof(data->size); - memcpy(bp, data->data, data->size); - bp += data->size; - } - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__qam_delext_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __qam_delext_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __qam_delext_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]qam_delext: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tfileid: %ld\n", (long)argp->fileid); - printf("\tlsn: [%lu][%lu]\n", - (u_long)argp->lsn.file, (u_long)argp->lsn.offset); - printf("\tpgno: %lu\n", (u_long)argp->pgno); - printf("\tindx: %lu\n", (u_long)argp->indx); - printf("\trecno: %lu\n", (u_long)argp->recno); - printf("\tdata: "); - for (i = 0; i < argp->data.size; i++) { - ch = ((u_int8_t *)argp->data.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__qam_delext_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __qam_delext_args **argpp; -{ - __qam_delext_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__qam_delext_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->fileid, bp, sizeof(argp->fileid)); - bp += sizeof(argp->fileid); - memcpy(&argp->lsn, bp, sizeof(argp->lsn)); - bp += sizeof(argp->lsn); - memcpy(&argp->pgno, bp, sizeof(argp->pgno)); - bp += sizeof(argp->pgno); - memcpy(&argp->indx, bp, sizeof(argp->indx)); - bp += sizeof(argp->indx); - memcpy(&argp->recno, bp, sizeof(argp->recno)); - bp += sizeof(argp->recno); - memset(&argp->data, 0, sizeof(argp->data)); - memcpy(&argp->data.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->data.data = bp; - bp += argp->data.size; - *argpp = argp; - return (0); -} - -int -__qam_init_print(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __qam_inc_print, DB_qam_inc)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_incfirst_print, DB_qam_incfirst)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_mvptr_print, DB_qam_mvptr)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_del_print, DB_qam_del)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_add_print, DB_qam_add)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_delete_print, DB_qam_delete)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_rename_print, DB_qam_rename)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_delext_print, DB_qam_delext)) != 0) - return (ret); - return (0); -} - -int -__qam_init_recover(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __qam_inc_recover, DB_qam_inc)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_incfirst_recover, DB_qam_incfirst)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_mvptr_recover, DB_qam_mvptr)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_del_recover, DB_qam_del)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_add_recover, DB_qam_add)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_delete_recover, DB_qam_delete)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_rename_recover, DB_qam_rename)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __qam_delext_recover, DB_qam_delext)) != 0) - return (ret); - return (0); -} - diff --git a/bdb/rpc_client/db_server_clnt.c b/bdb/rpc_client/db_server_clnt.c deleted file mode 100644 index 680a26144b2..00000000000 --- a/bdb/rpc_client/db_server_clnt.c +++ /dev/null @@ -1,692 +0,0 @@ -#include "db_config.h" -#ifdef HAVE_RPC -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "db_server.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -__env_cachesize_reply * -__db_env_cachesize_1(argp, clnt) - __env_cachesize_msg *argp; - CLIENT *clnt; -{ - static __env_cachesize_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_env_cachesize, - (xdrproc_t) xdr___env_cachesize_msg, (caddr_t) argp, - (xdrproc_t) xdr___env_cachesize_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__env_close_reply * -__db_env_close_1(argp, clnt) - __env_close_msg *argp; - CLIENT *clnt; -{ - static __env_close_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_env_close, - (xdrproc_t) xdr___env_close_msg, (caddr_t) argp, - (xdrproc_t) xdr___env_close_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__env_create_reply * -__db_env_create_1(argp, clnt) - __env_create_msg *argp; - CLIENT *clnt; -{ - static __env_create_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_env_create, - (xdrproc_t) xdr___env_create_msg, (caddr_t) argp, - (xdrproc_t) xdr___env_create_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__env_flags_reply * -__db_env_flags_1(argp, clnt) - __env_flags_msg *argp; - CLIENT *clnt; -{ - static __env_flags_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_env_flags, - (xdrproc_t) xdr___env_flags_msg, (caddr_t) argp, - (xdrproc_t) xdr___env_flags_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__env_open_reply * -__db_env_open_1(argp, clnt) - __env_open_msg *argp; - CLIENT *clnt; -{ - static __env_open_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_env_open, - (xdrproc_t) xdr___env_open_msg, (caddr_t) argp, - (xdrproc_t) xdr___env_open_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__env_remove_reply * -__db_env_remove_1(argp, clnt) - __env_remove_msg *argp; - CLIENT *clnt; -{ - static __env_remove_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_env_remove, - (xdrproc_t) xdr___env_remove_msg, (caddr_t) argp, - (xdrproc_t) xdr___env_remove_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__txn_abort_reply * -__db_txn_abort_1(argp, clnt) - __txn_abort_msg *argp; - CLIENT *clnt; -{ - static __txn_abort_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_txn_abort, - (xdrproc_t) xdr___txn_abort_msg, (caddr_t) argp, - (xdrproc_t) xdr___txn_abort_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__txn_begin_reply * -__db_txn_begin_1(argp, clnt) - __txn_begin_msg *argp; - CLIENT *clnt; -{ - static __txn_begin_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_txn_begin, - (xdrproc_t) xdr___txn_begin_msg, (caddr_t) argp, - (xdrproc_t) xdr___txn_begin_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__txn_commit_reply * -__db_txn_commit_1(argp, clnt) - __txn_commit_msg *argp; - CLIENT *clnt; -{ - static __txn_commit_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_txn_commit, - (xdrproc_t) xdr___txn_commit_msg, (caddr_t) argp, - (xdrproc_t) xdr___txn_commit_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_bt_maxkey_reply * -__db_db_bt_maxkey_1(argp, clnt) - __db_bt_maxkey_msg *argp; - CLIENT *clnt; -{ - static __db_bt_maxkey_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_bt_maxkey, - (xdrproc_t) xdr___db_bt_maxkey_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_bt_maxkey_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_bt_minkey_reply * -__db_db_bt_minkey_1(argp, clnt) - __db_bt_minkey_msg *argp; - CLIENT *clnt; -{ - static __db_bt_minkey_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_bt_minkey, - (xdrproc_t) xdr___db_bt_minkey_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_bt_minkey_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_close_reply * -__db_db_close_1(argp, clnt) - __db_close_msg *argp; - CLIENT *clnt; -{ - static __db_close_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_close, - (xdrproc_t) xdr___db_close_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_close_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_create_reply * -__db_db_create_1(argp, clnt) - __db_create_msg *argp; - CLIENT *clnt; -{ - static __db_create_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_create, - (xdrproc_t) xdr___db_create_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_create_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_del_reply * -__db_db_del_1(argp, clnt) - __db_del_msg *argp; - CLIENT *clnt; -{ - static __db_del_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_del, - (xdrproc_t) xdr___db_del_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_del_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_extentsize_reply * -__db_db_extentsize_1(argp, clnt) - __db_extentsize_msg *argp; - CLIENT *clnt; -{ - static __db_extentsize_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_extentsize, - (xdrproc_t) xdr___db_extentsize_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_extentsize_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_flags_reply * -__db_db_flags_1(argp, clnt) - __db_flags_msg *argp; - CLIENT *clnt; -{ - static __db_flags_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_flags, - (xdrproc_t) xdr___db_flags_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_flags_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_get_reply * -__db_db_get_1(argp, clnt) - __db_get_msg *argp; - CLIENT *clnt; -{ - static __db_get_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_get, - (xdrproc_t) xdr___db_get_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_get_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_h_ffactor_reply * -__db_db_h_ffactor_1(argp, clnt) - __db_h_ffactor_msg *argp; - CLIENT *clnt; -{ - static __db_h_ffactor_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_h_ffactor, - (xdrproc_t) xdr___db_h_ffactor_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_h_ffactor_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_h_nelem_reply * -__db_db_h_nelem_1(argp, clnt) - __db_h_nelem_msg *argp; - CLIENT *clnt; -{ - static __db_h_nelem_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_h_nelem, - (xdrproc_t) xdr___db_h_nelem_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_h_nelem_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_key_range_reply * -__db_db_key_range_1(argp, clnt) - __db_key_range_msg *argp; - CLIENT *clnt; -{ - static __db_key_range_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_key_range, - (xdrproc_t) xdr___db_key_range_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_key_range_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_lorder_reply * -__db_db_lorder_1(argp, clnt) - __db_lorder_msg *argp; - CLIENT *clnt; -{ - static __db_lorder_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_lorder, - (xdrproc_t) xdr___db_lorder_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_lorder_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_open_reply * -__db_db_open_1(argp, clnt) - __db_open_msg *argp; - CLIENT *clnt; -{ - static __db_open_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_open, - (xdrproc_t) xdr___db_open_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_open_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_pagesize_reply * -__db_db_pagesize_1(argp, clnt) - __db_pagesize_msg *argp; - CLIENT *clnt; -{ - static __db_pagesize_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_pagesize, - (xdrproc_t) xdr___db_pagesize_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_pagesize_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_put_reply * -__db_db_put_1(argp, clnt) - __db_put_msg *argp; - CLIENT *clnt; -{ - static __db_put_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_put, - (xdrproc_t) xdr___db_put_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_put_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_re_delim_reply * -__db_db_re_delim_1(argp, clnt) - __db_re_delim_msg *argp; - CLIENT *clnt; -{ - static __db_re_delim_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_re_delim, - (xdrproc_t) xdr___db_re_delim_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_re_delim_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_re_len_reply * -__db_db_re_len_1(argp, clnt) - __db_re_len_msg *argp; - CLIENT *clnt; -{ - static __db_re_len_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_re_len, - (xdrproc_t) xdr___db_re_len_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_re_len_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_re_pad_reply * -__db_db_re_pad_1(argp, clnt) - __db_re_pad_msg *argp; - CLIENT *clnt; -{ - static __db_re_pad_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_re_pad, - (xdrproc_t) xdr___db_re_pad_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_re_pad_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_remove_reply * -__db_db_remove_1(argp, clnt) - __db_remove_msg *argp; - CLIENT *clnt; -{ - static __db_remove_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_remove, - (xdrproc_t) xdr___db_remove_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_remove_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_rename_reply * -__db_db_rename_1(argp, clnt) - __db_rename_msg *argp; - CLIENT *clnt; -{ - static __db_rename_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_rename, - (xdrproc_t) xdr___db_rename_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_rename_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_stat_reply * -__db_db_stat_1(argp, clnt) - __db_stat_msg *argp; - CLIENT *clnt; -{ - static __db_stat_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_stat, - (xdrproc_t) xdr___db_stat_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_stat_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_swapped_reply * -__db_db_swapped_1(argp, clnt) - __db_swapped_msg *argp; - CLIENT *clnt; -{ - static __db_swapped_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_swapped, - (xdrproc_t) xdr___db_swapped_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_swapped_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_sync_reply * -__db_db_sync_1(argp, clnt) - __db_sync_msg *argp; - CLIENT *clnt; -{ - static __db_sync_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_sync, - (xdrproc_t) xdr___db_sync_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_sync_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_cursor_reply * -__db_db_cursor_1(argp, clnt) - __db_cursor_msg *argp; - CLIENT *clnt; -{ - static __db_cursor_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_cursor, - (xdrproc_t) xdr___db_cursor_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_cursor_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__db_join_reply * -__db_db_join_1(argp, clnt) - __db_join_msg *argp; - CLIENT *clnt; -{ - static __db_join_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_db_join, - (xdrproc_t) xdr___db_join_msg, (caddr_t) argp, - (xdrproc_t) xdr___db_join_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__dbc_close_reply * -__db_dbc_close_1(argp, clnt) - __dbc_close_msg *argp; - CLIENT *clnt; -{ - static __dbc_close_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_dbc_close, - (xdrproc_t) xdr___dbc_close_msg, (caddr_t) argp, - (xdrproc_t) xdr___dbc_close_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__dbc_count_reply * -__db_dbc_count_1(argp, clnt) - __dbc_count_msg *argp; - CLIENT *clnt; -{ - static __dbc_count_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_dbc_count, - (xdrproc_t) xdr___dbc_count_msg, (caddr_t) argp, - (xdrproc_t) xdr___dbc_count_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__dbc_del_reply * -__db_dbc_del_1(argp, clnt) - __dbc_del_msg *argp; - CLIENT *clnt; -{ - static __dbc_del_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_dbc_del, - (xdrproc_t) xdr___dbc_del_msg, (caddr_t) argp, - (xdrproc_t) xdr___dbc_del_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__dbc_dup_reply * -__db_dbc_dup_1(argp, clnt) - __dbc_dup_msg *argp; - CLIENT *clnt; -{ - static __dbc_dup_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_dbc_dup, - (xdrproc_t) xdr___dbc_dup_msg, (caddr_t) argp, - (xdrproc_t) xdr___dbc_dup_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__dbc_get_reply * -__db_dbc_get_1(argp, clnt) - __dbc_get_msg *argp; - CLIENT *clnt; -{ - static __dbc_get_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_dbc_get, - (xdrproc_t) xdr___dbc_get_msg, (caddr_t) argp, - (xdrproc_t) xdr___dbc_get_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -__dbc_put_reply * -__db_dbc_put_1(argp, clnt) - __dbc_put_msg *argp; - CLIENT *clnt; -{ - static __dbc_put_reply clnt_res; - - memset((char *)&clnt_res, 0, sizeof (clnt_res)); - if (clnt_call(clnt, __DB_dbc_put, - (xdrproc_t) xdr___dbc_put_msg, (caddr_t) argp, - (xdrproc_t) xdr___dbc_put_reply, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} -#endif /* HAVE_RPC */ diff --git a/bdb/rpc_client/gen_client.c b/bdb/rpc_client/gen_client.c deleted file mode 100644 index 7cc598e7dfa..00000000000 --- a/bdb/rpc_client/gen_client.c +++ /dev/null @@ -1,2494 +0,0 @@ -/* Do not edit: automatically built by gen_rpc.awk. */ -#include "db_config.h" - -#ifdef HAVE_RPC -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> -#include <rpc/rpc.h> -#include <rpc/xdr.h> - -#include <errno.h> -#include <string.h> -#endif -#include "db_server.h" - -#include "db_int.h" -#include "db_page.h" -#include "db_ext.h" -#include "mp.h" -#include "rpc_client_ext.h" -#include "txn.h" - -#include "gen_client_ext.h" - -int -__dbcl_env_cachesize(dbenv, gbytes, bytes, ncache) - DB_ENV * dbenv; - u_int32_t gbytes; - u_int32_t bytes; - int ncache; -{ - CLIENT *cl; - __env_cachesize_msg req; - static __env_cachesize_reply *replyp = NULL; - int ret; - - ret = 0; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___env_cachesize_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbenv == NULL) - req.dbenvcl_id = 0; - else - req.dbenvcl_id = dbenv->cl_id; - req.gbytes = gbytes; - req.bytes = bytes; - req.ncache = ncache; - - replyp = __db_env_cachesize_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_env_close(dbenv, flags) - DB_ENV * dbenv; - u_int32_t flags; -{ - CLIENT *cl; - __env_close_msg req; - static __env_close_reply *replyp = NULL; - int ret; - - ret = 0; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___env_close_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbenv == NULL) - req.dbenvcl_id = 0; - else - req.dbenvcl_id = dbenv->cl_id; - req.flags = flags; - - replyp = __db_env_close_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_env_close_ret(dbenv, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_rpc_illegal(dbenv, name) - DB_ENV *dbenv; - char *name; -{ - __db_err(dbenv, - "%s method meaningless in RPC environment", name); - return (__db_eopnotsup(dbenv)); -} - -int -__dbcl_set_data_dir(dbenv, dir) - DB_ENV * dbenv; - const char * dir; -{ - COMPQUIET(dir, NULL); - return (__dbcl_rpc_illegal(dbenv, "set_data_dir")); -} - -int -__dbcl_env_set_feedback(dbenv, func0) - DB_ENV * dbenv; - void (*func0) __P((DB_ENV *, int, int)); -{ - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "env_set_feedback")); -} - -int -__dbcl_env_flags(dbenv, flags, onoff) - DB_ENV * dbenv; - u_int32_t flags; - int onoff; -{ - CLIENT *cl; - __env_flags_msg req; - static __env_flags_reply *replyp = NULL; - int ret; - - ret = 0; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___env_flags_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbenv == NULL) - req.dbenvcl_id = 0; - else - req.dbenvcl_id = dbenv->cl_id; - req.flags = flags; - req.onoff = onoff; - - replyp = __db_env_flags_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_set_lg_bsize(dbenv, bsize) - DB_ENV * dbenv; - u_int32_t bsize; -{ - COMPQUIET(bsize, 0); - return (__dbcl_rpc_illegal(dbenv, "set_lg_bsize")); -} - -int -__dbcl_set_lg_dir(dbenv, dir) - DB_ENV * dbenv; - const char * dir; -{ - COMPQUIET(dir, NULL); - return (__dbcl_rpc_illegal(dbenv, "set_lg_dir")); -} - -int -__dbcl_set_lg_max(dbenv, max) - DB_ENV * dbenv; - u_int32_t max; -{ - COMPQUIET(max, 0); - return (__dbcl_rpc_illegal(dbenv, "set_lg_max")); -} - -int -__dbcl_set_lk_conflict(dbenv, conflicts, modes) - DB_ENV * dbenv; - u_int8_t * conflicts; - int modes; -{ - COMPQUIET(conflicts, 0); - COMPQUIET(modes, 0); - return (__dbcl_rpc_illegal(dbenv, "set_lk_conflict")); -} - -int -__dbcl_set_lk_detect(dbenv, detect) - DB_ENV * dbenv; - u_int32_t detect; -{ - COMPQUIET(detect, 0); - return (__dbcl_rpc_illegal(dbenv, "set_lk_detect")); -} - -int -__dbcl_set_lk_max(dbenv, max) - DB_ENV * dbenv; - u_int32_t max; -{ - COMPQUIET(max, 0); - return (__dbcl_rpc_illegal(dbenv, "set_lk_max")); -} - -int -__dbcl_set_lk_max_locks(dbenv, max) - DB_ENV * dbenv; - u_int32_t max; -{ - COMPQUIET(max, 0); - return (__dbcl_rpc_illegal(dbenv, "set_lk_max_locks")); -} - -int -__dbcl_set_lk_max_lockers(dbenv, max) - DB_ENV * dbenv; - u_int32_t max; -{ - COMPQUIET(max, 0); - return (__dbcl_rpc_illegal(dbenv, "set_lk_max_lockers")); -} - -int -__dbcl_set_lk_max_objects(dbenv, max) - DB_ENV * dbenv; - u_int32_t max; -{ - COMPQUIET(max, 0); - return (__dbcl_rpc_illegal(dbenv, "set_lk_max_objects")); -} - -int -__dbcl_set_mp_mmapsize(dbenv, mmapsize) - DB_ENV * dbenv; - size_t mmapsize; -{ - COMPQUIET(mmapsize, 0); - return (__dbcl_rpc_illegal(dbenv, "set_mp_mmapsize")); -} - -int -__dbcl_set_mutex_locks(dbenv, do_lock) - DB_ENV * dbenv; - int do_lock; -{ - COMPQUIET(do_lock, 0); - return (__dbcl_rpc_illegal(dbenv, "set_mutex_locks")); -} - -int -__dbcl_env_open(dbenv, home, flags, mode) - DB_ENV * dbenv; - const char * home; - u_int32_t flags; - int mode; -{ - CLIENT *cl; - __env_open_msg req; - static __env_open_reply *replyp = NULL; - int ret; - - ret = 0; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___env_open_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbenv == NULL) - req.dbenvcl_id = 0; - else - req.dbenvcl_id = dbenv->cl_id; - if (home == NULL) - req.home = ""; - else - req.home = (char *)home; - req.flags = flags; - req.mode = mode; - - replyp = __db_env_open_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_env_open_ret(dbenv, home, flags, mode, replyp)); -out: - return (ret); -} - -int -__dbcl_env_paniccall(dbenv, func0) - DB_ENV * dbenv; - void (*func0) __P((DB_ENV *, int)); -{ - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "env_paniccall")); -} - -int -__dbcl_set_recovery_init(dbenv, func0) - DB_ENV * dbenv; - int (*func0) __P((DB_ENV *)); -{ - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "set_recovery_init")); -} - -int -__dbcl_env_remove(dbenv, home, flags) - DB_ENV * dbenv; - const char * home; - u_int32_t flags; -{ - CLIENT *cl; - __env_remove_msg req; - static __env_remove_reply *replyp = NULL; - int ret; - - ret = 0; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___env_remove_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbenv == NULL) - req.dbenvcl_id = 0; - else - req.dbenvcl_id = dbenv->cl_id; - if (home == NULL) - req.home = ""; - else - req.home = (char *)home; - req.flags = flags; - - replyp = __db_env_remove_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_env_remove_ret(dbenv, home, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_set_shm_key(dbenv, shm_key) - DB_ENV * dbenv; - long shm_key; -{ - COMPQUIET(shm_key, 0); - return (__dbcl_rpc_illegal(dbenv, "set_shm_key")); -} - -int -__dbcl_set_tmp_dir(dbenv, dir) - DB_ENV * dbenv; - const char * dir; -{ - COMPQUIET(dir, NULL); - return (__dbcl_rpc_illegal(dbenv, "set_tmp_dir")); -} - -int -__dbcl_set_tx_recover(dbenv, func0) - DB_ENV * dbenv; - int (*func0) __P((DB_ENV *, DBT *, DB_LSN *, db_recops)); -{ - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "set_tx_recover")); -} - -int -__dbcl_set_tx_max(dbenv, max) - DB_ENV * dbenv; - u_int32_t max; -{ - COMPQUIET(max, 0); - return (__dbcl_rpc_illegal(dbenv, "set_tx_max")); -} - -int -__dbcl_set_tx_timestamp(dbenv, max) - DB_ENV * dbenv; - time_t * max; -{ - COMPQUIET(max, 0); - return (__dbcl_rpc_illegal(dbenv, "set_tx_timestamp")); -} - -int -__dbcl_set_verbose(dbenv, which, onoff) - DB_ENV * dbenv; - u_int32_t which; - int onoff; -{ - COMPQUIET(which, 0); - COMPQUIET(onoff, 0); - return (__dbcl_rpc_illegal(dbenv, "set_verbose")); -} - -int -__dbcl_txn_abort(txnp) - DB_TXN * txnp; -{ - CLIENT *cl; - __txn_abort_msg req; - static __txn_abort_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = txnp->mgrp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___txn_abort_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (txnp == NULL) - req.txnpcl_id = 0; - else - req.txnpcl_id = txnp->txnid; - - replyp = __db_txn_abort_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_txn_abort_ret(txnp, replyp)); -out: - return (ret); -} - -int -__dbcl_txn_begin(envp, parent, txnpp, flags) - DB_ENV * envp; - DB_TXN * parent; - DB_TXN ** txnpp; - u_int32_t flags; -{ - CLIENT *cl; - __txn_begin_msg req; - static __txn_begin_reply *replyp = NULL; - int ret; - - ret = 0; - if (envp == NULL || envp->cl_handle == NULL) { - __db_err(envp, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___txn_begin_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)envp->cl_handle; - - if (envp == NULL) - req.envpcl_id = 0; - else - req.envpcl_id = envp->cl_id; - if (parent == NULL) - req.parentcl_id = 0; - else - req.parentcl_id = parent->txnid; - req.flags = flags; - - replyp = __db_txn_begin_1(&req, cl); - if (replyp == NULL) { - __db_err(envp, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_txn_begin_ret(envp, parent, txnpp, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_txn_checkpoint(dbenv, kbyte, min) - DB_ENV * dbenv; - u_int32_t kbyte; - u_int32_t min; -{ - COMPQUIET(kbyte, 0); - COMPQUIET(min, 0); - return (__dbcl_rpc_illegal(dbenv, "txn_checkpoint")); -} - -int -__dbcl_txn_commit(txnp, flags) - DB_TXN * txnp; - u_int32_t flags; -{ - CLIENT *cl; - __txn_commit_msg req; - static __txn_commit_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = txnp->mgrp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___txn_commit_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (txnp == NULL) - req.txnpcl_id = 0; - else - req.txnpcl_id = txnp->txnid; - req.flags = flags; - - replyp = __db_txn_commit_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_txn_commit_ret(txnp, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_txn_prepare(txnp) - DB_TXN * txnp; -{ - DB_ENV *dbenv; - - dbenv = txnp->mgrp->dbenv; - return (__dbcl_rpc_illegal(dbenv, "txn_prepare")); -} - -int -__dbcl_txn_stat(dbenv, statp, func0) - DB_ENV * dbenv; - DB_TXN_STAT ** statp; - void *(*func0) __P((size_t)); -{ - COMPQUIET(statp, 0); - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "txn_stat")); -} - -int -__dbcl_db_bt_compare(dbp, func0) - DB * dbp; - int (*func0) __P((DB *, const DBT *, const DBT *)); -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "db_bt_compare")); -} - -int -__dbcl_db_bt_maxkey(dbp, maxkey) - DB * dbp; - u_int32_t maxkey; -{ - CLIENT *cl; - __db_bt_maxkey_msg req; - static __db_bt_maxkey_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_bt_maxkey_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.maxkey = maxkey; - - replyp = __db_db_bt_maxkey_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_bt_minkey(dbp, minkey) - DB * dbp; - u_int32_t minkey; -{ - CLIENT *cl; - __db_bt_minkey_msg req; - static __db_bt_minkey_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_bt_minkey_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.minkey = minkey; - - replyp = __db_db_bt_minkey_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_bt_prefix(dbp, func0) - DB * dbp; - size_t (*func0) __P((DB *, const DBT *, const DBT *)); -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "db_bt_prefix")); -} - -int -__dbcl_db_set_append_recno(dbp, func0) - DB * dbp; - int (*func0) __P((DB *, DBT *, db_recno_t)); -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "db_set_append_recno")); -} - -int -__dbcl_db_cachesize(dbp, gbytes, bytes, ncache) - DB * dbp; - u_int32_t gbytes; - u_int32_t bytes; - int ncache; -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(gbytes, 0); - COMPQUIET(bytes, 0); - COMPQUIET(ncache, 0); - return (__dbcl_rpc_illegal(dbenv, "db_cachesize")); -} - -int -__dbcl_db_close(dbp, flags) - DB * dbp; - u_int32_t flags; -{ - CLIENT *cl; - __db_close_msg req; - static __db_close_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_close_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.flags = flags; - - replyp = __db_db_close_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_db_close_ret(dbp, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_db_del(dbp, txnp, key, flags) - DB * dbp; - DB_TXN * txnp; - DBT * key; - u_int32_t flags; -{ - CLIENT *cl; - __db_del_msg req; - static __db_del_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_del_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - if (txnp == NULL) - req.txnpcl_id = 0; - else - req.txnpcl_id = txnp->txnid; - req.keydlen = key->dlen; - req.keydoff = key->doff; - req.keyflags = key->flags; - req.keydata.keydata_val = key->data; - req.keydata.keydata_len = key->size; - req.flags = flags; - - replyp = __db_db_del_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_extentsize(dbp, extentsize) - DB * dbp; - u_int32_t extentsize; -{ - CLIENT *cl; - __db_extentsize_msg req; - static __db_extentsize_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_extentsize_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.extentsize = extentsize; - - replyp = __db_db_extentsize_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_fd(dbp, fdp) - DB * dbp; - int * fdp; -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(fdp, 0); - return (__dbcl_rpc_illegal(dbenv, "db_fd")); -} - -int -__dbcl_db_feedback(dbp, func0) - DB * dbp; - void (*func0) __P((DB *, int, int)); -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "db_feedback")); -} - -int -__dbcl_db_flags(dbp, flags) - DB * dbp; - u_int32_t flags; -{ - CLIENT *cl; - __db_flags_msg req; - static __db_flags_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_flags_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.flags = flags; - - replyp = __db_db_flags_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_get(dbp, txnp, key, data, flags) - DB * dbp; - DB_TXN * txnp; - DBT * key; - DBT * data; - u_int32_t flags; -{ - CLIENT *cl; - __db_get_msg req; - static __db_get_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_get_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - if (txnp == NULL) - req.txnpcl_id = 0; - else - req.txnpcl_id = txnp->txnid; - req.keydlen = key->dlen; - req.keydoff = key->doff; - req.keyflags = key->flags; - req.keydata.keydata_val = key->data; - req.keydata.keydata_len = key->size; - req.datadlen = data->dlen; - req.datadoff = data->doff; - req.dataflags = data->flags; - req.datadata.datadata_val = data->data; - req.datadata.datadata_len = data->size; - req.flags = flags; - - replyp = __db_db_get_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_db_get_ret(dbp, txnp, key, data, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_db_h_ffactor(dbp, ffactor) - DB * dbp; - u_int32_t ffactor; -{ - CLIENT *cl; - __db_h_ffactor_msg req; - static __db_h_ffactor_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_h_ffactor_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.ffactor = ffactor; - - replyp = __db_db_h_ffactor_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_h_hash(dbp, func0) - DB * dbp; - u_int32_t (*func0) __P((DB *, const void *, u_int32_t)); -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "db_h_hash")); -} - -int -__dbcl_db_h_nelem(dbp, nelem) - DB * dbp; - u_int32_t nelem; -{ - CLIENT *cl; - __db_h_nelem_msg req; - static __db_h_nelem_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_h_nelem_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.nelem = nelem; - - replyp = __db_db_h_nelem_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_key_range(dbp, txnp, key, range, flags) - DB * dbp; - DB_TXN * txnp; - DBT * key; - DB_KEY_RANGE * range; - u_int32_t flags; -{ - CLIENT *cl; - __db_key_range_msg req; - static __db_key_range_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_key_range_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - if (txnp == NULL) - req.txnpcl_id = 0; - else - req.txnpcl_id = txnp->txnid; - req.keydlen = key->dlen; - req.keydoff = key->doff; - req.keyflags = key->flags; - req.keydata.keydata_val = key->data; - req.keydata.keydata_len = key->size; - req.flags = flags; - - replyp = __db_db_key_range_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_db_key_range_ret(dbp, txnp, key, range, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_db_lorder(dbp, lorder) - DB * dbp; - int lorder; -{ - CLIENT *cl; - __db_lorder_msg req; - static __db_lorder_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_lorder_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.lorder = lorder; - - replyp = __db_db_lorder_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_malloc(dbp, func0) - DB * dbp; - void *(*func0) __P((size_t)); -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "db_malloc")); -} - -int -__dbcl_db_open(dbp, name, subdb, type, flags, mode) - DB * dbp; - const char * name; - const char * subdb; - DBTYPE type; - u_int32_t flags; - int mode; -{ - CLIENT *cl; - __db_open_msg req; - static __db_open_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_open_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - if (name == NULL) - req.name = ""; - else - req.name = (char *)name; - if (subdb == NULL) - req.subdb = ""; - else - req.subdb = (char *)subdb; - req.type = type; - req.flags = flags; - req.mode = mode; - - replyp = __db_db_open_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_db_open_ret(dbp, name, subdb, type, flags, mode, replyp)); -out: - return (ret); -} - -int -__dbcl_db_pagesize(dbp, pagesize) - DB * dbp; - u_int32_t pagesize; -{ - CLIENT *cl; - __db_pagesize_msg req; - static __db_pagesize_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_pagesize_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.pagesize = pagesize; - - replyp = __db_db_pagesize_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_panic(dbp, func0) - DB * dbp; - void (*func0) __P((DB_ENV *, int)); -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "db_panic")); -} - -int -__dbcl_db_put(dbp, txnp, key, data, flags) - DB * dbp; - DB_TXN * txnp; - DBT * key; - DBT * data; - u_int32_t flags; -{ - CLIENT *cl; - __db_put_msg req; - static __db_put_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_put_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - if (txnp == NULL) - req.txnpcl_id = 0; - else - req.txnpcl_id = txnp->txnid; - req.keydlen = key->dlen; - req.keydoff = key->doff; - req.keyflags = key->flags; - req.keydata.keydata_val = key->data; - req.keydata.keydata_len = key->size; - req.datadlen = data->dlen; - req.datadoff = data->doff; - req.dataflags = data->flags; - req.datadata.datadata_val = data->data; - req.datadata.datadata_len = data->size; - req.flags = flags; - - replyp = __db_db_put_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_db_put_ret(dbp, txnp, key, data, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_db_realloc(dbp, func0) - DB * dbp; - void *(*func0) __P((void *, size_t)); -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "db_realloc")); -} - -int -__dbcl_db_re_delim(dbp, delim) - DB * dbp; - int delim; -{ - CLIENT *cl; - __db_re_delim_msg req; - static __db_re_delim_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_re_delim_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.delim = delim; - - replyp = __db_db_re_delim_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_re_len(dbp, len) - DB * dbp; - u_int32_t len; -{ - CLIENT *cl; - __db_re_len_msg req; - static __db_re_len_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_re_len_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.len = len; - - replyp = __db_db_re_len_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_re_pad(dbp, pad) - DB * dbp; - int pad; -{ - CLIENT *cl; - __db_re_pad_msg req; - static __db_re_pad_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_re_pad_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.pad = pad; - - replyp = __db_db_re_pad_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_re_source(dbp, re_source) - DB * dbp; - const char * re_source; -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(re_source, NULL); - return (__dbcl_rpc_illegal(dbenv, "db_re_source")); -} - -int -__dbcl_db_remove(dbp, name, subdb, flags) - DB * dbp; - const char * name; - const char * subdb; - u_int32_t flags; -{ - CLIENT *cl; - __db_remove_msg req; - static __db_remove_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_remove_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - if (name == NULL) - req.name = ""; - else - req.name = (char *)name; - if (subdb == NULL) - req.subdb = ""; - else - req.subdb = (char *)subdb; - req.flags = flags; - - replyp = __db_db_remove_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_db_remove_ret(dbp, name, subdb, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_db_rename(dbp, name, subdb, newname, flags) - DB * dbp; - const char * name; - const char * subdb; - const char * newname; - u_int32_t flags; -{ - CLIENT *cl; - __db_rename_msg req; - static __db_rename_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_rename_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - if (name == NULL) - req.name = ""; - else - req.name = (char *)name; - if (subdb == NULL) - req.subdb = ""; - else - req.subdb = (char *)subdb; - if (newname == NULL) - req.newname = ""; - else - req.newname = (char *)newname; - req.flags = flags; - - replyp = __db_db_rename_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_db_rename_ret(dbp, name, subdb, newname, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_db_stat(dbp, sp, func0, flags) - DB * dbp; - void * sp; - void *(*func0) __P((size_t)); - u_int32_t flags; -{ - CLIENT *cl; - __db_stat_msg req; - static __db_stat_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_stat_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (func0 != NULL) { - __db_err(sp, "User functions not supported in RPC."); - return (EINVAL); - } - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.flags = flags; - - replyp = __db_db_stat_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_db_stat_ret(dbp, sp, func0, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_db_swapped(dbp) - DB * dbp; -{ - CLIENT *cl; - __db_swapped_msg req; - static __db_swapped_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_swapped_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - - replyp = __db_db_swapped_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_sync(dbp, flags) - DB * dbp; - u_int32_t flags; -{ - CLIENT *cl; - __db_sync_msg req; - static __db_sync_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_sync_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - req.flags = flags; - - replyp = __db_db_sync_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_db_upgrade(dbp, fname, flags) - DB * dbp; - const char * fname; - u_int32_t flags; -{ - DB_ENV *dbenv; - - dbenv = dbp->dbenv; - COMPQUIET(fname, NULL); - COMPQUIET(flags, 0); - return (__dbcl_rpc_illegal(dbenv, "db_upgrade")); -} - -int -__dbcl_db_cursor(dbp, txnp, dbcpp, flags) - DB * dbp; - DB_TXN * txnp; - DBC ** dbcpp; - u_int32_t flags; -{ - CLIENT *cl; - __db_cursor_msg req; - static __db_cursor_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_cursor_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - if (txnp == NULL) - req.txnpcl_id = 0; - else - req.txnpcl_id = txnp->txnid; - req.flags = flags; - - replyp = __db_db_cursor_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_db_cursor_ret(dbp, txnp, dbcpp, flags, replyp)); -out: - return (ret); -} - -static int __dbcl_db_join_curslist __P((__db_join_curslist **, DBC **)); -static void __dbcl_db_join_cursfree __P((__db_join_curslist **)); -int -__dbcl_db_join(dbp, curs, dbcp, flags) - DB * dbp; - DBC ** curs; - DBC ** dbcp; - u_int32_t flags; -{ - CLIENT *cl; - __db_join_msg req; - static __db_join_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___db_join_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbp == NULL) - req.dbpcl_id = 0; - else - req.dbpcl_id = dbp->cl_id; - if ((ret = __dbcl_db_join_curslist(&req.curslist, curs)) != 0) - goto out; - req.flags = flags; - - replyp = __db_db_join_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - __dbcl_db_join_cursfree(&req.curslist); - return (__dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp)); -out: - __dbcl_db_join_cursfree(&req.curslist); - return (ret); -} - -int -__dbcl_db_join_curslist(locp, pp) - __db_join_curslist **locp; - DBC ** pp; -{ - DBC ** p; - u_int32_t *q; - int ret; - __db_join_curslist *nl, **nlp; - - *locp = NULL; - if (pp == NULL) - return (0); - nlp = locp; - for (p = pp; *p != 0; p++) { - if ((ret = __os_malloc(NULL, sizeof(*nl), NULL, nlp)) != 0) - goto out; - nl = *nlp; - nl->next = NULL; - nl->ent.ent_val = NULL; - nl->ent.ent_len = 0; - if ((ret = __os_malloc(NULL, sizeof(u_int32_t), NULL, &nl->ent.ent_val)) != 0) - goto out; - q = (u_int32_t *)nl->ent.ent_val; - *q = (*p)->cl_id; - nl->ent.ent_len = sizeof(u_int32_t); - nlp = &nl->next; - } - return (0); -out: - __dbcl_db_join_cursfree(locp); - return (ret); -} - -void -__dbcl_db_join_cursfree(locp) - __db_join_curslist **locp; -{ - __db_join_curslist *nl, *nl1; - - if (locp == NULL) - return; - for (nl = *locp; nl != NULL; nl = nl1) { - nl1 = nl->next; - if (nl->ent.ent_val) - __os_free(nl->ent.ent_val, nl->ent.ent_len); - __os_free(nl, sizeof(*nl)); - } -} - -int -__dbcl_dbc_close(dbc) - DBC * dbc; -{ - CLIENT *cl; - __dbc_close_msg req; - static __dbc_close_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbc->dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___dbc_close_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbc == NULL) - req.dbccl_id = 0; - else - req.dbccl_id = dbc->cl_id; - - replyp = __db_dbc_close_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_dbc_close_ret(dbc, replyp)); -out: - return (ret); -} - -int -__dbcl_dbc_count(dbc, countp, flags) - DBC * dbc; - db_recno_t * countp; - u_int32_t flags; -{ - CLIENT *cl; - __dbc_count_msg req; - static __dbc_count_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbc->dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___dbc_count_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbc == NULL) - req.dbccl_id = 0; - else - req.dbccl_id = dbc->cl_id; - req.flags = flags; - - replyp = __db_dbc_count_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_dbc_count_ret(dbc, countp, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_dbc_del(dbc, flags) - DBC * dbc; - u_int32_t flags; -{ - CLIENT *cl; - __dbc_del_msg req; - static __dbc_del_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbc->dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___dbc_del_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbc == NULL) - req.dbccl_id = 0; - else - req.dbccl_id = dbc->cl_id; - req.flags = flags; - - replyp = __db_dbc_del_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - ret = replyp->status; -out: - return (ret); -} - -int -__dbcl_dbc_dup(dbc, dbcp, flags) - DBC * dbc; - DBC ** dbcp; - u_int32_t flags; -{ - CLIENT *cl; - __dbc_dup_msg req; - static __dbc_dup_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbc->dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___dbc_dup_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbc == NULL) - req.dbccl_id = 0; - else - req.dbccl_id = dbc->cl_id; - req.flags = flags; - - replyp = __db_dbc_dup_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_dbc_get(dbc, key, data, flags) - DBC * dbc; - DBT * key; - DBT * data; - u_int32_t flags; -{ - CLIENT *cl; - __dbc_get_msg req; - static __dbc_get_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbc->dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___dbc_get_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbc == NULL) - req.dbccl_id = 0; - else - req.dbccl_id = dbc->cl_id; - req.keydlen = key->dlen; - req.keydoff = key->doff; - req.keyflags = key->flags; - req.keydata.keydata_val = key->data; - req.keydata.keydata_len = key->size; - req.datadlen = data->dlen; - req.datadoff = data->doff; - req.dataflags = data->flags; - req.datadata.datadata_val = data->data; - req.datadata.datadata_len = data->size; - req.flags = flags; - - replyp = __db_dbc_get_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_dbc_get_ret(dbc, key, data, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_dbc_put(dbc, key, data, flags) - DBC * dbc; - DBT * key; - DBT * data; - u_int32_t flags; -{ - CLIENT *cl; - __dbc_put_msg req; - static __dbc_put_reply *replyp = NULL; - int ret; - DB_ENV *dbenv; - - ret = 0; - dbenv = NULL; - dbenv = dbc->dbp->dbenv; - if (dbenv == NULL || dbenv->cl_handle == NULL) { - __db_err(dbenv, "No server environment."); - return (DB_NOSERVER); - } - - if (replyp != NULL) { - xdr_free((xdrproc_t)xdr___dbc_put_reply, (void *)replyp); - replyp = NULL; - } - cl = (CLIENT *)dbenv->cl_handle; - - if (dbc == NULL) - req.dbccl_id = 0; - else - req.dbccl_id = dbc->cl_id; - req.keydlen = key->dlen; - req.keydoff = key->doff; - req.keyflags = key->flags; - req.keydata.keydata_val = key->data; - req.keydata.keydata_len = key->size; - req.datadlen = data->dlen; - req.datadoff = data->doff; - req.dataflags = data->flags; - req.datadata.datadata_val = data->data; - req.datadata.datadata_len = data->size; - req.flags = flags; - - replyp = __db_dbc_put_1(&req, cl); - if (replyp == NULL) { - __db_err(dbenv, clnt_sperror(cl, "Berkeley DB")); - ret = DB_NOSERVER; - goto out; - } - return (__dbcl_dbc_put_ret(dbc, key, data, flags, replyp)); -out: - return (ret); -} - -int -__dbcl_lock_detect(dbenv, flags, atype, aborted) - DB_ENV * dbenv; - u_int32_t flags; - u_int32_t atype; - int * aborted; -{ - COMPQUIET(flags, 0); - COMPQUIET(atype, 0); - COMPQUIET(aborted, 0); - return (__dbcl_rpc_illegal(dbenv, "lock_detect")); -} - -int -__dbcl_lock_get(dbenv, locker, flags, obj, mode, lock) - DB_ENV * dbenv; - u_int32_t locker; - u_int32_t flags; - const DBT * obj; - db_lockmode_t mode; - DB_LOCK * lock; -{ - COMPQUIET(locker, 0); - COMPQUIET(flags, 0); - COMPQUIET(obj, NULL); - COMPQUIET(mode, 0); - COMPQUIET(lock, 0); - return (__dbcl_rpc_illegal(dbenv, "lock_get")); -} - -int -__dbcl_lock_id(dbenv, idp) - DB_ENV * dbenv; - u_int32_t * idp; -{ - COMPQUIET(idp, 0); - return (__dbcl_rpc_illegal(dbenv, "lock_id")); -} - -int -__dbcl_lock_put(dbenv, lock) - DB_ENV * dbenv; - DB_LOCK * lock; -{ - COMPQUIET(lock, 0); - return (__dbcl_rpc_illegal(dbenv, "lock_put")); -} - -int -__dbcl_lock_stat(dbenv, statp, func0) - DB_ENV * dbenv; - DB_LOCK_STAT ** statp; - void *(*func0) __P((size_t)); -{ - COMPQUIET(statp, 0); - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "lock_stat")); -} - -int -__dbcl_lock_vec(dbenv, locker, flags, list, nlist, elistp) - DB_ENV * dbenv; - u_int32_t locker; - u_int32_t flags; - DB_LOCKREQ * list; - int nlist; - DB_LOCKREQ ** elistp; -{ - COMPQUIET(locker, 0); - COMPQUIET(flags, 0); - COMPQUIET(list, 0); - COMPQUIET(nlist, 0); - COMPQUIET(elistp, 0); - return (__dbcl_rpc_illegal(dbenv, "lock_vec")); -} - -int -__dbcl_log_archive(dbenv, listp, flags, func0) - DB_ENV * dbenv; - char *** listp; - u_int32_t flags; - void *(*func0) __P((size_t)); -{ - COMPQUIET(listp, 0); - COMPQUIET(flags, 0); - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "log_archive")); -} - -int -__dbcl_log_file(dbenv, lsn, namep, len) - DB_ENV * dbenv; - const DB_LSN * lsn; - char * namep; - size_t len; -{ - COMPQUIET(lsn, NULL); - COMPQUIET(namep, NULL); - COMPQUIET(len, 0); - return (__dbcl_rpc_illegal(dbenv, "log_file")); -} - -int -__dbcl_log_flush(dbenv, lsn) - DB_ENV * dbenv; - const DB_LSN * lsn; -{ - COMPQUIET(lsn, NULL); - return (__dbcl_rpc_illegal(dbenv, "log_flush")); -} - -int -__dbcl_log_get(dbenv, lsn, data, flags) - DB_ENV * dbenv; - DB_LSN * lsn; - DBT * data; - u_int32_t flags; -{ - COMPQUIET(lsn, 0); - COMPQUIET(data, NULL); - COMPQUIET(flags, 0); - return (__dbcl_rpc_illegal(dbenv, "log_get")); -} - -int -__dbcl_log_put(dbenv, lsn, data, flags) - DB_ENV * dbenv; - DB_LSN * lsn; - const DBT * data; - u_int32_t flags; -{ - COMPQUIET(lsn, 0); - COMPQUIET(data, NULL); - COMPQUIET(flags, 0); - return (__dbcl_rpc_illegal(dbenv, "log_put")); -} - -int -__dbcl_log_register(dbenv, dbp, namep) - DB_ENV * dbenv; - DB * dbp; - const char * namep; -{ - COMPQUIET(dbp, 0); - COMPQUIET(namep, NULL); - return (__dbcl_rpc_illegal(dbenv, "log_register")); -} - -int -__dbcl_log_stat(dbenv, statp, func0) - DB_ENV * dbenv; - DB_LOG_STAT ** statp; - void *(*func0) __P((size_t)); -{ - COMPQUIET(statp, 0); - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "log_stat")); -} - -int -__dbcl_log_unregister(dbenv, dbp) - DB_ENV * dbenv; - DB * dbp; -{ - COMPQUIET(dbp, 0); - return (__dbcl_rpc_illegal(dbenv, "log_unregister")); -} - -int -__dbcl_memp_fclose(mpf) - DB_MPOOLFILE * mpf; -{ - DB_ENV *dbenv; - - dbenv = mpf->dbmp->dbenv; - return (__dbcl_rpc_illegal(dbenv, "memp_fclose")); -} - -int -__dbcl_memp_fget(mpf, pgno, flags, pagep) - DB_MPOOLFILE * mpf; - db_pgno_t * pgno; - u_int32_t flags; - void ** pagep; -{ - DB_ENV *dbenv; - - dbenv = mpf->dbmp->dbenv; - COMPQUIET(pgno, 0); - COMPQUIET(flags, 0); - COMPQUIET(pagep, 0); - return (__dbcl_rpc_illegal(dbenv, "memp_fget")); -} - -int -__dbcl_memp_fopen(dbenv, file, flags, mode, pagesize, finfop, mpf) - DB_ENV * dbenv; - const char * file; - u_int32_t flags; - int mode; - size_t pagesize; - DB_MPOOL_FINFO * finfop; - DB_MPOOLFILE ** mpf; -{ - COMPQUIET(file, NULL); - COMPQUIET(flags, 0); - COMPQUIET(mode, 0); - COMPQUIET(pagesize, 0); - COMPQUIET(finfop, 0); - COMPQUIET(mpf, 0); - return (__dbcl_rpc_illegal(dbenv, "memp_fopen")); -} - -int -__dbcl_memp_fput(mpf, pgaddr, flags) - DB_MPOOLFILE * mpf; - void * pgaddr; - u_int32_t flags; -{ - DB_ENV *dbenv; - - dbenv = mpf->dbmp->dbenv; - COMPQUIET(pgaddr, 0); - COMPQUIET(flags, 0); - return (__dbcl_rpc_illegal(dbenv, "memp_fput")); -} - -int -__dbcl_memp_fset(mpf, pgaddr, flags) - DB_MPOOLFILE * mpf; - void * pgaddr; - u_int32_t flags; -{ - DB_ENV *dbenv; - - dbenv = mpf->dbmp->dbenv; - COMPQUIET(pgaddr, 0); - COMPQUIET(flags, 0); - return (__dbcl_rpc_illegal(dbenv, "memp_fset")); -} - -int -__dbcl_memp_fsync(mpf) - DB_MPOOLFILE * mpf; -{ - DB_ENV *dbenv; - - dbenv = mpf->dbmp->dbenv; - return (__dbcl_rpc_illegal(dbenv, "memp_fsync")); -} - -int -__dbcl_memp_register(dbenv, ftype, func0, func1) - DB_ENV * dbenv; - int ftype; - int (*func0) __P((DB_ENV *, db_pgno_t, void *, DBT *)); - int (*func1) __P((DB_ENV *, db_pgno_t, void *, DBT *)); -{ - COMPQUIET(ftype, 0); - COMPQUIET(func0, 0); - COMPQUIET(func1, 0); - return (__dbcl_rpc_illegal(dbenv, "memp_register")); -} - -int -__dbcl_memp_stat(dbenv, gstatp, fstatp, func0) - DB_ENV * dbenv; - DB_MPOOL_STAT ** gstatp; - DB_MPOOL_FSTAT *** fstatp; - void *(*func0) __P((size_t)); -{ - COMPQUIET(gstatp, 0); - COMPQUIET(fstatp, 0); - COMPQUIET(func0, 0); - return (__dbcl_rpc_illegal(dbenv, "memp_stat")); -} - -int -__dbcl_memp_sync(dbenv, lsn) - DB_ENV * dbenv; - DB_LSN * lsn; -{ - COMPQUIET(lsn, 0); - return (__dbcl_rpc_illegal(dbenv, "memp_sync")); -} - -int -__dbcl_memp_trickle(dbenv, pct, nwrotep) - DB_ENV * dbenv; - int pct; - int * nwrotep; -{ - COMPQUIET(pct, 0); - COMPQUIET(nwrotep, 0); - return (__dbcl_rpc_illegal(dbenv, "memp_trickle")); -} - -#endif /* HAVE_RPC */ diff --git a/bdb/rpc_server/db_server_svc.c b/bdb/rpc_server/db_server_svc.c deleted file mode 100644 index 96d8a4a5dd9..00000000000 --- a/bdb/rpc_server/db_server_svc.c +++ /dev/null @@ -1,359 +0,0 @@ -#include "db_config.h" -#ifdef HAVE_RPC -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "db_server.h" -#include <stdio.h> -#include <stdlib.h> /* getenv, exit */ -#include <memory.h> -#include <sys/socket.h> -#include <netinet/in.h> -extern void __dbsrv_timeout(); - -#ifdef DEBUG -#define RPC_SVC_FG -#endif - -static void -db_serverprog_1(rqstp, transp) - struct svc_req *rqstp; - register SVCXPRT *transp; -{ - union { - __env_cachesize_msg __db_env_cachesize_1_arg; - __env_close_msg __db_env_close_1_arg; - __env_create_msg __db_env_create_1_arg; - __env_flags_msg __db_env_flags_1_arg; - __env_open_msg __db_env_open_1_arg; - __env_remove_msg __db_env_remove_1_arg; - __txn_abort_msg __db_txn_abort_1_arg; - __txn_begin_msg __db_txn_begin_1_arg; - __txn_commit_msg __db_txn_commit_1_arg; - __db_bt_maxkey_msg __db_db_bt_maxkey_1_arg; - __db_bt_minkey_msg __db_db_bt_minkey_1_arg; - __db_close_msg __db_db_close_1_arg; - __db_create_msg __db_db_create_1_arg; - __db_del_msg __db_db_del_1_arg; - __db_extentsize_msg __db_db_extentsize_1_arg; - __db_flags_msg __db_db_flags_1_arg; - __db_get_msg __db_db_get_1_arg; - __db_h_ffactor_msg __db_db_h_ffactor_1_arg; - __db_h_nelem_msg __db_db_h_nelem_1_arg; - __db_key_range_msg __db_db_key_range_1_arg; - __db_lorder_msg __db_db_lorder_1_arg; - __db_open_msg __db_db_open_1_arg; - __db_pagesize_msg __db_db_pagesize_1_arg; - __db_put_msg __db_db_put_1_arg; - __db_re_delim_msg __db_db_re_delim_1_arg; - __db_re_len_msg __db_db_re_len_1_arg; - __db_re_pad_msg __db_db_re_pad_1_arg; - __db_remove_msg __db_db_remove_1_arg; - __db_rename_msg __db_db_rename_1_arg; - __db_stat_msg __db_db_stat_1_arg; - __db_swapped_msg __db_db_swapped_1_arg; - __db_sync_msg __db_db_sync_1_arg; - __db_cursor_msg __db_db_cursor_1_arg; - __db_join_msg __db_db_join_1_arg; - __dbc_close_msg __db_dbc_close_1_arg; - __dbc_count_msg __db_dbc_count_1_arg; - __dbc_del_msg __db_dbc_del_1_arg; - __dbc_dup_msg __db_dbc_dup_1_arg; - __dbc_get_msg __db_dbc_get_1_arg; - __dbc_put_msg __db_dbc_put_1_arg; - } argument; - char *result; - bool_t (*xdr_argument)(), (*xdr_result)(); - char *(*local)(); - - switch (rqstp->rq_proc) { - case NULLPROC: - (void) svc_sendreply(transp, xdr_void, - (char *)NULL); - return; - - case __DB_env_cachesize: - xdr_argument = xdr___env_cachesize_msg; - xdr_result = xdr___env_cachesize_reply; - local = (char *(*)()) __db_env_cachesize_1; - break; - - case __DB_env_close: - xdr_argument = xdr___env_close_msg; - xdr_result = xdr___env_close_reply; - local = (char *(*)()) __db_env_close_1; - break; - - case __DB_env_create: - xdr_argument = xdr___env_create_msg; - xdr_result = xdr___env_create_reply; - local = (char *(*)()) __db_env_create_1; - break; - - case __DB_env_flags: - xdr_argument = xdr___env_flags_msg; - xdr_result = xdr___env_flags_reply; - local = (char *(*)()) __db_env_flags_1; - break; - - case __DB_env_open: - xdr_argument = xdr___env_open_msg; - xdr_result = xdr___env_open_reply; - local = (char *(*)()) __db_env_open_1; - break; - - case __DB_env_remove: - xdr_argument = xdr___env_remove_msg; - xdr_result = xdr___env_remove_reply; - local = (char *(*)()) __db_env_remove_1; - break; - - case __DB_txn_abort: - xdr_argument = xdr___txn_abort_msg; - xdr_result = xdr___txn_abort_reply; - local = (char *(*)()) __db_txn_abort_1; - break; - - case __DB_txn_begin: - xdr_argument = xdr___txn_begin_msg; - xdr_result = xdr___txn_begin_reply; - local = (char *(*)()) __db_txn_begin_1; - break; - - case __DB_txn_commit: - xdr_argument = xdr___txn_commit_msg; - xdr_result = xdr___txn_commit_reply; - local = (char *(*)()) __db_txn_commit_1; - break; - - case __DB_db_bt_maxkey: - xdr_argument = xdr___db_bt_maxkey_msg; - xdr_result = xdr___db_bt_maxkey_reply; - local = (char *(*)()) __db_db_bt_maxkey_1; - break; - - case __DB_db_bt_minkey: - xdr_argument = xdr___db_bt_minkey_msg; - xdr_result = xdr___db_bt_minkey_reply; - local = (char *(*)()) __db_db_bt_minkey_1; - break; - - case __DB_db_close: - xdr_argument = xdr___db_close_msg; - xdr_result = xdr___db_close_reply; - local = (char *(*)()) __db_db_close_1; - break; - - case __DB_db_create: - xdr_argument = xdr___db_create_msg; - xdr_result = xdr___db_create_reply; - local = (char *(*)()) __db_db_create_1; - break; - - case __DB_db_del: - xdr_argument = xdr___db_del_msg; - xdr_result = xdr___db_del_reply; - local = (char *(*)()) __db_db_del_1; - break; - - case __DB_db_extentsize: - xdr_argument = xdr___db_extentsize_msg; - xdr_result = xdr___db_extentsize_reply; - local = (char *(*)()) __db_db_extentsize_1; - break; - - case __DB_db_flags: - xdr_argument = xdr___db_flags_msg; - xdr_result = xdr___db_flags_reply; - local = (char *(*)()) __db_db_flags_1; - break; - - case __DB_db_get: - xdr_argument = xdr___db_get_msg; - xdr_result = xdr___db_get_reply; - local = (char *(*)()) __db_db_get_1; - break; - - case __DB_db_h_ffactor: - xdr_argument = xdr___db_h_ffactor_msg; - xdr_result = xdr___db_h_ffactor_reply; - local = (char *(*)()) __db_db_h_ffactor_1; - break; - - case __DB_db_h_nelem: - xdr_argument = xdr___db_h_nelem_msg; - xdr_result = xdr___db_h_nelem_reply; - local = (char *(*)()) __db_db_h_nelem_1; - break; - - case __DB_db_key_range: - xdr_argument = xdr___db_key_range_msg; - xdr_result = xdr___db_key_range_reply; - local = (char *(*)()) __db_db_key_range_1; - break; - - case __DB_db_lorder: - xdr_argument = xdr___db_lorder_msg; - xdr_result = xdr___db_lorder_reply; - local = (char *(*)()) __db_db_lorder_1; - break; - - case __DB_db_open: - xdr_argument = xdr___db_open_msg; - xdr_result = xdr___db_open_reply; - local = (char *(*)()) __db_db_open_1; - break; - - case __DB_db_pagesize: - xdr_argument = xdr___db_pagesize_msg; - xdr_result = xdr___db_pagesize_reply; - local = (char *(*)()) __db_db_pagesize_1; - break; - - case __DB_db_put: - xdr_argument = xdr___db_put_msg; - xdr_result = xdr___db_put_reply; - local = (char *(*)()) __db_db_put_1; - break; - - case __DB_db_re_delim: - xdr_argument = xdr___db_re_delim_msg; - xdr_result = xdr___db_re_delim_reply; - local = (char *(*)()) __db_db_re_delim_1; - break; - - case __DB_db_re_len: - xdr_argument = xdr___db_re_len_msg; - xdr_result = xdr___db_re_len_reply; - local = (char *(*)()) __db_db_re_len_1; - break; - - case __DB_db_re_pad: - xdr_argument = xdr___db_re_pad_msg; - xdr_result = xdr___db_re_pad_reply; - local = (char *(*)()) __db_db_re_pad_1; - break; - - case __DB_db_remove: - xdr_argument = xdr___db_remove_msg; - xdr_result = xdr___db_remove_reply; - local = (char *(*)()) __db_db_remove_1; - break; - - case __DB_db_rename: - xdr_argument = xdr___db_rename_msg; - xdr_result = xdr___db_rename_reply; - local = (char *(*)()) __db_db_rename_1; - break; - - case __DB_db_stat: - xdr_argument = xdr___db_stat_msg; - xdr_result = xdr___db_stat_reply; - local = (char *(*)()) __db_db_stat_1; - break; - - case __DB_db_swapped: - xdr_argument = xdr___db_swapped_msg; - xdr_result = xdr___db_swapped_reply; - local = (char *(*)()) __db_db_swapped_1; - break; - - case __DB_db_sync: - xdr_argument = xdr___db_sync_msg; - xdr_result = xdr___db_sync_reply; - local = (char *(*)()) __db_db_sync_1; - break; - - case __DB_db_cursor: - xdr_argument = xdr___db_cursor_msg; - xdr_result = xdr___db_cursor_reply; - local = (char *(*)()) __db_db_cursor_1; - break; - - case __DB_db_join: - xdr_argument = xdr___db_join_msg; - xdr_result = xdr___db_join_reply; - local = (char *(*)()) __db_db_join_1; - break; - - case __DB_dbc_close: - xdr_argument = xdr___dbc_close_msg; - xdr_result = xdr___dbc_close_reply; - local = (char *(*)()) __db_dbc_close_1; - break; - - case __DB_dbc_count: - xdr_argument = xdr___dbc_count_msg; - xdr_result = xdr___dbc_count_reply; - local = (char *(*)()) __db_dbc_count_1; - break; - - case __DB_dbc_del: - xdr_argument = xdr___dbc_del_msg; - xdr_result = xdr___dbc_del_reply; - local = (char *(*)()) __db_dbc_del_1; - break; - - case __DB_dbc_dup: - xdr_argument = xdr___dbc_dup_msg; - xdr_result = xdr___dbc_dup_reply; - local = (char *(*)()) __db_dbc_dup_1; - break; - - case __DB_dbc_get: - xdr_argument = xdr___dbc_get_msg; - xdr_result = xdr___dbc_get_reply; - local = (char *(*)()) __db_dbc_get_1; - break; - - case __DB_dbc_put: - xdr_argument = xdr___dbc_put_msg; - xdr_result = xdr___dbc_put_reply; - local = (char *(*)()) __db_dbc_put_1; - break; - - default: - svcerr_noproc(transp); - return; - } - (void) memset((char *)&argument, 0, sizeof (argument)); - if (!svc_getargs(transp, xdr_argument, &argument)) { - svcerr_decode(transp); - return; - } - result = (*local)(&argument, rqstp); - if (result != NULL && !svc_sendreply(transp, xdr_result, result)) { - svcerr_systemerr(transp); - } - if (!svc_freeargs(transp, xdr_argument, &argument)) { - fprintf(stderr, "unable to free arguments"); - exit(1); - } - __dbsrv_timeout(0); - return; -} - -void __dbsrv_main() -{ - register SVCXPRT *transp; - - (void) pmap_unset(DB_SERVERPROG, DB_SERVERVERS); - - transp = svctcp_create(RPC_ANYSOCK, 0, 0); - if (transp == NULL) { - fprintf(stderr, "cannot create tcp service."); - exit(1); - } - if (!svc_register(transp, DB_SERVERPROG, DB_SERVERVERS, db_serverprog_1, IPPROTO_TCP)) { - fprintf(stderr, "unable to register (DB_SERVERPROG, DB_SERVERVERS, tcp)."); - exit(1); - } - - svc_run(); - fprintf(stderr, "svc_run returned"); - exit(1); - /* NOTREACHED */ -} -#endif /* HAVE_RPC */ diff --git a/bdb/rpc_server/db_server_xdr.c b/bdb/rpc_server/db_server_xdr.c deleted file mode 100644 index f403f862e5d..00000000000 --- a/bdb/rpc_server/db_server_xdr.c +++ /dev/null @@ -1,1149 +0,0 @@ -#include "db_config.h" -#ifdef HAVE_RPC -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "db_server.h" - -bool_t -xdr___env_cachesize_msg(xdrs, objp) - register XDR *xdrs; - __env_cachesize_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbenvcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->gbytes)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->bytes)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->ncache)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_cachesize_reply(xdrs, objp) - register XDR *xdrs; - __env_cachesize_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_close_msg(xdrs, objp) - register XDR *xdrs; - __env_close_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbenvcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_close_reply(xdrs, objp) - register XDR *xdrs; - __env_close_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_create_msg(xdrs, objp) - register XDR *xdrs; - __env_create_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->timeout)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_create_reply(xdrs, objp) - register XDR *xdrs; - __env_create_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->envcl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_flags_msg(xdrs, objp) - register XDR *xdrs; - __env_flags_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbenvcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->onoff)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_flags_reply(xdrs, objp) - register XDR *xdrs; - __env_flags_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_open_msg(xdrs, objp) - register XDR *xdrs; - __env_open_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbenvcl_id)) - return (FALSE); - if (!xdr_string(xdrs, &objp->home, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->mode)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_open_reply(xdrs, objp) - register XDR *xdrs; - __env_open_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_remove_msg(xdrs, objp) - register XDR *xdrs; - __env_remove_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbenvcl_id)) - return (FALSE); - if (!xdr_string(xdrs, &objp->home, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___env_remove_reply(xdrs, objp) - register XDR *xdrs; - __env_remove_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___txn_abort_msg(xdrs, objp) - register XDR *xdrs; - __txn_abort_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->txnpcl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___txn_abort_reply(xdrs, objp) - register XDR *xdrs; - __txn_abort_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___txn_begin_msg(xdrs, objp) - register XDR *xdrs; - __txn_begin_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->envpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->parentcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___txn_begin_reply(xdrs, objp) - register XDR *xdrs; - __txn_begin_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->txnidcl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___txn_commit_msg(xdrs, objp) - register XDR *xdrs; - __txn_commit_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->txnpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___txn_commit_reply(xdrs, objp) - register XDR *xdrs; - __txn_commit_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_bt_maxkey_msg(xdrs, objp) - register XDR *xdrs; - __db_bt_maxkey_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->maxkey)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_bt_maxkey_reply(xdrs, objp) - register XDR *xdrs; - __db_bt_maxkey_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_bt_minkey_msg(xdrs, objp) - register XDR *xdrs; - __db_bt_minkey_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->minkey)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_bt_minkey_reply(xdrs, objp) - register XDR *xdrs; - __db_bt_minkey_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_close_msg(xdrs, objp) - register XDR *xdrs; - __db_close_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_close_reply(xdrs, objp) - register XDR *xdrs; - __db_close_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_create_msg(xdrs, objp) - register XDR *xdrs; - __db_create_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->envpcl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_create_reply(xdrs, objp) - register XDR *xdrs; - __db_create_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_del_msg(xdrs, objp) - register XDR *xdrs; - __db_del_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->txnpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keyflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_del_reply(xdrs, objp) - register XDR *xdrs; - __db_del_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_extentsize_msg(xdrs, objp) - register XDR *xdrs; - __db_extentsize_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->extentsize)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_extentsize_reply(xdrs, objp) - register XDR *xdrs; - __db_extentsize_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_flags_msg(xdrs, objp) - register XDR *xdrs; - __db_flags_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_flags_reply(xdrs, objp) - register XDR *xdrs; - __db_flags_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_get_msg(xdrs, objp) - register XDR *xdrs; - __db_get_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->txnpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keyflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->datadlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->datadoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dataflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_get_reply(xdrs, objp) - register XDR *xdrs; - __db_get_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_h_ffactor_msg(xdrs, objp) - register XDR *xdrs; - __db_h_ffactor_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->ffactor)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_h_ffactor_reply(xdrs, objp) - register XDR *xdrs; - __db_h_ffactor_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_h_nelem_msg(xdrs, objp) - register XDR *xdrs; - __db_h_nelem_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->nelem)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_h_nelem_reply(xdrs, objp) - register XDR *xdrs; - __db_h_nelem_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_key_range_msg(xdrs, objp) - register XDR *xdrs; - __db_key_range_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->txnpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keyflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_key_range_reply(xdrs, objp) - register XDR *xdrs; - __db_key_range_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_double(xdrs, &objp->less)) - return (FALSE); - if (!xdr_double(xdrs, &objp->equal)) - return (FALSE); - if (!xdr_double(xdrs, &objp->greater)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_lorder_msg(xdrs, objp) - register XDR *xdrs; - __db_lorder_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->lorder)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_lorder_reply(xdrs, objp) - register XDR *xdrs; - __db_lorder_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_open_msg(xdrs, objp) - register XDR *xdrs; - __db_open_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_string(xdrs, &objp->name, ~0)) - return (FALSE); - if (!xdr_string(xdrs, &objp->subdb, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->type)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->mode)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_open_reply(xdrs, objp) - register XDR *xdrs; - __db_open_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->type)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dbflags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_pagesize_msg(xdrs, objp) - register XDR *xdrs; - __db_pagesize_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->pagesize)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_pagesize_reply(xdrs, objp) - register XDR *xdrs; - __db_pagesize_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_put_msg(xdrs, objp) - register XDR *xdrs; - __db_put_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->txnpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keyflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->datadlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->datadoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dataflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_put_reply(xdrs, objp) - register XDR *xdrs; - __db_put_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_re_delim_msg(xdrs, objp) - register XDR *xdrs; - __db_re_delim_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->delim)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_re_delim_reply(xdrs, objp) - register XDR *xdrs; - __db_re_delim_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_re_len_msg(xdrs, objp) - register XDR *xdrs; - __db_re_len_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->len)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_re_len_reply(xdrs, objp) - register XDR *xdrs; - __db_re_len_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_re_pad_msg(xdrs, objp) - register XDR *xdrs; - __db_re_pad_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->pad)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_re_pad_reply(xdrs, objp) - register XDR *xdrs; - __db_re_pad_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_remove_msg(xdrs, objp) - register XDR *xdrs; - __db_remove_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_string(xdrs, &objp->name, ~0)) - return (FALSE); - if (!xdr_string(xdrs, &objp->subdb, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_remove_reply(xdrs, objp) - register XDR *xdrs; - __db_remove_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_rename_msg(xdrs, objp) - register XDR *xdrs; - __db_rename_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_string(xdrs, &objp->name, ~0)) - return (FALSE); - if (!xdr_string(xdrs, &objp->subdb, ~0)) - return (FALSE); - if (!xdr_string(xdrs, &objp->newname, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_rename_reply(xdrs, objp) - register XDR *xdrs; - __db_rename_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_stat_msg(xdrs, objp) - register XDR *xdrs; - __db_stat_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_stat_statsreplist(xdrs, objp) - register XDR *xdrs; - __db_stat_statsreplist *objp; -{ - - if (!xdr_bytes(xdrs, (char **)&objp->ent.ent_val, (u_int *) &objp->ent.ent_len, ~0)) - return (FALSE); - if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof (__db_stat_statsreplist), (xdrproc_t) xdr___db_stat_statsreplist)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_stat_reply(xdrs, objp) - register XDR *xdrs; - __db_stat_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_pointer(xdrs, (char **)&objp->statslist, sizeof (__db_stat_statsreplist), (xdrproc_t) xdr___db_stat_statsreplist)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_swapped_msg(xdrs, objp) - register XDR *xdrs; - __db_swapped_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_swapped_reply(xdrs, objp) - register XDR *xdrs; - __db_swapped_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_sync_msg(xdrs, objp) - register XDR *xdrs; - __db_sync_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_sync_reply(xdrs, objp) - register XDR *xdrs; - __db_sync_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_cursor_msg(xdrs, objp) - register XDR *xdrs; - __db_cursor_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->txnpcl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_cursor_reply(xdrs, objp) - register XDR *xdrs; - __db_cursor_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dbcidcl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_join_curslist(xdrs, objp) - register XDR *xdrs; - __db_join_curslist *objp; -{ - - if (!xdr_bytes(xdrs, (char **)&objp->ent.ent_val, (u_int *) &objp->ent.ent_len, ~0)) - return (FALSE); - if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof (__db_join_curslist), (xdrproc_t) xdr___db_join_curslist)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_join_msg(xdrs, objp) - register XDR *xdrs; - __db_join_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbpcl_id)) - return (FALSE); - if (!xdr_pointer(xdrs, (char **)&objp->curslist, sizeof (__db_join_curslist), (xdrproc_t) xdr___db_join_curslist)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___db_join_reply(xdrs, objp) - register XDR *xdrs; - __db_join_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dbcidcl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_close_msg(xdrs, objp) - register XDR *xdrs; - __dbc_close_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbccl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_close_reply(xdrs, objp) - register XDR *xdrs; - __dbc_close_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_count_msg(xdrs, objp) - register XDR *xdrs; - __dbc_count_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbccl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_count_reply(xdrs, objp) - register XDR *xdrs; - __dbc_count_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dupcount)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_del_msg(xdrs, objp) - register XDR *xdrs; - __dbc_del_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbccl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_del_reply(xdrs, objp) - register XDR *xdrs; - __dbc_del_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_dup_msg(xdrs, objp) - register XDR *xdrs; - __dbc_dup_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbccl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_dup_reply(xdrs, objp) - register XDR *xdrs; - __dbc_dup_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dbcidcl_id)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_get_msg(xdrs, objp) - register XDR *xdrs; - __dbc_get_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbccl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keyflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->datadlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->datadoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dataflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_get_reply(xdrs, objp) - register XDR *xdrs; - __dbc_get_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_put_msg(xdrs, objp) - register XDR *xdrs; - __dbc_put_msg *objp; -{ - - if (!xdr_u_int(xdrs, &objp->dbccl_id)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keydoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->keyflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->datadlen)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->datadoff)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->dataflags)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0)) - return (FALSE); - if (!xdr_u_int(xdrs, &objp->flags)) - return (FALSE); - return (TRUE); -} - -bool_t -xdr___dbc_put_reply(xdrs, objp) - register XDR *xdrs; - __dbc_put_reply *objp; -{ - - if (!xdr_u_int(xdrs, &objp->status)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0)) - return (FALSE); - return (TRUE); -} -#endif /* HAVE_RPC */ diff --git a/bdb/rpc_server/gen_db_server.c b/bdb/rpc_server/gen_db_server.c deleted file mode 100644 index 20da69c4b1b..00000000000 --- a/bdb/rpc_server/gen_db_server.c +++ /dev/null @@ -1,703 +0,0 @@ -/* Do not edit: automatically built by gen_rpc.awk. */ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <rpc/rpc.h> -#include <rpc/xdr.h> - -#include <errno.h> -#include <string.h> -#endif -#include "db_server.h" - -#include "db_int.h" -#include "db_server_int.h" -#include "rpc_server_ext.h" - -#include "gen_server_ext.h" - -__env_cachesize_reply * -__db_env_cachesize_1(req) - __env_cachesize_msg *req; -{ - static __env_cachesize_reply reply; /* must be static */ - - __env_cachesize_1_proc(req->dbenvcl_id, - req->gbytes, - req->bytes, - req->ncache, - &reply); - - return (&reply); -} - -__env_close_reply * -__db_env_close_1(req) - __env_close_msg *req; -{ - static __env_close_reply reply; /* must be static */ - - __env_close_1_proc(req->dbenvcl_id, - req->flags, - &reply); - - return (&reply); -} - -__env_create_reply * -__db_env_create_1(req) - __env_create_msg *req; -{ - static __env_create_reply reply; /* must be static */ - - __env_create_1_proc(req->timeout, - &reply); - - return (&reply); -} - -__env_flags_reply * -__db_env_flags_1(req) - __env_flags_msg *req; -{ - static __env_flags_reply reply; /* must be static */ - - __env_flags_1_proc(req->dbenvcl_id, - req->flags, - req->onoff, - &reply); - - return (&reply); -} - -__env_open_reply * -__db_env_open_1(req) - __env_open_msg *req; -{ - static __env_open_reply reply; /* must be static */ - - __env_open_1_proc(req->dbenvcl_id, - (*req->home == '\0') ? NULL : req->home, - req->flags, - req->mode, - &reply); - - return (&reply); -} - -__env_remove_reply * -__db_env_remove_1(req) - __env_remove_msg *req; -{ - static __env_remove_reply reply; /* must be static */ - - __env_remove_1_proc(req->dbenvcl_id, - (*req->home == '\0') ? NULL : req->home, - req->flags, - &reply); - - return (&reply); -} - -__txn_abort_reply * -__db_txn_abort_1(req) - __txn_abort_msg *req; -{ - static __txn_abort_reply reply; /* must be static */ - - __txn_abort_1_proc(req->txnpcl_id, - &reply); - - return (&reply); -} - -__txn_begin_reply * -__db_txn_begin_1(req) - __txn_begin_msg *req; -{ - static __txn_begin_reply reply; /* must be static */ - - __txn_begin_1_proc(req->envpcl_id, - req->parentcl_id, - req->flags, - &reply); - - return (&reply); -} - -__txn_commit_reply * -__db_txn_commit_1(req) - __txn_commit_msg *req; -{ - static __txn_commit_reply reply; /* must be static */ - - __txn_commit_1_proc(req->txnpcl_id, - req->flags, - &reply); - - return (&reply); -} - -__db_bt_maxkey_reply * -__db_db_bt_maxkey_1(req) - __db_bt_maxkey_msg *req; -{ - static __db_bt_maxkey_reply reply; /* must be static */ - - __db_bt_maxkey_1_proc(req->dbpcl_id, - req->maxkey, - &reply); - - return (&reply); -} - -__db_bt_minkey_reply * -__db_db_bt_minkey_1(req) - __db_bt_minkey_msg *req; -{ - static __db_bt_minkey_reply reply; /* must be static */ - - __db_bt_minkey_1_proc(req->dbpcl_id, - req->minkey, - &reply); - - return (&reply); -} - -__db_close_reply * -__db_db_close_1(req) - __db_close_msg *req; -{ - static __db_close_reply reply; /* must be static */ - - __db_close_1_proc(req->dbpcl_id, - req->flags, - &reply); - - return (&reply); -} - -__db_create_reply * -__db_db_create_1(req) - __db_create_msg *req; -{ - static __db_create_reply reply; /* must be static */ - - __db_create_1_proc(req->flags, - req->envpcl_id, - &reply); - - return (&reply); -} - -__db_del_reply * -__db_db_del_1(req) - __db_del_msg *req; -{ - static __db_del_reply reply; /* must be static */ - - __db_del_1_proc(req->dbpcl_id, - req->txnpcl_id, - req->keydlen, - req->keydoff, - req->keyflags, - req->keydata.keydata_val, - req->keydata.keydata_len, - req->flags, - &reply); - - return (&reply); -} - -__db_extentsize_reply * -__db_db_extentsize_1(req) - __db_extentsize_msg *req; -{ - static __db_extentsize_reply reply; /* must be static */ - - __db_extentsize_1_proc(req->dbpcl_id, - req->extentsize, - &reply); - - return (&reply); -} - -__db_flags_reply * -__db_db_flags_1(req) - __db_flags_msg *req; -{ - static __db_flags_reply reply; /* must be static */ - - __db_flags_1_proc(req->dbpcl_id, - req->flags, - &reply); - - return (&reply); -} - -__db_get_reply * -__db_db_get_1(req) - __db_get_msg *req; -{ - static __db_get_reply reply; /* must be static */ - static int __db_get_free = 0; /* must be static */ - - if (__db_get_free) - xdr_free((xdrproc_t)xdr___db_get_reply, (void *)&reply); - __db_get_free = 0; - - /* Reinitialize allocated fields */ - reply.keydata.keydata_val = NULL; - reply.datadata.datadata_val = NULL; - - __db_get_1_proc(req->dbpcl_id, - req->txnpcl_id, - req->keydlen, - req->keydoff, - req->keyflags, - req->keydata.keydata_val, - req->keydata.keydata_len, - req->datadlen, - req->datadoff, - req->dataflags, - req->datadata.datadata_val, - req->datadata.datadata_len, - req->flags, - &reply, - &__db_get_free); - return (&reply); -} - -__db_h_ffactor_reply * -__db_db_h_ffactor_1(req) - __db_h_ffactor_msg *req; -{ - static __db_h_ffactor_reply reply; /* must be static */ - - __db_h_ffactor_1_proc(req->dbpcl_id, - req->ffactor, - &reply); - - return (&reply); -} - -__db_h_nelem_reply * -__db_db_h_nelem_1(req) - __db_h_nelem_msg *req; -{ - static __db_h_nelem_reply reply; /* must be static */ - - __db_h_nelem_1_proc(req->dbpcl_id, - req->nelem, - &reply); - - return (&reply); -} - -__db_key_range_reply * -__db_db_key_range_1(req) - __db_key_range_msg *req; -{ - static __db_key_range_reply reply; /* must be static */ - - __db_key_range_1_proc(req->dbpcl_id, - req->txnpcl_id, - req->keydlen, - req->keydoff, - req->keyflags, - req->keydata.keydata_val, - req->keydata.keydata_len, - req->flags, - &reply); - - return (&reply); -} - -__db_lorder_reply * -__db_db_lorder_1(req) - __db_lorder_msg *req; -{ - static __db_lorder_reply reply; /* must be static */ - - __db_lorder_1_proc(req->dbpcl_id, - req->lorder, - &reply); - - return (&reply); -} - -__db_open_reply * -__db_db_open_1(req) - __db_open_msg *req; -{ - static __db_open_reply reply; /* must be static */ - - __db_open_1_proc(req->dbpcl_id, - (*req->name == '\0') ? NULL : req->name, - (*req->subdb == '\0') ? NULL : req->subdb, - req->type, - req->flags, - req->mode, - &reply); - - return (&reply); -} - -__db_pagesize_reply * -__db_db_pagesize_1(req) - __db_pagesize_msg *req; -{ - static __db_pagesize_reply reply; /* must be static */ - - __db_pagesize_1_proc(req->dbpcl_id, - req->pagesize, - &reply); - - return (&reply); -} - -__db_put_reply * -__db_db_put_1(req) - __db_put_msg *req; -{ - static __db_put_reply reply; /* must be static */ - static int __db_put_free = 0; /* must be static */ - - if (__db_put_free) - xdr_free((xdrproc_t)xdr___db_put_reply, (void *)&reply); - __db_put_free = 0; - - /* Reinitialize allocated fields */ - reply.keydata.keydata_val = NULL; - - __db_put_1_proc(req->dbpcl_id, - req->txnpcl_id, - req->keydlen, - req->keydoff, - req->keyflags, - req->keydata.keydata_val, - req->keydata.keydata_len, - req->datadlen, - req->datadoff, - req->dataflags, - req->datadata.datadata_val, - req->datadata.datadata_len, - req->flags, - &reply, - &__db_put_free); - return (&reply); -} - -__db_re_delim_reply * -__db_db_re_delim_1(req) - __db_re_delim_msg *req; -{ - static __db_re_delim_reply reply; /* must be static */ - - __db_re_delim_1_proc(req->dbpcl_id, - req->delim, - &reply); - - return (&reply); -} - -__db_re_len_reply * -__db_db_re_len_1(req) - __db_re_len_msg *req; -{ - static __db_re_len_reply reply; /* must be static */ - - __db_re_len_1_proc(req->dbpcl_id, - req->len, - &reply); - - return (&reply); -} - -__db_re_pad_reply * -__db_db_re_pad_1(req) - __db_re_pad_msg *req; -{ - static __db_re_pad_reply reply; /* must be static */ - - __db_re_pad_1_proc(req->dbpcl_id, - req->pad, - &reply); - - return (&reply); -} - -__db_remove_reply * -__db_db_remove_1(req) - __db_remove_msg *req; -{ - static __db_remove_reply reply; /* must be static */ - - __db_remove_1_proc(req->dbpcl_id, - (*req->name == '\0') ? NULL : req->name, - (*req->subdb == '\0') ? NULL : req->subdb, - req->flags, - &reply); - - return (&reply); -} - -__db_rename_reply * -__db_db_rename_1(req) - __db_rename_msg *req; -{ - static __db_rename_reply reply; /* must be static */ - - __db_rename_1_proc(req->dbpcl_id, - (*req->name == '\0') ? NULL : req->name, - (*req->subdb == '\0') ? NULL : req->subdb, - (*req->newname == '\0') ? NULL : req->newname, - req->flags, - &reply); - - return (&reply); -} - -__db_stat_reply * -__db_db_stat_1(req) - __db_stat_msg *req; -{ - static __db_stat_reply reply; /* must be static */ - static int __db_stat_free = 0; /* must be static */ - - if (__db_stat_free) - xdr_free((xdrproc_t)xdr___db_stat_reply, (void *)&reply); - __db_stat_free = 0; - - /* Reinitialize allocated fields */ - reply.statslist = NULL; - - __db_stat_1_proc(req->dbpcl_id, - req->flags, - &reply, - &__db_stat_free); - return (&reply); -} - -__db_swapped_reply * -__db_db_swapped_1(req) - __db_swapped_msg *req; -{ - static __db_swapped_reply reply; /* must be static */ - - __db_swapped_1_proc(req->dbpcl_id, - &reply); - - return (&reply); -} - -__db_sync_reply * -__db_db_sync_1(req) - __db_sync_msg *req; -{ - static __db_sync_reply reply; /* must be static */ - - __db_sync_1_proc(req->dbpcl_id, - req->flags, - &reply); - - return (&reply); -} - -__db_cursor_reply * -__db_db_cursor_1(req) - __db_cursor_msg *req; -{ - static __db_cursor_reply reply; /* must be static */ - - __db_cursor_1_proc(req->dbpcl_id, - req->txnpcl_id, - req->flags, - &reply); - - return (&reply); -} - -int __db_db_join_curslist __P((__db_join_curslist *, u_int32_t **)); -void __db_db_join_cursfree __P((u_int32_t *)); - -__db_join_reply * -__db_db_join_1(req) - __db_join_msg *req; -{ - u_int32_t *__db_curslist; - int ret; - static __db_join_reply reply; /* must be static */ - - if ((ret = __db_db_join_curslist(req->curslist, &__db_curslist)) != 0) - goto out; - - __db_join_1_proc(req->dbpcl_id, - __db_curslist, - req->flags, - &reply); - - __db_db_join_cursfree(__db_curslist); - -out: - return (&reply); -} - -int -__db_db_join_curslist(locp, ppp) - __db_join_curslist *locp; - u_int32_t **ppp; -{ - u_int32_t *pp; - int cnt, ret, size; - __db_join_curslist *nl; - - for (cnt = 0, nl = locp; nl != NULL; cnt++, nl = nl->next) - ; - - if (cnt == 0) { - *ppp = NULL; - return (0); - } - size = sizeof(*pp) * (cnt + 1); - if ((ret = __os_malloc(NULL, size, NULL, ppp)) != 0) - return (ret); - memset(*ppp, 0, size); - for (pp = *ppp, nl = locp; nl != NULL; nl = nl->next, pp++) { - *pp = *(u_int32_t *)nl->ent.ent_val; - } - return (0); -} - -void -__db_db_join_cursfree(pp) - u_int32_t *pp; -{ - size_t size; - u_int32_t *p; - - if (pp == NULL) - return; - size = sizeof(*p); - for (p = pp; *p != 0; p++) { - size += sizeof(*p); - } - __os_free(pp, size); -} - -__dbc_close_reply * -__db_dbc_close_1(req) - __dbc_close_msg *req; -{ - static __dbc_close_reply reply; /* must be static */ - - __dbc_close_1_proc(req->dbccl_id, - &reply); - - return (&reply); -} - -__dbc_count_reply * -__db_dbc_count_1(req) - __dbc_count_msg *req; -{ - static __dbc_count_reply reply; /* must be static */ - - __dbc_count_1_proc(req->dbccl_id, - req->flags, - &reply); - - return (&reply); -} - -__dbc_del_reply * -__db_dbc_del_1(req) - __dbc_del_msg *req; -{ - static __dbc_del_reply reply; /* must be static */ - - __dbc_del_1_proc(req->dbccl_id, - req->flags, - &reply); - - return (&reply); -} - -__dbc_dup_reply * -__db_dbc_dup_1(req) - __dbc_dup_msg *req; -{ - static __dbc_dup_reply reply; /* must be static */ - - __dbc_dup_1_proc(req->dbccl_id, - req->flags, - &reply); - - return (&reply); -} - -__dbc_get_reply * -__db_dbc_get_1(req) - __dbc_get_msg *req; -{ - static __dbc_get_reply reply; /* must be static */ - static int __dbc_get_free = 0; /* must be static */ - - if (__dbc_get_free) - xdr_free((xdrproc_t)xdr___dbc_get_reply, (void *)&reply); - __dbc_get_free = 0; - - /* Reinitialize allocated fields */ - reply.keydata.keydata_val = NULL; - reply.datadata.datadata_val = NULL; - - __dbc_get_1_proc(req->dbccl_id, - req->keydlen, - req->keydoff, - req->keyflags, - req->keydata.keydata_val, - req->keydata.keydata_len, - req->datadlen, - req->datadoff, - req->dataflags, - req->datadata.datadata_val, - req->datadata.datadata_len, - req->flags, - &reply, - &__dbc_get_free); - return (&reply); -} - -__dbc_put_reply * -__db_dbc_put_1(req) - __dbc_put_msg *req; -{ - static __dbc_put_reply reply; /* must be static */ - static int __dbc_put_free = 0; /* must be static */ - - if (__dbc_put_free) - xdr_free((xdrproc_t)xdr___dbc_put_reply, (void *)&reply); - __dbc_put_free = 0; - - /* Reinitialize allocated fields */ - reply.keydata.keydata_val = NULL; - - __dbc_put_1_proc(req->dbccl_id, - req->keydlen, - req->keydoff, - req->keyflags, - req->keydata.keydata_val, - req->keydata.keydata_len, - req->datadlen, - req->datadoff, - req->dataflags, - req->datadata.datadata_val, - req->datadata.datadata_len, - req->flags, - &reply, - &__dbc_put_free); - return (&reply); -} - diff --git a/bdb/test/include.tcl b/bdb/test/include.tcl deleted file mode 100644 index e5084d6507c..00000000000 --- a/bdb/test/include.tcl +++ /dev/null @@ -1,19 +0,0 @@ -set tclsh_path @TCL_TCLSH@ -set tcllib .libs/libdb_tcl-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@SOSUFFIX@ -set rpc_server localhost -set rpc_path . -set test_path @srcdir@/../test - -set KILL "@db_cv_path_kill@" - -# DO NOT EDIT BELOW THIS LINE: automatically built by dist/s_tcl. - -global dict -global testdir -global util_path -set testdir ./TESTDIR -set rpc_testdir $rpc_path/TESTDIR - -global is_hp_test -global is_qnx_test -global is_windows_test diff --git a/bdb/txn/txn_auto.c b/bdb/txn/txn_auto.c deleted file mode 100644 index cbfa536733e..00000000000 --- a/bdb/txn/txn_auto.c +++ /dev/null @@ -1,893 +0,0 @@ -/* Do not edit: automatically built by gen_rec.awk. */ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <ctype.h> -#include <errno.h> -#include <string.h> -#endif - -#include "db_int.h" -#include "db_page.h" -#include "db_dispatch.h" -#include "db_am.h" -#include "txn.h" - -int -__txn_old_regop_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __txn_old_regop_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __txn_old_regop_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]txn_old_regop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__txn_old_regop_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __txn_old_regop_args **argpp; -{ - __txn_old_regop_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__txn_old_regop_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - *argpp = argp; - return (0); -} - -int -__txn_regop_log(dbenv, txnid, ret_lsnp, flags, - opcode, timestamp) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t opcode; - int32_t timestamp; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_txn_regop; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(opcode) - + sizeof(timestamp); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - memcpy(bp, ×tamp, sizeof(timestamp)); - bp += sizeof(timestamp); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__txn_regop_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __txn_regop_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __txn_regop_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]txn_regop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\ttimestamp: %ld\n", (long)argp->timestamp); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__txn_regop_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __txn_regop_args **argpp; -{ - __txn_regop_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__txn_regop_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->timestamp, bp, sizeof(argp->timestamp)); - bp += sizeof(argp->timestamp); - *argpp = argp; - return (0); -} - -int -__txn_old_ckp_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __txn_old_ckp_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __txn_old_ckp_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]txn_old_ckp: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tckp_lsn: [%lu][%lu]\n", - (u_long)argp->ckp_lsn.file, (u_long)argp->ckp_lsn.offset); - printf("\tlast_ckp: [%lu][%lu]\n", - (u_long)argp->last_ckp.file, (u_long)argp->last_ckp.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__txn_old_ckp_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __txn_old_ckp_args **argpp; -{ - __txn_old_ckp_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__txn_old_ckp_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->ckp_lsn, bp, sizeof(argp->ckp_lsn)); - bp += sizeof(argp->ckp_lsn); - memcpy(&argp->last_ckp, bp, sizeof(argp->last_ckp)); - bp += sizeof(argp->last_ckp); - *argpp = argp; - return (0); -} - -int -__txn_ckp_log(dbenv, txnid, ret_lsnp, flags, - ckp_lsn, last_ckp, timestamp) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - DB_LSN * ckp_lsn; - DB_LSN * last_ckp; - int32_t timestamp; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_txn_ckp; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(*ckp_lsn) - + sizeof(*last_ckp) - + sizeof(timestamp); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - if (ckp_lsn != NULL) - memcpy(bp, ckp_lsn, sizeof(*ckp_lsn)); - else - memset(bp, 0, sizeof(*ckp_lsn)); - bp += sizeof(*ckp_lsn); - if (last_ckp != NULL) - memcpy(bp, last_ckp, sizeof(*last_ckp)); - else - memset(bp, 0, sizeof(*last_ckp)); - bp += sizeof(*last_ckp); - memcpy(bp, ×tamp, sizeof(timestamp)); - bp += sizeof(timestamp); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__txn_ckp_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __txn_ckp_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __txn_ckp_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]txn_ckp: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tckp_lsn: [%lu][%lu]\n", - (u_long)argp->ckp_lsn.file, (u_long)argp->ckp_lsn.offset); - printf("\tlast_ckp: [%lu][%lu]\n", - (u_long)argp->last_ckp.file, (u_long)argp->last_ckp.offset); - printf("\ttimestamp: %ld\n", (long)argp->timestamp); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__txn_ckp_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __txn_ckp_args **argpp; -{ - __txn_ckp_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__txn_ckp_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->ckp_lsn, bp, sizeof(argp->ckp_lsn)); - bp += sizeof(argp->ckp_lsn); - memcpy(&argp->last_ckp, bp, sizeof(argp->last_ckp)); - bp += sizeof(argp->last_ckp); - memcpy(&argp->timestamp, bp, sizeof(argp->timestamp)); - bp += sizeof(argp->timestamp); - *argpp = argp; - return (0); -} - -int -__txn_xa_regop_old_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __txn_xa_regop_old_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __txn_xa_regop_old_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]txn_xa_regop_old: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\txid: "); - for (i = 0; i < argp->xid.size; i++) { - ch = ((u_int8_t *)argp->xid.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tformatID: %ld\n", (long)argp->formatID); - printf("\tgtrid: %u\n", argp->gtrid); - printf("\tbqual: %u\n", argp->bqual); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__txn_xa_regop_old_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __txn_xa_regop_old_args **argpp; -{ - __txn_xa_regop_old_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__txn_xa_regop_old_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memset(&argp->xid, 0, sizeof(argp->xid)); - memcpy(&argp->xid.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->xid.data = bp; - bp += argp->xid.size; - memcpy(&argp->formatID, bp, sizeof(argp->formatID)); - bp += sizeof(argp->formatID); - memcpy(&argp->gtrid, bp, sizeof(argp->gtrid)); - bp += sizeof(argp->gtrid); - memcpy(&argp->bqual, bp, sizeof(argp->bqual)); - bp += sizeof(argp->bqual); - *argpp = argp; - return (0); -} - -int -__txn_xa_regop_log(dbenv, txnid, ret_lsnp, flags, - opcode, xid, formatID, gtrid, bqual, begin_lsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t opcode; - const DBT *xid; - int32_t formatID; - u_int32_t gtrid; - u_int32_t bqual; - DB_LSN * begin_lsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t zero; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_txn_xa_regop; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(opcode) - + sizeof(u_int32_t) + (xid == NULL ? 0 : xid->size) - + sizeof(formatID) - + sizeof(gtrid) - + sizeof(bqual) - + sizeof(*begin_lsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &opcode, sizeof(opcode)); - bp += sizeof(opcode); - if (xid == NULL) { - zero = 0; - memcpy(bp, &zero, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - } else { - memcpy(bp, &xid->size, sizeof(xid->size)); - bp += sizeof(xid->size); - memcpy(bp, xid->data, xid->size); - bp += xid->size; - } - memcpy(bp, &formatID, sizeof(formatID)); - bp += sizeof(formatID); - memcpy(bp, >rid, sizeof(gtrid)); - bp += sizeof(gtrid); - memcpy(bp, &bqual, sizeof(bqual)); - bp += sizeof(bqual); - if (begin_lsn != NULL) - memcpy(bp, begin_lsn, sizeof(*begin_lsn)); - else - memset(bp, 0, sizeof(*begin_lsn)); - bp += sizeof(*begin_lsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__txn_xa_regop_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __txn_xa_regop_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __txn_xa_regop_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]txn_xa_regop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\txid: "); - for (i = 0; i < argp->xid.size; i++) { - ch = ((u_int8_t *)argp->xid.data)[i]; - if (isprint(ch) || ch == 0xa) - putchar(ch); - else - printf("%#x ", ch); - } - printf("\n"); - printf("\tformatID: %ld\n", (long)argp->formatID); - printf("\tgtrid: %u\n", argp->gtrid); - printf("\tbqual: %u\n", argp->bqual); - printf("\tbegin_lsn: [%lu][%lu]\n", - (u_long)argp->begin_lsn.file, (u_long)argp->begin_lsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__txn_xa_regop_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __txn_xa_regop_args **argpp; -{ - __txn_xa_regop_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__txn_xa_regop_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memset(&argp->xid, 0, sizeof(argp->xid)); - memcpy(&argp->xid.size, bp, sizeof(u_int32_t)); - bp += sizeof(u_int32_t); - argp->xid.data = bp; - bp += argp->xid.size; - memcpy(&argp->formatID, bp, sizeof(argp->formatID)); - bp += sizeof(argp->formatID); - memcpy(&argp->gtrid, bp, sizeof(argp->gtrid)); - bp += sizeof(argp->gtrid); - memcpy(&argp->bqual, bp, sizeof(argp->bqual)); - bp += sizeof(argp->bqual); - memcpy(&argp->begin_lsn, bp, sizeof(argp->begin_lsn)); - bp += sizeof(argp->begin_lsn); - *argpp = argp; - return (0); -} - -int -__txn_child_old_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __txn_child_old_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __txn_child_old_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]txn_child_old: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\topcode: %lu\n", (u_long)argp->opcode); - printf("\tparent: 0x%lx\n", (u_long)argp->parent); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__txn_child_old_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __txn_child_old_args **argpp; -{ - __txn_child_old_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__txn_child_old_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->opcode, bp, sizeof(argp->opcode)); - bp += sizeof(argp->opcode); - memcpy(&argp->parent, bp, sizeof(argp->parent)); - bp += sizeof(argp->parent); - *argpp = argp; - return (0); -} - -int -__txn_child_log(dbenv, txnid, ret_lsnp, flags, - child, c_lsn) - DB_ENV *dbenv; - DB_TXN *txnid; - DB_LSN *ret_lsnp; - u_int32_t flags; - u_int32_t child; - DB_LSN * c_lsn; -{ - DBT logrec; - DB_LSN *lsnp, null_lsn; - u_int32_t rectype, txn_num; - int ret; - u_int8_t *bp; - - rectype = DB_txn_child; - if (txnid != NULL && - TAILQ_FIRST(&txnid->kids) != NULL && - (ret = __txn_activekids(dbenv, rectype, txnid)) != 0) - return (ret); - txn_num = txnid == NULL ? 0 : txnid->txnid; - if (txnid == NULL) { - ZERO_LSN(null_lsn); - lsnp = &null_lsn; - } else - lsnp = &txnid->last_lsn; - logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) - + sizeof(child) - + sizeof(*c_lsn); - if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0) - return (ret); - - bp = logrec.data; - memcpy(bp, &rectype, sizeof(rectype)); - bp += sizeof(rectype); - memcpy(bp, &txn_num, sizeof(txn_num)); - bp += sizeof(txn_num); - memcpy(bp, lsnp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(bp, &child, sizeof(child)); - bp += sizeof(child); - if (c_lsn != NULL) - memcpy(bp, c_lsn, sizeof(*c_lsn)); - else - memset(bp, 0, sizeof(*c_lsn)); - bp += sizeof(*c_lsn); - DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); - ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); - if (txnid != NULL) - txnid->last_lsn = *ret_lsnp; - __os_free(logrec.data, logrec.size); - return (ret); -} - -int -__txn_child_print(dbenv, dbtp, lsnp, notused2, notused3) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops notused2; - void *notused3; -{ - __txn_child_args *argp; - u_int32_t i; - u_int ch; - int ret; - - i = 0; - ch = 0; - notused2 = DB_TXN_ABORT; - notused3 = NULL; - - if ((ret = __txn_child_read(dbenv, dbtp->data, &argp)) != 0) - return (ret); - printf("[%lu][%lu]txn_child: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", - (u_long)lsnp->file, - (u_long)lsnp->offset, - (u_long)argp->type, - (u_long)argp->txnid->txnid, - (u_long)argp->prev_lsn.file, - (u_long)argp->prev_lsn.offset); - printf("\tchild: 0x%lx\n", (u_long)argp->child); - printf("\tc_lsn: [%lu][%lu]\n", - (u_long)argp->c_lsn.file, (u_long)argp->c_lsn.offset); - printf("\n"); - __os_free(argp, 0); - return (0); -} - -int -__txn_child_read(dbenv, recbuf, argpp) - DB_ENV *dbenv; - void *recbuf; - __txn_child_args **argpp; -{ - __txn_child_args *argp; - u_int8_t *bp; - int ret; - - ret = __os_malloc(dbenv, sizeof(__txn_child_args) + - sizeof(DB_TXN), NULL, &argp); - if (ret != 0) - return (ret); - argp->txnid = (DB_TXN *)&argp[1]; - bp = recbuf; - memcpy(&argp->type, bp, sizeof(argp->type)); - bp += sizeof(argp->type); - memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); - bp += sizeof(argp->txnid->txnid); - memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); - bp += sizeof(DB_LSN); - memcpy(&argp->child, bp, sizeof(argp->child)); - bp += sizeof(argp->child); - memcpy(&argp->c_lsn, bp, sizeof(argp->c_lsn)); - bp += sizeof(argp->c_lsn); - *argpp = argp; - return (0); -} - -int -__txn_init_print(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __txn_old_regop_print, DB_txn_old_regop)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_regop_print, DB_txn_regop)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_old_ckp_print, DB_txn_old_ckp)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_ckp_print, DB_txn_ckp)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_xa_regop_old_print, DB_txn_xa_regop_old)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_xa_regop_print, DB_txn_xa_regop)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_child_old_print, DB_txn_child_old)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_child_print, DB_txn_child)) != 0) - return (ret); - return (0); -} - -int -__txn_init_recover(dbenv) - DB_ENV *dbenv; -{ - int ret; - - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_txn_old_regop)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_regop_recover, DB_txn_regop)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_txn_old_ckp)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_ckp_recover, DB_txn_ckp)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_txn_xa_regop_old)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_xa_regop_recover, DB_txn_xa_regop)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __deprecated_recover, DB_txn_child_old)) != 0) - return (ret); - if ((ret = __db_add_recovery(dbenv, - __txn_child_recover, DB_txn_child)) != 0) - return (ret); - return (0); -} - |