diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-14 21:02:05 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-14 21:02:05 +0300 |
commit | 5580c3248794803a8e45dd58b45933a32637954d (patch) | |
tree | 3067db40ccf49fab472d7fe3df31bae17d24df5b /src/proto.h | |
parent | 66eb071ce6202a33dbf53dfc46e52b25d683290c (diff) | |
download | gdbm-5580c3248794803a8e45dd58b45933a32637954d.tar.gz gdbm-5580c3248794803a8e45dd58b45933a32637954d.tar.bz2 |
Don't use hardcoded constant
* src/gdbmconst.h (GDBM_HASH_BITS): New constant.
* src/bucket.c: Use GDBM_HASH_BITS instead of the
hardcoded value.
* src/findkey.c (_gdbm_findkey): Use _gdbm_hash_key.
* src/gdbmtool.c (hash_handler): Use _gdbm_hash_key if the
database is open.
* src/hash.c (_gdbm_bucket_dir, _gdbm_hash_key): New functions.
* src/proto.h (_gdbm_bucket_dir, _gdbm_hash_key): New protos.
* src/systems.h (STATBLKSIZE): Take a struct stat as argument.
* src/gdbmopen.c (STATBLKSIZE): Takes argument now.
Diffstat (limited to 'src/proto.h')
-rw-r--r-- | src/proto.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/proto.h b/src/proto.h index 07ff378..ce5551f 100644 --- a/src/proto.h +++ b/src/proto.h @@ -38,6 +38,9 @@ int _gdbm_findkey (GDBM_FILE, datum, char **, int *); /* From hash.c */ int _gdbm_hash (datum); +void _gdbm_hash_key (GDBM_FILE dbf, datum key, int *hash, int *bucket, + int *offset); +int _gdbm_bucket_dir (GDBM_FILE dbf, int hash); /* From update.c */ int _gdbm_end_update (GDBM_FILE); |