cxx_logc.cpp 1.4 KB
Newer Older
unknown's avatar
unknown committed
1 2 3
/*-
 * See the file LICENSE for redistribution information.
 *
unknown's avatar
unknown committed
4
 * Copyright (c) 1997-2005
unknown's avatar
unknown committed
5
 *	Sleepycat Software.  All rights reserved.
unknown's avatar
unknown committed
6
 *
unknown's avatar
unknown committed
7
 * $Id: cxx_logc.cpp,v 12.1 2005/06/16 20:21:00 bostic Exp $
unknown's avatar
unknown committed
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
 */

#include "db_config.h"

#include <errno.h>
#include <string.h>

#include "db_cxx.h"
#include "dbinc/cxx_int.h"

#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc_auto/db_auto.h"
#include "dbinc_auto/crdel_auto.h"
#include "dbinc/db_dispatch.h"
#include "dbinc_auto/db_ext.h"
#include "dbinc_auto/common_ext.h"

// It's private, and should never be called,
// but some compilers need it resolved
//
DbLogc::~DbLogc()
{
}

// The name _flags prevents a name clash with __db_log_cursor::flags
int DbLogc::close(u_int32_t _flags)
{
	DB_LOGC *logc = this;
	int ret;
unknown's avatar
unknown committed
38
	DbEnv *dbenv2 = DbEnv::get_DbEnv(logc->dbenv);
unknown's avatar
unknown committed
39 40 41 42

	ret = logc->close(logc, _flags);

	if (!DB_RETOK_STD(ret))
unknown's avatar
unknown committed
43
		DB_ERROR(dbenv2, "DbLogc::close", ret, ON_ERROR_UNKNOWN);
unknown's avatar
unknown committed
44 45 46 47 48 49 50 51 52 53 54 55 56

	return (ret);
}

// The name _flags prevents a name clash with __db_log_cursor::flags
int DbLogc::get(DbLsn *lsn, Dbt *data, u_int32_t _flags)
{
	DB_LOGC *logc = this;
	int ret;

	ret = logc->get(logc, lsn, data, _flags);

	if (!DB_RETOK_LGGET(ret)) {
unknown's avatar
unknown committed
57 58 59
		if (ret == DB_BUFFER_SMALL)
			DB_ERROR_DBT(DbEnv::get_DbEnv(logc->dbenv),
				"DbLogc::get", data, ON_ERROR_UNKNOWN);
unknown's avatar
unknown committed
60
		else
unknown's avatar
unknown committed
61 62
			DB_ERROR(DbEnv::get_DbEnv(logc->dbenv),
				"DbLogc::get", ret, ON_ERROR_UNKNOWN);
unknown's avatar
unknown committed
63 64 65 66
	}

	return (ret);
}