2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 1996, 1997, 1998
5 * Sleepycat Software. All rights reserved.
7 * @(#)db_am.h 10.9 (Sleepycat) 4/10/98
13 #define DB_ADD_DUP 0x10
14 #define DB_REM_DUP 0x20
15 #define DB_ADD_BIG 0x30
16 #define DB_REM_BIG 0x40
17 #define DB_SPLITOLD 0x50
18 #define DB_SPLITNEW 0x60
21 * Standard initialization and shutdown macros for all recovery functions.
23 * Requires the following local variables:
25 * DB *file_dbp, *mdbp;
29 #define REC_INTRO(func) { \
30 file_dbp = mdbp = NULL; \
31 if ((ret = func(dbtp->data, &argp)) != 0) \
33 if ((ret = __db_fileid_to_db(logp, &mdbp, argp->fileid)) != 0) {\
34 if (ret == DB_DELETED) \
40 if (F_ISSET(mdbp, DB_AM_THREAD)) { \
41 if ((ret = __db_gethandle(mdbp, \
42 mdbp->type == DB_HASH ? __ham_hdup : __bam_bdup, \
47 F_SET(file_dbp, DB_AM_RECOVER); \
48 mpf = file_dbp->mpf; \
53 if (file_dbp != NULL) { \
54 F_CLR(file_dbp, DB_AM_RECOVER); \
55 if (F_ISSET(file_dbp, DB_AM_THREAD)) \
56 __db_puthandle(file_dbp); \
62 * No-op versions of the same macros.
64 #define REC_NOOP_INTRO(func) { \
65 if ((ret = func(dbtp->data, &argp)) != 0) \
68 #define REC_NOOP_CLOSE { \
75 * Standard debugging macro for all recovery functions.
78 #define REC_PRINT(func) \
79 (void)func(logp, dbtp, lsnp, redo, info);
81 #define REC_PRINT(func) \
82 COMPQUIET(info, NULL);