head	1.2;
access;
symbols
	RPM_4_2_1:1.1.1.4
	RPM_4_2:1.1.1.4
	RPM_4_1_1:1.1.1.4
	RPM_4_1:1.1.1.3
	RPM_4_0_5:1.1.1.2
	RPM_4_0_4:1.1.1.1
	RPM:1.1.1;
locks; strict;
comment	@// @;


1.2
date	2008.01.02.09.51.40;	author rse;	state dead;
branches;
next	1.1;
commitid	z4cpSiAhOCXk5PLs;

1.1
date	2002.01.07.22.29.55;	author rse;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2002.01.07.22.29.55;	author rse;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2003.01.18.13.48.49;	author rse;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2002.01.17.20.11.42;	author rse;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2003.01.18.14.04.50;	author rse;	state Exp;
branches;
next	;


desc
@@


1.2
log
@remove the ancient RPM 4.2.1 source tree copy
@
text
@/*-
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 1997-2001
 *	Sleepycat Software.  All rights reserved.
 */

#include "db_config.h"

#ifndef lint
static const char revid[] = "Id: cxx_logc.cpp,v 11.3 2001/11/08 06:18:08 mjc Exp ";
#endif /* not lint */

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

#include "db_cxx.h"
#include "cxx_int.h"

#include "db_int.h"
#include "db_page.h"
#include "db_auto.h"
#include "crdel_auto.h"
#include "db_ext.h"
#include "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 *cursor = this;
	int err;

	if ((err = cursor->close(cursor, _flags)) != 0) {
		DB_ERROR("DbLogc::close", err, ON_ERROR_UNKNOWN);
		return (err);
	}
	return (0);
}

// 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 *cursor = this;
	int err;

	if ((err = cursor->get(cursor, lsn, data, _flags)) != 0) {

		// DB_NOTFOUND is a "normal" returns,
		// so should not be thrown as an error
		//
		if (err != DB_NOTFOUND) {
			const char *name = "DbLogc::get";
			if (err == ENOMEM && DB_OVERFLOWED_DBT(data))
				DB_ERROR_DBT(name, data, ON_ERROR_UNKNOWN);
			else
				DB_ERROR(name, err, ON_ERROR_UNKNOWN);

			return (err);
		}
	}
	return (err);
}
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Import: RPM 4.0.4
@
text
@@


1.1.1.2
log
@Import: RPM 4.0.5
@
text
@d4 1
a4 1
 * Copyright (c) 1997-2002
d11 1
a11 1
static const char revid[] = "Id: cxx_logc.cpp,v 11.8 2002/07/03 21:03:53 bostic Exp ";
d18 1
a18 1
#include "dbinc/cxx_int.h"
d21 5
a25 6
#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"
d37 2
a38 2
	DB_LOGC *logc = this;
	int ret;
d40 5
a44 6
	ret = logc->close(logc, _flags);

	if (!DB_RETOK_STD(ret))
		DB_ERROR("DbLogc::close", ret, ON_ERROR_UNKNOWN);

	return (ret);
d50 2
a51 2
	DB_LOGC *logc = this;
	int ret;
d53 1
a53 1
	ret = logc->get(logc, lsn, data, _flags);
d55 12
a66 5
	if (!DB_RETOK_LGGET(ret)) {
		if (ret == ENOMEM && DB_OVERFLOWED_DBT(data))
			DB_ERROR_DBT("DbLogc::get", data, ON_ERROR_UNKNOWN);
		else
			DB_ERROR("DbLogc::get", ret, ON_ERROR_UNKNOWN);
d68 1
a68 2

	return (ret);
@


1.1.1.3
log
@Import: RPM 4.1
@
text
@d4 1
a4 1
 * Copyright (c) 1997-2001
d11 1
a11 1
static const char revid[] = "Id: cxx_logc.cpp,v 11.3 2001/11/08 06:18:08 mjc Exp ";
d18 1
a18 1
#include "cxx_int.h"
d21 6
a26 5
#include "db_page.h"
#include "db_auto.h"
#include "crdel_auto.h"
#include "db_ext.h"
#include "common_ext.h"
d38 2
a39 2
	DB_LOGC *cursor = this;
	int err;
d41 6
a46 5
	if ((err = cursor->close(cursor, _flags)) != 0) {
		DB_ERROR("DbLogc::close", err, ON_ERROR_UNKNOWN);
		return (err);
	}
	return (0);
d52 2
a53 2
	DB_LOGC *cursor = this;
	int err;
d55 1
a55 1
	if ((err = cursor->get(cursor, lsn, data, _flags)) != 0) {
d57 6
a62 9
		// DB_NOTFOUND is a "normal" returns,
		// so should not be thrown as an error
		//
		if (err != DB_NOTFOUND) {
			const char *name = "DbLogc::get";
			if (err == ENOMEM && DB_OVERFLOWED_DBT(data))
				DB_ERROR_DBT(name, data, ON_ERROR_UNKNOWN);
			else
				DB_ERROR(name, err, ON_ERROR_UNKNOWN);
d64 1
a64 4
			return (err);
		}
	}
	return (err);
@


1.1.1.4
log
@Import: RPM 4.1.1
@
text
@d4 1
a4 1
 * Copyright (c) 1997-2002
d11 1
a11 1
static const char revid[] = "Id: cxx_logc.cpp,v 11.8 2002/07/03 21:03:53 bostic Exp ";
d18 1
a18 1
#include "dbinc/cxx_int.h"
d21 5
a25 6
#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"
d37 2
a38 2
	DB_LOGC *logc = this;
	int ret;
d40 5
a44 6
	ret = logc->close(logc, _flags);

	if (!DB_RETOK_STD(ret))
		DB_ERROR("DbLogc::close", ret, ON_ERROR_UNKNOWN);

	return (ret);
d50 2
a51 2
	DB_LOGC *logc = this;
	int ret;
d53 1
a53 1
	ret = logc->get(logc, lsn, data, _flags);
d55 12
a66 5
	if (!DB_RETOK_LGGET(ret)) {
		if (ret == ENOMEM && DB_OVERFLOWED_DBT(data))
			DB_ERROR_DBT("DbLogc::get", data, ON_ERROR_UNKNOWN);
		else
			DB_ERROR("DbLogc::get", ret, ON_ERROR_UNKNOWN);
d68 1
a68 2

	return (ret);
@


