diff options
Diffstat (limited to 'Build/source/texk/web2c/web2c/makecpool.c')
-rw-r--r-- | Build/source/texk/web2c/web2c/makecpool.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/Build/source/texk/web2c/web2c/makecpool.c b/Build/source/texk/web2c/web2c/makecpool.c index 7f4ebebb0ed..434d87064ae 100644 --- a/Build/source/texk/web2c/web2c/makecpool.c +++ b/Build/source/texk/web2c/web2c/makecpool.c @@ -10,21 +10,19 @@ static const char __svn_version[] = int main(int argc, char *argv[]) { - char *filename; - char *headername; + char filename[20]; FILE *fh; char data[1024]; int is_metafont = 0; - int is_metapost = 0; int is_luatex = 0; - if (argc != 3) { + if (argc != 2) { fprintf(stderr, - "%s: need exactly two arguments (pool name and C header name).\n", + "%s: need exactly one argument (base name).\n", argv[0]); exit(EXIT_FAILURE); } - filename = argv[1]; - headername = argv[2]; + strcpy(filename, argv[1]); + strcat(filename, ".pool"); fh = fopen(filename, "r"); if (!fh) { fprintf(stderr, "%s: can't open %s for reading.\n", argv[0], filename); @@ -32,21 +30,19 @@ int main(int argc, char *argv[]) } if (strstr(filename, "luatex.pool") != NULL) is_luatex = 1; - else if (strstr(filename, "mp.pool") != NULL) - is_metapost = 1; else if (strstr(filename, "mf.pool") != NULL) is_metafont = 1; printf("/*\n" " * This file is auto-generated by makecpool.\n" - " * %s %s %s\n" + " * %s %s\n" " */\n" "\n" "#include <stdio.h>\n" "#include <string.h>\n" - "#include \"%s\"\n" + "#define EXTERN extern\n" + "#include \"%sd.h\"\n" "\n" - "static const char *poolfilearr[] = {\n", argv[0], filename, - headername, headername); + "static const char *poolfilearr[] = {\n", argv[0], argv[1], argv[1]); while (fgets(data, 1024, fh)) { int i; int len = strlen(data); @@ -86,7 +82,7 @@ int main(int argc, char *argv[]) else printf(" while (l-- > 0) strpool[poolptr++] = *s++;\n" " g = makestring();\n"); - if (is_metapost || is_metafont) + if (is_metafont) printf(" strref[g]= 127;\n"); printf(" }\n" " return g;\n" "}\n"); return EXIT_SUCCESS; |