hash.h (5ed136e814a98e845927fffa6aa7c497dbd8fa5e) | hash.h (f19d047aec2b1d05cfb00498caff5141094d1124) |
---|---|
1#ifndef HASH_H 2#define HASH_H 3/* hash.h */ 4/************************************************************************ 5 Copyright 1988, 1991 by Carnegie Mellon University 6 7 All Rights Reserved 8 --- 103 unchanged lines hidden (view full) --- 112 113struct hash_tblstruct { 114 unsigned size, bucketnum; 115 hash_member *member; /* Used for linear dump */ 116 hash_member *table[1]; /* Dynamically extended */ 117}; 118 119/* ANSI function prototypes or empty arg list? */ | 1#ifndef HASH_H 2#define HASH_H 3/* hash.h */ 4/************************************************************************ 5 Copyright 1988, 1991 by Carnegie Mellon University 6 7 All Rights Reserved 8 --- 103 unchanged lines hidden (view full) --- 112 113struct hash_tblstruct { 114 unsigned size, bucketnum; 115 hash_member *member; /* Used for linear dump */ 116 hash_member *table[1]; /* Dynamically extended */ 117}; 118 119/* ANSI function prototypes or empty arg list? */ |
120#define P(args) args | |
121 | 120 |
122typedef int (*hash_cmpfp) P((hash_datum *, hash_datum *)); 123typedef void (*hash_freefp) P((hash_datum *)); | 121typedef int (*hash_cmpfp)(hash_datum *, hash_datum *); 122typedef void (*hash_freefp)(hash_datum *); |
124 | 123 |
125extern hash_tbl *hash_Init P((u_int tablesize)); | 124extern hash_tbl *hash_Init(u_int tablesize); |
126 | 125 |
127extern void hash_Reset P((hash_tbl *tbl, hash_freefp)); | 126extern void hash_Reset(hash_tbl *tbl, hash_freefp); |
128 | 127 |
129extern unsigned hash_HashFunction P((u_char *str, u_int len)); | 128extern unsigned hash_HashFunction(u_char *str, u_int len); |
130 | 129 |
131extern int hash_Exists P((hash_tbl *, u_int code, 132 hash_cmpfp, hash_datum *key)); | 130extern int hash_Exists(hash_tbl *, u_int code, 131 hash_cmpfp, hash_datum *key); |
133 | 132 |
134extern int hash_Insert P((hash_tbl *, u_int code, | 133extern int hash_Insert(hash_tbl *, u_int code, |
135 hash_cmpfp, hash_datum *key, | 134 hash_cmpfp, hash_datum *key, |
136 hash_datum *element)); | 135 hash_datum *element); |
137 | 136 |
138extern int hash_Delete P((hash_tbl *, u_int code, | 137extern int hash_Delete(hash_tbl *, u_int code, |
139 hash_cmpfp, hash_datum *key, | 138 hash_cmpfp, hash_datum *key, |
140 hash_freefp)); | 139 hash_freefp); |
141 | 140 |
142extern hash_datum *hash_Lookup P((hash_tbl *, u_int code, 143 hash_cmpfp, hash_datum *key)); | 141extern hash_datum *hash_Lookup(hash_tbl *, u_int code, 142 hash_cmpfp, hash_datum *key); |
144 | 143 |
145extern hash_datum *hash_FirstEntry P((hash_tbl *)); | 144extern hash_datum *hash_FirstEntry(hash_tbl *); |
146 | 145 |
147extern hash_datum *hash_NextEntry P((hash_tbl *)); | 146extern hash_datum *hash_NextEntry(hash_tbl *); |
148 | 147 |
149#undef P 150 | |
151#endif /* HASH_H */ | 148#endif /* HASH_H */ |