Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tero Saarni
OpenLDAP
Commits
0609aa45
Commit
0609aa45
authored
13 years ago
by
Howard Chu
Committed by
Howard Chu
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Reimplement basic ops as cursor ops
parent
23790cf3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libraries/libmdb/Makefile
+2
-1
2 additions, 1 deletion
libraries/libmdb/Makefile
libraries/libmdb/mdb.c
+608
-217
608 additions, 217 deletions
libraries/libmdb/mdb.c
libraries/libmdb/mdb.h
+9
-8
9 additions, 8 deletions
libraries/libmdb/mdb.h
libraries/libmdb/midl.h
+6
-2
6 additions, 2 deletions
libraries/libmdb/midl.h
with
625 additions
and
228 deletions
libraries/libmdb/Makefile
+
2
−
1
View file @
0609aa45
...
...
@@ -4,7 +4,7 @@ OPT = -O2 -g
CFLAGS
=
-pthread
$(
OPT
)
$(
W
)
$(
XCFLAGS
)
LDLIBS
=
PROGS
=
mdb_stat mtest mtest2 mtest3
PROGS
=
mdb_stat mtest mtest2 mtest3
mtest4 mtest5
all
:
libmdb.a libmdb.so $(PROGS)
clean
:
...
...
@@ -25,6 +25,7 @@ mtest: mtest.o libmdb.a
mtest2
:
mtest2.o libmdb.a
mtest3
:
mtest3.o libmdb.a
mtest4
:
mtest4.o libmdb.a
mtest5
:
mtest5.o libmdb.a
mdb.o
:
mdb.c mdb.h midl.h
$(
CC
)
$(
CFLAGS
)
-fPIC
$(
CPPFLAGS
)
-c
mdb.c
...
...
This diff is collapsed.
Click to expand it.
libraries/libmdb/mdb.c
+
608
−
217
View file @
0609aa45
This diff is collapsed.
Click to expand it.
libraries/libmdb/mdb.h
+
9
−
8
View file @
0609aa45
...
...
@@ -133,7 +133,7 @@ typedef int (MDB_cmp_func)(const MDB_val *a, const MDB_val *b);
*/
typedef
void
(
MDB_rel_func
)(
void
*
newptr
,
void
*
oldptr
,
size_t
size
);
/** @defgroup mdb_env
e
nvironment
f
lags
/** @defgroup mdb_env
E
nvironment
F
lags
* @{
*/
/** mmap at a fixed address */
...
...
@@ -144,7 +144,7 @@ typedef void (MDB_rel_func)(void *newptr, void *oldptr, size_t size);
#define MDB_RDONLY 0x20000
/** @} */
/** @defgroup mdb_open
d
atabase
f
lags
/** @defgroup mdb_open
D
atabase
F
lags
* @{
*/
/** use reverse string keys */
...
...
@@ -161,15 +161,18 @@ typedef void (MDB_rel_func)(void *newptr, void *oldptr, size_t size);
#define MDB_CREATE 0x40000
/** @} */
/** @defgroup mdb_put
mdb_put f
lags
/** @defgroup mdb_put
Write F
lags
* @{
*/
/** For
mdb_
put:
d
on't write if the key already exists. */
/** For put:
D
on't write if the key already exists. */
#define MDB_NOOVERWRITE 0x10
/** For mdb_put: don't write if the key and data pair already exist.
* Only for #MDB_DUPSORT
/** Only for #MDB_DUPSORT<br>
* For put: don't write if the key and data pair already exist.<br>
* For mdb_cursor_del: remove all duplicate data items.
*/
#define MDB_NODUPDATA 0x20
/** For mdb_cursor_put: overwrite the current key/data pair */
#define MDB_CURRENT 0x40
/* @} */
/** Cursor operations */
...
...
@@ -723,8 +726,6 @@ int mdb_del(MDB_txn *txn, MDB_dbi dbi, MDB_val *key, MDB_val *data);
/** Create a cursor handle.
* Cursors are associated with a specific transaction and database and
* may not span threads.
* @todo Cursors only support read operations. Support for cursor_put() and
* cursor_del() needs to be added.
* @param[in] txn A transaction handle returned by #mdb_txn_begin()
* @param[in] dbi A database handle returned by #mdb_open()
* @param[out] cursor Address where the new #MDB_cursor handle will be stored
...
...
This diff is collapsed.
Click to expand it.
libraries/libmdb/midl.h
+
6
−
2
View file @
0609aa45
...
...
@@ -29,12 +29,16 @@
/** @defgroup internal MDB Internals
* @{
*/
/** ULONG should be the largest integer type supported on a machine.
* It should be equal to the size of a pointer.
*/
#define ULONG unsigned long
/** @defgroup idls ID List Management
* @{
*/
/** A
n ID should be the largest integer type supported on a machine
.
/** A
generic ID number. These were entryIDs in back-bdb
.
*/
#define ID unsigned long
typedef
ULONG
ID
;
/** An IDL is an ID List, a sorted array of IDs. The first
* element of the array is a counter for how many actual
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment