X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Fdoc%2Fdesign.lyx;h=c57ae2a40651f84b4efaa89e04060374bc5b0871;hb=74b0109ebd2a30d57d19ae9a56f16c0f3b3637eb;hp=bb499482e5c077385fadfc1b82ed7c14577bedb5;hpb=a42bba8ec446284256a7c9146ba3525404de474c;p=ccan diff --git a/ccan/tdb2/doc/design.lyx b/ccan/tdb2/doc/design.lyx index bb499482..c57ae2a4 100644 --- a/ccan/tdb2/doc/design.lyx +++ b/ccan/tdb2/doc/design.lyx @@ -698,7 +698,13 @@ Status \end_layout \begin_layout Standard + +\change_deleted 0 1298979572 Incomplete; nesting flag is still defined as per tdb1. +\change_inserted 0 1298979584 +Complete; the nesting flag has been removed. +\change_unchanged + \end_layout \begin_layout Subsection @@ -779,9 +785,15 @@ Status \end_layout \begin_layout Standard + +\change_deleted 0 1300360559 Incomplete. TDB_VOLATILE still defined, but implementation should fail on unknown flags to be future-proof. +\change_inserted 0 1300360588 +Complete. + Unknown flags cause tdb_open() to fail as well, so they can be detected + at runtime. \end_layout \begin_layout Subsection @@ -841,7 +853,13 @@ Status \end_layout \begin_layout Standard + +\change_deleted 0 1300360823 Incomplete. +\change_inserted 0 1300360824 +Complete. +\change_unchanged + \end_layout \begin_layout Subsection @@ -870,14 +888,32 @@ Proposed Solution \begin_layout Standard Reachitecting the API to include a tdb_errcode pointer would be a great - deal of churn; we are better to guarantee that the tdb_errcode is per-thread - so the current programming model can be maintained. + deal of churn +\change_inserted 0 1298979557 +, but fortunately most functions return 0 on success and -1 on error: we + can change these to return 0 on success and a negative error code on error, + and the API remains similar to previous. + The tdb_fetch, tdb_firstkey and tdb_nextkey functions need to take a TDB_DATA + pointer and return an error code. + It is also simpler to have tdb_nextkey replace its key argument in place, + freeing up any old .dptr. +\end_layout + +\begin_layout Standard + +\change_deleted 0 1298979438 +; we are better to guarantee that the tdb_errcode is per-thread so the current + programming model can be maintained. \end_layout \begin_layout Standard + +\change_deleted 0 1298979438 This requires dynamic per-thread allocations, which is awkward with POSIX threads (pthread_key_create space is limited and we cannot simply allocate a key for every TDB). +\change_unchanged + \end_layout \begin_layout Standard @@ -903,7 +939,13 @@ Status \end_layout \begin_layout Standard -Incomplete. +Incomplete +\change_inserted 0 1298979681 +; API has been changed but thread safety has not been implemented. +\change_deleted 0 1298979669 +. +\change_unchanged + \end_layout \begin_layout Subsection @@ -1246,7 +1288,13 @@ Status \end_layout \begin_layout Standard + +\change_deleted 0 1300360712 Incomplete. +\change_inserted 0 1300360716 +Complete. +\change_unchanged + \end_layout \begin_layout Subsection @@ -1291,7 +1339,13 @@ Status \end_layout \begin_layout Standard + +\change_deleted 0 1298979699 Incomplete, TDB_CLEAR_IF_FIRST still defined, but not implemented. +\change_inserted 0 1298979700 +Complete. +\change_unchanged + \end_layout \begin_layout Subsection @@ -1350,7 +1404,13 @@ Status \end_layout \begin_layout Standard + +\change_deleted 0 1300360753 Incomplete. +\change_inserted 0 1300360754 +Complete. +\change_unchanged + \end_layout \begin_layout Subsection @@ -1380,7 +1440,13 @@ Status \end_layout \begin_layout Standard + +\change_deleted 0 1300360766 Incomplete. +\change_inserted 0 1300360767 +Complete. +\change_unchanged + \end_layout \begin_layout Subsection @@ -1497,7 +1563,13 @@ Status \end_layout \begin_layout Standard + +\change_deleted 0 1298979837 Incomplete; TDB_CLEAR_IF_FIRST still defined, but does nothing. +\change_inserted 0 1298979837 +Complete. +\change_unchanged + \end_layout \begin_layout Subsection