1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1997, 1998, 1999, 2000
* Sleepycat Software. All rights reserved.
*/
#include "db_config.h"
#ifndef lint
static const char revid[] = "$Id: cxx_log.cpp,v 11.9 2000/09/21 15:05:45 dda Exp $";
#endif /* not lint */
#include <errno.h>
#include "db_cxx.h"
#include "cxx_int.h"
////////////////////////////////////////////////////////////////////////
// //
// DbLog //
// //
////////////////////////////////////////////////////////////////////////
int DbEnv::log_archive(char **list[], u_int32_t flags,
db_malloc_fcn_type db_malloc_fcn)
{
int err;
DB_ENV *env = unwrap(this);
if ((err = ::log_archive(env, list, flags, db_malloc_fcn)) != 0) {
DB_ERROR("DbEnv::log_archive", err, error_policy());
return (err);
}
return (0);
}
int DbEnv::log_compare(const DbLsn *lsn0, const DbLsn *lsn1)
{
return (::log_compare(lsn0, lsn1));
}
int DbEnv::log_file(DbLsn *lsn, char *namep, size_t len)
{
int err;
DB_ENV *env = unwrap(this);
if ((err = ::log_file(env, lsn, namep, len)) != 0) {
DB_ERROR("DbEnv::log_file", err, error_policy());
return (err);
}
return (0);
}
int DbEnv::log_flush(const DbLsn *lsn)
{
int err;
DB_ENV *env = unwrap(this);
if ((err = ::log_flush(env, lsn)) != 0) {
DB_ERROR("DbEnv::log_flush", err, error_policy());
return (err);
}
return (0);
}
int DbEnv::log_get(DbLsn *lsn, Dbt *data, u_int32_t flags)
{
int err;
DB_ENV *env = unwrap(this);
if ((err = ::log_get(env, lsn, data, flags)) != 0) {
DB_ERROR("DbEnv::log_get", err, error_policy());
return (err);
}
return (0);
}
int DbEnv::log_put(DbLsn *lsn, const Dbt *data, u_int32_t flags)
{
int err = 0;
DB_ENV *env = unwrap(this);
if ((err = ::log_put(env, lsn, data, flags)) != 0) {
DB_ERROR("DbEnv::log_put", err, error_policy());
return (err);
}
return (0);
}
int DbEnv::log_register(Db *dbp, const char *name)
{
int err = 0;
DB_ENV *env = unwrap(this);
if ((err = ::log_register(env, unwrap(dbp), name)) != 0) {
DB_ERROR("DbEnv::log_register", err, error_policy());
return (err);
}
return (0);
}
int DbEnv::log_stat(DB_LOG_STAT **spp, db_malloc_fcn_type db_malloc_fcn)
{
int err = 0;
DB_ENV *env = unwrap(this);
if ((err = ::log_stat(env, spp, db_malloc_fcn)) != 0) {
DB_ERROR("DbEnv::log_stat", err, error_policy());
return (err);
}
return (0);
}
int DbEnv::log_unregister(Db *dbp)
{
int err;
DB_ENV *env = unwrap(this);
if ((err = ::log_unregister(env, unwrap(dbp))) != 0) {
DB_ERROR("DbEnv::log_unregister", err, error_policy());
return (err);
}
return (0);
}
|