00001
00002
00003 #include "db_config.h"
00004
00005 #ifndef NO_SYSTEM_INCLUDES
00006 #include <sys/types.h>
00007
00008 #include <ctype.h>
00009 #include <string.h>
00010 #endif
00011
00012 #include "db_int.h"
00013 #include "dbinc/crypto.h"
00014 #include "dbinc/db_page.h"
00015 #include "dbinc/db_dispatch.h"
00016 #include "dbinc/db_am.h"
00017 #include "dbinc/log.h"
00018 #include "dbinc/txn.h"
00019
00020
00021
00022
00023
00024 int
00025 __dbreg_register_print(dbenv, dbtp, lsnp, notused2, notused3)
00026 DB_ENV *dbenv;
00027 DBT *dbtp;
00028 DB_LSN *lsnp;
00029 db_recops notused2;
00030 void *notused3;
00031 {
00032 __dbreg_register_args *argp;
00033 u_int32_t i;
00034 int ch;
00035 int ret;
00036
00037 notused2 = DB_TXN_PRINT;
00038 notused3 = NULL;
00039
00040 if ((ret = __dbreg_register_read(dbenv, dbtp->data, &argp)) != 0)
00041 return (ret);
00042 (void)printf(
00043 "[%lu][%lu]__dbreg_register%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
00044 (u_long)lsnp->file,
00045 (u_long)lsnp->offset,
00046 (argp->type & DB_debug_FLAG) ? "_debug" : "",
00047 (u_long)argp->type,
00048 (u_long)argp->txnid->txnid,
00049 (u_long)argp->prev_lsn.file,
00050 (u_long)argp->prev_lsn.offset);
00051 (void)printf("\topcode: %lu\n", (u_long)argp->opcode);
00052 (void)printf("\tname: ");
00053 for (i = 0; i < argp->name.size; i++) {
00054 ch = ((u_int8_t *)argp->name.data)[i];
00055 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00056 }
00057 (void)printf("\n");
00058 (void)printf("\tuid: ");
00059 for (i = 0; i < argp->uid.size; i++) {
00060 ch = ((u_int8_t *)argp->uid.data)[i];
00061 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00062 }
00063 (void)printf("\n");
00064 (void)printf("\tfileid: %ld\n", (long)argp->fileid);
00065 (void)printf("\tftype: 0x%lx\n", (u_long)argp->ftype);
00066 (void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
00067 (void)printf("\tid: 0x%lx\n", (u_long)argp->id);
00068 (void)printf("\n");
00069 __os_free(dbenv, argp);
00070 return (0);
00071 }
00072
00073
00074
00075
00076
00077 int
00078 __dbreg_init_print(dbenv, dtabp, dtabsizep)
00079 DB_ENV *dbenv;
00080 int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
00081 size_t *dtabsizep;
00082 {
00083 int ret;
00084
00085 if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
00086 __dbreg_register_print, DB___dbreg_register)) != 0)
00087 return (ret);
00088 return (0);
00089 }