more openssl 1.1 support stuff
[rofl0r-ixchat.git] / src / make-te.c
blobed87df3d652428c560e67889e65fa0aa82e70fdb
1 #include <stdio.h>
2 #include <string.h>
3 #include <stdlib.h>
5 int main()
7 char name[512];
8 char num[512];
9 char help[512];
10 char def[512];
11 char args[512];
12 char buf[512];
13 char *defines[512];
14 int i = 0, max;
16 printf("/* this file is auto generated, edit textevents.in instead! */\n\nconst struct text_event te[] = {\n");
17 while(fgets(name, sizeof(name), stdin))
19 name[strlen(name)-1] = 0;
20 fgets(num, sizeof(num), stdin);
21 num[strlen(num)-1] = 0;
22 fgets(help, sizeof(help), stdin);
23 help[strlen(help)-1] = 0;
24 fgets(def, sizeof(def), stdin);
25 def[strlen(def)-1] = 0;
26 fgets(args, sizeof(args), stdin);
27 args[strlen(args)-1] = 0;
28 fgets(buf, sizeof(buf), stdin);
30 if (args[0] == 'n')
31 printf("\n{\"%s\", %s, %d, \n\"%s\"},\n",
32 name, help, atoi(args+1) | 128, def);
33 else
34 printf("\n{\"%s\", %s, %d, \nN_(\"%s\")},\n",
35 name, help, atoi(args), def);
36 defines[i] = strdup (num);
37 i++;
40 printf("};\n");
42 fprintf(stderr, "/* this file is auto generated, edit textevents.in instead! */\n\nenum\n{\n");
43 max = i;
44 i = 0;
45 while (i < max)
47 if (i + 1 < max)
49 fprintf(stderr, "\t%s,\t\t%s,\n", defines[i], defines[i+1]);
50 i++;
51 } else
52 fprintf(stderr, "\t%s,\n", defines[i]);
53 i++;
55 fprintf(stderr, "\tNUM_XP\n};\n");
57 return 0;