1/*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 1997,2008 Oracle.  All rights reserved.
5 *
6 * $Id: cxx_logc.cpp,v 12.10 2008/01/08 20:58:09 bostic Exp $
7 */
8
9#include "db_config.h"
10
11#include "db_int.h"
12
13#include "db_cxx.h"
14#include "dbinc/cxx_int.h"
15
16#include "dbinc/db_page.h"
17#include "dbinc_auto/db_auto.h"
18#include "dbinc_auto/crdel_auto.h"
19#include "dbinc/db_dispatch.h"
20#include "dbinc_auto/db_ext.h"
21#include "dbinc_auto/common_ext.h"
22
23// It's private, and should never be called,
24// but some compilers need it resolved
25//
26DbLogc::~DbLogc()
27{
28}
29
30// The name _flags prevents a name clash with __db_log_cursor::flags
31int DbLogc::close(u_int32_t _flags)
32{
33	DB_LOGC *logc = this;
34	int ret;
35	DbEnv *dbenv2 = DbEnv::get_DbEnv(logc->env->dbenv);
36
37	ret = logc->close(logc, _flags);
38
39	if (!DB_RETOK_STD(ret))
40		DB_ERROR(dbenv2, "DbLogc::close", ret, ON_ERROR_UNKNOWN);
41
42	return (ret);
43}
44
45// The name _flags prevents a name clash with __db_log_cursor::flags
46int DbLogc::get(DbLsn *get_lsn, Dbt *data, u_int32_t _flags)
47{
48	DB_LOGC *logc = this;
49	int ret;
50
51	ret = logc->get(logc, get_lsn, data, _flags);
52
53	if (!DB_RETOK_LGGET(ret)) {
54		if (ret == DB_BUFFER_SMALL)
55			DB_ERROR_DBT(DbEnv::get_DbEnv(logc->env->dbenv),
56				"DbLogc::get", data, ON_ERROR_UNKNOWN);
57		else
58			DB_ERROR(DbEnv::get_DbEnv(logc->env->dbenv),
59				"DbLogc::get", ret, ON_ERROR_UNKNOWN);
60	}
61
62	return (ret);
63}
64
65// The name _flags prevents a name clash with __db_log_cursor::flags
66int DbLogc::version(u_int32_t *versionp, u_int32_t _flags)
67{
68	DB_LOGC *logc = this;
69	int ret;
70
71	ret = logc->version(logc, versionp, _flags);
72
73	if (!DB_RETOK_LGGET(ret))
74		DB_ERROR(DbEnv::get_DbEnv(logc->env->dbenv),
75			"DbLogc::version", ret, ON_ERROR_UNKNOWN);
76
77	return (ret);
78}
79