maketab.c (107806) | maketab.c (170331) |
---|---|
1/**************************************************************** 2Copyright (C) Lucent Technologies 1997 3All Rights Reserved 4 5Permission to use, copy, modify, and distribute this software and 6its documentation for any purpose and without fee is hereby 7granted, provided that the above copyright notice appear in all 8copies and that both that the copyright notice and this --- 121 unchanged lines hidden (view full) --- 130 } 131 printf("static char *printname[%d] = {\n", SIZE); 132 i = 0; 133 while (fgets(buf, sizeof buf, fp) != NULL) { 134 n = sscanf(buf, "%1c %s %s %d", &c, def, name, &tok); 135 if (c != '#' || (n != 4 && strcmp(def,"define") != 0)) /* not a valid #define */ 136 continue; 137 if (tok < FIRSTTOKEN || tok > LASTTOKEN) { | 1/**************************************************************** 2Copyright (C) Lucent Technologies 1997 3All Rights Reserved 4 5Permission to use, copy, modify, and distribute this software and 6its documentation for any purpose and without fee is hereby 7granted, provided that the above copyright notice appear in all 8copies and that both that the copyright notice and this --- 121 unchanged lines hidden (view full) --- 130 } 131 printf("static char *printname[%d] = {\n", SIZE); 132 i = 0; 133 while (fgets(buf, sizeof buf, fp) != NULL) { 134 n = sscanf(buf, "%1c %s %s %d", &c, def, name, &tok); 135 if (c != '#' || (n != 4 && strcmp(def,"define") != 0)) /* not a valid #define */ 136 continue; 137 if (tok < FIRSTTOKEN || tok > LASTTOKEN) { |
138 fprintf(stderr, "maketab funny token %d %s ignored\n", tok, buf); | 138 /* fprintf(stderr, "maketab funny token %d %s ignored\n", tok, buf); */ |
139 continue; 140 } 141 names[tok-FIRSTTOKEN] = (char *) malloc(strlen(name)+1); 142 strcpy(names[tok-FIRSTTOKEN], name); 143 printf("\t(char *) \"%s\",\t/* %d */\n", name, tok); 144 i++; 145 } 146 printf("};\n\n"); --- 22 unchanged lines hidden --- | 139 continue; 140 } 141 names[tok-FIRSTTOKEN] = (char *) malloc(strlen(name)+1); 142 strcpy(names[tok-FIRSTTOKEN], name); 143 printf("\t(char *) \"%s\",\t/* %d */\n", name, tok); 144 i++; 145 } 146 printf("};\n\n"); --- 22 unchanged lines hidden --- |