diff options
| author | gwr <gwr@NetBSD.org> | 1994-05-24 15:19:56 +0000 |
|---|---|---|
| committer | gwr <gwr@NetBSD.org> | 1994-05-24 15:19:56 +0000 |
| commit | 438d67fe4e073750dfca3245e8a2bac11187b223 (patch) | |
| tree | 5f8eeb02ac62cac4202c3e627246b061b51ed1b4 /libexec/bootpd/hash.h | |
| parent | 0645f8963f663d296322b025a9e0c1dff377718f (diff) | |
Wholesale update to bootp-2.3.7 release.
Diffstat (limited to 'libexec/bootpd/hash.h')
| -rw-r--r-- | libexec/bootpd/hash.h | 57 |
1 files changed, 39 insertions, 18 deletions
diff --git a/libexec/bootpd/hash.h b/libexec/bootpd/hash.h index 2a1d8b8e5a3..51d0a5ebd33 100644 --- a/libexec/bootpd/hash.h +++ b/libexec/bootpd/hash.h @@ -1,5 +1,6 @@ -#ifndef _BLURB_ -#define _BLURB_ +#ifndef HASH_H +#define HASH_H +/* hash.h */ /************************************************************************ Copyright 1988, 1991 by Carnegie Mellon University @@ -21,8 +22,6 @@ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ************************************************************************/ -#endif /* _BLURB_ */ - /* * Generalized hash table ADT @@ -91,10 +90,6 @@ SOFTWARE. */ -#ifndef __HASHXYZ973__ - -#define __HASHXYZ973__ - /* * Define "hash_datum" as a universal data type */ @@ -124,14 +119,40 @@ struct hash_tblstruct { hash_member *table[1]; /* Dynamically extended */ }; -extern hash_tbl *hash_Init(); -extern void hash_Reset(); -extern unsigned hash_HashFunction(); -extern int hash_Exists(); -extern int hash_Insert(); -extern int hash_Delete(); -extern hash_datum *hash_Lookup(); -extern hash_datum *hash_FirstEntry(); -extern hash_datum *hash_NextEntry(); - +/* ANSI function prototypes or empty arg list? */ +#ifdef __STDC__ +#define P(args) args +#else +#define P(args) () #endif + +typedef int (*hash_cmpfp) P((hash_datum *, hash_datum *)); +typedef void (*hash_freefp) P((hash_datum *)); + +extern hash_tbl *hash_Init P((u_int tablesize)); + +extern void hash_Reset P((hash_tbl *tbl, hash_freefp)); + +extern unsigned hash_HashFunction P((u_char *str, u_int len)); + +extern int hash_Exists P((hash_tbl *, u_int code, + hash_cmpfp, hash_datum *key)); + +extern int hash_Insert P((hash_tbl *, u_int code, + hash_cmpfp, hash_datum *key, + hash_datum *element)); + +extern int hash_Delete P((hash_tbl *, u_int code, + hash_cmpfp, hash_datum *key, + hash_freefp)); + +extern hash_datum *hash_Lookup P((hash_tbl *, u_int code, + hash_cmpfp, hash_datum *key)); + +extern hash_datum *hash_FirstEntry P((hash_tbl *)); + +extern hash_datum *hash_NextEntry P((hash_tbl *)); + +#undef P + +#endif /* HASH_H */ |
