/* Tokengen header file -- for reading tokens from files with comments. Note, you must include and "fields.h" before including "tg.h" */ typedef void TokenGen; extern TokenGen *new_tokengen(char *); /* Make a new TokenGen struct. Returns NULL on a bad filename */ extern char *tokengen_get_token(TokenGen *); /* Get a new token. Returns NULL at EOF */ /* deallocates the TokenGen and its associated inputstruct. */ extern void free_tokengen(TokenGen *tg) ; /* gets the next token, converts it to an int and returns it. If tg is at EOF, then it prints out eofstring and exits. If the next token is not an integer, then it prints out nointstring and exits. It's ok to make eofstring and nointstring NULL -- then nothing will be printed out. */ extern int tokengen_get_int(TokenGen *tg, char *eofstring, char *nointstring); /* Works just like tokengen_get_int(), only it returns a float instead. */ extern float tokengen_get_float(TokenGen *tg, char *eofstring, char *nofloatstring); /* Works just like tokengen_get_int(), only it returns a double instead. */ extern double tokengen_get_double(TokenGen *tg, char *eofstring, char *nodoublestring); /* Works just like tokengen_get_int, only it fills in fp with the int, and then returns: 1 if successful, 0 if the next token could not be converted to a int, and -1 if EOF was hit. */ extern int tokengen_get_int2(TokenGen *tg, int *fp); /* Works just like tokengen_get_int2, only for floats instead of ints. */ extern float tokengen_get_float2(TokenGen *tg, float *fp); /* Works just like tokengen_get_int2, only for doubles instead of ints. */ extern double tokengen_get_double2(TokenGen *tg, double *dp);