4 /* codes for pol_usefile */
6 #define P_USE_STR 1 /* use string as input source */
7 #define P_USE_FILE 2 /* use file as input source */
9 /* codes for pol_int and pol_float */
10 /* if in reject catagory, get new number from terminal */
12 #define P_FLTINT 1 /* get a real or integer number */
13 #define P_BFLTINT 2 /* get a real or integer number, clip against bounds */
14 #define P_CBFLTINT 3 /* get real or int, reject if outside bounds */
16 #define P_FLT 4 /* get a real number */
17 #define P_BFLT 5 /* get a real, clip against bounds */
18 #define P_CBFLT 6 /* get a floating, reject if outside bounds */
20 #define P_INT 7 /* get a integer number */
21 #define P_BINT 8 /* get a integer, clip against bounds */
22 #define P_CBINT 9 /* get a integer, reject if outside bounds */
27 #define MAXTOK 200 /* maximum length of a token */
30 #define MAXSKIPWORD 20
31 #define MAXSKIPCHAR 20
33 #define MIN_INT -32768
38 #define TT_STRING 1 /* string token */
39 #define TT_INT 2 /* integer token */
40 #define TT_REAL 3 /* floating point token */
41 #define TT_ALPHA 4 /* alphabetic token */
42 #define TT_ALPNUM 5 /* alphanumeric token */
44 #define TT_SPECLCHAR 7
46 #define TT_EOF 8 /* end of file reached */
47 #define TT_ERROR 9 /* error in token, caused by call to wrong */
48 /* type of token reader */
49 #define TT_BLANK 10 /* white space token. pol_tok() skips these */
50 #define TT_USERTOK 11 /* user defined token */
58 typedef struct symlist SYMBOL;
61 int ready; /* TRUE if token is ready */
62 char tokstr[MAXTOK+1]; /* token string */
63 int type; /* type of token 'TT_' */
64 int code; /* holds code for user defined tokens */
65 double fnum; /* real value of token */
66 int inum; /* integer value of token */
69 typedef struct token_st TOKEN;
73 void pol_skpword(char *w);
74 void pol_skpchar(char *s);
75 int pol_install(char *str, int code);
76 int pol_word(char *search, int nlet);
77 int pol_usertok(char *str, int *code);
78 int pol_string(char *str);
79 int pol_integer(int *n, int typecode, int boundcode, int bb1, int bb2);
80 int pol_float(double *n, double typecode, double boundcode, double bb1, double bb2);
82 void pol_reader(void);
83 void gettext(char *str, int lim);
84 void pol_usefile(int source, char *fn);
85 void pol_closefile(void);
86 int pol_lookchar(void);
88 void pol_ungetch(int c);
89 int get_inputline(FILE *fp);
90 void set_inputline(char *line);