Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4a1ff1e7
Commit
4a1ff1e7
authored
Dec 18, 2007
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make db_dump work. Addresses #197.
git-svn-id:
file:///svn/tokudb@1204
c7de825b-a66e-492c-adef-691d508d4ae1
parent
8ba5e8f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
+20
-2
cxx/db.cpp
cxx/db.cpp
+5
-0
cxx/db_cxx.h
cxx/db_cxx.h
+12
-0
cxx/tests/Makefile
cxx/tests/Makefile
+2
-2
cxx/tests/db_dump.cpp
cxx/tests/db_dump.cpp
+1
-0
No files found.
cxx/db.cpp
View file @
4a1ff1e7
...
...
@@ -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
;
}
cxx/db_cxx.h
View file @
4a1ff1e7
...
...
@@ -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
);
};
cxx/tests/Makefile
View file @
4a1ff1e7
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)
cxx/tests/db_dump.cpp
View file @
4a1ff1e7
#include <stdlib.h>
#include <assert.h>
#include <db_cxx.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment