14 static void GetAuxLine PROTO((FILE *)); /* forward */
15 static void GetAuxTok PROTO((FILE *)); /* forward */
27 while (endfile == 0) {
37 * Read the next line from the aux file, check the syntax, and
38 * perform the appropriate action.
48 if (thetok != FLOAT_TOK) {
49 Error("%s, line %d, floating point number must follow X_RANGE",
52 auxxrange = thefloatish;
57 if (thetok != FLOAT_TOK) {
58 Error("%s, line %d, floating point number must follow Y_RANGE",
61 auxyrange = thefloatish;
66 if (thetok != IDENTIFIER_TOK) {
67 Error("%s, line %d: identifier must follow ORDER",
71 if (thetok != INTEGER_TOK) {
72 Error("%s, line %d: identifier and integer must follow ORDER",
75 OrderFor(theident, theinteger);
80 if (thetok != IDENTIFIER_TOK) {
81 Error("%s, line %d: identifier must follow SHADE",
85 if (thetok != FLOAT_TOK) {
86 Error("%s, line %d: identifier and floating point number must follow SHADE",
89 ShadeFor(theident, thefloatish);
96 Error("%s, line %d: %s unexpected", auxfile, linenum,
97 TokenToString(thetok));
105 * Read the next token from the input and assign its value
106 * to the global variable "thetok". In the case of numbers,
107 * the corresponding value is also assigned to "thefloatish";
108 * in the case of identifiers it is assigned to "theident".
111 static void GetAuxTok(auxfp)
115 while (isspace(ch)) { /* skip whitespace */
116 if (ch == '\n') linenum++;
126 thetok = GetNumber(auxfp);
128 } else if (IsIdChar(ch)) { /* ch can't be a digit here */
130 if (!isupper((int)theident[0])) {
131 thetok = IDENTIFIER_TOK;
132 } else if (strcmp(theident, "X_RANGE") == 0) {
133 thetok = X_RANGE_TOK;
134 } else if (strcmp(theident, "Y_RANGE") == 0) {
135 thetok = Y_RANGE_TOK;
136 } else if (strcmp(theident, "ORDER") == 0) {
138 } else if (strcmp(theident, "SHADE") == 0) {
141 thetok = IDENTIFIER_TOK;
145 Error("%s, line %d: strange character (%c)", auxfile, linenum, ch);
155 fprintf(auxfp, "X_RANGE %.2f\n", xrange);
156 fprintf(auxfp, "Y_RANGE %.2f\n", yrange);
158 for (i = 0; i < nidents; i++) {
159 fprintf(auxfp, "ORDER %s %d\n", identtable[i]->name, i+1);
162 for (i = 0; i < nidents; i++) {
163 fprintf(auxfp, "SHADE %s %.2f\n", identtable[i]->name,
164 ShadeOf(identtable[i]->name));