diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-05 11:29:26 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-05 11:29:26 +0000 |
commit | 39cc2512acbcf56ffbf87e3d26afc0450ca37de9 (patch) | |
tree | 69bde184c07add3dfd3ad7479bf72b5bdcb584d6 /compat/seq.c | |
parent | ff788884bcaeeb59579ff88f51b90e57c1f8c3be (diff) | |
download | gdbm-39cc2512acbcf56ffbf87e3d26afc0450ca37de9.tar.gz gdbm-39cc2512acbcf56ffbf87e3d26afc0450ca37de9.tar.bz2 |
Rewrite using ndbm interface.
Diffstat (limited to 'compat/seq.c')
-rw-r--r-- | compat/seq.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/compat/seq.c b/compat/seq.c index f5a744f..e787f96 100644 --- a/compat/seq.c +++ b/compat/seq.c @@ -20,9 +20,7 @@ /* Include system configuration before all else. */ #include "autoconf.h" - -#include "gdbmdefs.h" -#include "extern.h" +#include "dbm-priv.h" /* Start the visit of all keys in the database. This produces something in hash order, not in any sorted order. */ @@ -30,16 +28,7 @@ datum firstkey (void) { - datum ret_val; - - /* Free previous dynamic memory, do actual call, and save pointer to new - memory. */ - ret_val = gdbm_firstkey (_gdbm_file); - if (_gdbm_memory.dptr != NULL) free (_gdbm_memory.dptr); - _gdbm_memory = ret_val; - - /* Return the new value. */ - return ret_val; + return dbm_firstkey (_gdbm_file); } @@ -48,17 +37,5 @@ firstkey (void) datum nextkey (datum key) { - datum ret_val; - - /* Make sure we have a valid key. */ - if (key.dptr == NULL) - return key; - - /* Call gdbm nextkey with supplied value. After that, free the old value. */ - ret_val = gdbm_nextkey (_gdbm_file, key); - if (_gdbm_memory.dptr != NULL) free (_gdbm_memory.dptr); - _gdbm_memory = ret_val; - - /* Return the new value. */ - return ret_val; + return dbm_nextkey (_gdbm_file); } |