| 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 <string.h> | 
| 13 | + |  | 
| 14 |  | #include "lookup.h" | 
| 15 |  |  | 
| 16 |  | #ifdef  NOSTRUCTASS | 
| 17 | < | #define  copystruct(d,s)        bcopy((char *)(s),(char *)(d),sizeof(*(d))) | 
| 17 | > | #define  copystruct(d,s)        memcpy((void *)(d),(void *)(s),sizeof(*(d))) | 
| 18 |  | #else | 
| 19 |  | #define  copystruct(d,s)        (*(d) = *(s)) | 
| 20 |  | #endif | 
| 21 |  |  | 
| 20 | – | #define MEM_PTR         char * | 
| 22 |  |  | 
| 22 | – | extern MEM_PTR  calloc(); | 
| 23 | – |  | 
| 24 | – |  | 
| 23 |  | int | 
| 24 |  | lu_init(tbl, nel)               /* initialize tbl for at least nel elements */ | 
| 25 |  | register LUTAB  *tbl; | 
| 136 |  | copystruct(lu_find(tbl,le[ndx].key), &le[ndx]); | 
| 137 |  | else if (tbl->freek != NULL) | 
| 138 |  | (*tbl->freek)(le[ndx].key); | 
| 139 | < | free((MEM_PTR)le); | 
| 139 | > | free((void *)le); | 
| 140 |  | goto tryagain;                  /* should happen only once! */ | 
| 141 |  | } | 
| 142 |  |  | 
| 192 |  | if (tp->data != NULL && tbl->freed != NULL) | 
| 193 |  | (*tbl->freed)(tp->data); | 
| 194 |  | } | 
| 195 | < | free((MEM_PTR)tbl->tabl); | 
| 195 | > | free((void *)tbl->tabl); | 
| 196 |  | tbl->tabl = NULL; | 
| 197 |  | tbl->tsiz = 0; | 
| 198 |  | tbl->ndel = 0; |