00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #define USE_HCONFIG
00023
00024 #include "proj.h"
00025 #include "malloc.h"
00026
00027 #undef MAXNAMELEN
00028 #define MAXNAMELEN 100
00029
00030 typedef struct _name_ *name;
00031
00032 struct _name_
00033 {
00034 name next;
00035 name previous;
00036 name next_alpha;
00037 name previous_alpha;
00038 int namelen;
00039 int kwlen;
00040 char kwname[MAXNAMELEN];
00041 char name_uc[MAXNAMELEN];
00042 char name_lc[MAXNAMELEN];
00043 char name_ic[MAXNAMELEN];
00044 };
00045
00046 struct _name_root_
00047 {
00048 name first;
00049 name last;
00050 };
00051
00052 struct _name_alpha_
00053 {
00054 name ign1;
00055 name ign2;
00056 name first;
00057 name last;
00058 };
00059
00060 static FILE *in;
00061 static FILE *out;
00062 static char prefix[32];
00063 static char postfix[32];
00064 static char storage[32];
00065 static const char *const xspaces[]
00066 =
00067 {
00068 "",
00069 " ",
00070 " ",
00071 " ",
00072 " ",
00073 " ",
00074 " ",
00075 " ",
00076 "\t",
00077 "\t ",
00078 "\t ",
00079 "\t ",
00080 "\t ",
00081 "\t ",
00082 "\t ",
00083 "\t ",
00084 "\t\t",
00085 "\t\t ",
00086 "\t\t ",
00087 "\t\t ",
00088 "\t\t ",
00089 "\t\t ",
00090 "\t\t ",
00091 "\t\t ",
00092 "\t\t\t",
00093 "\t\t\t ",
00094 "\t\t\t ",
00095 "\t\t\t ",
00096 "\t\t\t ",
00097 "\t\t\t ",
00098 "\t\t\t ",
00099 "\t\t\t ",
00100 "\t\t\t\t",
00101 "\t\t\t\t ",
00102 "\t\t\t\t ",
00103 "\t\t\t\t ",
00104 "\t\t\t\t ",
00105 "\t\t\t\t ",
00106 "\t\t\t\t ",
00107 "\t\t\t\t ",
00108 "\t\t\t\t\t",
00109 "\t\t\t\t\t ",
00110 "\t\t\t\t\t ",
00111 "\t\t\t\t\t ",
00112 "\t\t\t\t\t ",
00113 "\t\t\t\t\t ",
00114 "\t\t\t\t\t ",
00115 "\t\t\t\t\t ",
00116 "\t\t\t\t\t\t",
00117 "\t\t\t\t\t\t ",
00118 "\t\t\t\t\t\t ",
00119 "\t\t\t\t\t\t ",
00120 "\t\t\t\t\t\t ",
00121 "\t\t\t\t\t\t ",
00122 "\t\t\t\t\t\t ",
00123 "\t\t\t\t\t\t ",
00124 "\t\t\t\t\t\t\t",
00125 "\t\t\t\t\t\t\t ",
00126 "\t\t\t\t\t\t\t ",
00127 "\t\t\t\t\t\t\t ",
00128 "\t\t\t\t\t\t\t ",
00129 "\t\t\t\t\t\t\t ",
00130 "\t\t\t\t\t\t\t ",
00131 "\t\t\t\t\t\t\t ",
00132 "\t\t\t\t\t\t\t\t",
00133 "\t\t\t\t\t\t\t\t ",
00134 "\t\t\t\t\t\t\t\t ",
00135 "\t\t\t\t\t\t\t\t ",
00136 "\t\t\t\t\t\t\t\t ",
00137 "\t\t\t\t\t\t\t\t ",
00138 "\t\t\t\t\t\t\t\t ",
00139 "\t\t\t\t\t\t\t\t ",
00140 "\t\t\t\t\t\t\t\t\t",
00141 "\t\t\t\t\t\t\t\t\t ",
00142 "\t\t\t\t\t\t\t\t\t ",
00143 "\t\t\t\t\t\t\t\t\t ",
00144 "\t\t\t\t\t\t\t\t\t ",
00145 "\t\t\t\t\t\t\t\t\t ",
00146 "\t\t\t\t\t\t\t\t\t ",
00147 "\t\t\t\t\t\t\t\t\t ",
00148 "\t\t\t\t\t\t\t\t\t\t",
00149 "\t\t\t\t\t\t\t\t\t\t ",
00150 "\t\t\t\t\t\t\t\t\t\t ",
00151 "\t\t\t\t\t\t\t\t\t\t ",
00152 "\t\t\t\t\t\t\t\t\t\t ",
00153 "\t\t\t\t\t\t\t\t\t\t ",
00154 "\t\t\t\t\t\t\t\t\t\t ",
00155 "\t\t\t\t\t\t\t\t\t\t ",
00156 "\t\t\t\t\t\t\t\t\t\t\t",
00157 "\t\t\t\t\t\t\t\t\t\t\t ",
00158 "\t\t\t\t\t\t\t\t\t\t\t ",
00159 "\t\t\t\t\t\t\t\t\t\t\t ",
00160 "\t\t\t\t\t\t\t\t\t\t\t ",
00161 "\t\t\t\t\t\t\t\t\t\t\t ",
00162 "\t\t\t\t\t\t\t\t\t\t\t ",
00163 "\t\t\t\t\t\t\t\t\t\t\t ",
00164 "\t\t\t\t\t\t\t\t\t\t\t\t",
00165 "\t\t\t\t\t\t\t\t\t\t\t\t ",
00166 "\t\t\t\t\t\t\t\t\t\t\t\t ",
00167 "\t\t\t\t\t\t\t\t\t\t\t\t ",
00168 "\t\t\t\t\t\t\t\t\t\t\t\t ",
00169 "\t\t\t\t\t\t\t\t\t\t\t\t ",
00170 "\t\t\t\t\t\t\t\t\t\t\t\t ",
00171 "\t\t\t\t\t\t\t\t\t\t\t\t ",
00172 "\t\t\t\t\t\t\t\t\t\t\t\t\t",
00173 "\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00174 "\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00175 "\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00176 "\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00177 "\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00178 "\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00179 "\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00180 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t",
00181 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00182 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00183 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00184 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00185 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00186 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00187 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00188 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t",
00189 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00190 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00191 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00192 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00193 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00194 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00195 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00196 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t",
00197 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00198 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00199 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00200 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00201 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00202 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00203 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00204 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t",
00205 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00206 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00207 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00208 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00209 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00210 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00211 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00212 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t",
00213 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00214 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00215 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00216 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00217 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00218 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00219 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00220 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t",
00221 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00222 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00223 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00224 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00225 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00226 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00227 "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ",
00228 };
00229
00230 void testname (bool nested, int indent, name first, name last);
00231 void testnames (bool nested, int indent, int len, name first, name last);
00232
00233 int
00234 main (int argc, char **argv)
00235 {
00236 char buf[MAXNAMELEN];
00237 char last_buf[MAXNAMELEN];
00238 char kwname[MAXNAMELEN];
00239 char routine[32];
00240 char type[32];
00241 int i;
00242 int count;
00243 int len;
00244 struct _name_root_ names[200];
00245 struct _name_alpha_ names_alpha;
00246 name n;
00247 name newname;
00248 char *input_name;
00249 char *output_name;
00250 char *include_name;
00251 FILE *incl;
00252 int fixlengths;
00253 int total_length;
00254 int do_name;
00255 int do_names;
00256 int cc;
00257 bool do_exit = FALSE;
00258
00259 last_buf[0] = '\0';
00260
00261 for (i = 0; ((size_t) i) < ARRAY_SIZE (names); ++i)
00262 {
00263 names[i].first = (name) &names[i];
00264 names[i].last = (name) &names[i];
00265 }
00266 names_alpha.first = (name) &names_alpha;
00267 names_alpha.last = (name) &names_alpha;
00268
00269 if (argc != 4)
00270 {
00271 fprintf (stderr, "Command form: fini input output-code output-include\n");
00272 return (1);
00273 }
00274
00275 input_name = argv[1];
00276 output_name = argv[2];
00277 include_name = argv[3];
00278
00279 in = fopen (input_name, "r");
00280 if (in == NULL)
00281 {
00282 fprintf (stderr, "Cannot open \"%s\"\n", input_name);
00283 return (1);
00284 }
00285 out = fopen (output_name, "w");
00286 if (out == NULL)
00287 {
00288 fclose (in);
00289 fprintf (stderr, "Cannot open \"%s\"\n", output_name);
00290 return (1);
00291 }
00292 incl = fopen (include_name, "w");
00293 if (incl == NULL)
00294 {
00295 fclose (in);
00296 fprintf (stderr, "Cannot open \"%s\"\n", include_name);
00297 return (1);
00298 }
00299
00300
00301
00302
00303 for (;;)
00304 {
00305 cc = getc (in);
00306 if (cc == '{')
00307 {
00308 while (((cc = getc (in)) != '}') && (cc != EOF))
00309 ;
00310 }
00311 else if (cc != EOF)
00312 {
00313 while (((cc = getc (in)) != EOF) && (! ISALNUM (cc)))
00314 ;
00315 ungetc (cc, in);
00316 break;
00317 }
00318 else
00319 {
00320 assert ("EOF too soon!" == NULL);
00321 return (1);
00322 }
00323 }
00324
00325 fscanf (in, "%s %s %s %s %s %d %d", prefix, postfix, storage, type, routine,
00326 &do_name, &do_names);
00327
00328 if (storage[0] == '\0')
00329 storage[1] = '\0';
00330 else
00331
00332 {
00333 if (storage[2] == '\0')
00334 storage[1] = '\0';
00335 else
00336 storage[strlen (storage) - 1] = ' ';
00337 }
00338
00339 if (postfix[0] == '\0')
00340 postfix[1] = '\0';
00341 else
00342
00343 postfix[strlen (postfix) - 1] = '\0';
00344
00345 for (i = 1; storage[i] != '\0'; ++i)
00346 storage[i - 1] = storage[i];
00347 storage[i - 1] = '\0';
00348
00349 for (i = 1; postfix[i] != '\0'; ++i)
00350 postfix[i - 1] = postfix[i];
00351 postfix[i - 1] = '\0';
00352
00353 fixlengths = strlen (prefix) + strlen (postfix);
00354
00355 while (TRUE)
00356 {
00357 count = fscanf (in, "%s %s", buf, kwname);
00358 if (count == EOF)
00359 break;
00360 len = strlen (buf);
00361 if (len == 0)
00362 continue;
00363 if (buf[0] == ';')
00364 continue;
00365 for (i = strlen (buf) - 1; i > 0; --i)
00366 cc = buf[i];
00367
00368
00369
00370 newname = (name) xmalloc (sizeof (*newname));
00371 newname->namelen = strlen (buf);
00372 newname->kwlen = strlen (kwname);
00373 total_length = newname->kwlen + fixlengths;
00374 if (total_length >= 32)
00375 {
00376 fprintf (stderr, "%s: %s%s%s is 31+%d chars long\n", input_name,
00377 prefix, kwname, postfix, total_length - 31);
00378 do_exit = TRUE;
00379 }
00380 strcpy (newname->kwname, kwname);
00381 for (i = 0; i < newname->namelen; ++i)
00382 {
00383 cc = buf[i];
00384 newname->name_uc[i] = TOUPPER (cc);
00385 newname->name_lc[i] = TOLOWER (cc);
00386 newname->name_ic[i] = cc;
00387 }
00388 newname->name_uc[i] = newname->name_lc[i] = newname->name_ic[i] = '\0';
00389
00390
00391
00392 if ((last_buf[0] != '\0')
00393 && (strcmp (last_buf, newname->name_uc) >= 0))
00394 {
00395 fprintf (stderr, "%s: \"%s\" precedes \"%s\"\n", input_name,
00396 last_buf, newname->name_uc);
00397 do_exit = TRUE;
00398 }
00399 strcpy (last_buf, newname->name_uc);
00400
00401
00402
00403
00404
00405 n = names_alpha.last;
00406 newname->next_alpha = n->next_alpha;
00407 newname->previous_alpha = n;
00408 n->next_alpha->previous_alpha = newname;
00409 n->next_alpha = newname;
00410
00411
00412
00413 n = (name) &names[len];
00414 while ((n->next != (name) &names[len])
00415 && (strcmp (buf, n->next->name_uc) > 0))
00416 n = n->next;
00417 if (strcmp (buf, n->next->name_uc) == 0)
00418 {
00419 fprintf (stderr, "%s: extraneous \"%s\"\n", input_name, buf);
00420 do_exit = TRUE;
00421 }
00422 newname->next = n->next;
00423 newname->previous = n;
00424 n->next->previous = newname;
00425 n->next = newname;
00426 }
00427
00428 #if 0
00429 for (len = 0; len < ARRAY_SIZE (name); ++len)
00430 {
00431 if (names[len].first == (name) &names[len])
00432 continue;
00433 printf ("Length %d:\n", len);
00434 for (n = names[len].first; n != (name) &names[len]; n = n->next)
00435 printf (" %s %s %s\n", n->name_uc, n->name_lc, n->name_ic);
00436 }
00437 #endif
00438
00439 if (do_exit)
00440 return (1);
00441
00442
00443
00444 for (n = names_alpha.first; n != (name) &names_alpha; n = n->next_alpha)
00445 {
00446 fprintf (incl, "#define %sl%s%s %d\n", prefix, n->kwname, postfix,
00447 n->namelen);
00448 }
00449
00450 fprintf (incl,
00451 "\
00452 \n\
00453 enum %s_\n\
00454 {\n\
00455 %sNone%s,\n\
00456 ",
00457 type, prefix, postfix);
00458
00459 for (n = names_alpha.first; n != (name) &names_alpha; n = n->next_alpha)
00460 {
00461 fprintf (incl,
00462 "\
00463 %s%s%s,\n\
00464 ",
00465 prefix, n->kwname, postfix);
00466 }
00467
00468 fprintf (incl,
00469 "\
00470 %s%s\n\
00471 };\n\
00472 typedef enum %s_ %s;\n\
00473 ",
00474 prefix, postfix, type, type);
00475
00476
00477
00478 fprintf (out,
00479 "\
00480 %s%s\n\
00481 %s (ffelexToken t)\n\
00482 %c\n\
00483 char *p;\n\
00484 int c;\n\
00485 \n\
00486 p = ffelex_token_text (t);\n\
00487 \n\
00488 ",
00489 storage, type, routine, '{');
00490
00491 if (do_name)
00492 {
00493 if (do_names)
00494 fprintf (out,
00495 "\
00496 if (ffelex_token_type (t) == FFELEX_typeNAME)\n\
00497 {\n\
00498 switch (ffelex_token_length (t))\n\
00499 \t{\n\
00500 "
00501 );
00502 else
00503 fprintf (out,
00504 "\
00505 assert (ffelex_token_type (t) == FFELEX_typeNAME);\n\
00506 \n\
00507 switch (ffelex_token_length (t))\n\
00508 {\n\
00509 "
00510 );
00511
00512
00513
00514 for (len = 0; ((size_t) len) < ARRAY_SIZE (names); ++len)
00515 {
00516 if (names[len].first != (name) &names[len])
00517 {
00518 if (do_names)
00519 fprintf (out,
00520 "\
00521 \tcase %d:\n\
00522 ",
00523 len);
00524 else
00525 fprintf (out,
00526 "\
00527 case %d:\n\
00528 ",
00529 len);
00530 testname (FALSE, do_names ? 10 : 6, names[len].first, names[len].last);
00531 if (do_names)
00532 fprintf (out,
00533 "\
00534 \t break;\n\
00535 "
00536 );
00537 else
00538 fprintf (out,
00539 "\
00540 break;\n\
00541 "
00542 );
00543 }
00544 }
00545
00546 if (do_names)
00547 fprintf (out,
00548 "\
00549 \t}\n\
00550 return %sNone%s;\n\
00551 }\n\
00552 \n\
00553 ",
00554 prefix, postfix);
00555 else
00556 fprintf (out,
00557 "\
00558 }\n\
00559 \n\
00560 return %sNone%s;\n\
00561 }\n\
00562 ",
00563 prefix, postfix);
00564 }
00565
00566 if (do_names)
00567 {
00568 fputs ("\
00569 assert (ffelex_token_type (t) == FFELEX_typeNAMES);\n\
00570 \n\
00571 switch (ffelex_token_length (t))\n\
00572 {\n\
00573 default:\n\
00574 ",
00575 out);
00576
00577
00578
00579 for (len = ARRAY_SIZE (names) - 1;
00580 names[len].first == (name) &names[len];
00581 --len)
00582 ;
00583
00584
00585
00586 if (len > 0)
00587 {
00588 for (; len != 0; --len)
00589 {
00590 fprintf (out,
00591 "\
00592 case %d:\n\
00593 ",
00594 len);
00595 if (names[len].first != (name) &names[len])
00596 testnames (FALSE, 6, len, names[len].first, names[len].last);
00597 }
00598 if (names[1].first == (name) &names[1])
00599 fprintf (out,
00600 "\
00601 ;\n\
00602 "
00603 );
00604
00605 }
00606
00607 fprintf (out,
00608 "\
00609 }\n\
00610 \n\
00611 return %sNone%s;\n\
00612 }\n\
00613 ",
00614 prefix, postfix);
00615 }
00616
00617 if (out != stdout)
00618 fclose (out);
00619 if (incl != stdout)
00620 fclose (incl);
00621 if (in != stdin)
00622 fclose (in);
00623 return (0);
00624 }
00625
00626 void
00627 testname (bool nested, int indent, name first, name last)
00628 {
00629 name n;
00630 name nhalf;
00631 int num;
00632 int numhalf;
00633
00634 assert (!nested || indent >= 2);
00635 assert (((size_t) indent) + 4 < ARRAY_SIZE (xspaces));
00636
00637 num = 0;
00638 numhalf = 0;
00639 for (n = first, nhalf = first; n != last->next; n = n->next)
00640 {
00641 if ((++num & 1) == 0)
00642 {
00643 nhalf = nhalf->next;
00644 ++numhalf;
00645 }
00646 }
00647
00648 if (nested)
00649 fprintf (out,
00650 "\
00651 %s{\n\
00652 ",
00653 xspaces[indent - 2]);
00654
00655 fprintf (out,
00656 "\
00657 %sif ((c = ffesrc_strcmp_2c (ffe_case_match (), p, \"%s\", \"%s\", \"%s\")) == 0)\n\
00658 %sreturn %s%s%s;\n\
00659 ",
00660 xspaces[indent], nhalf->name_uc, nhalf->name_lc, nhalf->name_ic,
00661 xspaces[indent + 2], prefix, nhalf->kwname, postfix);
00662
00663 if (num != 1)
00664 {
00665 fprintf (out,
00666 "\
00667 %selse if (c < 0)\n\
00668 ",
00669 xspaces[indent]);
00670
00671 if (numhalf == 0)
00672 fprintf (out,
00673 "\
00674 %s;\n\
00675 ",
00676 xspaces[indent + 2]);
00677 else
00678 testname (TRUE, indent + 4, first, nhalf->previous);
00679
00680 if (num - numhalf > 1)
00681 {
00682 fprintf (out,
00683 "\
00684 %selse\n\
00685 ",
00686 xspaces[indent]);
00687
00688 testname (TRUE, indent + 4, nhalf->next, last);
00689 }
00690 }
00691
00692 if (nested)
00693 fprintf (out,
00694 "\
00695 %s}\n\
00696 ",
00697 xspaces[indent - 2]);
00698 }
00699
00700 void
00701 testnames (bool nested, int indent, int len, name first, name last)
00702 {
00703 name n;
00704 name nhalf;
00705 int num;
00706 int numhalf;
00707
00708 assert (!nested || indent >= 2);
00709 assert (((size_t) indent) + 4 < ARRAY_SIZE (xspaces));
00710
00711 num = 0;
00712 numhalf = 0;
00713 for (n = first, nhalf = first; n != last->next; n = n->next)
00714 {
00715 if ((++num & 1) == 0)
00716 {
00717 nhalf = nhalf->next;
00718 ++numhalf;
00719 }
00720 }
00721
00722 if (nested)
00723 fprintf (out,
00724 "\
00725 %s{\n\
00726 ",
00727 xspaces[indent - 2]);
00728
00729 fprintf (out,
00730 "\
00731 %sif ((c = ffesrc_strncmp_2c (ffe_case_match (), p, \"%s\", \"%s\", \"%s\", %d)) == 0)\n\
00732 %sreturn %s%s%s;\n\
00733 ",
00734 xspaces[indent], nhalf->name_uc, nhalf->name_lc, nhalf->name_ic,
00735 len, xspaces[indent + 2], prefix, nhalf->kwname, postfix);
00736
00737 if (num != 1)
00738 {
00739 fprintf (out,
00740 "\
00741 %selse if (c < 0)\n\
00742 ",
00743 xspaces[indent]);
00744
00745 if (numhalf == 0)
00746 fprintf (out,
00747 "\
00748 %s;\n\
00749 ",
00750 xspaces[indent + 2]);
00751 else
00752 testnames (TRUE, indent + 4, len, first, nhalf->previous);
00753
00754 if (num - numhalf > 1)
00755 {
00756 fprintf (out,
00757 "\
00758 %selse\n\
00759 ",
00760 xspaces[indent]);
00761
00762 testnames (TRUE, indent + 4, len, nhalf->next, last);
00763 }
00764 }
00765
00766 if (nested)
00767 fprintf (out,
00768 "\
00769 %s}\n\
00770 ",
00771 xspaces[indent - 2]);
00772 }