163 |
|
if (skipwhite && isspace(c)) |
164 |
|
continue; |
165 |
|
skipwhite = 0; |
166 |
< |
if (cp-buf < IDF_MAXLINE-1) |
166 |
> |
if (cp-buf < IDF_MAXARGL-1) |
167 |
|
*cp++ = c; |
168 |
|
} |
169 |
|
if (trim) |
203 |
|
IDF_PARAMETER * |
204 |
|
idf_readparam(IDF_LOADED *idf, FILE *fp) |
205 |
|
{ |
206 |
< |
char abuf[IDF_MAXLINE], cbuf[IDF_MAXLINE]; |
206 |
> |
char abuf[IDF_MAXARGL], cbuf[IDF_MAXLINE]; |
207 |
|
int delim; |
208 |
|
IDF_PARAMETER *pnew; |
209 |
|
|
221 |
|
return(pnew); |
222 |
|
} |
223 |
|
|
224 |
+ |
/* Upper-case string hashing function */ |
225 |
+ |
static unsigned long |
226 |
+ |
strcasehash(const char *s) |
227 |
+ |
{ |
228 |
+ |
char strup[IDF_MAXARGL]; |
229 |
+ |
char *cdst = strup; |
230 |
+ |
|
231 |
+ |
while ((*cdst++ = toupper(*s++))) |
232 |
+ |
if (cdst >= strup+(sizeof(strup)-1)) { |
233 |
+ |
*cdst = '\0'; |
234 |
+ |
break; |
235 |
+ |
} |
236 |
+ |
return(lu_shash(strup)); |
237 |
+ |
} |
238 |
+ |
|
239 |
|
/* Initialize an IDF struct */ |
240 |
|
IDF_LOADED * |
241 |
|
idf_create(const char *hdrcomm) |
244 |
|
|
245 |
|
if (idf == NULL) |
246 |
|
return(NULL); |
247 |
< |
idf->ptab.hashf = &lu_shash; |
248 |
< |
idf->ptab.keycmp = &strcmp; |
247 |
> |
idf->ptab.hashf = &strcasehash; |
248 |
> |
idf->ptab.keycmp = &strcasecmp; |
249 |
|
idf->ptab.freek = &free; |
250 |
|
lu_init(&idf->ptab, 200); |
251 |
|
if (hdrcomm != NULL && *hdrcomm) { |