Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
74b0109e
Commit
74b0109e
authored
Mar 17, 2011
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdb2: begin tdb1 to tdb2 porting guide.
parent
bb4d59ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
ccan/tdb2/doc/TDB1_porting.txt
ccan/tdb2/doc/TDB1_porting.txt
+25
-0
No files found.
ccan/tdb2/doc/TDB1_porting.txt
0 → 100644
View file @
74b0109e
Interface differences between TDB1 and TDB2.
- tdb2 functions return 0 on success, and a negative error on failure,
whereas tdb1 functions returned 0 on success, and -1 on failure. tdb1
then used tdb_error() to determine the error.
- tdb2's tdb_fetch() returns an error, tdb1's returned the data directly
(or tdb_null, and you were supposed to check tdb_error() to find out why).
- tdb2's tdb_nextkey() frees the old key's dptr, in tdb2 you needed to do
this manually.
- tdb1's tdb_open/tdb_open_ex took an explicit hash size. tdb2's hash table
resizes as required.
- tdb2 uses a linked list of attribute structures to implement logging and
alternate hashes. tdb1 used tdb_open_ex, which was not extensible.
- tdb2 does locking on read-only databases (ie. O_RDONLY passed to tdb_open).
tdb1 did not: use the TDB_NOLOCK flag if you want to suppress locking.
- tdb2's log function is simpler than tdb1's log function. The string is
already formatted, and it takes an enum tdb_log_level not a tdb_debug_level,
and which has only three values: TDB_LOG_ERROR, TDB_LOG_USE_ERROR and
TDB_LOG_WARNING.
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