Commit c04573d6 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Make db_dump work. Addresses #197.

git-svn-id: file:///svn/tokudb@1204 c7de825b-a66e-492c-adef-691d508d4ae1
parent 58fd6d07
......@@ -54,3 +54,8 @@ int Db::put(DbTxn *txn, Dbt *key, Dbt *data, u_int32_t flags) {
return ret;
}
int Db::cursor(DbTxn *txn, Dbc **cursorp, u_int32_t flags) {
int ret = the_db->cursor(the_db, txn->get_DB_TXN(), (DBC**)cursorp, flags);
return ret;
}
......@@ -9,6 +9,7 @@ class Dbc;
// DBT and Dbt objects are the same pointers. So watch out if you use Dbt to make other classes (e.g., with subclassing).
class Dbt : private DBT
{
friend class Dbc;
public:
void * get_data(void) const { return data; }
......@@ -17,6 +18,9 @@ class Dbt : private DBT
u_int32_t get_size(void) const { return size; }
void set_size(u_int32_t p) { size = p; }
u_int32_t get_flags() const { return flags; }
void set_flags(u_int32_t f) { flags = f; }
DBT *get_DBT(void) { return (DBT*)this; }
Dbt(void */*data*/, u_int32_t /*size*/);
......@@ -94,3 +98,11 @@ class DbTxn {
DB_TXN *the_txn;
};
class Dbc : protected DBC
{
public:
int close(void);
int get(Dbt*, Dbt *, u_int32_t);
};
SRCS = $(wildcard *.cpp)
TARGETS = $(patsubst %.cpp,%,$(SRCS))
DBCXX = ../dbt.o ../db.o ../dbenv.o
DBCXX = ../dbt.o ../db.o ../dbenv.o ../dbc.o
CPPFLAGS = -I../ -I../../include
CXXFLAGS = -Wall -g
LDLIBS = ../../lib/libdb.a -lz
all: $(TARGETS)
$(TARGETS): $(DBCXX)
$(DBCXX):
cd ..;make
all: $(TARGETS)
clean:
rm -rf $(TARGETS)
#include <stdlib.h>
#include <assert.h>
#include <db_cxx.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment