#include "extern.h"
static int32_t flush_meta __P((HTAB *));
-static int32_t hash_access __P((HTAB *, ACTION, DBT *, DBT *));
+static int32_t hash_access __P((HTAB *, ACTION, const DBT *, DBT *));
static int32_t hash_close __P((DB *));
static int32_t hash_delete __P((const DB *, const DBT *, u_int32_t));
static int32_t hash_fd __P((const DB *));
static int32_t cursor_get __P((const DB *, CURSOR *, DBT *, DBT *, \
u_int32_t));
static int32_t cursor_delete __P((const DB *, CURSOR *, u_int32_t));
-static HTAB *init_hash __P((HTAB *, const char *, HASHINFO *));
+static HTAB *init_hash __P((HTAB *, const char *, const HASHINFO *));
static int32_t init_htab __P((HTAB *, int32_t));
#if DB_BYTE_ORDER == DB_LITTLE_ENDIAN
static void swap_header __P((HTAB *));
if (!file) {
file = tmpnam(NULL);
/* store the file name so that we can unlink it later */
- hashp->fname = (char *)file;
+ hashp->fname = file;
#ifdef DEBUG
fprintf(stderr, "Using file name %s.\n", file);
#endif
/* Process arguments to set up hash table header. */
if (new_table) {
- if (!(hashp = init_hash(hashp, file, (HASHINFO *)info)))
+ if (!(hashp = init_hash(hashp, file, info)))
RETURN_ERROR(errno, error1);
} else {
/* Table already exists */
init_hash(hashp, file, info)
HTAB *hashp;
const char *file;
- HASHINFO *info;
+ const HASHINFO *info;
{
struct stat statbuf;
int32_t nelem;
hashp->local_errno = errno = EINVAL;
return (ERROR);
}
- return (hash_access(hashp, HASH_GET, (DBT *)key, data));
+ return (hash_access(hashp, HASH_GET, key, data));
}
static int32_t
return (ERROR);
}
return (hash_access(hashp, flag == R_NOOVERWRITE ?
- HASH_PUTNEW : HASH_PUT, (DBT *)key, (DBT *)data));
+ HASH_PUTNEW : HASH_PUT, key, (DBT *)data));
}
static int32_t
return (ERROR);
}
- return (hash_access(hashp, HASH_DELETE, (DBT *)key, NULL));
+ return (hash_access(hashp, HASH_DELETE, key, NULL));
}
/*
hash_access(hashp, action, key, val)
HTAB *hashp;
ACTION action;
- DBT *key, *val;
+ const DBT *key;
+ DBT *val;
{
DBT page_key, page_val;
CURSOR cursor;