1 |
< |
/* Copyright (c) 1994 Regents of the University of California */ |
2 |
< |
|
3 |
< |
/* SCCSid "$SunId$ LBL" */ |
4 |
< |
|
1 |
> |
/* RCSid $Id$ */ |
2 |
|
/* |
3 |
|
* Header file for general associative table lookup routines |
4 |
|
*/ |
5 |
|
|
6 |
+ |
#include "copyright.h" |
7 |
+ |
|
8 |
|
typedef struct { |
9 |
< |
char *key; /* key name */ |
10 |
< |
long hval; /* key hash value (for efficiency) */ |
11 |
< |
char *data; /* pointer to client data */ |
9 |
> |
char *key; /* key name */ |
10 |
> |
unsigned long hval; /* key hash value (for efficiency) */ |
11 |
> |
char *data; /* pointer to client data */ |
12 |
|
} LUENT; |
13 |
|
|
14 |
|
typedef struct { |
15 |
< |
long (*hashf)(); /* key hash function */ |
16 |
< |
int (*keycmp)(); /* key comparison function */ |
17 |
< |
void (*freek)(); /* free a key */ |
18 |
< |
void (*freed)(); /* free the data */ |
19 |
< |
int tsiz; /* current table size */ |
20 |
< |
LUENT *tabl; /* table, if allocated */ |
21 |
< |
int ndel; /* number of deleted entries */ |
15 |
> |
unsigned long (*hashf)(); /* key hash function */ |
16 |
> |
int (*keycmp)(); /* key comparison function */ |
17 |
> |
void (*freek)(); /* free a key */ |
18 |
> |
void (*freed)(); /* free the data */ |
19 |
> |
int tsiz; /* current table size */ |
20 |
> |
LUENT *tabl; /* table, if allocated */ |
21 |
> |
int ndel; /* number of deleted entries */ |
22 |
|
} LUTAB; |
23 |
|
|
24 |
|
#undef strcmp |
72 |
|
* allocated table itself. |
73 |
|
*/ |
74 |
|
|
75 |
+ |
extern int strcmp(); |
76 |
+ |
|
77 |
+ |
#ifdef NOPROTO |
78 |
+ |
|
79 |
|
extern int lu_init(); |
80 |
|
extern LUENT *lu_find(); |
81 |
|
extern void lu_delete(); |
82 |
|
extern int lu_doall(); |
83 |
|
extern void lu_done(); |
84 |
< |
extern long lu_shash(); |
84 |
> |
extern unsigned long lu_shash(); |
85 |
|
|
86 |
< |
extern int strcmp(); |
86 |
> |
#else |
87 |
> |
|
88 |
> |
extern int lu_init(LUTAB *tbl, int nel); |
89 |
> |
extern unsigned long lu_shash(char *s); |
90 |
> |
extern LUENT *lu_find(LUTAB *tbl, char *key); |
91 |
> |
extern void lu_delete(LUTAB *tbl, char *key); |
92 |
> |
extern int lu_doall(LUTAB *tbl, int (*f)()); |
93 |
> |
extern void lu_done(LUTAB *tbl); |
94 |
> |
|
95 |
> |
#endif |