5 int main(int argc, char *argv[])
11 printf("usage:\n%s <carthw.cfg> <carthw.c>\n", argv[0]);
15 fi = fopen(argv[1], "r");
16 fo = fopen(argv[2], "w");
17 if (fi == NULL || fo == NULL) {
18 printf("fopen failed\n");
22 fprintf(fo, "/* generated by %s, do not modify */\n", argv[0]);
23 fprintf(fo, "static const char builtin_carthw_cfg[] =\n");
25 while ((fgets(buf, sizeof(buf), fi)))
28 char *d = bufd, *p = buf;
31 while (*p && isspace(*p))
34 if (*p == 0 || *p == '#')
37 /* section names not needed */
41 for (; *p != 0; p++) {
42 if (!quote && isspace(*p))
53 fprintf(fo, " \"%s\\n\"\n", bufd);