1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Table lookup routines |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
+ |
|
10 |
|
#include <stdio.h> |
11 |
+ |
#include <stdlib.h> |
12 |
|
#include "lookup.h" |
13 |
|
|
14 |
|
#ifdef NOSTRUCTASS |
17 |
|
#define copystruct(d,s) (*(d) = *(s)) |
18 |
|
#endif |
19 |
|
|
20 |
– |
#define MEM_PTR char * |
20 |
|
|
22 |
– |
extern MEM_PTR calloc(); |
23 |
– |
|
24 |
– |
|
21 |
|
int |
22 |
|
lu_init(tbl, nel) /* initialize tbl for at least nel elements */ |
23 |
|
register LUTAB *tbl; |
134 |
|
copystruct(lu_find(tbl,le[ndx].key), &le[ndx]); |
135 |
|
else if (tbl->freek != NULL) |
136 |
|
(*tbl->freek)(le[ndx].key); |
137 |
< |
free((MEM_PTR)le); |
137 |
> |
free((void *)le); |
138 |
|
goto tryagain; /* should happen only once! */ |
139 |
|
} |
140 |
|
|
190 |
|
if (tp->data != NULL && tbl->freed != NULL) |
191 |
|
(*tbl->freed)(tp->data); |
192 |
|
} |
193 |
< |
free((MEM_PTR)tbl->tabl); |
193 |
> |
free((void *)tbl->tabl); |
194 |
|
tbl->tabl = NULL; |
195 |
|
tbl->tsiz = 0; |
196 |
|
tbl->ndel = 0; |