aboutsummaryrefslogtreecommitdiff
path: root/src/gdbmseq.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-05-21 20:43:02 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2013-05-21 20:43:02 +0000
commit05fa76dfce5311161abbc64c12acbaf56f298e97 (patch)
tree00c6651278ded58dc53fdf1d50e601c2d469090a /src/gdbmseq.c
parent7a87cd8c3ca9528bf53cdb06dfb4168450251d79 (diff)
downloadgdbm-05fa76dfce5311161abbc64c12acbaf56f298e97.tar.gz
gdbm-05fa76dfce5311161abbc64c12acbaf56f298e97.tar.bz2
New function gdbm_count.
* configure.ac: Check for unsigned long long, define substitution variable GDBM_COUNT_T. * src/gdbmcount.c: New file. * src/Makefile.am (libgdbm_la_SOURCES): Add gdbmcount.c. * src/bucket.c (_gdbm_read_bucket_at): New function. * src/gdbm.h.in (gdbm_count_t): New typedef. (gdbm_count): New proto. * src/gdbmdefs.h (GDBM_DIR_COUNT): New define. * src/proto.h (_gdbm_read_bucket_at): New proto. * src/var.c: New variable "filemode". * src/gdbmtool.c: Use gdbm_count. Various bugfixes. * NEWS: Update. * doc/gdbm.texinfo: Update.
Diffstat (limited to 'src/gdbmseq.c')
-rw-r--r--src/gdbmseq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gdbmseq.c b/src/gdbmseq.c
index 4323185..bae60a3 100644
--- a/src/gdbmseq.c
+++ b/src/gdbmseq.c
@@ -49,12 +49,12 @@ get_next_key (GDBM_FILE dbf, int elem_loc, datum *return_val)
/* Find the next bucket. It is possible several entries in
the bucket directory point to the same bucket. */
- while (dbf->bucket_dir < dbf->header->dir_size / sizeof (off_t)
+ while (dbf->bucket_dir < GDBM_DIR_COUNT (dbf)
&& dbf->cache_entry->ca_adr == dbf->dir[dbf->bucket_dir])
dbf->bucket_dir++;
/* Check to see if there was a next bucket. */
- if (dbf->bucket_dir < dbf->header->dir_size / sizeof (off_t))
+ if (dbf->bucket_dir < GDBM_DIR_COUNT (dbf))
_gdbm_get_bucket (dbf, dbf->bucket_dir);
else
/* No next key, just return. */

Return to:

Send suggestions and report system problems to the System administrator.