X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fdb.h;h=b2a13a234a9610c92f84e398d6d273a1fc774d69;hb=2a5686e35c9d6be6cefe22d49cfff6d23ec2e842;hp=886b8f4b314f577805ec4a19b12a68fccdee8953;hpb=6be2a072b66c459b94e3df7e17e363dc48311151;p=libucw.git diff --git a/lib/db.h b/lib/db.h index 886b8f4b..b2a13a23 100644 --- a/lib/db.h +++ b/lib/db.h @@ -1,7 +1,10 @@ /* * Sherlock Library -- Fast Database Management Routines * - * (c) 1999 Martin Mares + * (c) 1999--2001 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ #ifndef _SHERLOCK_DB_H @@ -27,6 +30,7 @@ int sdbm_fetch(struct sdbm *, byte *key, uns keylen, byte *val, uns *vallen); / void sdbm_rewind(struct sdbm *); int sdbm_get_next(struct sdbm *, byte *key, uns *keylen, byte *val, uns *vallen); /* val can be NULL */ void sdbm_sync(struct sdbm *); +u32 sdbm_hash(byte *key, uns keylen); #define SDBM_CREAT 1 /* Create the database if it doesn't exist */ #define SDBM_WRITE 2 /* Open the database in read/write mode */ @@ -41,5 +45,6 @@ void sdbm_sync(struct sdbm *); #define SDBM_ERROR_BAD_VAL_SIZE -2 /* Fixed value size doesn't match */ #define SDBM_ERROR_TOO_LARGE -3 /* Key/value doesn't fit in buffer supplied */ #define SDBM_ERROR_READ_ONLY -4 /* Database has been opened read only */ +#define SDBM_ERROR_GIANT -5 /* Key/value too large to fit in a page */ #endif