2013-04-17 00:00:36 -04:00
|
|
|
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
|
|
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
2007-12-18 20:39:02 +00:00
|
|
|
#include <db_cxx.h>
|
2007-12-18 19:37:59 +00:00
|
|
|
|
|
|
|
int Dbc::close (void) {
|
|
|
|
DBC *dbc = this;
|
2007-12-21 19:59:31 +00:00
|
|
|
DbEnv *env = (DbEnv*)dbc->dbp->api_internal; // Must grab the env before closing the cursor.
|
2007-12-18 19:37:59 +00:00
|
|
|
int ret = dbc->c_close(dbc);
|
2007-12-21 15:32:21 +00:00
|
|
|
return env->maybe_throw_error(ret);
|
2007-12-18 19:37:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int Dbc::get(Dbt* key, Dbt *data, u_int32_t flags) {
|
|
|
|
DBC *dbc = this;
|
|
|
|
int ret = dbc->c_get(dbc, key, data, flags);
|
2007-12-21 20:39:53 +00:00
|
|
|
DB_ENV *dbenv_c=dbc->dbp->dbenv;
|
|
|
|
DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
|
2007-12-21 15:32:21 +00:00
|
|
|
return env->maybe_throw_error(ret);
|
2007-12-18 19:37:59 +00:00
|
|
|
}
|
2007-12-23 01:09:09 +00:00
|
|
|
|
2013-04-17 00:00:12 -04:00
|
|
|
#if 0
|
|
|
|
// No longer present (see #4576)
|
2007-12-27 21:37:04 +00:00
|
|
|
int Dbc::del(u_int32_t flags) {
|
|
|
|
DBC *dbc = this;
|
|
|
|
int ret = dbc->c_del(dbc, flags);
|
|
|
|
DB_ENV *dbenv_c=dbc->dbp->dbenv;
|
|
|
|
DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
|
|
|
|
return env->maybe_throw_error(ret);
|
|
|
|
}
|
2013-04-17 00:00:12 -04:00
|
|
|
#endif
|
2007-12-27 21:37:04 +00:00
|
|
|
|
2008-01-10 19:42:08 +00:00
|
|
|
int Dbc::count(db_recno_t *count, u_int32_t flags) {
|
|
|
|
DBC *dbc = this;
|
|
|
|
int ret = dbc->c_count(dbc, count, flags);
|
|
|
|
DB_ENV *dbenv_c=dbc->dbp->dbenv;
|
|
|
|
DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
|
|
|
|
return env->maybe_throw_error(ret);
|
|
|
|
}
|
|
|
|
|
2007-12-23 01:09:09 +00:00
|
|
|
// Not callable, but some compilers require it to be defined anyway.
|
|
|
|
Dbc::~Dbc()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|