0a1,2
> #ifndef _UTIL_H
> #define _UTIL_H
2,5c4,6
< extern char	*util_strip_whitespace(char *instr);
< extern FILE	*util_discard_header(FILE *fp, char *fname, char *headstr);
< extern char	*util_strip_label(FILE *fp, char *key);
< extern char	*util_to_lower(char *s);
---
> #include <stdio.h>
> #include <string.h>
> #include <ctype.h>
6a8,108
> //#include "list.h"
> #include "defs.h"
> 
> /*extern*/ char	*util_strip_whitespace(char *instr);
> /*extern*/ FILE	*util_discard_header(FILE *fp, char *fname, char *headstr);
> /*extern*/ char	*util_strip_label(FILE *fp, char *key);
> /*extern*/ char	*util_to_lower(char *s);
> 
> /*
> extern inline char* util_strip_whitespace(char* instr) {
> 	int	i, count;
> 	char	outstr[255];
> 
> 	memset(outstr, '\0', sizeof(outstr));
> 	count = 0;
> 	for(i = 0;i < (int)(strlen(instr));i++) {
> 		if (instr[i] == '*')
> 		{
> 			outstr[count] = '\0';
> 
>             // copy updated local data back to parameter address
> 			strcpy(instr, outstr);
> 
> 			return instr;
> 		}
> 		if (instr[i] != ' ' && instr[i] != '\n' && instr[i] != '\t')
> 		{
> 			outstr[count] = instr[i];
> 			count++;
> 		}
> 	}
> 	outstr[count] = '\0';
> 
>     // copy updated local data back to parameter address
>     strcpy(instr, outstr);
> 
> 	return instr;
> }
> 
> // converts argument buffer to lower case and returns pointer to it
> extern inline char* util_to_lower(char* s)
> {
>     int i;
> 	char outstr[255];
> 
> 	s = (char*) util_strip_whitespace(s);
> 	memset(outstr, '\0', sizeof(outstr));
> 	for(i = 0;i < (int)strlen(s);i++)
> 	{
> 		outstr[i] = tolower(s[i]);
> 	}
>     // copy updated local data back to parameter address
> 	strcpy(s, outstr);
> 
> 	return s;
> }
> 
> extern inline char*  util_strip_label(FILE* fp, char* key) {
> 	int	c, i;
> 	char	instr[255], *ptr;
> 
> 	ptr = NULL;
> 	while (ptr == NULL)
> 	{
> 		c = (int)fgets(instr, sizeof(instr), fp);
> 		ptr = strstr(instr, key);
> 		if (feof(fp)) {
> 			return(ptr);
> 		}
> 	}
> 	ptr += strlen(key);
> 	ptr += strspn(ptr, " \t");
> 	if (strchr(ptr, '\n')) {
> 		*(strchr(ptr, '\n')) = '\0';
> 	}
>     // copy updated local data back to parameter address
> 	strcpy(key, ptr);
> 	return(util_strip_whitespace(key));
> }
> 
> extern inline FILE* util_discard_header(FILE *fp, char *fname, char *headstr) {
> 	int	c;
> 	char	instr[255];
> 
> 	sprintf(headstr, "%s", util_to_lower(headstr));
> 	c = (int)fgets(instr, sizeof(instr), fp);
> 	sprintf(instr, "%s", util_to_lower(instr));
> 	while (!strstr(instr, headstr)) {
> 		c = (int)fgets(instr, sizeof(instr), fp);
> 		sprintf(instr, "%s", util_to_lower(instr));
> 		if (feof(fp)) {
> 			fclose(fp);
> 			printf("\n\nERROR: util_discard_header(): Invalid header");
> 			printf("\n\tFilename: ..... %s\n\n", fname);
> 			exit(-2);
> 		}
> 	}
> 	return(fp);
> }
> */
> #endif
