diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-03-23 19:35:00 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-03-23 19:35:00 +0000 |
commit | 1a88b22742a7df6205d19a7ecf78aba3eda53a16 (patch) | |
tree | a45ce9ebf2f99c9486e0f0e47d77fa69a6265ccc /lib/libc/db/hash/hash_bigkey.c | |
parent | 68d8bc8b8c8f1e4de98ae6f483ac210dfdf13420 (diff) |
ansify. ok deraadt@ moritz@
Diffstat (limited to 'lib/libc/db/hash/hash_bigkey.c')
-rw-r--r-- | lib/libc/db/hash/hash_bigkey.c | 79 |
1 files changed, 24 insertions, 55 deletions
diff --git a/lib/libc/db/hash/hash_bigkey.c b/lib/libc/db/hash/hash_bigkey.c index fd51e40d7aa..2b67c093d19 100644 --- a/lib/libc/db/hash/hash_bigkey.c +++ b/lib/libc/db/hash/hash_bigkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash_bigkey.c,v 1.14 2005/01/03 22:46:43 millert Exp $ */ +/* $OpenBSD: hash_bigkey.c,v 1.15 2005/03/23 19:34:59 otto Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)hash_bigkey.c 8.3 (Berkeley) 5/31/94"; #else -static const char rcsid[] = "$OpenBSD: hash_bigkey.c,v 1.14 2005/01/03 22:46:43 millert Exp $"; +static const char rcsid[] = "$OpenBSD: hash_bigkey.c,v 1.15 2005/03/23 19:34:59 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -86,11 +86,8 @@ static int collect_data(HTAB *, BUFHEAD *, int, int); * 0 ==> OK *-1 ==> ERROR */ -extern int -__big_insert(hashp, bufp, key, val) - HTAB *hashp; - BUFHEAD *bufp; - const DBT *key, *val; +int +__big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) { u_int16_t *p; int key_size, n, val_size; @@ -198,10 +195,8 @@ __big_insert(hashp, bufp, key, val) * 0 => OK *-1 => ERROR */ -extern int -__big_delete(hashp, bufp) - HTAB *hashp; - BUFHEAD *bufp; +int +__big_delete(HTAB *hashp, BUFHEAD *bufp) { BUFHEAD *last_bfp, *rbufp; u_int16_t *bp, pageno; @@ -277,13 +272,8 @@ __big_delete(hashp, bufp) * -2 means key not found and this is big key/data * -3 error */ -extern int -__find_bigpair(hashp, bufp, ndx, key, size) - HTAB *hashp; - BUFHEAD *bufp; - int ndx; - char *key; - int size; +int +__find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size) { u_int16_t *bp; char *p; @@ -329,10 +319,8 @@ __find_bigpair(hashp, bufp, ndx, key, size) * of the pair; 0 if there isn't any (i.e. big pair is the last key in the * bucket) */ -extern u_int16_t -__find_last_page(hashp, bpp) - HTAB *hashp; - BUFHEAD **bpp; +u_int16_t +__find_last_page(HTAB *hashp, BUFHEAD **bpp) { BUFHEAD *bufp; u_int16_t *bp, pageno; @@ -370,13 +358,8 @@ __find_last_page(hashp, bpp) * Return the data for the key/data pair that begins on this page at this * index (index should always be 1). */ -extern int -__big_return(hashp, bufp, ndx, val, set_current) - HTAB *hashp; - BUFHEAD *bufp; - int ndx; - DBT *val; - int set_current; +int +__big_return(HTAB *hashp, BUFHEAD *bufp, int ndx, DBT *val, int set_current) { BUFHEAD *save_p; u_int16_t *bp, len, off, save_addr; @@ -462,10 +445,7 @@ __big_return(hashp, bufp, ndx, val, set_current) * allocate a buffer and copy the data as you recurse up. */ static int -collect_data(hashp, bufp, len, set) - HTAB *hashp; - BUFHEAD *bufp; - int len, set; +collect_data(HTAB *hashp, BUFHEAD *bufp, int len, int set) { u_int16_t *bp; char *p; @@ -517,12 +497,8 @@ collect_data(hashp, bufp, len, set) /* * Fill in the key and data for this big pair. */ -extern int -__big_keydata(hashp, bufp, key, val, set) - HTAB *hashp; - BUFHEAD *bufp; - DBT *key, *val; - int set; +int +__big_keydata(HTAB *hashp, BUFHEAD *bufp, DBT *key, DBT *val, int set) { key->size = collect_key(hashp, bufp, 0, val, set); if (key->size == (size_t)-1) @@ -536,12 +512,7 @@ __big_keydata(hashp, bufp, key, val, set) * collect the data, allocate a buffer and copy the key as you recurse up. */ static int -collect_key(hashp, bufp, len, val, set) - HTAB *hashp; - BUFHEAD *bufp; - int len; - DBT *val; - int set; +collect_key(HTAB *hashp, BUFHEAD *bufp, int len, DBT *val, int set) { BUFHEAD *xbp; char *p; @@ -580,16 +551,14 @@ collect_key(hashp, bufp, len, val, set) * 0 => OK * -1 => error */ -extern int -__big_split(hashp, op, np, big_keyp, addr, obucket, ret) - HTAB *hashp; - BUFHEAD *op; /* Pointer to where to put keys that go in old bucket */ - BUFHEAD *np; /* Pointer to new bucket page */ - /* Pointer to first page containing the big key/data */ - BUFHEAD *big_keyp; - int addr; /* Address of big_keyp */ - u_int32_t obucket;/* Old Bucket */ - SPLIT_RETURN *ret; +int +__big_split(HTAB *hashp, + BUFHEAD *op, /* Pointer to where to put keys that go in old bucket */ + BUFHEAD *np, /* Pointer to new bucket page */ + BUFHEAD *big_keyp, /* Pointer to first page containing the big key/data */ + int addr, /* Address of big_keyp */ + u_int32_t obucket, /* Old Bucket */ + SPLIT_RETURN *ret) { BUFHEAD *bp, *tmpp; DBT key, val; |