Created
March 30, 2010 00:46
-
-
Save actsasflinn/348619 to your computer and use it in GitHub Desktop.
Tokyo Cabinet patch adds iterrec and iterout to tcadbmisc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- tcadb.c.orig 2010-03-11 09:55:29.000000000 -0500 | |
+++ tcadb.c 2010-03-13 15:34:13.000000000 -0500 | |
@@ -2423,6 +2423,25 @@ TCLIST *tcadbmisc(TCADB *adb, const char | |
tclistdel(rv); | |
rv = NULL; | |
} | |
+ } else if(!strcmp(name, "iterrec")){ | |
+ rv = tclistnew2(1); | |
+ int ksiz; | |
+ const char *kbuf = tcbdbcurkey3(adb->cur, &ksiz); | |
+ if(kbuf){ | |
+ TCLISTPUSH(rv, kbuf, ksiz); | |
+ int vsiz; | |
+ const char *vbuf = tcbdbcurval3(adb->cur, &vsiz); | |
+ if(vbuf) TCLISTPUSH(rv, vbuf, vsiz); | |
+ } else { | |
+ tclistdel(rv); | |
+ rv = NULL; | |
+ } | |
+ } else if(!strcmp(name, "iterout")){ | |
+ rv = tclistnew2(0); | |
+ if(!tcbdbcurout(adb->cur)){ | |
+ tclistdel(rv); | |
+ rv = NULL; | |
+ } | |
} else if(!strcmp(name, "sync")){ | |
rv = tclistnew2(1); | |
if(!tcadbsync(adb)){ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment