84
86
if ((header[0] == 'I') && (header[1] == 'D') && (header[2] == 'R')) {
85
87
res_value = idr_counter++;
86
fprintf(output, "#define ");
87
fwrite(header, 1, 3, output);
88
fprintf(houtput, "#define ");
89
fwrite(header, 1, 3, houtput);
88
90
state = OUTPUT_LINE;
89
91
} else if ((header[0] == 'I') && (header[1] == 'D') && (header[2] == 'D')) {
90
92
res_value = idd_counter++;
91
fprintf(output, "#define ");
92
fwrite(header, 1, 3, output);
93
fprintf(houtput, "#define ");
94
fwrite(header, 1, 3, houtput);
93
95
state = OUTPUT_LINE;
94
96
} else if ((header[0] == 'I') && (header[1] == 'D') && (header[2] == 'C')) {
95
97
res_value = idc_counter++;
96
fprintf(output, "#define ");
97
fwrite(header, 1, 3, output);
98
fprintf(houtput, "#define ");
99
fwrite(header, 1, 3, houtput);
98
100
state = OUTPUT_LINE;
99
101
} else if ((header[0] == 'I') && (header[1] == 'D') && (header[2] == 'S')) {
100
102
res_value = ids_counter++;
101
fprintf(output, "#define ");
102
fwrite(header, 1, 3, output);
103
fprintf(houtput, "#define ");
104
fwrite(header, 1, 3, houtput);
103
105
state = OUTPUT_LINE;
104
106
} else if ((header[0] == 'I') && (header[1] == 'D') && (header[2] == 'M')) {
105
107
res_value = idm_counter++;
106
fprintf(output, "#define ");
107
fwrite(header, 1, 3, output);
109
fprintf(houtput, "#define ");
110
fwrite(header, 1, 3, houtput);
111
fprintf(moutput, " { \"");
112
fwrite(header, 1, 3, moutput);
108
113
state = OUTPUT_LINE;
109
114
} else if ((header[0] == 'I') && (header[1] == 'D') && (header[2] == 'I')) {
110
115
res_value = idi_counter++;
111
fprintf(output, "#define ");
112
fwrite(header, 1, 3, output);
116
fprintf(houtput, "#define ");
117
fwrite(header, 1, 3, houtput);
113
118
state = OUTPUT_LINE;
115
120
res_value = general_counter++;
116
fprintf(output, "#define ");
117
fwrite(header, 1, 3, output);
121
fprintf(houtput, "#define ");
122
fwrite(header, 1, 3, houtput);
118
123
state = OUTPUT_LINE;
170
180
idi_start = idi_counter = 1;
171
181
general_start = general_counter = 1;
173
fprintf(output, "/*\n");
174
fprintf(output, " * %s\n", argv[1]);
175
fprintf(output, " *\n");
176
fprintf(output, " * Autogenerated genwinres file, DO NOT EDIT !!!\n");
177
fprintf(output, " *\n");
178
fprintf(output, " * Written by\n");
179
fprintf(output, " * Andreas Boose <viceteam@t-online.de>\n");
180
fprintf(output, " * Ettore Perazzoli <ettore@comm2000.it>\n");
181
fprintf(output, " * Tibor Biczo <crown@t-online.hu>\n");
182
fprintf(output, " *\n");
183
fprintf(output, " * This file is part of VICE, the Versatile Commodore Emulator.\n");
184
fprintf(output, " * See README for copyright notice.\n");
185
fprintf(output, " *\n");
186
fprintf(output, " * This program is free software; you can redistribute it and/or modify\n");
187
fprintf(output, " * it under the terms of the GNU General Public License as published by\n");
188
fprintf(output, " * the Free Software Foundation; either version 2 of the License, or\n");
189
fprintf(output, " * (at your option) any later version.\n");
190
fprintf(output, " *\n");
191
fprintf(output, " * This program is distributed in the hope that it will be useful,\n");
192
fprintf(output, " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
193
fprintf(output, " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n");
194
fprintf(output, " * GNU General Public License for more details.\n");
195
fprintf(output, " *\n");
196
fprintf(output, " * You should have received a copy of the GNU General Public License\n");
197
fprintf(output, " * along with this program; if not, write to the Free Software\n");
198
fprintf(output, " * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n");
199
fprintf(output, " * 02111-1307 USA.\n");
200
fprintf(output, " *\n");
201
fprintf(output, " */\n");
202
fprintf(output, "\n");
203
fprintf(output, "#ifndef _RES_H\n");
204
fprintf(output, "#define _RES_H\n");
205
fprintf(output, "\n");
207
for (i = 2; i < argc; i++) {
208
fprintf(output, "/* Definitions from %s */\n\n", argv[i]);
209
process_file(argv[i], output);
210
fprintf(output, "\n");
183
fprintf(houtput, "/*\n");
184
fprintf(houtput, " * %s\n", argv[1]);
185
fprintf(houtput, " *\n");
186
fprintf(houtput, " * Autogenerated genwinres file, DO NOT EDIT !!!\n");
187
fprintf(houtput, " *\n");
188
fprintf(houtput, " * Written by\n");
189
fprintf(houtput, " * Andreas Boose <viceteam@t-online.de>\n");
190
fprintf(houtput, " * Ettore Perazzoli <ettore@comm2000.it>\n");
191
fprintf(houtput, " * Tibor Biczo <crown@t-online.hu>\n");
192
fprintf(houtput, " *\n");
193
fprintf(houtput, " * This file is part of VICE, the Versatile Commodore Emulator.\n");
194
fprintf(houtput, " * See README for copyright notice.\n");
195
fprintf(houtput, " *\n");
196
fprintf(houtput, " * This program is free software; you can redistribute it and/or modify\n");
197
fprintf(houtput, " * it under the terms of the GNU General Public License as published by\n");
198
fprintf(houtput, " * the Free Software Foundation; either version 2 of the License, or\n");
199
fprintf(houtput, " * (at your option) any later version.\n");
200
fprintf(houtput, " *\n");
201
fprintf(houtput, " * This program is distributed in the hope that it will be useful,\n");
202
fprintf(houtput, " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
203
fprintf(houtput, " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n");
204
fprintf(houtput, " * GNU General Public License for more details.\n");
205
fprintf(houtput, " *\n");
206
fprintf(houtput, " * You should have received a copy of the GNU General Public License\n");
207
fprintf(houtput, " * along with this program; if not, write to the Free Software\n");
208
fprintf(houtput, " * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n");
209
fprintf(houtput, " * 02111-1307 USA.\n");
210
fprintf(houtput, " *\n");
211
fprintf(houtput, " */\n");
212
fprintf(houtput, "\n");
213
fprintf(houtput, "#ifndef _RES_H\n");
214
fprintf(houtput, "#define _RES_H\n");
215
fprintf(houtput, "\n");
217
fprintf(moutput, "/*\n");
218
fprintf(moutput, " * %s\n", argv[2]);
219
fprintf(moutput, " *\n");
220
fprintf(moutput, " * Autogenerated genwinres file, DO NOT EDIT !!!\n");
221
fprintf(moutput, " *\n");
222
fprintf(moutput, " */\n");
223
fprintf(moutput, "#ifndef _MENUID_H\n");
224
fprintf(moutput, "#define _MENUID_H\n");
225
fprintf(moutput, "\n");
226
fprintf(moutput, "static struct { char *str; int cmd; } idmlist[] = {\n");
228
for (i = 3; i < argc; i++) {
229
fprintf(houtput, "/* Definitions from %s */\n\n", argv[i]);
230
process_file(argv[i], houtput, moutput);
231
fprintf(houtput, "\n");
212
fprintf(output, "#define FIRST_IDR %d\n", idr_start);
213
fprintf(output, "#define LAST_IDR %d\n", idr_counter);
214
fprintf(output, "#define FIRST_IDD %d\n", idd_start);
215
fprintf(output, "#define LAST_IDD %d\n", idd_counter);
216
fprintf(output, "#define FIRST_IDC %d\n", idc_start);
217
fprintf(output, "#define LAST_IDC %d\n", idc_counter);
218
fprintf(output, "#define FIRST_IDS %d\n", ids_start);
219
fprintf(output, "#define LAST_IDS %d\n", ids_counter);
220
fprintf(output, "#define FIRST_IDM %d\n", idm_start);
221
fprintf(output, "#define LAST_IDM %d\n", idm_counter);
222
fprintf(output, "#define FIRST_IDI %d\n", idi_start);
223
fprintf(output, "#define LAST_IDI %d\n", idi_counter);
224
fprintf(output, "#define FIRST_GENERAL %d\n", general_start);
225
fprintf(output, "#define LAST_GENERAL %d\n", general_counter);
226
fprintf(output, "\n");
227
fprintf(output, "#endif\n");
233
fprintf(houtput, "#define FIRST_IDR %d\n", idr_start);
234
fprintf(houtput, "#define LAST_IDR %d\n", idr_counter);
235
fprintf(houtput, "#define FIRST_IDD %d\n", idd_start);
236
fprintf(houtput, "#define LAST_IDD %d\n", idd_counter);
237
fprintf(houtput, "#define FIRST_IDC %d\n", idc_start);
238
fprintf(houtput, "#define LAST_IDC %d\n", idc_counter);
239
fprintf(houtput, "#define FIRST_IDS %d\n", ids_start);
240
fprintf(houtput, "#define LAST_IDS %d\n", ids_counter);
241
fprintf(houtput, "#define FIRST_IDM %d\n", idm_start);
242
fprintf(houtput, "#define LAST_IDM %d\n", idm_counter);
243
fprintf(houtput, "#define FIRST_IDI %d\n", idi_start);
244
fprintf(houtput, "#define LAST_IDI %d\n", idi_counter);
245
fprintf(houtput, "#define FIRST_GENERAL %d\n", general_start);
246
fprintf(houtput, "#define LAST_GENERAL %d\n", general_counter);
247
fprintf(houtput, "\n");
248
fprintf(houtput, "#endif\n");
250
fprintf(moutput, " { NULL, 0 }\n};\n");
251
fprintf(moutput, "#endif\n");