source: trunk/tools/wrc/y.tab.c@ 5087

Last change on this file since 5087 was 4617, checked in by bird, 25 years ago

Quick-fix for strcasecmp problem. (heapstring.cpp is included!)

File size: 135.8 KB
Line 
1
2/* A Bison parser, made from parser.y
3 by GNU Bison version 1.28 */
4
5#define YYBISON 1 /* Identify Bison output. */
6
7#define tIF 257
8#define tIFDEF 258
9#define tIFNDEF 259
10#define tELSE 260
11#define tELIF 261
12#define tENDIF 262
13#define tDEFINED 263
14#define tNL 264
15#define tTYPEDEF 265
16#define tEXTERN 266
17#define NUMBER 267
18#define LNUMBER 268
19#define tSTRING 269
20#define IDENT 270
21#define FILENAME 271
22#define RAWDATA 272
23#define ACCELERATORS 273
24#define tBITMAP 274
25#define CURSOR 275
26#define DIALOG 276
27#define DIALOGEX 277
28#define MENU 278
29#define MENUEX 279
30#define MESSAGETABLE 280
31#define RCDATA 281
32#define VERSIONINFO 282
33#define STRINGTABLE 283
34#define FONT 284
35#define ICON 285
36#define AUTO3STATE 286
37#define AUTOCHECKBOX 287
38#define AUTORADIOBUTTON 288
39#define CHECKBOX 289
40#define DEFPUSHBUTTON 290
41#define PUSHBUTTON 291
42#define RADIOBUTTON 292
43#define STATE3 293
44#define GROUPBOX 294
45#define COMBOBOX 295
46#define LISTBOX 296
47#define SCROLLBAR 297
48#define CONTROL 298
49#define EDITTEXT 299
50#define RTEXT 300
51#define CTEXT 301
52#define LTEXT 302
53#define BLOCK 303
54#define VALUE 304
55#define SHIFT 305
56#define ALT 306
57#define ASCII 307
58#define VIRTKEY 308
59#define GRAYED 309
60#define CHECKED 310
61#define INACTIVE 311
62#define NOINVERT 312
63#define tPURE 313
64#define IMPURE 314
65#define DISCARDABLE 315
66#define LOADONCALL 316
67#define PRELOAD 317
68#define tFIXED 318
69#define MOVEABLE 319
70#define CLASS 320
71#define CAPTION 321
72#define CHARACTERISTICS 322
73#define EXSTYLE 323
74#define STYLE 324
75#define VERSION 325
76#define LANGUAGE 326
77#define FILEVERSION 327
78#define PRODUCTVERSION 328
79#define FILEFLAGSMASK 329
80#define FILEOS 330
81#define FILETYPE 331
82#define FILEFLAGS 332
83#define FILESUBTYPE 333
84#define MENUBARBREAK 334
85#define MENUBREAK 335
86#define MENUITEM 336
87#define POPUP 337
88#define SEPARATOR 338
89#define HELP 339
90#define TOOLBAR 340
91#define BUTTON 341
92#define tBEGIN 342
93#define tEND 343
94#define DLGINIT 344
95#define LOGOR 345
96#define LOGAND 346
97#define EQ 347
98#define NE 348
99#define LTE 349
100#define GTE 350
101#define NOT 351
102
103#line 1 "parser.y"
104
105/*
106 * Copyright Martin von Loewis, 1994
107 * Copyright 1998 Bertho A. Stultiens (BS)
108 * 1999 Juergen Schmied (JS)
109 *
110 * 6-Nov-1999 JS - see CHANGES
111 *
112 * 29-Dec-1998 AdH - Grammar and function extensions.
113 * grammar: TOOLBAR resources, Named ICONs in
114 * DIALOGS
115 * functions: semantic actions for the grammar
116 * changes, resource files can now be anywhere
117 * on the include path instead of just in the
118 * current directory
119 *
120 * 20-Jun-1998 BS - Fixed a bug in load_file() where the name was not
121 * printed out correctly.
122 *
123 * 17-Jun-1998 BS - Fixed a bug in CLASS statement parsing which should
124 * also accept a tSTRING as argument.
125 *
126 * 25-May-1998 BS - Found out that I need to support language, version
127 * and characteristics in inline resources (bitmap,
128 * cursor, etc) but they can also be specified with
129 * a filename. This renders my filename-scanning scheme
130 * worthless. Need to build newline parsing to solve
131 * this one.
132 * It will come with version 1.1.0 (sigh).
133 *
134 * 19-May-1998 BS - Started to build a builtin preprocessor
135 *
136 * 30-Apr-1998 BS - Redid the stringtable parsing/handling. My previous
137 * ideas had some serious flaws.
138 *
139 * 27-Apr-1998 BS - Removed a lot of dead comments and put it in a doc
140 * file.
141 *
142 * 21-Apr-1998 BS - Added correct behavior for cursors and icons.
143 * - This file is growing too big. It is time to strip
144 * things and put it in a support file.
145 *
146 * 19-Apr-1998 BS - Tagged the stringtable resource so that only one
147 * resource will be created. This because the table
148 * has a different layout than other resources. The
149 * table has to be sorted, and divided into smaller
150 * resource entries (see comment in source).
151 *
152 * 17-Apr-1998 BS - Almost all strings, including identifiers, are parsed
153 * as string_t which include unicode strings upon
154 * input.
155 * - Parser now emits a warning when compiling win32
156 * extensions in win16 mode.
157 *
158 * 16-Apr-1998 BS - Raw data elements are now *optionally* seperated
159 * by commas. Read the comments in file sq2dq.l.
160 * - FIXME: there are instances in the source that rely
161 * on the fact that int==32bit and pointers are int size.
162 * - Fixed the conflict in menuex by changing a rule
163 * back into right recursion. See note in source.
164 * - UserType resources cannot have an expression as its
165 * typeclass. See note in source.
166 *
167 * 15-Apr-1998 BS - Changed all right recursion into left recursion to
168 * get reduction of the parsestack.
169 * This also helps communication between bison and flex.
170 * Main advantage is that the Empty rule gets reduced
171 * first, which is used to allocate/link things.
172 * It also added a shift/reduce conflict in the menuex
173 * handling, due to expression/option possibility,
174 * although not serious.
175 *
176 * 14-Apr-1998 BS - Redone almost the entire parser. We're not talking
177 * about making it more efficient, but readable (for me)
178 * and slightly easier to expand/change.
179 * This is done primarily by using more reduce states
180 * with many (intuitive) types for the various resource
181 * statements.
182 * - Added expression handling for all resources where a
183 * number is accepted (not only for win32). Also added
184 * multiply and division (not MS compatible, but handy).
185 * Unary minus introduced a shift/reduce conflict, but
186 * it is not serious.
187 *
188 * 13-Apr-1998 BS - Reordered a lot of things
189 * - Made the source more readable
190 * - Added Win32 resource definitions
191 * - Corrected syntax problems with an old yacc (;)
192 * - Added extra comment about grammar
193 */
194#include "config.h"
195
196#include <stdio.h>
197#include <stdlib.h>
198#include <stdarg.h>
199#include <assert.h>
200#include <ctype.h>
201#include <string.h>
202#ifdef HAVE_ALLOCA_H
203#include <alloca.h>
204#endif
205
206#include "wrc.h"
207#include "utils.h"
208#include "newstruc.h"
209#include "dumpres.h"
210#include "preproc.h"
211#include "parser.h"
212#include "windef.h"
213#include "wingdi.h"
214#include "winuser.h"
215/* kso Sun 19.11.2000 */
216#undef strcasecmp
217#define strcasecmp stricmp
218
219#ifdef __BORLANDC__
220#pragma warn -sig
221#endif
222
223int indialog = 0; /* Signal flex that we're parsing a dialog */
224int want_rscname = 0; /* Set when a resource's name is required */
225stringtable_t *tagstt; /* Stringtable tag.
226 * It is set while parsing a stringtable to one of
227 * the stringtables in the sttres list or a new one
228 * if the language was not parsed before.
229 */
230stringtable_t *sttres; /* Stringtable resources. This holds the list of
231 * stringtables with different lanuages
232 */
233/* Set to the current options of the currently scanning stringtable */
234static int *tagstt_memopt;
235static characts_t *tagstt_characts;
236static version_t *tagstt_version;
237
238/* Prototypes of here defined functions */
239void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur);
240void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico);
241int alloc_cursor_id(language_t *);
242int alloc_icon_id(language_t *);
243void ins_stt_entry(stt_entry_t *ste);
244int check_stt_entry(stringtable_t *tabs, stt_entry_t *ste);
245event_t *get_event_head(event_t *p);
246control_t *get_control_head(control_t *p);
247ver_value_t *get_ver_value_head(ver_value_t *p);
248ver_block_t *get_ver_block_head(ver_block_t *p);
249resource_t *get_resource_head(resource_t *p);
250menuex_item_t *get_itemex_head(menuex_item_t *p);
251menu_item_t *get_item_head(menu_item_t *p);
252raw_data_t *merge_raw_data_str(raw_data_t *r1, string_t *str);
253raw_data_t *merge_raw_data_int(raw_data_t *r1, int i);
254raw_data_t *merge_raw_data_long(raw_data_t *r1, int i);
255raw_data_t *merge_raw_data(raw_data_t *r1, raw_data_t *r2);
256raw_data_t *str2raw_data(string_t *str);
257raw_data_t *int2raw_data(int i);
258raw_data_t *long2raw_data(int i);
259raw_data_t *load_file(string_t *name);
260itemex_opt_t *new_itemex_opt(int id, int type, int state, int helpid);
261event_t *add_string_event(string_t *key, int id, int flags, event_t *prev);
262event_t *add_event(int key, int id, int flags, event_t *prev);
263dialogex_t *dialogex_version(version_t *v, dialogex_t *dlg);
264dialogex_t *dialogex_characteristics(characts_t *c, dialogex_t *dlg);
265dialogex_t *dialogex_language(language_t *l, dialogex_t *dlg);
266dialogex_t *dialogex_menu(name_id_t *m, dialogex_t *dlg);
267dialogex_t *dialogex_class(name_id_t *n, dialogex_t *dlg);
268dialogex_t *dialogex_font(font_id_t *f, dialogex_t *dlg);
269dialogex_t *dialogex_caption(string_t *s, dialogex_t *dlg);
270dialogex_t *dialogex_exstyle(style_t *st, dialogex_t *dlg);
271dialogex_t *dialogex_style(style_t *st, dialogex_t *dlg);
272name_id_t *convert_ctlclass(name_id_t *cls);
273control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control_t *prev);
274dialog_t *dialog_version(version_t *v, dialog_t *dlg);
275dialog_t *dialog_characteristics(characts_t *c, dialog_t *dlg);
276dialog_t *dialog_language(language_t *l, dialog_t *dlg);
277dialog_t *dialog_menu(name_id_t *m, dialog_t *dlg);
278dialog_t *dialog_class(name_id_t *n, dialog_t *dlg);
279dialog_t *dialog_font(font_id_t *f, dialog_t *dlg);
280dialog_t *dialog_caption(string_t *s, dialog_t *dlg);
281dialog_t *dialog_exstyle(style_t * st, dialog_t *dlg);
282dialog_t *dialog_style(style_t * st, dialog_t *dlg);
283resource_t *build_stt_resources(stringtable_t *stthead);
284stringtable_t *find_stringtable(lvc_t *lvc);
285toolbar_item_t *ins_tlbr_button(toolbar_item_t *prev, toolbar_item_t *idrec);
286toolbar_item_t *get_tlbr_buttons_head(toolbar_item_t *p, int *nitems);
287
288
289#line 183 "parser.y"
290typedef union{
291 string_t *str;
292 int num;
293 int *iptr;
294 resource_t *res;
295 accelerator_t *acc;
296 bitmap_t *bmp;
297 cursor_t *cur;
298 cursor_group_t *curg;
299 dialog_t *dlg;
300 dialogex_t *dlgex;
301 font_t *fnt;
302 icon_t *ico;
303 icon_group_t *icog;
304 menu_t *men;
305 menuex_t *menex;
306 rcdata_t *rdt;
307 stringtable_t *stt;
308 stt_entry_t *stte;
309 user_t *usr;
310 messagetable_t *msg;
311 versioninfo_t *veri;
312 control_t *ctl;
313 name_id_t *nid;
314 font_id_t *fntid;
315 language_t *lan;
316 version_t *ver;
317 characts_t *chars;
318 event_t *event;
319 menu_item_t *menitm;
320 menuex_item_t *menexitm;
321 itemex_opt_t *exopt;
322 raw_data_t *raw;
323 lvc_t *lvc;
324 ver_value_t *val;
325 ver_block_t *blk;
326 ver_words_t *verw;
327 toolbar_t *tlbar;
328 toolbar_item_t *tlbarItems;
329 dlginit_t *dginit;
330 style_pair_t *styles;
331 style_t *style;
332} YYSTYPE;
333#ifndef YYDEBUG
334#define YYDEBUG 1
335#endif
336
337#include <stdio.h>
338
339#ifndef __cplusplus
340#ifndef __STDC__
341#define const
342#endif
343#endif
344
345
346
347#define YYFINAL 604
348#define YYFLAG -32768
349#define YYNTBASE 112
350
351#define YYTRANSLATE(x) ((unsigned)(x) <= 351 ? yytranslate[x] : 191)
352
353static const char yytranslate[] = { 0,
354 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
355 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
356 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
357 2, 2, 107, 2, 2, 2, 2, 95, 2, 109,
358 110, 104, 102, 111, 103, 2, 105, 2, 2, 2,
359 2, 2, 2, 2, 2, 2, 2, 2, 2, 98,
360 2, 100, 2, 2, 2, 2, 2, 2, 2, 2,
361 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
362 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
363 2, 2, 2, 94, 2, 2, 2, 2, 2, 2,
364 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
365 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
366 2, 2, 2, 93, 2, 106, 2, 2, 2, 2,
367 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
368 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
369 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
371 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
374 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
375 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
376 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
377 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
378 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
379 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
380 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
381 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
382 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
383 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
384 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
385 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
386 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
387 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
388 87, 88, 89, 90, 91, 92, 96, 97, 99, 101,
389 108
390};
391
392#if YYDEBUG != 0
393static const short yyprhs[] = { 0,
394 0, 2, 3, 6, 9, 12, 16, 20, 24, 28,
395 31, 34, 36, 40, 44, 48, 52, 56, 60, 64,
396 68, 72, 76, 80, 83, 86, 89, 92, 96, 98,
397 100, 103, 108, 110, 112, 115, 118, 121, 124, 126,
398 128, 130, 132, 134, 136, 138, 140, 142, 144, 146,
399 148, 150, 152, 154, 156, 158, 160, 162, 164, 166,
400 170, 174, 178, 182, 186, 190, 194, 197, 202, 207,
401 211, 215, 217, 219, 226, 227, 233, 239, 240, 244,
402 248, 252, 256, 260, 264, 278, 279, 283, 287, 291,
403 294, 298, 302, 305, 308, 311, 312, 316, 320, 324,
404 328, 332, 336, 340, 344, 348, 352, 356, 360, 364,
405 368, 372, 376, 380, 391, 404, 415, 416, 421, 428,
406 437, 455, 471, 476, 477, 480, 481, 484, 489, 493,
407 497, 499, 502, 504, 506, 521, 522, 526, 530, 534,
408 537, 540, 544, 548, 551, 554, 557, 558, 562, 566,
409 570, 574, 578, 582, 586, 590, 594, 598, 602, 606,
410 610, 614, 618, 622, 626, 637, 657, 674, 688, 700,
411 701, 703, 704, 707, 717, 718, 721, 726, 730, 731,
412 738, 742, 748, 749, 753, 757, 761, 765, 769, 773,
413 778, 782, 783, 788, 792, 798, 799, 802, 808, 815,
414 816, 819, 824, 831, 840, 845, 849, 850, 855, 856,
415 858, 864, 865, 875, 885, 889, 893, 897, 901, 905,
416 906, 909, 915, 916, 919, 921, 926, 931, 933, 937,
417 947, 948, 952, 955, 956, 959, 962, 964, 966, 968,
418 970, 972, 974, 976, 977, 980, 983, 986, 991, 994,
419 997, 1001, 1003, 1005, 1007, 1009, 1013, 1017, 1021, 1025,
420 1026, 1028, 1030, 1034, 1038, 1042, 1046, 1050, 1054, 1057,
421 1060, 1064, 1066, 1069, 1071
422};
423
424static const short yyrhs[] = { 113,
425 0, 0, 113, 118, 0, 113, 114, 0, 113, 117,
426 0, 3, 115, 10, 0, 4, 16, 10, 0, 5,
427 16, 10, 0, 7, 115, 10, 0, 6, 10, 0,
428 8, 10, 0, 116, 0, 115, 91, 115, 0, 115,
429 92, 115, 0, 115, 102, 115, 0, 115, 103, 115,
430 0, 115, 94, 115, 0, 115, 96, 115, 0, 115,
431 97, 115, 0, 115, 98, 115, 0, 115, 100, 115,
432 0, 115, 99, 115, 0, 115, 101, 115, 0, 106,
433 115, 0, 102, 115, 0, 103, 115, 0, 107, 115,
434 0, 109, 115, 110, 0, 190, 0, 16, 0, 9,
435 16, 0, 9, 109, 16, 110, 0, 11, 0, 12,
436 0, 16, 16, 0, 16, 109, 0, 16, 104, 0,
437 119, 121, 0, 165, 0, 182, 0, 188, 0, 16,
438 0, 119, 0, 15, 0, 131, 0, 122, 0, 123,
439 0, 134, 0, 146, 0, 128, 0, 124, 0, 125,
440 0, 156, 0, 160, 0, 126, 0, 127, 0, 176,
441 0, 129, 0, 169, 0, 20, 178, 17, 0, 20,
442 178, 185, 0, 21, 178, 17, 0, 21, 178, 185,
443 0, 30, 178, 17, 0, 31, 178, 17, 0, 31,
444 178, 185, 0, 26, 17, 0, 27, 178, 181, 185,
445 0, 90, 178, 181, 185, 0, 130, 178, 17, 0,
446 130, 178, 185, 0, 13, 0, 15, 0, 19, 178,
447 181, 88, 132, 89, 0, 0, 132, 15, 111, 188,
448 133, 0, 132, 188, 111, 188, 133, 0, 0, 133,
449 111, 58, 0, 133, 111, 51, 0, 133, 111, 44,
450 0, 133, 111, 52, 0, 133, 111, 53, 0, 133,
451 111, 54, 0, 22, 178, 188, 111, 188, 111, 188,
452 111, 188, 135, 88, 136, 89, 0, 0, 135, 70,
453 144, 0, 135, 69, 144, 0, 135, 67, 15, 0,
454 135, 141, 0, 135, 66, 120, 0, 135, 24, 119,
455 0, 135, 182, 0, 135, 183, 0, 135, 184, 0,
456 0, 136, 44, 140, 0, 136, 45, 138, 0, 136,
457 42, 138, 0, 136, 41, 138, 0, 136, 43, 138,
458 0, 136, 35, 137, 0, 136, 36, 137, 0, 136,
459 40, 137, 0, 136, 37, 137, 0, 136, 38, 137,
460 0, 136, 32, 137, 0, 136, 39, 137, 0, 136,
461 33, 137, 0, 136, 34, 137, 0, 136, 48, 137,
462 0, 136, 47, 137, 0, 136, 46, 137, 0, 136,
463 31, 120, 168, 188, 111, 188, 111, 188, 139, 0,
464 15, 168, 188, 111, 188, 111, 188, 111, 188, 111,
465 188, 142, 0, 188, 111, 188, 111, 188, 111, 188,
466 111, 188, 142, 0, 0, 111, 188, 111, 188, 0,
467 111, 188, 111, 188, 111, 144, 0, 111, 188, 111,
468 188, 111, 144, 111, 144, 0, 120, 168, 188, 111,
469 145, 111, 144, 111, 188, 111, 188, 111, 188, 111,
470 188, 111, 144, 0, 120, 168, 188, 111, 145, 111,
471 144, 111, 188, 111, 188, 111, 188, 111, 188, 0,
472 30, 188, 111, 15, 0, 0, 111, 144, 0, 0,
473 111, 144, 0, 111, 144, 111, 144, 0, 144, 93,
474 144, 0, 109, 144, 110, 0, 190, 0, 108, 190,
475 0, 188, 0, 15, 0, 23, 178, 188, 111, 188,
476 111, 188, 111, 188, 153, 147, 88, 148, 89, 0,
477 0, 147, 70, 144, 0, 147, 69, 144, 0, 147,
478 67, 15, 0, 147, 141, 0, 147, 154, 0, 147,
479 66, 120, 0, 147, 24, 119, 0, 147, 182, 0,
480 147, 183, 0, 147, 184, 0, 0, 148, 44, 149,
481 0, 148, 45, 151, 0, 148, 42, 151, 0, 148,
482 41, 151, 0, 148, 43, 151, 0, 148, 35, 150,
483 0, 148, 36, 150, 0, 148, 40, 150, 0, 148,
484 37, 150, 0, 148, 38, 150, 0, 148, 32, 150,
485 0, 148, 39, 150, 0, 148, 33, 150, 0, 148,
486 34, 150, 0, 148, 48, 150, 0, 148, 47, 150,
487 0, 148, 46, 150, 0, 148, 31, 120, 168, 188,
488 111, 188, 111, 188, 139, 0, 120, 168, 188, 111,
489 145, 111, 144, 111, 188, 111, 188, 111, 188, 111,
490 188, 111, 144, 153, 152, 0, 120, 168, 188, 111,
491 145, 111, 144, 111, 188, 111, 188, 111, 188, 111,
492 188, 152, 0, 15, 168, 188, 111, 188, 111, 188,
493 111, 188, 111, 188, 143, 152, 0, 188, 111, 188,
494 111, 188, 111, 188, 111, 188, 143, 152, 0, 0,
495 185, 0, 0, 111, 188, 0, 30, 188, 111, 15,
496 111, 188, 111, 188, 155, 0, 0, 111, 188, 0,
497 24, 178, 181, 157, 0, 88, 158, 89, 0, 0,
498 158, 82, 15, 168, 188, 159, 0, 158, 82, 84,
499 0, 158, 83, 15, 159, 157, 0, 0, 111, 56,
500 159, 0, 111, 55, 159, 0, 111, 85, 159, 0,
501 111, 57, 159, 0, 111, 80, 159, 0, 111, 81,
502 159, 0, 25, 178, 181, 161, 0, 88, 162, 89,
503 0, 0, 162, 82, 15, 163, 0, 162, 82, 84,
504 0, 162, 83, 15, 164, 161, 0, 0, 111, 188,
505 0, 111, 187, 111, 187, 159, 0, 111, 187, 111,
506 187, 111, 188, 0, 0, 111, 188, 0, 111, 187,
507 111, 188, 0, 111, 187, 111, 187, 111, 188, 0,
508 111, 187, 111, 187, 111, 187, 111, 188, 0, 166,
509 88, 167, 89, 0, 29, 178, 181, 0, 0, 167,
510 188, 168, 15, 0, 0, 111, 0, 28, 170, 88,
511 171, 89, 0, 0, 170, 73, 188, 111, 188, 111,
512 188, 111, 188, 0, 170, 74, 188, 111, 188, 111,
513 188, 111, 188, 0, 170, 78, 188, 0, 170, 75,
514 188, 0, 170, 76, 188, 0, 170, 77, 188, 0,
515 170, 79, 188, 0, 0, 171, 172, 0, 49, 15,
516 88, 173, 89, 0, 0, 173, 174, 0, 172, 0,
517 50, 15, 111, 15, 0, 50, 15, 111, 175, 0,
518 188, 0, 175, 111, 188, 0, 86, 178, 188, 111,
519 188, 181, 88, 177, 89, 0, 0, 177, 87, 188,
520 0, 177, 84, 0, 0, 178, 179, 0, 178, 180,
521 0, 63, 0, 65, 0, 61, 0, 59, 0, 62,
522 0, 64, 0, 60, 0, 0, 181, 182, 0, 181,
523 183, 0, 181, 184, 0, 72, 188, 111, 188, 0,
524 68, 188, 0, 71, 188, 0, 88, 186, 89, 0,
525 18, 0, 13, 0, 14, 0, 15, 0, 186, 168,
526 18, 0, 186, 168, 13, 0, 186, 168, 14, 0,
527 186, 168, 15, 0, 0, 188, 0, 189, 0, 189,
528 102, 189, 0, 189, 103, 189, 0, 189, 93, 189,
529 0, 189, 95, 189, 0, 189, 104, 189, 0, 189,
530 105, 189, 0, 106, 189, 0, 103, 189, 0, 109,
531 189, 110, 0, 190, 0, 108, 190, 0, 13, 0,
532 14, 0
533};
534
535#endif
536
537#if YYDEBUG != 0
538static const short yyrline[] = { 0,
539 310, 330, 331, 356, 357, 362, 363, 364, 365, 366,
540 367, 370, 371, 372, 373, 374, 375, 376, 377, 378,
541 379, 380, 381, 382, 383, 384, 385, 386, 390, 391,
542 392, 393, 397, 398, 399, 400, 401, 406, 421, 429,
543 442, 450, 461, 462, 472, 473, 474, 488, 489, 495,
544 496, 497, 511, 512, 518, 519, 520, 521, 522, 526,
545 527, 531, 532, 537, 541, 542, 550, 558, 571, 584,
546 585, 604, 616, 626, 650, 651, 652, 655, 656, 657,
547 658, 659, 660, 661, 666, 701, 702, 703, 704, 705,
548 706, 707, 708, 709, 710, 713, 714, 715, 716, 717,
549 718, 719, 720, 721, 722, 724, 725, 726, 727, 728,
550 729, 730, 731, 733, 743, 762, 777, 780, 785, 792,
551 803, 817, 832, 837, 838, 842, 843, 844, 848, 849,
552 850, 851, 855, 860, 868, 913, 914, 915, 916, 917,
553 918, 919, 920, 921, 922, 923, 926, 927, 928, 929,
554 930, 931, 932, 933, 934, 935, 937, 938, 939, 940,
555 941, 942, 943, 944, 946, 956, 981, 997, 1025, 1048,
556 1049, 1052, 1053, 1057, 1064, 1065, 1069, 1092, 1096, 1097,
557 1106, 1112, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1141,
558 1166, 1170, 1171, 1187, 1193, 1213, 1214, 1218, 1226, 1237,
559 1238, 1242, 1248, 1256, 1276, 1317, 1328, 1329, 1361, 1362,
560 1367, 1374, 1375, 1385, 1395, 1402, 1409, 1416, 1423, 1433,
561 1434, 1443, 1451, 1452, 1461, 1466, 1472, 1481, 1482, 1486,
562 1512, 1513, 1518, 1527, 1528, 1538, 1553, 1554, 1555, 1556,
563 1559, 1560, 1561, 1565, 1566, 1574, 1582, 1593, 1597, 1601,
564 1605, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1623,
565 1624, 1626, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636,
566 1638, 1639, 1640, 1643, 1644
567};
568#endif
569
570
571#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
572
573static const char * const yytname[] = { "$","error","$undefined.","tIF","tIFDEF",
574"tIFNDEF","tELSE","tELIF","tENDIF","tDEFINED","tNL","tTYPEDEF","tEXTERN","NUMBER",
575"LNUMBER","tSTRING","IDENT","FILENAME","RAWDATA","ACCELERATORS","tBITMAP","CURSOR",
576"DIALOG","DIALOGEX","MENU","MENUEX","MESSAGETABLE","RCDATA","VERSIONINFO","STRINGTABLE",
577"FONT","ICON","AUTO3STATE","AUTOCHECKBOX","AUTORADIOBUTTON","CHECKBOX","DEFPUSHBUTTON",
578"PUSHBUTTON","RADIOBUTTON","STATE3","GROUPBOX","COMBOBOX","LISTBOX","SCROLLBAR",
579"CONTROL","EDITTEXT","RTEXT","CTEXT","LTEXT","BLOCK","VALUE","SHIFT","ALT","ASCII",
580"VIRTKEY","GRAYED","CHECKED","INACTIVE","NOINVERT","tPURE","IMPURE","DISCARDABLE",
581"LOADONCALL","PRELOAD","tFIXED","MOVEABLE","CLASS","CAPTION","CHARACTERISTICS",
582"EXSTYLE","STYLE","VERSION","LANGUAGE","FILEVERSION","PRODUCTVERSION","FILEFLAGSMASK",
583"FILEOS","FILETYPE","FILEFLAGS","FILESUBTYPE","MENUBARBREAK","MENUBREAK","MENUITEM",
584"POPUP","SEPARATOR","HELP","TOOLBAR","BUTTON","tBEGIN","tEND","DLGINIT","LOGOR",
585"LOGAND","'|'","'^'","'&'","EQ","NE","'<'","LTE","'>'","GTE","'+'","'-'","'*'",
586"'/'","'~'","'!'","NOT","'('","')'","','","resource_file","resources","preprocessor",
587"pp_expr","pp_constant","cjunk","resource","nameid","nameid_s","resource_definition",
588"bitmap","cursor","font","icon","messagetable","rcdata","dlginit","userres",
589"usertype","accelerators","events","acc_opt","dialog","dlg_attributes","ctrls",
590"lab_ctrl","ctrl_desc","iconinfo","gen_ctrl","opt_font","optional_style","optional_style_pair",
591"style","ctlclass","dialogex","dlgex_attribs","exctrls","gen_exctrl","lab_exctrl",
592"exctrl_desc","opt_data","helpid","opt_exfont","opt_expr","menu","menu_body",
593"item_definitions","item_options","menuex","menuex_body","itemex_definitions",
594"itemex_options","itemex_p_options","stringtable","stt_head","strings","opt_comma",
595"versioninfo","fix_version","ver_blocks","ver_block","ver_values","ver_value",
596"ver_words","toolbar","toolbar_items","loadmemopts","lamo","lama","opt_lvc",
597"opt_language","opt_characts","opt_version","raw_data","raw_elements","e_expr",
598"expr","xpr","any_num", NULL
599};
600#endif
601
602static const short yyr1[] = { 0,
603 112, 113, 113, 113, 113, 114, 114, 114, 114, 114,
604 114, 115, 115, 115, 115, 115, 115, 115, 115, 115,
605 115, 115, 115, 115, 115, 115, 115, 115, 116, 116,
606 116, 116, 117, 117, 117, 117, 117, 118, 118, 118,
607 119, 119, 120, 120, 121, 121, 121, 121, 121, 121,
608 121, 121, 121, 121, 121, 121, 121, 121, 121, 122,
609 122, 123, 123, 124, 125, 125, 126, 127, 128, 129,
610 129, 130, 130, 131, 132, 132, 132, 133, 133, 133,
611 133, 133, 133, 133, 134, 135, 135, 135, 135, 135,
612 135, 135, 135, 135, 135, 136, 136, 136, 136, 136,
613 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
614 136, 136, 136, 136, 137, 138, 139, 139, 139, 139,
615 140, 140, 141, 142, 142, 143, 143, 143, 144, 144,
616 144, 144, 145, 145, 146, 147, 147, 147, 147, 147,
617 147, 147, 147, 147, 147, 147, 148, 148, 148, 148,
618 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
619 148, 148, 148, 148, 148, 149, 149, 150, 151, 152,
620 152, 153, 153, 154, 155, 155, 156, 157, 158, 158,
621 158, 158, 159, 159, 159, 159, 159, 159, 159, 160,
622 161, 162, 162, 162, 162, 163, 163, 163, 163, 164,
623 164, 164, 164, 164, 165, 166, 167, 167, 168, 168,
624 169, 170, 170, 170, 170, 170, 170, 170, 170, 171,
625 171, 172, 173, 173, 174, 174, 174, 175, 175, 176,
626 177, 177, 177, 178, 178, 178, 179, 179, 179, 179,
627 180, 180, 180, 181, 181, 181, 181, 182, 183, 184,
628 185, 186, 186, 186, 186, 186, 186, 186, 186, 187,
629 187, 188, 189, 189, 189, 189, 189, 189, 189, 189,
630 189, 189, 189, 190, 190
631};
632
633static const short yyr2[] = { 0,
634 1, 0, 2, 2, 2, 3, 3, 3, 3, 2,
635 2, 1, 3, 3, 3, 3, 3, 3, 3, 3,
636 3, 3, 3, 2, 2, 2, 2, 3, 1, 1,
637 2, 4, 1, 1, 2, 2, 2, 2, 1, 1,
638 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
639 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
640 3, 3, 3, 3, 3, 3, 2, 4, 4, 3,
641 3, 1, 1, 6, 0, 5, 5, 0, 3, 3,
642 3, 3, 3, 3, 13, 0, 3, 3, 3, 2,
643 3, 3, 2, 2, 2, 0, 3, 3, 3, 3,
644 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
645 3, 3, 3, 10, 12, 10, 0, 4, 6, 8,
646 17, 15, 4, 0, 2, 0, 2, 4, 3, 3,
647 1, 2, 1, 1, 14, 0, 3, 3, 3, 2,
648 2, 3, 3, 2, 2, 2, 0, 3, 3, 3,
649 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
650 3, 3, 3, 3, 10, 19, 16, 13, 11, 0,
651 1, 0, 2, 9, 0, 2, 4, 3, 0, 6,
652 3, 5, 0, 3, 3, 3, 3, 3, 3, 4,
653 3, 0, 4, 3, 5, 0, 2, 5, 6, 0,
654 2, 4, 6, 8, 4, 3, 0, 4, 0, 1,
655 5, 0, 9, 9, 3, 3, 3, 3, 3, 0,
656 2, 5, 0, 2, 1, 4, 4, 1, 3, 9,
657 0, 3, 2, 0, 2, 2, 1, 1, 1, 1,
658 1, 1, 1, 0, 2, 2, 2, 4, 2, 2,
659 3, 1, 1, 1, 1, 3, 3, 3, 3, 0,
660 1, 1, 3, 3, 3, 3, 3, 3, 2, 2,
661 3, 1, 2, 1, 1
662};
663
664static const short yydefact[] = { 2,
665 1, 0, 0, 0, 0, 0, 0, 33, 34, 274,
666 275, 42, 234, 0, 0, 0, 0, 0, 4, 5,
667 3, 0, 39, 0, 40, 41, 262, 272, 0, 30,
668 0, 0, 0, 0, 0, 0, 12, 29, 0, 0,
669 10, 0, 11, 35, 37, 36, 244, 0, 270, 269,
670 273, 0, 72, 73, 234, 234, 234, 234, 234, 234,
671 234, 0, 234, 212, 234, 234, 234, 234, 38, 46,
672 47, 51, 52, 55, 56, 50, 58, 234, 45, 48,
673 49, 53, 54, 59, 57, 207, 0, 0, 0, 0,
674 0, 0, 31, 0, 25, 26, 24, 27, 0, 6,
675 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
676 0, 7, 8, 9, 240, 243, 239, 241, 237, 242,
677 238, 235, 236, 206, 0, 271, 244, 0, 0, 0,
678 0, 244, 244, 67, 244, 0, 0, 0, 0, 244,
679 0, 0, 265, 266, 263, 264, 267, 268, 0, 28,
680 13, 14, 17, 18, 19, 20, 22, 21, 23, 15,
681 16, 0, 0, 245, 246, 247, 248, 0, 60, 0,
682 61, 62, 63, 0, 0, 0, 0, 0, 0, 0,
683 0, 0, 0, 0, 0, 220, 64, 65, 66, 0,
684 0, 70, 71, 205, 209, 32, 249, 250, 75, 253,
685 254, 255, 252, 209, 0, 0, 179, 177, 192, 190,
686 68, 0, 0, 216, 217, 218, 215, 219, 0, 0,
687 69, 210, 0, 0, 251, 0, 0, 0, 0, 0,
688 0, 0, 0, 211, 221, 244, 208, 0, 74, 0,
689 257, 258, 259, 256, 0, 0, 0, 0, 178, 0,
690 0, 191, 0, 0, 0, 0, 0, 0, 0, 0,
691 209, 181, 183, 196, 194, 200, 0, 0, 223, 231,
692 78, 78, 0, 0, 0, 0, 0, 260, 193, 260,
693 0, 0, 0, 0, 0, 76, 77, 86, 172, 183,
694 183, 183, 183, 183, 183, 183, 182, 0, 197, 0,
695 201, 195, 0, 0, 0, 222, 225, 224, 233, 0,
696 230, 0, 0, 0, 136, 180, 185, 184, 187, 188,
697 189, 186, 260, 260, 213, 214, 0, 232, 81, 80,
698 82, 83, 84, 79, 0, 0, 0, 0, 0, 0,
699 96, 90, 93, 94, 95, 173, 0, 183, 261, 0,
700 202, 0, 42, 92, 0, 44, 43, 91, 89, 0,
701 0, 88, 131, 87, 0, 0, 0, 0, 0, 0,
702 0, 147, 140, 141, 144, 145, 146, 0, 198, 260,
703 226, 227, 228, 0, 132, 0, 0, 0, 0, 0,
704 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
705 0, 0, 0, 0, 0, 85, 143, 0, 142, 139,
706 138, 137, 0, 199, 0, 203, 0, 123, 130, 129,
707 209, 209, 107, 109, 110, 102, 103, 105, 106, 108,
708 104, 100, 0, 99, 101, 209, 97, 98, 113, 112,
709 111, 0, 0, 0, 0, 0, 0, 0, 0, 0,
710 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
711 135, 0, 229, 0, 0, 0, 0, 123, 209, 209,
712 158, 160, 161, 153, 154, 156, 157, 159, 155, 151,
713 0, 150, 152, 209, 148, 149, 164, 163, 162, 204,
714 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
715 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
716 0, 134, 0, 133, 0, 0, 0, 0, 0, 0,
717 0, 0, 0, 175, 0, 0, 0, 0, 117, 0,
718 0, 0, 0, 174, 0, 0, 0, 0, 0, 114,
719 0, 0, 0, 176, 117, 0, 0, 0, 0, 0,
720 124, 0, 165, 0, 0, 0, 0, 0, 0, 116,
721 0, 0, 126, 0, 118, 124, 125, 0, 0, 0,
722 170, 0, 0, 115, 0, 126, 127, 169, 171, 0,
723 119, 0, 170, 0, 0, 0, 0, 168, 128, 0,
724 120, 122, 0, 0, 170, 121, 0, 167, 172, 170,
725 166, 0, 0, 0
726};
727
728static const short yydefgoto[] = { 602,
729 1, 19, 36, 37, 20, 21, 357, 358, 69, 70,
730 71, 72, 73, 74, 75, 76, 77, 78, 79, 224,
731 286, 80, 313, 365, 423, 432, 540, 437, 342, 560,
732 571, 362, 513, 81, 347, 413, 485, 471, 480, 578,
733 315, 374, 534, 82, 208, 229, 277, 83, 210, 230,
734 279, 281, 23, 24, 142, 223, 84, 136, 219, 235,
735 284, 308, 382, 85, 285, 47, 122, 123, 124, 164,
736 165, 166, 579, 204, 298, 26, 27, 28
737};
738
739static const short yypact[] = {-32768,
740 39, 10, -4, 0, -1, 10, 15,-32768,-32768,-32768,
741-32768, -15,-32768, 197, 197, 197, 82, 197,-32768,-32768,
742-32768, 442,-32768, -68,-32768,-32768, 390,-32768, 6,-32768,
743 10, 10, 10, 10, 10, 298,-32768,-32768, 31, 56,
744-32768, 351,-32768,-32768,-32768,-32768, 611, -41, 50,-32768,
745-32768, 483,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
746-32768, 55,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
747-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
748-32768,-32768,-32768,-32768,-32768,-32768, 197, 197, 197, 197,
749 197, 197,-32768, 58,-32768,-32768,-32768,-32768, 449,-32768,
750 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
751 10,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
752-32768,-32768,-32768, 349, 197,-32768, 611, 345, 417, 110,
753 110, 611, 611,-32768, 611, 558, 19, 439, 110, 611,
754 454, 114, 517, 125, 50, 50,-32768,-32768, -25,-32768,
755 690, 700, 556, 706, 706, 85, 85, 85, 85,-32768,
756-32768, 197, 197,-32768,-32768,-32768,-32768, 153,-32768, 401,
757-32768,-32768,-32768, -14, 7, 195, 255, 262, 197, 197,
758 197, 197, 197, 197, 197,-32768,-32768,-32768,-32768, 53,
759 262,-32768,-32768,-32768, 78,-32768,-32768,-32768,-32768,-32768,
760-32768,-32768,-32768, -13, 197, 197,-32768,-32768,-32768,-32768,
761-32768, 88, 123,-32768,-32768,-32768,-32768,-32768, -22, 197,
762-32768,-32768, 135, 73,-32768, 516, 132, 148, 74, 95,
763 197, 197, 178,-32768,-32768,-32768,-32768, 154,-32768, 157,
764-32768,-32768,-32768,-32768, 197, 197, -9, 254,-32768, -7,
765 257,-32768, 173, 184, 22, 276, 197, 197, 214, 220,
766 78,-32768, 224, 230,-32768, 234, 197, 197,-32768,-32768,
767-32768,-32768, 197, 197, 197, 111, 209, 197,-32768, 197,
768 258, 240, 245, 76, 268, 252, 252,-32768, 267, 224,
769 224, 224, 224, 224, 224, 224,-32768, 269, 273, 280,
770 273,-32768, 197, 197, 297,-32768,-32768,-32768,-32768, 197,
771-32768, 723, 530, 197,-32768,-32768,-32768,-32768,-32768,-32768,
772-32768,-32768, 197, 197,-32768,-32768, 282,-32768,-32768,-32768,
773-32768,-32768,-32768,-32768, 193, 197, 77, 364, 35, 35,
774-32768,-32768,-32768,-32768,-32768,-32768, 618, 291,-32768, 292,
775 273, 43,-32768,-32768, 302,-32768,-32768,-32768,-32768, 82,
776 35, 294,-32768, 294, 676, 193, 197, 77, 420, 35,
777 35,-32768,-32768,-32768,-32768,-32768,-32768, 201,-32768, 197,
778-32768, 328,-32768, 425,-32768, 48, 35, 77, 426, 426,
779 426, 426, 426, 426, 426, 426, 426, 197, 197, 197,
780 77, 197, 426, 426, 426,-32768,-32768, 335,-32768,-32768,
781 294, 294, 694,-32768, 347, 273, 197,-32768,-32768,-32768,
782 78, 78,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
783-32768,-32768, 348,-32768,-32768, 78,-32768,-32768,-32768,-32768,
784-32768, 459, 77, 469, 469, 469, 469, 469, 469, 469,
785 469, 469, 197, 197, 197, 77, 197, 469, 469, 469,
786-32768, 197,-32768, 197, 197, 197, 197, 376, 78, 78,
787-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
788 378,-32768,-32768, 78,-32768,-32768,-32768,-32768,-32768,-32768,
789 379, 380, 385, 386, 197, 197, 197, 197, 197, 197,
790 197, 197, 146, 398, 400, 409, 411, 412, 413, 415,
791 422,-32768, 424,-32768, 197, 197, 197, 197, 146, 197,
792 197, 197, 35, 427, 428, 433, 444, 445, 447, 453,
793 455, 101, 197,-32768, 197, 197, 197, 35, 197,-32768,
794 197, 197, 197,-32768, 447, 456, 458, 149, 466, 468,
795 470, 472,-32768, 197, 197, 197, 197, 197, 35,-32768,
796 197, 478, 479, 480, 502, 470, 294, 503, 197, 35,
797 465, 197, 35,-32768, 197, 479, 151,-32768,-32768, 504,
798 218, 505, 465, 35, 197, 35, 197,-32768, 294, 506,
799 294, 527, 197, 35, -71, 294, 35,-32768, 231, 465,
800-32768, 512, 537,-32768
801};
802
803static const short yypgoto[] = {-32768,
804-32768,-32768, 28,-32768,-32768,-32768, 1, -248,-32768,-32768,
805-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
806 308,-32768,-32768,-32768, 33, -202, 49,-32768, 293, 94,
807 63, -333, 142,-32768,-32768,-32768,-32768, 312, -84, -223,
808 68,-32768,-32768,-32768, 391,-32768, 26,-32768, 397,-32768,
809-32768,-32768,-32768,-32768,-32768, -190,-32768,-32768,-32768, 395,
810-32768,-32768,-32768,-32768,-32768, 688,-32768,-32768, -122, 2,
811 -278, -274, 107,-32768, -259, 108, 186, -2
812};
813
814
815#define YYLAST 809
816
817
818static const short yytable[] = { 38,
819 44, 22, 25, 38, 168, 261, 364, 264, 41, 176,
820 177, 39, 178, 226, 51, 40, 170, 191, 29, 86,
821 300, 93, 10, 11, 43, 30, 233, 386, 38, 38,
822 38, 38, 38, 42, 344, 187, 411, 412, 345, 597,
823 112, 2, 3, 4, 5, 6, 7, 10, 11, 8,
824 9, 10, 11, 420, 12, 10, 11, 381, 95, 96,
825 97, 98, 99, 348, 350, 113, 234, 13, 376, 125,
826 275, 134, 377, 149, 262, 225, 265, 115, 116, 117,
827 118, 119, 120, 121, 196, 10, 11, 238, 45, 10,
828 11, 356, 353, 46, 10, 11, 205, 222, 38, 38,
829 38, 38, 38, 38, 38, 38, 38, 38, 38, 269,
830 14, 31, 32, 256, 94, 33, 34, 206, 35, 409,
831 415, 48, 10, 11, 233, 305, 10, 11, 151, 152,
832 153, 154, 155, 156, 157, 158, 159, 160, 161, 421,
833 387, 15, 360, 361, 16, 15, 17, 18, 16, 237,
834 17, 18, 436, 91, 92, 247, 248, 419, 10, 11,
835 512, 239, 249, 220, 306, 291, 292, 293, 115, 116,
836 117, 118, 119, 120, 121, 15, 250, 251, 16, 15,
837 17, 18, 16, 252, 17, 18, 110, 111, 222, 532,
838 294, 295, 255, 387, 469, 296, 434, 435, 231, 438,
839 49, 50, 194, 52, 548, 10, 11, 484, 353, 10,
840 11, 543, 15, 10, 11, 16, 15, 17, 18, 16,
841 162, 17, 18, 163, 14, 567, 89, 90, 91, 92,
842 464, 465, 167, 232, 171, 173, 577, 174, 175, 581,
843 199, 387, 245, 387, 189, 467, 190, 193, 15, 195,
844 589, 16, 591, 17, 18, 291, 292, 293, 246, 556,
845 596, 584, 162, 599, 257, 163, 14, 258, 263, 197,
846 198, 266, 143, 144, 145, 146, 147, 148, 496, 497,
847 294, 295, 207, 267, 211, 296, 212, 213, 214, 215,
848 216, 217, 218, 499, 268, 15, 207, 221, 16, 15,
849 17, 18, 16, 15, 17, 18, 16, 100, 17, 18,
850 387, 327, 227, 228, 343, 316, 317, 318, 319, 320,
851 321, 322, 162, 387, 273, 163, 14, 236, 586, 162,
852 274, 240, 163, 14, 276, 354, 363, 363, 253, 254,
853 278, 314, 209, 162, 280, 209, 163, 14, 375, 170,
854 303, 309, 259, 260, 310, 304, 311, 385, 363, 588,
855 114, 169, 312, 270, 271, 272, 407, 363, 363, 482,
856 483, 598, 486, 379, 282, 283, 601, 314, 359, 323,
857 288, 289, 290, -261, 363, 299, 387, 301, 101, 102,
858 324, 103, 352, 104, 105, 106, 107, 108, 109, 110,
859 111, 378, 380, 115, 116, 117, 118, 119, 120, 121,
860 325, 326, 384, 200, 201, 202, 162, 328, 203, 163,
861 14, 346, 424, 425, 426, 427, 428, 429, 430, 431,
862 349, 351, 170, 172, 410, 439, 440, 441, 417, 418,
863 422, 101, 102, 355, 103, 442, 104, 105, 106, 107,
864 108, 109, 110, 111, 53, 188, 54, 462, 466, 383,
865 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
866 192, 65, 66, 468, 408, 115, 116, 117, 118, 119,
867 120, 121, 87, 470, 88, 414, 495, 416, 498, 500,
868 501, 89, 90, 91, 92, 502, 503, 115, 116, 117,
869 118, 119, 120, 121, 170, 433, 433, 433, 515, 433,
870 516, 603, 115, 116, 117, 118, 119, 120, 121, 517,
871 363, 518, 519, 520, 463, 521, 170, 67, 241, 242,
872 243, 68, 522, 244, 523, 363, 604, 533, 535, 101,
873 102, 170, 103, 536, 104, 105, 106, 107, 108, 109,
874 110, 111, 170, 335, 537, 538, 363, 539, 150, 336,
875 481, 481, 481, 541, 481, 542, 554, 363, 555, 490,
876 363, 491, 492, 493, 494, 87, 557, 88, 558, 287,
877 559, 363, 561, 363, 89, 90, 91, 92, 569, 570,
878 572, 363, 126, 553, 363, 337, 338, 162, 339, 340,
879 163, 14, 504, 505, 506, 507, 508, 509, 510, 511,
880 514, 88, 573, 575, 585, 587, 593, 341, 89, 90,
881 91, 92, 524, 525, 526, 527, 514, 529, 530, 531,
882 179, 180, 181, 182, 183, 184, 185, 594, 583, 373,
883 544, 366, 545, 546, 547, 186, 549, 367, 550, 551,
884 552, 104, 105, 106, 107, 108, 109, 110, 111, 574,
885 528, 562, 563, 564, 565, 566, 600, 297, 568, 115,
886 116, 117, 118, 119, 120, 121, 576, 302, 307, 580,
887 0, 0, 582, 368, 369, 162, 370, 371, 163, 14,
888 0, 0, 590, 0, 592, 0, 0, 0, 0, 0,
889 595, 0, 0, 0, 0, 372, 388, 389, 390, 391,
890 392, 393, 394, 395, 396, 397, 398, 399, 400, 401,
891 402, 403, 404, 405, 443, 444, 445, 446, 447, 448,
892 449, 450, 451, 452, 453, 454, 455, 456, 457, 458,
893 459, 460, 127, 128, 129, 130, 131, 132, 133, 0,
894 135, 0, 137, 138, 139, 140, 472, 473, 474, 475,
895 476, 477, 478, 479, 406, 141, 329, 0, 0, 487,
896 488, 489, 0, 330, 331, 332, 333, 0, 0, 0,
897 334, 102, 461, 103, 0, 104, 105, 106, 107, 108,
898 109, 110, 111, 103, 0, 104, 105, 106, 107, 108,
899 109, 110, 111, 106, 107, 108, 109, 110, 111
900};
901
902static const short yycheck[] = { 2,
903 16, 1, 1, 6, 127, 15, 340, 15, 10, 132,
904 133, 16, 135, 204, 17, 16, 88, 140, 9, 88,
905 280, 16, 13, 14, 10, 16, 49, 361, 31, 32,
906 33, 34, 35, 6, 313, 17, 370, 371, 313, 111,
907 10, 3, 4, 5, 6, 7, 8, 13, 14, 11,
908 12, 13, 14, 387, 16, 13, 14, 15, 31, 32,
909 33, 34, 35, 323, 324, 10, 89, 29, 347, 111,
910 261, 17, 347, 16, 84, 89, 84, 59, 60, 61,
911 62, 63, 64, 65, 110, 13, 14, 15, 104, 13,
912 14, 15, 16, 109, 13, 14, 111, 111, 101, 102,
913 103, 104, 105, 106, 107, 108, 109, 110, 111, 88,
914 72, 102, 103, 236, 109, 106, 107, 111, 109, 368,
915 380, 14, 13, 14, 49, 50, 13, 14, 101, 102,
916 103, 104, 105, 106, 107, 108, 109, 110, 111, 388,
917 93, 103, 108, 109, 106, 103, 108, 109, 106, 15,
918 108, 109, 401, 104, 105, 82, 83, 110, 13, 14,
919 15, 89, 89, 111, 89, 55, 56, 57, 59, 60,
920 61, 62, 63, 64, 65, 103, 82, 83, 106, 103,
921 108, 109, 106, 89, 108, 109, 102, 103, 111, 523,
922 80, 81, 15, 93, 443, 85, 399, 400, 111, 402,
923 15, 16, 89, 18, 538, 13, 14, 456, 16, 13,
924 14, 111, 103, 13, 14, 106, 103, 108, 109, 106,
925 68, 108, 109, 71, 72, 559, 102, 103, 104, 105,
926 421, 422, 125, 111, 128, 129, 570, 130, 131, 573,
927 88, 93, 111, 93, 138, 436, 139, 141, 103, 142,
928 584, 106, 586, 108, 109, 55, 56, 57, 111, 111,
929 594, 111, 68, 597, 111, 71, 72, 111, 15, 162,
930 163, 15, 87, 88, 89, 90, 91, 92, 469, 470,
931 80, 81, 88, 111, 178, 85, 179, 180, 181, 182,
932 183, 184, 185, 484, 111, 103, 88, 191, 106, 103,
933 108, 109, 106, 103, 108, 109, 106, 10, 108, 109,
934 93, 15, 205, 206, 313, 290, 291, 292, 293, 294,
935 295, 296, 68, 93, 111, 71, 72, 220, 111, 68,
936 111, 224, 71, 72, 111, 335, 339, 340, 231, 232,
937 111, 111, 88, 68, 111, 88, 71, 72, 347, 88,
938 111, 84, 245, 246, 87, 111, 89, 360, 361, 583,
939 10, 17, 111, 88, 257, 258, 366, 370, 371, 454,
940 455, 595, 457, 348, 267, 268, 600, 111, 15, 111,
941 273, 274, 275, 111, 387, 278, 93, 280, 91, 92,
942 111, 94, 111, 96, 97, 98, 99, 100, 101, 102,
943 103, 111, 111, 59, 60, 61, 62, 63, 64, 65,
944 303, 304, 111, 13, 14, 15, 68, 310, 18, 71,
945 72, 314, 390, 391, 392, 393, 394, 395, 396, 397,
946 323, 324, 88, 17, 15, 403, 404, 405, 111, 15,
947 15, 91, 92, 336, 94, 111, 96, 97, 98, 99,
948 100, 101, 102, 103, 13, 17, 15, 111, 111, 352,
949 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
950 17, 30, 31, 15, 367, 59, 60, 61, 62, 63,
951 64, 65, 93, 15, 95, 378, 111, 380, 111, 111,
952 111, 102, 103, 104, 105, 111, 111, 59, 60, 61,
953 62, 63, 64, 65, 88, 398, 399, 400, 111, 402,
954 111, 0, 59, 60, 61, 62, 63, 64, 65, 111,
955 523, 111, 111, 111, 417, 111, 88, 86, 13, 14,
956 15, 90, 111, 18, 111, 538, 0, 111, 111, 91,
957 92, 88, 94, 111, 96, 97, 98, 99, 100, 101,
958 102, 103, 88, 24, 111, 111, 559, 111, 110, 30,
959 453, 454, 455, 111, 457, 111, 111, 570, 111, 462,
960 573, 464, 465, 466, 467, 93, 111, 95, 111, 272,
961 111, 584, 111, 586, 102, 103, 104, 105, 111, 111,
962 111, 594, 110, 545, 597, 66, 67, 68, 69, 70,
963 71, 72, 495, 496, 497, 498, 499, 500, 501, 502,
964 503, 95, 111, 111, 111, 111, 111, 88, 102, 103,
965 104, 105, 515, 516, 517, 518, 519, 520, 521, 522,
966 73, 74, 75, 76, 77, 78, 79, 111, 576, 347,
967 533, 24, 535, 536, 537, 88, 539, 30, 541, 542,
968 543, 96, 97, 98, 99, 100, 101, 102, 103, 566,
969 519, 554, 555, 556, 557, 558, 599, 277, 561, 59,
970 60, 61, 62, 63, 64, 65, 569, 281, 284, 572,
971 -1, -1, 575, 66, 67, 68, 69, 70, 71, 72,
972 -1, -1, 585, -1, 587, -1, -1, -1, -1, -1,
973 593, -1, -1, -1, -1, 88, 31, 32, 33, 34,
974 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
975 45, 46, 47, 48, 31, 32, 33, 34, 35, 36,
976 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
977 47, 48, 55, 56, 57, 58, 59, 60, 61, -1,
978 63, -1, 65, 66, 67, 68, 445, 446, 447, 448,
979 449, 450, 451, 452, 89, 78, 44, -1, -1, 458,
980 459, 460, -1, 51, 52, 53, 54, -1, -1, -1,
981 58, 92, 89, 94, -1, 96, 97, 98, 99, 100,
982 101, 102, 103, 94, -1, 96, 97, 98, 99, 100,
983 101, 102, 103, 98, 99, 100, 101, 102, 103
984};
985/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
986#line 3 "/emx/share/bison.simple"
987/* This file comes from bison-1.28. */
988
989/* Skeleton output parser for bison,
990 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
991
992 This program is free software; you can redistribute it and/or modify
993 it under the terms of the GNU General Public License as published by
994 the Free Software Foundation; either version 2, or (at your option)
995 any later version.
996
997 This program is distributed in the hope that it will be useful,
998 but WITHOUT ANY WARRANTY; without even the implied warranty of
999 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1000 GNU General Public License for more details.
1001
1002 You should have received a copy of the GNU General Public License
1003 along with this program; if not, write to the Free Software
1004 Foundation, Inc., 59 Temple Place - Suite 330,
1005 Boston, MA 02111-1307, USA. */
1006
1007/* As a special exception, when this file is copied by Bison into a
1008 Bison output file, you may use that output file without restriction.
1009 This special exception was added by the Free Software Foundation
1010 in version 1.24 of Bison. */
1011
1012/* This is the parser code that is written into each bison parser
1013 when the %semantic_parser declaration is not specified in the grammar.
1014 It was written by Richard Stallman by simplifying the hairy parser
1015 used when %semantic_parser is specified. */
1016
1017#ifndef YYSTACK_USE_ALLOCA
1018#ifdef alloca
1019#define YYSTACK_USE_ALLOCA
1020#else /* alloca not defined */
1021#ifdef __GNUC__
1022#define YYSTACK_USE_ALLOCA
1023#define alloca __builtin_alloca
1024#else /* not GNU C. */
1025#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
1026#define YYSTACK_USE_ALLOCA
1027#include <alloca.h>
1028#else /* not sparc */
1029/* We think this test detects Watcom and Microsoft C. */
1030/* This used to test MSDOS, but that is a bad idea
1031 since that symbol is in the user namespace. */
1032#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
1033#if 0 /* No need for malloc.h, which pollutes the namespace;
1034 instead, just don't use alloca. */
1035#include <malloc.h>
1036#endif
1037#else /* not MSDOS, or __TURBOC__ */
1038#if defined(_AIX)
1039/* I don't know what this was needed for, but it pollutes the namespace.
1040 So I turned it off. rms, 2 May 1997. */
1041/* #include <malloc.h> */
1042 #pragma alloca
1043#define YYSTACK_USE_ALLOCA
1044#else /* not MSDOS, or __TURBOC__, or _AIX */
1045#if 0
1046#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
1047 and on HPUX 10. Eventually we can turn this on. */
1048#define YYSTACK_USE_ALLOCA
1049#define alloca __builtin_alloca
1050#endif /* __hpux */
1051#endif
1052#endif /* not _AIX */
1053#endif /* not MSDOS, or __TURBOC__ */
1054#endif /* not sparc */
1055#endif /* not GNU C */
1056#endif /* alloca not defined */
1057#endif /* YYSTACK_USE_ALLOCA not defined */
1058
1059#ifdef YYSTACK_USE_ALLOCA
1060#define YYSTACK_ALLOC alloca
1061#else
1062#define YYSTACK_ALLOC malloc
1063#endif
1064
1065/* Note: there must be only one dollar sign in this file.
1066 It is replaced by the list of actions, each action
1067 as one case of the switch. */
1068
1069#define yyerrok (yyerrstatus = 0)
1070#define yyclearin (yychar = YYEMPTY)
1071#define YYEMPTY -2
1072#define YYEOF 0
1073#define YYACCEPT goto yyacceptlab
1074#define YYABORT goto yyabortlab
1075#define YYERROR goto yyerrlab1
1076/* Like YYERROR except do call yyerror.
1077 This remains here temporarily to ease the
1078 transition to the new meaning of YYERROR, for GCC.
1079 Once GCC version 2 has supplanted version 1, this can go. */
1080#define YYFAIL goto yyerrlab
1081#define YYRECOVERING() (!!yyerrstatus)
1082#define YYBACKUP(token, value) \
1083do \
1084 if (yychar == YYEMPTY && yylen == 1) \
1085 { yychar = (token), yylval = (value); \
1086 yychar1 = YYTRANSLATE (yychar); \
1087 YYPOPSTACK; \
1088 goto yybackup; \
1089 } \
1090 else \
1091 { yyerror ("syntax error: cannot back up"); YYERROR; } \
1092while (0)
1093
1094#define YYTERROR 1
1095#define YYERRCODE 256
1096
1097#ifndef YYPURE
1098#define YYLEX yylex()
1099#endif
1100
1101#ifdef YYPURE
1102#ifdef YYLSP_NEEDED
1103#ifdef YYLEX_PARAM
1104#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
1105#else
1106#define YYLEX yylex(&yylval, &yylloc)
1107#endif
1108#else /* not YYLSP_NEEDED */
1109#ifdef YYLEX_PARAM
1110#define YYLEX yylex(&yylval, YYLEX_PARAM)
1111#else
1112#define YYLEX yylex(&yylval)
1113#endif
1114#endif /* not YYLSP_NEEDED */
1115#endif
1116
1117/* If nonreentrant, generate the variables here */
1118
1119#ifndef YYPURE
1120
1121int yychar; /* the lookahead symbol */
1122YYSTYPE yylval; /* the semantic value of the */
1123 /* lookahead symbol */
1124
1125#ifdef YYLSP_NEEDED
1126YYLTYPE yylloc; /* location data for the lookahead */
1127 /* symbol */
1128#endif
1129
1130int yynerrs; /* number of parse errors so far */
1131#endif /* not YYPURE */
1132
1133#if YYDEBUG != 0
1134int yydebug; /* nonzero means print parse trace */
1135/* Since this is uninitialized, it does not stop multiple parsers
1136 from coexisting. */
1137#endif
1138
1139/* YYINITDEPTH indicates the initial size of the parser's stacks */
1140
1141#ifndef YYINITDEPTH
1142#define YYINITDEPTH 200
1143#endif
1144
1145/* YYMAXDEPTH is the maximum size the stacks can grow to
1146 (effective only if the built-in stack extension method is used). */
1147
1148#if YYMAXDEPTH == 0
1149#undef YYMAXDEPTH
1150#endif
1151
1152#ifndef YYMAXDEPTH
1153#define YYMAXDEPTH 10000
1154#endif
1155
1156
1157/* Define __yy_memcpy. Note that the size argument
1158 should be passed with type unsigned int, because that is what the non-GCC
1159 definitions require. With GCC, __builtin_memcpy takes an arg
1160 of type size_t, but it can handle unsigned int. */
1161
1162#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
1163#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1164#else /* not GNU C or C++ */
1165#ifndef __cplusplus
1166
1167/* This is the most reliable way to avoid incompatibilities
1168 in available built-in functions on various systems. */
1169static void
1170__yy_memcpy (to, from, count)
1171 char *to;
1172 char *from;
1173 unsigned int count;
1174{
1175 register char *f = from;
1176 register char *t = to;
1177 register int i = count;
1178
1179 while (i-- > 0)
1180 *t++ = *f++;
1181}
1182
1183#else /* __cplusplus */
1184
1185/* This is the most reliable way to avoid incompatibilities
1186 in available built-in functions on various systems. */
1187static void
1188__yy_memcpy (char *to, char *from, unsigned int count)
1189{
1190 register char *t = to;
1191 register char *f = from;
1192 register int i = count;
1193
1194 while (i-- > 0)
1195 *t++ = *f++;
1196}
1197
1198#endif
1199#endif
1200
1201
1202#line 217 "/emx/share/bison.simple"
1203
1204/* The user can define YYPARSE_PARAM as the name of an argument to be passed
1205 into yyparse. The argument should have type void *.
1206 It should actually point to an object.
1207 Grammar actions can access the variable by casting it
1208 to the proper pointer type. */
1209
1210#ifdef YYPARSE_PARAM
1211#ifdef __cplusplus
1212#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1213#define YYPARSE_PARAM_DECL
1214#else /* not __cplusplus */
1215#define YYPARSE_PARAM_ARG YYPARSE_PARAM
1216#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1217#endif /* not __cplusplus */
1218#else /* not YYPARSE_PARAM */
1219#define YYPARSE_PARAM_ARG
1220#define YYPARSE_PARAM_DECL
1221#endif /* not YYPARSE_PARAM */
1222
1223/* Prevent warning if -Wstrict-prototypes. */
1224#ifdef __GNUC__
1225#ifdef YYPARSE_PARAM
1226int yyparse (void *);
1227#else
1228int yyparse (void);
1229#endif
1230#endif
1231
1232int
1233yyparse(YYPARSE_PARAM_ARG)
1234 YYPARSE_PARAM_DECL
1235{
1236 register int yystate;
1237 register int yyn;
1238 register short *yyssp;
1239 register YYSTYPE *yyvsp;
1240 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1241 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
1242
1243 short yyssa[YYINITDEPTH]; /* the state stack */
1244 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1245
1246 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1247 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1248
1249#ifdef YYLSP_NEEDED
1250 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1251 YYLTYPE *yyls = yylsa;
1252 YYLTYPE *yylsp;
1253
1254#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1255#else
1256#define YYPOPSTACK (yyvsp--, yyssp--)
1257#endif
1258
1259 int yystacksize = YYINITDEPTH;
1260 int yyfree_stacks = 0;
1261
1262#ifdef YYPURE
1263 int yychar;
1264 YYSTYPE yylval;
1265 int yynerrs;
1266#ifdef YYLSP_NEEDED
1267 YYLTYPE yylloc;
1268#endif
1269#endif
1270
1271 YYSTYPE yyval; /* the variable used to return */
1272 /* semantic values from the action */
1273 /* routines */
1274
1275 int yylen;
1276
1277#if YYDEBUG != 0
1278 if (yydebug)
1279 fprintf(stderr, "Starting parse\n");
1280#endif
1281
1282 yystate = 0;
1283 yyerrstatus = 0;
1284 yynerrs = 0;
1285 yychar = YYEMPTY; /* Cause a token to be read. */
1286
1287 /* Initialize stack pointers.
1288 Waste one element of value and location stack
1289 so that they stay on the same level as the state stack.
1290 The wasted elements are never initialized. */
1291
1292 yyssp = yyss - 1;
1293 yyvsp = yyvs;
1294#ifdef YYLSP_NEEDED
1295 yylsp = yyls;
1296#endif
1297
1298/* Push a new state, which is found in yystate . */
1299/* In all cases, when you get here, the value and location stacks
1300 have just been pushed. so pushing a state here evens the stacks. */
1301yynewstate:
1302
1303 *++yyssp = yystate;
1304
1305 if (yyssp >= yyss + yystacksize - 1)
1306 {
1307 /* Give user a chance to reallocate the stack */
1308 /* Use copies of these so that the &'s don't force the real ones into memory. */
1309 YYSTYPE *yyvs1 = yyvs;
1310 short *yyss1 = yyss;
1311#ifdef YYLSP_NEEDED
1312 YYLTYPE *yyls1 = yyls;
1313#endif
1314
1315 /* Get the current used size of the three stacks, in elements. */
1316 int size = yyssp - yyss + 1;
1317
1318#ifdef yyoverflow
1319 /* Each stack pointer address is followed by the size of
1320 the data in use in that stack, in bytes. */
1321#ifdef YYLSP_NEEDED
1322 /* This used to be a conditional around just the two extra args,
1323 but that might be undefined if yyoverflow is a macro. */
1324 yyoverflow("parser stack overflow",
1325 &yyss1, size * sizeof (*yyssp),
1326 &yyvs1, size * sizeof (*yyvsp),
1327 &yyls1, size * sizeof (*yylsp),
1328 &yystacksize);
1329#else
1330 yyoverflow("parser stack overflow",
1331 &yyss1, size * sizeof (*yyssp),
1332 &yyvs1, size * sizeof (*yyvsp),
1333 &yystacksize);
1334#endif
1335
1336 yyss = yyss1; yyvs = yyvs1;
1337#ifdef YYLSP_NEEDED
1338 yyls = yyls1;
1339#endif
1340#else /* no yyoverflow */
1341 /* Extend the stack our own way. */
1342 if (yystacksize >= YYMAXDEPTH)
1343 {
1344 yyerror("parser stack overflow");
1345 if (yyfree_stacks)
1346 {
1347 free (yyss);
1348 free (yyvs);
1349#ifdef YYLSP_NEEDED
1350 free (yyls);
1351#endif
1352 }
1353 return 2;
1354 }
1355 yystacksize *= 2;
1356 if (yystacksize > YYMAXDEPTH)
1357 yystacksize = YYMAXDEPTH;
1358#ifndef YYSTACK_USE_ALLOCA
1359 yyfree_stacks = 1;
1360#endif
1361 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1362 __yy_memcpy ((char *)yyss, (char *)yyss1,
1363 size * (unsigned int) sizeof (*yyssp));
1364 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1365 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1366 size * (unsigned int) sizeof (*yyvsp));
1367#ifdef YYLSP_NEEDED
1368 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1369 __yy_memcpy ((char *)yyls, (char *)yyls1,
1370 size * (unsigned int) sizeof (*yylsp));
1371#endif
1372#endif /* no yyoverflow */
1373
1374 yyssp = yyss + size - 1;
1375 yyvsp = yyvs + size - 1;
1376#ifdef YYLSP_NEEDED
1377 yylsp = yyls + size - 1;
1378#endif
1379
1380#if YYDEBUG != 0
1381 if (yydebug)
1382 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1383#endif
1384
1385 if (yyssp >= yyss + yystacksize - 1)
1386 YYABORT;
1387 }
1388
1389#if YYDEBUG != 0
1390 if (yydebug)
1391 fprintf(stderr, "Entering state %d\n", yystate);
1392#endif
1393
1394 goto yybackup;
1395 yybackup:
1396
1397/* Do appropriate processing given the current state. */
1398/* Read a lookahead token if we need one and don't already have one. */
1399/* yyresume: */
1400
1401 /* First try to decide what to do without reference to lookahead token. */
1402
1403 yyn = yypact[yystate];
1404 if (yyn == YYFLAG)
1405 goto yydefault;
1406
1407 /* Not known => get a lookahead token if don't already have one. */
1408
1409 /* yychar is either YYEMPTY or YYEOF
1410 or a valid token in external form. */
1411
1412 if (yychar == YYEMPTY)
1413 {
1414#if YYDEBUG != 0
1415 if (yydebug)
1416 fprintf(stderr, "Reading a token: ");
1417#endif
1418 yychar = YYLEX;
1419 }
1420
1421 /* Convert token to internal form (in yychar1) for indexing tables with */
1422
1423 if (yychar <= 0) /* This means end of input. */
1424 {
1425 yychar1 = 0;
1426 yychar = YYEOF; /* Don't call YYLEX any more */
1427
1428#if YYDEBUG != 0
1429 if (yydebug)
1430 fprintf(stderr, "Now at end of input.\n");
1431#endif
1432 }
1433 else
1434 {
1435 yychar1 = YYTRANSLATE(yychar);
1436
1437#if YYDEBUG != 0
1438 if (yydebug)
1439 {
1440 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1441 /* Give the individual parser a way to print the precise meaning
1442 of a token, for further debugging info. */
1443#ifdef YYPRINT
1444 YYPRINT (stderr, yychar, yylval);
1445#endif
1446 fprintf (stderr, ")\n");
1447 }
1448#endif
1449 }
1450
1451 yyn += yychar1;
1452 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1453 goto yydefault;
1454
1455 yyn = yytable[yyn];
1456
1457 /* yyn is what to do for this token type in this state.
1458 Negative => reduce, -yyn is rule number.
1459 Positive => shift, yyn is new state.
1460 New state is final state => don't bother to shift,
1461 just return success.
1462 0, or most negative number => error. */
1463
1464 if (yyn < 0)
1465 {
1466 if (yyn == YYFLAG)
1467 goto yyerrlab;
1468 yyn = -yyn;
1469 goto yyreduce;
1470 }
1471 else if (yyn == 0)
1472 goto yyerrlab;
1473
1474 if (yyn == YYFINAL)
1475 YYACCEPT;
1476
1477 /* Shift the lookahead token. */
1478
1479#if YYDEBUG != 0
1480 if (yydebug)
1481 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1482#endif
1483
1484 /* Discard the token being shifted unless it is eof. */
1485 if (yychar != YYEOF)
1486 yychar = YYEMPTY;
1487
1488 *++yyvsp = yylval;
1489#ifdef YYLSP_NEEDED
1490 *++yylsp = yylloc;
1491#endif
1492
1493 /* count tokens shifted since error; after three, turn off error status. */
1494 if (yyerrstatus) yyerrstatus--;
1495
1496 yystate = yyn;
1497 goto yynewstate;
1498
1499/* Do the default action for the current state. */
1500yydefault:
1501
1502 yyn = yydefact[yystate];
1503 if (yyn == 0)
1504 goto yyerrlab;
1505
1506/* Do a reduction. yyn is the number of a rule to reduce with. */
1507yyreduce:
1508 yylen = yyr2[yyn];
1509 if (yylen > 0)
1510 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1511
1512#if YYDEBUG != 0
1513 if (yydebug)
1514 {
1515 int i;
1516
1517 fprintf (stderr, "Reducing via rule %d (line %d), ",
1518 yyn, yyrline[yyn]);
1519
1520 /* Print the symbols being reduced, and their result. */
1521 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1522 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1523 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1524 }
1525#endif
1526
1527
1528 switch (yyn) {
1529
1530case 1:
1531#line 310 "parser.y"
1532{
1533 resource_t *rsc;
1534 /* First add stringtables to the resource-list */
1535 rsc = build_stt_resources(sttres);
1536 /* 'build_stt_resources' returns a head and $1 is a tail */
1537 if(yyvsp[0].res)
1538 {
1539 yyvsp[0].res->next = rsc;
1540 if(rsc)
1541 rsc->prev = yyvsp[0].res;
1542 }
1543 else
1544 yyvsp[0].res = rsc;
1545 /* Final statement before were done */
1546 resource_top = get_resource_head(yyvsp[0].res);
1547 ;
1548 break;}
1549case 2:
1550#line 330 "parser.y"
1551{ yyval.res = NULL; want_rscname = 1; ;
1552 break;}
1553case 3:
1554#line 331 "parser.y"
1555{
1556 if(yyvsp[0].res)
1557 {
1558 resource_t *tail = yyvsp[0].res;
1559 resource_t *head = yyvsp[0].res;
1560 while(tail->next)
1561 tail = tail->next;
1562 while(head->prev)
1563 head = head->prev;
1564 head->prev = yyvsp[-1].res;
1565 if(yyvsp[-1].res)
1566 yyvsp[-1].res->next = head;
1567 yyval.res = tail;
1568 }
1569 else if(yyvsp[-1].res)
1570 {
1571 resource_t *tail = yyvsp[-1].res;
1572 while(tail->next)
1573 tail = tail->next;
1574 yyval.res = tail;
1575 }
1576 else
1577 yyval.res = NULL;
1578 want_rscname = 1;
1579 ;
1580 break;}
1581case 4:
1582#line 356 "parser.y"
1583{ yyval.res = yyvsp[-1].res; want_rscname = 1; ;
1584 break;}
1585case 5:
1586#line 357 "parser.y"
1587{ yyval.res = yyvsp[-1].res; want_rscname = 1; ;
1588 break;}
1589case 6:
1590#line 362 "parser.y"
1591{ pop_start(); push_if(yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, 0, 0); if(yyvsp[-1].iptr) free(yyvsp[-1].iptr);;
1592 break;}
1593case 7:
1594#line 363 "parser.y"
1595{ pop_start(); push_if(pp_lookup(yyvsp[-1].str->str.cstr) != NULL, 0, 0); ;
1596 break;}
1597case 8:
1598#line 364 "parser.y"
1599{ pop_start(); push_if(pp_lookup(yyvsp[-1].str->str.cstr) == NULL, 0, 0); ;
1600 break;}
1601case 9:
1602#line 365 "parser.y"
1603{ pop_start(); push_if(yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, pop_if(), 0); if(yyvsp[-1].iptr) free(yyvsp[-1].iptr); ;
1604 break;}
1605case 10:
1606#line 366 "parser.y"
1607{ pop_start(); push_if(1, pop_if(), 0); ;
1608 break;}
1609case 11:
1610#line 367 "parser.y"
1611{ pop_if(); ;
1612 break;}
1613case 12:
1614#line 370 "parser.y"
1615{ yyval.iptr = yyvsp[0].iptr; ;
1616 break;}
1617case 13:
1618#line 371 "parser.y"
1619{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr || *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1620 break;}
1621case 14:
1622#line 372 "parser.y"
1623{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr && *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1624 break;}
1625case 15:
1626#line 373 "parser.y"
1627{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr + *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1628 break;}
1629case 16:
1630#line 374 "parser.y"
1631{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr - *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1632 break;}
1633case 17:
1634#line 375 "parser.y"
1635{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr ^ *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1636 break;}
1637case 18:
1638#line 376 "parser.y"
1639{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr == *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1640 break;}
1641case 19:
1642#line 377 "parser.y"
1643{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr != *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1644 break;}
1645case 20:
1646#line 378 "parser.y"
1647{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr < *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1648 break;}
1649case 21:
1650#line 379 "parser.y"
1651{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr > *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1652 break;}
1653case 22:
1654#line 380 "parser.y"
1655{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr <= *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1656 break;}
1657case 23:
1658#line 381 "parser.y"
1659{ yyval.iptr = new_int(yyvsp[-2].iptr && yyvsp[0].iptr ? (*yyvsp[-2].iptr >= *yyvsp[0].iptr) : 0); if(yyvsp[-2].iptr) free(yyvsp[-2].iptr); if(yyvsp[0].iptr) free(yyvsp[0].iptr); ;
1660 break;}
1661case 24:
1662#line 382 "parser.y"
1663{ yyval.iptr = yyvsp[0].iptr; if(yyvsp[0].iptr) *yyvsp[0].iptr = ~(*yyvsp[0].iptr); ;
1664 break;}
1665case 25:
1666#line 383 "parser.y"
1667{ yyval.iptr = yyvsp[0].iptr; ;
1668 break;}
1669case 26:
1670#line 384 "parser.y"
1671{ yyval.iptr = yyvsp[0].iptr; if(yyvsp[0].iptr) *yyvsp[0].iptr = -(*yyvsp[0].iptr); ;
1672 break;}
1673case 27:
1674#line 385 "parser.y"
1675{ yyval.iptr = yyvsp[0].iptr; if(yyvsp[0].iptr) *yyvsp[0].iptr = !(*yyvsp[0].iptr); ;
1676 break;}
1677case 28:
1678#line 386 "parser.y"
1679{ yyval.iptr = yyvsp[-1].iptr; ;
1680 break;}
1681case 29:
1682#line 390 "parser.y"
1683{ yyval.iptr = new_int(yyvsp[0].num); ;
1684 break;}
1685case 30:
1686#line 391 "parser.y"
1687{ yyval.iptr = NULL; ;
1688 break;}
1689case 31:
1690#line 392 "parser.y"
1691{ yyval.iptr = new_int(pp_lookup(yyvsp[0].str->str.cstr) != NULL); ;
1692 break;}
1693case 32:
1694#line 393 "parser.y"
1695{ yyval.iptr = new_int(pp_lookup(yyvsp[-1].str->str.cstr) != NULL); ;
1696 break;}
1697case 33:
1698#line 397 "parser.y"
1699{ strip_til_semicolon(); ;
1700 break;}
1701case 34:
1702#line 398 "parser.y"
1703{ strip_extern(); ;
1704 break;}
1705case 35:
1706#line 399 "parser.y"
1707{ strip_til_semicolon(); ;
1708 break;}
1709case 36:
1710#line 400 "parser.y"
1711{ strip_til_parenthesis(); ;
1712 break;}
1713case 37:
1714#line 401 "parser.y"
1715{ strip_til_semicolon(); ;
1716 break;}
1717case 38:
1718#line 406 "parser.y"
1719{
1720 yyval.res = yyvsp[0].res;
1721 if(yyval.res)
1722 {
1723 yyval.res->name = yyvsp[-1].nid;
1724 if(yyvsp[-1].nid->type == name_ord)
1725 {
1726 chat("Got %s (%d)",get_typename(yyvsp[0].res),yyvsp[-1].nid->name.i_name);
1727 }
1728 else if(yyvsp[-1].nid->type == name_str)
1729 {
1730 chat("Got %s (%s)",get_typename(yyvsp[0].res),yyvsp[-1].nid->name.s_name->str.cstr);
1731 }
1732 }
1733 ;
1734 break;}
1735case 39:
1736#line 421 "parser.y"
1737{
1738 /* Don't do anything, stringtables are converted to
1739 * resource_t structures when we are finished parsing and
1740 * the final rule of the parser is reduced (see above)
1741 */
1742 yyval.res = NULL;
1743 chat("Got STRINGTABLE");
1744 ;
1745 break;}
1746case 40:
1747#line 429 "parser.y"
1748{
1749 if(!win32)
1750 yywarning("LANGUAGE not supported in 16-bit mode");
1751 if(currentlanguage)
1752 free(currentlanguage);
1753 currentlanguage = yyvsp[0].lan;
1754 yyval.res = NULL;
1755 ;
1756 break;}
1757case 41:
1758#line 442 "parser.y"
1759{
1760 if(yyvsp[0].num > 65535 || yyvsp[0].num < -32768)
1761 yyerror("Resource's ID out of range (%d)", yyvsp[0].num);
1762 yyval.nid = new_name_id();
1763 yyval.nid->type = name_ord;
1764 yyval.nid->name.i_name = yyvsp[0].num;
1765 want_rscname = 0;
1766 ;
1767 break;}
1768case 42:
1769#line 450 "parser.y"
1770{
1771 yyval.nid = new_name_id();
1772 yyval.nid->type = name_str;
1773 yyval.nid->name.s_name = yyvsp[0].str;
1774 want_rscname = 0;
1775 ;
1776 break;}
1777case 43:
1778#line 461 "parser.y"
1779{ yyval.nid = yyvsp[0].nid; ;
1780 break;}
1781case 44:
1782#line 462 "parser.y"
1783{
1784 yyval.nid = new_name_id();
1785 yyval.nid->type = name_str;
1786 yyval.nid->name.s_name = yyvsp[0].str;
1787 want_rscname = 0;
1788 ;
1789 break;}
1790case 45:
1791#line 472 "parser.y"
1792{ yyval.res = new_resource(res_acc, yyvsp[0].acc, yyvsp[0].acc->memopt, yyvsp[0].acc->lvc.language); ;
1793 break;}
1794case 46:
1795#line 473 "parser.y"
1796{ yyval.res = new_resource(res_bmp, yyvsp[0].bmp, yyvsp[0].bmp->memopt, dup_language(currentlanguage)); ;
1797 break;}
1798case 47:
1799#line 474 "parser.y"
1800{
1801 resource_t *rsc;
1802 cursor_t *cur;
1803 yyval.res = rsc = new_resource(res_curg, yyvsp[0].curg, yyvsp[0].curg->memopt, dup_language(currentlanguage));
1804 for(cur = yyvsp[0].curg->cursorlist; cur; cur = cur->next)
1805 {
1806 rsc->prev = new_resource(res_cur, cur, yyvsp[0].curg->memopt, dup_language(currentlanguage));
1807 rsc->prev->next = rsc;
1808 rsc = rsc->prev;
1809 rsc->name = new_name_id();
1810 rsc->name->type = name_ord;
1811 rsc->name->name.i_name = cur->id;
1812 }
1813 ;
1814 break;}
1815case 48:
1816#line 488 "parser.y"
1817{ yyval.res = new_resource(res_dlg, yyvsp[0].dlg, yyvsp[0].dlg->memopt, yyvsp[0].dlg->lvc.language); ;
1818 break;}
1819case 49:
1820#line 489 "parser.y"
1821{
1822 if(win32)
1823 yyval.res = new_resource(res_dlgex, yyvsp[0].dlgex, yyvsp[0].dlgex->memopt, yyvsp[0].dlgex->lvc.language);
1824 else
1825 yyval.res = NULL;
1826 ;
1827 break;}
1828case 50:
1829#line 495 "parser.y"
1830{ yyval.res = new_resource(res_dlginit, yyvsp[0].dginit, yyvsp[0].dginit->memopt, yyvsp[0].dginit->lvc.language); ;
1831 break;}
1832case 51:
1833#line 496 "parser.y"
1834{ yyval.res = new_resource(res_fnt, yyvsp[0].fnt, yyvsp[0].fnt->memopt, dup_language(currentlanguage)); ;
1835 break;}
1836case 52:
1837#line 497 "parser.y"
1838{
1839 resource_t *rsc;
1840 icon_t *ico;
1841 yyval.res = rsc = new_resource(res_icog, yyvsp[0].icog, yyvsp[0].icog->memopt, dup_language(currentlanguage));
1842 for(ico = yyvsp[0].icog->iconlist; ico; ico = ico->next)
1843 {
1844 rsc->prev = new_resource(res_ico, ico, yyvsp[0].icog->memopt, dup_language(currentlanguage));
1845 rsc->prev->next = rsc;
1846 rsc = rsc->prev;
1847 rsc->name = new_name_id();
1848 rsc->name->type = name_ord;
1849 rsc->name->name.i_name = ico->id;
1850 }
1851 ;
1852 break;}
1853case 53:
1854#line 511 "parser.y"
1855{ yyval.res = new_resource(res_men, yyvsp[0].men, yyvsp[0].men->memopt, yyvsp[0].men->lvc.language); ;
1856 break;}
1857case 54:
1858#line 512 "parser.y"
1859{
1860 if(win32)
1861 yyval.res = new_resource(res_menex, yyvsp[0].menex, yyvsp[0].menex->memopt, yyvsp[0].menex->lvc.language);
1862 else
1863 yyval.res = NULL;
1864 ;
1865 break;}
1866case 55:
1867#line 518 "parser.y"
1868{ yyval.res = new_resource(res_msg, yyvsp[0].msg, WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, dup_language(currentlanguage)); ;
1869 break;}
1870case 56:
1871#line 519 "parser.y"
1872{ yyval.res = new_resource(res_rdt, yyvsp[0].rdt, yyvsp[0].rdt->memopt, yyvsp[0].rdt->lvc.language); ;
1873 break;}
1874case 57:
1875#line 520 "parser.y"
1876{ yyval.res = new_resource(res_toolbar, yyvsp[0].tlbar, yyvsp[0].tlbar->memopt, yyvsp[0].tlbar->lvc.language); ;
1877 break;}
1878case 58:
1879#line 521 "parser.y"
1880{ yyval.res = new_resource(res_usr, yyvsp[0].usr, yyvsp[0].usr->memopt, dup_language(currentlanguage)); ;
1881 break;}
1882case 59:
1883#line 522 "parser.y"
1884{ yyval.res = new_resource(res_ver, yyvsp[0].veri, WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, dup_language(currentlanguage)); ;
1885 break;}
1886case 60:
1887#line 526 "parser.y"
1888{ yyval.bmp = new_bitmap(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1889 break;}
1890case 61:
1891#line 527 "parser.y"
1892{ yyval.bmp = new_bitmap(yyvsp[0].raw, yyvsp[-1].iptr); ;
1893 break;}
1894case 62:
1895#line 531 "parser.y"
1896{ yyval.curg = new_cursor_group(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1897 break;}
1898case 63:
1899#line 532 "parser.y"
1900{ yyval.curg = new_cursor_group(yyvsp[0].raw, yyvsp[-1].iptr); ;
1901 break;}
1902case 64:
1903#line 537 "parser.y"
1904{ yyval.fnt = new_font(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1905 break;}
1906case 65:
1907#line 541 "parser.y"
1908{ yyval.icog = new_icon_group(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1909 break;}
1910case 66:
1911#line 542 "parser.y"
1912{ yyval.icog = new_icon_group(yyvsp[0].raw, yyvsp[-1].iptr); ;
1913 break;}
1914case 67:
1915#line 550 "parser.y"
1916{
1917 if(!win32)
1918 yywarning("MESSAGETABLE not supported in 16-bit mode");
1919 yyval.msg = new_messagetable(load_file(yyvsp[0].str));
1920 ;
1921 break;}
1922case 68:
1923#line 558 "parser.y"
1924{
1925 yyval.rdt = new_rcdata(yyvsp[0].raw, yyvsp[-2].iptr);
1926 if(yyvsp[-1].lvc)
1927 {
1928 yyval.rdt->lvc = *(yyvsp[-1].lvc);
1929 free(yyvsp[-1].lvc);
1930 }
1931 if(!yyval.rdt->lvc.language)
1932 yyval.rdt->lvc.language = dup_language(currentlanguage);
1933 ;
1934 break;}
1935case 69:
1936#line 571 "parser.y"
1937{
1938 yyval.dginit = new_dlginit(yyvsp[0].raw, yyvsp[-2].iptr);
1939 if(yyvsp[-1].lvc)
1940 {
1941 yyval.dginit->lvc = *(yyvsp[-1].lvc);
1942 free(yyvsp[-1].lvc);
1943 }
1944 if(!yyval.dginit->lvc.language)
1945 yyval.dginit->lvc.language = dup_language(currentlanguage);
1946 ;
1947 break;}
1948case 70:
1949#line 584 "parser.y"
1950{ yyval.usr = new_user(yyvsp[-2].nid, load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
1951 break;}
1952case 71:
1953#line 585 "parser.y"
1954{ yyval.usr = new_user(yyvsp[-2].nid, yyvsp[0].raw, yyvsp[-1].iptr); ;
1955 break;}
1956case 72:
1957#line 604 "parser.y"
1958{
1959 yyval.nid = new_name_id();
1960 yyval.nid->type = name_ord;
1961 yyval.nid->name.i_name = yyvsp[0].num;
1962 set_yywf();
1963 ;
1964 break;}
1965case 73:
1966#line 616 "parser.y"
1967{
1968 yyval.nid = new_name_id();
1969 yyval.nid->type = name_str;
1970 yyval.nid->name.s_name = yyvsp[0].str;
1971 set_yywf();
1972 ;
1973 break;}
1974case 74:
1975#line 626 "parser.y"
1976{
1977 yyval.acc = new_accelerator();
1978 if(yyvsp[-4].iptr)
1979 {
1980 yyval.acc->memopt = *(yyvsp[-4].iptr);
1981 free(yyvsp[-4].iptr);
1982 }
1983 else
1984 {
1985 yyval.acc->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE;
1986 }
1987 if(!yyvsp[-1].event)
1988 yyerror("Accelerator table must have at least one entry");
1989 yyval.acc->events = get_event_head(yyvsp[-1].event);
1990 if(yyvsp[-3].lvc)
1991 {
1992 yyval.acc->lvc = *(yyvsp[-3].lvc);
1993 free(yyvsp[-3].lvc);
1994 }
1995 if(!yyval.acc->lvc.language)
1996 yyval.acc->lvc.language = dup_language(currentlanguage);
1997 ;
1998 break;}
1999case 75:
2000#line 650 "parser.y"
2001{ yyval.event=NULL; ;
2002 break;}
2003case 76:
2004#line 651 "parser.y"
2005{ yyval.event=add_string_event(yyvsp[-3].str, yyvsp[-1].num, yyvsp[0].num, yyvsp[-4].event); ;
2006 break;}
2007case 77:
2008#line 652 "parser.y"
2009{ yyval.event=add_event(yyvsp[-3].num, yyvsp[-1].num, yyvsp[0].num, yyvsp[-4].event); ;
2010 break;}
2011case 78:
2012#line 655 "parser.y"
2013{ yyval.num=0; ;
2014 break;}
2015case 79:
2016#line 656 "parser.y"
2017{ yyval.num=yyvsp[-2].num | WRC_AF_NOINVERT; ;
2018 break;}
2019case 80:
2020#line 657 "parser.y"
2021{ yyval.num=yyvsp[-2].num | WRC_AF_SHIFT; ;
2022 break;}
2023case 81:
2024#line 658 "parser.y"
2025{ yyval.num=yyvsp[-2].num | WRC_AF_CONTROL; ;
2026 break;}
2027case 82:
2028#line 659 "parser.y"
2029{ yyval.num=yyvsp[-2].num | WRC_AF_ALT; ;
2030 break;}
2031case 83:
2032#line 660 "parser.y"
2033{ yyval.num=yyvsp[-2].num | WRC_AF_ASCII; ;
2034 break;}
2035case 84:
2036#line 661 "parser.y"
2037{ yyval.num=yyvsp[-2].num | WRC_AF_VIRTKEY; ;
2038 break;}
2039case 85:
2040#line 667 "parser.y"
2041{
2042 if(yyvsp[-11].iptr)
2043 {
2044 yyvsp[-3].dlg->memopt = *(yyvsp[-11].iptr);
2045 free(yyvsp[-11].iptr);
2046 }
2047 else
2048 yyvsp[-3].dlg->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE;
2049 yyvsp[-3].dlg->x = yyvsp[-10].num;
2050 yyvsp[-3].dlg->y = yyvsp[-8].num;
2051 yyvsp[-3].dlg->width = yyvsp[-6].num;
2052 yyvsp[-3].dlg->height = yyvsp[-4].num;
2053 yyvsp[-3].dlg->controls = get_control_head(yyvsp[-1].ctl);
2054 yyval.dlg = yyvsp[-3].dlg;
2055 if(!yyval.dlg->gotstyle)
2056 {
2057 yyval.dlg->style->or_mask = WS_POPUP;
2058 yyval.dlg->gotstyle = TRUE;
2059 }
2060 if(yyval.dlg->title)
2061 yyval.dlg->style->or_mask |= WS_CAPTION;
2062 if(yyval.dlg->font)
2063 yyval.dlg->style->or_mask |= DS_SETFONT;
2064
2065 yyval.dlg->style->or_mask &= ~(yyval.dlg->style->and_mask);
2066 yyval.dlg->style->and_mask = 0;
2067
2068 indialog = FALSE;
2069 if(!yyval.dlg->lvc.language)
2070 yyval.dlg->lvc.language = dup_language(currentlanguage);
2071 ;
2072 break;}
2073case 86:
2074#line 701 "parser.y"
2075{ yyval.dlg=new_dialog(); ;
2076 break;}
2077case 87:
2078#line 702 "parser.y"
2079{ yyval.dlg=dialog_style(yyvsp[0].style,yyvsp[-2].dlg); ;
2080 break;}
2081case 88:
2082#line 703 "parser.y"
2083{ yyval.dlg=dialog_exstyle(yyvsp[0].style,yyvsp[-2].dlg); ;
2084 break;}
2085case 89:
2086#line 704 "parser.y"
2087{ yyval.dlg=dialog_caption(yyvsp[0].str,yyvsp[-2].dlg); ;
2088 break;}
2089case 90:
2090#line 705 "parser.y"
2091{ yyval.dlg=dialog_font(yyvsp[0].fntid,yyvsp[-1].dlg); ;
2092 break;}
2093case 91:
2094#line 706 "parser.y"
2095{ yyval.dlg=dialog_class(yyvsp[0].nid,yyvsp[-2].dlg); ;
2096 break;}
2097case 92:
2098#line 707 "parser.y"
2099{ yyval.dlg=dialog_menu(yyvsp[0].nid,yyvsp[-2].dlg); ;
2100 break;}
2101case 93:
2102#line 708 "parser.y"
2103{ yyval.dlg=dialog_language(yyvsp[0].lan,yyvsp[-1].dlg); ;
2104 break;}
2105case 94:
2106#line 709 "parser.y"
2107{ yyval.dlg=dialog_characteristics(yyvsp[0].chars,yyvsp[-1].dlg); ;
2108 break;}
2109case 95:
2110#line 710 "parser.y"
2111{ yyval.dlg=dialog_version(yyvsp[0].ver,yyvsp[-1].dlg); ;
2112 break;}
2113case 96:
2114#line 713 "parser.y"
2115{ yyval.ctl = NULL; ;
2116 break;}
2117case 97:
2118#line 714 "parser.y"
2119{ yyval.ctl=ins_ctrl(-1, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2120 break;}
2121case 98:
2122#line 715 "parser.y"
2123{ yyval.ctl=ins_ctrl(CT_EDIT, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2124 break;}
2125case 99:
2126#line 716 "parser.y"
2127{ yyval.ctl=ins_ctrl(CT_LISTBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2128 break;}
2129case 100:
2130#line 717 "parser.y"
2131{ yyval.ctl=ins_ctrl(CT_COMBOBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2132 break;}
2133case 101:
2134#line 718 "parser.y"
2135{ yyval.ctl=ins_ctrl(CT_SCROLLBAR, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2136 break;}
2137case 102:
2138#line 719 "parser.y"
2139{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_CHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2140 break;}
2141case 103:
2142#line 720 "parser.y"
2143{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2144 break;}
2145case 104:
2146#line 721 "parser.y"
2147{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_GROUPBOX, yyvsp[0].ctl, yyvsp[-2].ctl);;
2148 break;}
2149case 105:
2150#line 722 "parser.y"
2151{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2152 break;}
2153case 106:
2154#line 724 "parser.y"
2155{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2156 break;}
2157case 107:
2158#line 725 "parser.y"
2159{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2160 break;}
2161case 108:
2162#line 726 "parser.y"
2163{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2164 break;}
2165case 109:
2166#line 727 "parser.y"
2167{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2168 break;}
2169case 110:
2170#line 728 "parser.y"
2171{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2172 break;}
2173case 111:
2174#line 729 "parser.y"
2175{ yyval.ctl=ins_ctrl(CT_STATIC, SS_LEFT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2176 break;}
2177case 112:
2178#line 730 "parser.y"
2179{ yyval.ctl=ins_ctrl(CT_STATIC, SS_CENTER, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2180 break;}
2181case 113:
2182#line 731 "parser.y"
2183{ yyval.ctl=ins_ctrl(CT_STATIC, SS_RIGHT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2184 break;}
2185case 114:
2186#line 733 "parser.y"
2187{
2188 yyvsp[0].ctl->title = yyvsp[-7].nid;
2189 yyvsp[0].ctl->id = yyvsp[-5].num;
2190 yyvsp[0].ctl->x = yyvsp[-3].num;
2191 yyvsp[0].ctl->y = yyvsp[-1].num;
2192 yyval.ctl = ins_ctrl(CT_STATIC, SS_ICON, yyvsp[0].ctl, yyvsp[-9].ctl);
2193 ;
2194 break;}
2195case 115:
2196#line 743 "parser.y"
2197{
2198 yyval.ctl=new_control();
2199 yyval.ctl->title = new_name_id();
2200 yyval.ctl->title->type = name_str;
2201 yyval.ctl->title->name.s_name = yyvsp[-11].str;
2202 yyval.ctl->id = yyvsp[-9].num;
2203 yyval.ctl->x = yyvsp[-7].num;
2204 yyval.ctl->y = yyvsp[-5].num;
2205 yyval.ctl->width = yyvsp[-3].num;
2206 yyval.ctl->height = yyvsp[-1].num;
2207 if(yyvsp[0].style)
2208 {
2209 yyval.ctl->style = yyvsp[0].style;
2210 yyval.ctl->gotstyle = TRUE;
2211 }
2212 ;
2213 break;}
2214case 116:
2215#line 762 "parser.y"
2216{
2217 yyval.ctl = new_control();
2218 yyval.ctl->id = yyvsp[-9].num;
2219 yyval.ctl->x = yyvsp[-7].num;
2220 yyval.ctl->y = yyvsp[-5].num;
2221 yyval.ctl->width = yyvsp[-3].num;
2222 yyval.ctl->height = yyvsp[-1].num;
2223 if(yyvsp[0].style)
2224 {
2225 yyval.ctl->style = yyvsp[0].style;
2226 yyval.ctl->gotstyle = TRUE;
2227 }
2228 ;
2229 break;}
2230case 117:
2231#line 778 "parser.y"
2232{ yyval.ctl = new_control(); ;
2233 break;}
2234case 118:
2235#line 780 "parser.y"
2236{
2237 yyval.ctl = new_control();
2238 yyval.ctl->width = yyvsp[-2].num;
2239 yyval.ctl->height = yyvsp[0].num;
2240 ;
2241 break;}
2242case 119:
2243#line 785 "parser.y"
2244{
2245 yyval.ctl = new_control();
2246 yyval.ctl->width = yyvsp[-4].num;
2247 yyval.ctl->height = yyvsp[-2].num;
2248 yyval.ctl->style = yyvsp[0].style;
2249 yyval.ctl->gotstyle = TRUE;
2250 ;
2251 break;}
2252case 120:
2253#line 792 "parser.y"
2254{
2255 yyval.ctl = new_control();
2256 yyval.ctl->width = yyvsp[-6].num;
2257 yyval.ctl->height = yyvsp[-4].num;
2258 yyval.ctl->style = yyvsp[-2].style;
2259 yyval.ctl->gotstyle = TRUE;
2260 yyval.ctl->exstyle = yyvsp[0].style;
2261 yyval.ctl->gotexstyle = TRUE;
2262 ;
2263 break;}
2264case 121:
2265#line 803 "parser.y"
2266{
2267 yyval.ctl=new_control();
2268 yyval.ctl->title = yyvsp[-16].nid;
2269 yyval.ctl->id = yyvsp[-14].num;
2270 yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-12].nid);
2271 yyval.ctl->style = yyvsp[-10].style;
2272 yyval.ctl->gotstyle = TRUE;
2273 yyval.ctl->x = yyvsp[-8].num;
2274 yyval.ctl->y = yyvsp[-6].num;
2275 yyval.ctl->width = yyvsp[-4].num;
2276 yyval.ctl->height = yyvsp[-2].num;
2277 yyval.ctl->exstyle = yyvsp[0].style;
2278 yyval.ctl->gotexstyle = TRUE;
2279 ;
2280 break;}
2281case 122:
2282#line 817 "parser.y"
2283{
2284 yyval.ctl=new_control();
2285 yyval.ctl->title = yyvsp[-14].nid;
2286 yyval.ctl->id = yyvsp[-12].num;
2287 yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-10].nid);
2288 yyval.ctl->style = yyvsp[-8].style;
2289 yyval.ctl->gotstyle = TRUE;
2290 yyval.ctl->x = yyvsp[-6].num;
2291 yyval.ctl->y = yyvsp[-4].num;
2292 yyval.ctl->width = yyvsp[-2].num;
2293 yyval.ctl->height = yyvsp[0].num;
2294 ;
2295 break;}
2296case 123:
2297#line 832 "parser.y"
2298{ yyval.fntid = new_font_id(yyvsp[-2].num, yyvsp[0].str, 0, 0); ;
2299 break;}
2300case 124:
2301#line 837 "parser.y"
2302{ yyval.style = NULL; ;
2303 break;}
2304case 125:
2305#line 838 "parser.y"
2306{ yyval.style = yyvsp[0].style; ;
2307 break;}
2308case 126:
2309#line 842 "parser.y"
2310{ yyval.styles = NULL; ;
2311 break;}
2312case 127:
2313#line 843 "parser.y"
2314{ yyval.styles = new_style_pair(yyvsp[0].style, 0); ;
2315 break;}
2316case 128:
2317#line 844 "parser.y"
2318{ yyval.styles = new_style_pair(yyvsp[-2].style, yyvsp[0].style); ;
2319 break;}
2320case 129:
2321#line 848 "parser.y"
2322{ yyval.style = new_style(yyvsp[-2].style->or_mask | yyvsp[0].style->or_mask, yyvsp[-2].style->and_mask | yyvsp[0].style->and_mask); free(yyvsp[-2].style); free(yyvsp[0].style);;
2323 break;}
2324case 130:
2325#line 849 "parser.y"
2326{ yyval.style = yyvsp[-1].style; ;
2327 break;}
2328case 131:
2329#line 850 "parser.y"
2330{ yyval.style = new_style(yyvsp[0].num, 0); ;
2331 break;}
2332case 132:
2333#line 851 "parser.y"
2334{ yyval.style = new_style(0, yyvsp[0].num); ;
2335 break;}
2336case 133:
2337#line 855 "parser.y"
2338{
2339 yyval.nid = new_name_id();
2340 yyval.nid->type = name_ord;
2341 yyval.nid->name.i_name = yyvsp[0].num;
2342 ;
2343 break;}
2344case 134:
2345#line 860 "parser.y"
2346{
2347 yyval.nid = new_name_id();
2348 yyval.nid->type = name_str;
2349 yyval.nid->name.s_name = yyvsp[0].str;
2350 ;
2351 break;}
2352case 135:
2353#line 869 "parser.y"
2354{
2355 if(!win32)
2356 yywarning("DIALOGEX not supported in 16-bit mode");
2357 if(yyvsp[-12].iptr)
2358 {
2359 yyvsp[-3].dlgex->memopt = *(yyvsp[-12].iptr);
2360 free(yyvsp[-12].iptr);
2361 }
2362 else
2363 yyvsp[-3].dlgex->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE;
2364 yyvsp[-3].dlgex->x = yyvsp[-11].num;
2365 yyvsp[-3].dlgex->y = yyvsp[-9].num;
2366 yyvsp[-3].dlgex->width = yyvsp[-7].num;
2367 yyvsp[-3].dlgex->height = yyvsp[-5].num;
2368 if(yyvsp[-4].iptr)
2369 {
2370 yyvsp[-3].dlgex->helpid = *(yyvsp[-4].iptr);
2371 yyvsp[-3].dlgex->gothelpid = TRUE;
2372 free(yyvsp[-4].iptr);
2373 }
2374 yyvsp[-3].dlgex->controls = get_control_head(yyvsp[-1].ctl);
2375 yyval.dlgex = yyvsp[-3].dlgex;
2376
2377 assert(yyval.dlgex->style != NULL);
2378 if(!yyval.dlgex->gotstyle)
2379 {
2380 yyval.dlgex->style->or_mask = WS_POPUP;
2381 yyval.dlgex->gotstyle = TRUE;
2382 }
2383 if(yyval.dlgex->title)
2384 yyval.dlgex->style->or_mask |= WS_CAPTION;
2385 if(yyval.dlgex->font)
2386 yyval.dlgex->style->or_mask |= DS_SETFONT;
2387
2388 yyval.dlgex->style->or_mask &= ~(yyval.dlgex->style->and_mask);
2389 yyval.dlgex->style->and_mask = 0;
2390
2391 indialog = FALSE;
2392 if(!yyval.dlgex->lvc.language)
2393 yyval.dlgex->lvc.language = dup_language(currentlanguage);
2394 ;
2395 break;}
2396case 136:
2397#line 913 "parser.y"
2398{ yyval.dlgex=new_dialogex(); ;
2399 break;}
2400case 137:
2401#line 914 "parser.y"
2402{ yyval.dlgex=dialogex_style(yyvsp[0].style,yyvsp[-2].dlgex); ;
2403 break;}
2404case 138:
2405#line 915 "parser.y"
2406{ yyval.dlgex=dialogex_exstyle(yyvsp[0].style,yyvsp[-2].dlgex); ;
2407 break;}
2408case 139:
2409#line 916 "parser.y"
2410{ yyval.dlgex=dialogex_caption(yyvsp[0].str,yyvsp[-2].dlgex); ;
2411 break;}
2412case 140:
2413#line 917 "parser.y"
2414{ yyval.dlgex=dialogex_font(yyvsp[0].fntid,yyvsp[-1].dlgex); ;
2415 break;}
2416case 141:
2417#line 918 "parser.y"
2418{ yyval.dlgex=dialogex_font(yyvsp[0].fntid,yyvsp[-1].dlgex); ;
2419 break;}
2420case 142:
2421#line 919 "parser.y"
2422{ yyval.dlgex=dialogex_class(yyvsp[0].nid,yyvsp[-2].dlgex); ;
2423 break;}
2424case 143:
2425#line 920 "parser.y"
2426{ yyval.dlgex=dialogex_menu(yyvsp[0].nid,yyvsp[-2].dlgex); ;
2427 break;}
2428case 144:
2429#line 921 "parser.y"
2430{ yyval.dlgex=dialogex_language(yyvsp[0].lan,yyvsp[-1].dlgex); ;
2431 break;}
2432case 145:
2433#line 922 "parser.y"
2434{ yyval.dlgex=dialogex_characteristics(yyvsp[0].chars,yyvsp[-1].dlgex); ;
2435 break;}
2436case 146:
2437#line 923 "parser.y"
2438{ yyval.dlgex=dialogex_version(yyvsp[0].ver,yyvsp[-1].dlgex); ;
2439 break;}
2440case 147:
2441#line 926 "parser.y"
2442{ yyval.ctl = NULL; ;
2443 break;}
2444case 148:
2445#line 927 "parser.y"
2446{ yyval.ctl=ins_ctrl(-1, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2447 break;}
2448case 149:
2449#line 928 "parser.y"
2450{ yyval.ctl=ins_ctrl(CT_EDIT, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2451 break;}
2452case 150:
2453#line 929 "parser.y"
2454{ yyval.ctl=ins_ctrl(CT_LISTBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2455 break;}
2456case 151:
2457#line 930 "parser.y"
2458{ yyval.ctl=ins_ctrl(CT_COMBOBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2459 break;}
2460case 152:
2461#line 931 "parser.y"
2462{ yyval.ctl=ins_ctrl(CT_SCROLLBAR, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2463 break;}
2464case 153:
2465#line 932 "parser.y"
2466{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_CHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2467 break;}
2468case 154:
2469#line 933 "parser.y"
2470{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2471 break;}
2472case 155:
2473#line 934 "parser.y"
2474{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_GROUPBOX, yyvsp[0].ctl, yyvsp[-2].ctl);;
2475 break;}
2476case 156:
2477#line 935 "parser.y"
2478{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2479 break;}
2480case 157:
2481#line 937 "parser.y"
2482{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2483 break;}
2484case 158:
2485#line 938 "parser.y"
2486{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2487 break;}
2488case 159:
2489#line 939 "parser.y"
2490{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2491 break;}
2492case 160:
2493#line 940 "parser.y"
2494{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2495 break;}
2496case 161:
2497#line 941 "parser.y"
2498{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2499 break;}
2500case 162:
2501#line 942 "parser.y"
2502{ yyval.ctl=ins_ctrl(CT_STATIC, SS_LEFT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2503 break;}
2504case 163:
2505#line 943 "parser.y"
2506{ yyval.ctl=ins_ctrl(CT_STATIC, SS_CENTER, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2507 break;}
2508case 164:
2509#line 944 "parser.y"
2510{ yyval.ctl=ins_ctrl(CT_STATIC, SS_RIGHT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
2511 break;}
2512case 165:
2513#line 946 "parser.y"
2514{
2515 yyvsp[0].ctl->title = yyvsp[-7].nid;
2516 yyvsp[0].ctl->id = yyvsp[-5].num;
2517 yyvsp[0].ctl->x = yyvsp[-3].num;
2518 yyvsp[0].ctl->y = yyvsp[-1].num;
2519 yyval.ctl = ins_ctrl(CT_STATIC, SS_ICON, yyvsp[0].ctl, yyvsp[-9].ctl);
2520 ;
2521 break;}
2522case 166:
2523#line 957 "parser.y"
2524{
2525 yyval.ctl=new_control();
2526 yyval.ctl->title = yyvsp[-18].nid;
2527 yyval.ctl->id = yyvsp[-16].num;
2528 yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-14].nid);
2529 yyval.ctl->style = yyvsp[-12].style;
2530 yyval.ctl->gotstyle = TRUE;
2531 yyval.ctl->x = yyvsp[-10].num;
2532 yyval.ctl->y = yyvsp[-8].num;
2533 yyval.ctl->width = yyvsp[-6].num;
2534 yyval.ctl->height = yyvsp[-4].num;
2535 if(yyvsp[-2].style)
2536 {
2537 yyval.ctl->exstyle = yyvsp[-2].style;
2538 yyval.ctl->gotexstyle = TRUE;
2539 }
2540 if(yyvsp[-1].iptr)
2541 {
2542 yyval.ctl->helpid = *(yyvsp[-1].iptr);
2543 yyval.ctl->gothelpid = TRUE;
2544 free(yyvsp[-1].iptr);
2545 }
2546 yyval.ctl->extra = yyvsp[0].raw;
2547 ;
2548 break;}
2549case 167:
2550#line 981 "parser.y"
2551{
2552 yyval.ctl=new_control();
2553 yyval.ctl->title = yyvsp[-15].nid;
2554 yyval.ctl->id = yyvsp[-13].num;
2555 yyval.ctl->style = yyvsp[-9].style;
2556 yyval.ctl->gotstyle = TRUE;
2557 yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-11].nid);
2558 yyval.ctl->x = yyvsp[-7].num;
2559 yyval.ctl->y = yyvsp[-5].num;
2560 yyval.ctl->width = yyvsp[-3].num;
2561 yyval.ctl->height = yyvsp[-1].num;
2562 yyval.ctl->extra = yyvsp[0].raw;
2563 ;
2564 break;}
2565case 168:
2566#line 997 "parser.y"
2567{
2568 yyval.ctl=new_control();
2569 yyval.ctl->title = new_name_id();
2570 yyval.ctl->title->type = name_str;
2571 yyval.ctl->title->name.s_name = yyvsp[-12].str;
2572 yyval.ctl->id = yyvsp[-10].num;
2573 yyval.ctl->x = yyvsp[-8].num;
2574 yyval.ctl->y = yyvsp[-6].num;
2575 yyval.ctl->width = yyvsp[-4].num;
2576 yyval.ctl->height = yyvsp[-2].num;
2577 if(yyvsp[-1].styles)
2578 {
2579 yyval.ctl->style = yyvsp[-1].styles->style;
2580 yyval.ctl->gotstyle = TRUE;
2581
2582 if (yyvsp[-1].styles->exstyle)
2583 {
2584 yyval.ctl->exstyle = yyvsp[-1].styles->exstyle;
2585 yyval.ctl->gotexstyle = TRUE;
2586 }
2587 free(yyvsp[-1].styles);
2588 }
2589
2590 yyval.ctl->extra = yyvsp[0].raw;
2591 ;
2592 break;}
2593case 169:
2594#line 1025 "parser.y"
2595{
2596 yyval.ctl = new_control();
2597 yyval.ctl->id = yyvsp[-10].num;
2598 yyval.ctl->x = yyvsp[-8].num;
2599 yyval.ctl->y = yyvsp[-6].num;
2600 yyval.ctl->width = yyvsp[-4].num;
2601 yyval.ctl->height = yyvsp[-2].num;
2602 if(yyvsp[-1].styles)
2603 {
2604 yyval.ctl->style = yyvsp[-1].styles->style;
2605 yyval.ctl->gotstyle = TRUE;
2606
2607 if (yyvsp[-1].styles->exstyle)
2608 {
2609 yyval.ctl->exstyle = yyvsp[-1].styles->exstyle;
2610 yyval.ctl->gotexstyle = TRUE;
2611 }
2612 free(yyvsp[-1].styles);
2613 }
2614 yyval.ctl->extra = yyvsp[0].raw;
2615 ;
2616 break;}
2617case 170:
2618#line 1048 "parser.y"
2619{ yyval.raw = NULL; ;
2620 break;}
2621case 171:
2622#line 1049 "parser.y"
2623{ yyval.raw = yyvsp[0].raw; ;
2624 break;}
2625case 172:
2626#line 1052 "parser.y"
2627{ yyval.iptr = NULL; ;
2628 break;}
2629case 173:
2630#line 1053 "parser.y"
2631{ yyval.iptr = new_int(yyvsp[0].num); ;
2632 break;}
2633case 174:
2634#line 1057 "parser.y"
2635{ yyval.fntid = new_font_id(yyvsp[-7].num, yyvsp[-5].str, yyvsp[-3].num, yyvsp[-1].num); ;
2636 break;}
2637case 175:
2638#line 1064 "parser.y"
2639{ yyval.fntid = NULL; ;
2640 break;}
2641case 176:
2642#line 1065 "parser.y"
2643{ yyval.fntid = NULL; ;
2644 break;}
2645case 177:
2646#line 1069 "parser.y"
2647{
2648 if(!yyvsp[0].menitm)
2649 yyerror("Menu must contain items");
2650 yyval.men = new_menu();
2651 if(yyvsp[-2].iptr)
2652 {
2653 yyval.men->memopt = *(yyvsp[-2].iptr);
2654 free(yyvsp[-2].iptr);
2655 }
2656 else
2657 yyval.men->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE;
2658 yyval.men->items = get_item_head(yyvsp[0].menitm);
2659 if(yyvsp[-1].lvc)
2660 {
2661 yyval.men->lvc = *(yyvsp[-1].lvc);
2662 free(yyvsp[-1].lvc);
2663 }
2664 if(!yyval.men->lvc.language)
2665 yyval.men->lvc.language = dup_language(currentlanguage);
2666 ;
2667 break;}
2668case 178:
2669#line 1092 "parser.y"
2670{ yyval.menitm = yyvsp[-1].menitm; ;
2671 break;}
2672case 179:
2673#line 1096 "parser.y"
2674{yyval.menitm = NULL;;
2675 break;}
2676case 180:
2677#line 1097 "parser.y"
2678{
2679 yyval.menitm=new_menu_item();
2680 yyval.menitm->prev = yyvsp[-5].menitm;
2681 if(yyvsp[-5].menitm)
2682 yyvsp[-5].menitm->next = yyval.menitm;
2683 yyval.menitm->id = yyvsp[-1].num;
2684 yyval.menitm->state = yyvsp[0].num;
2685 yyval.menitm->name = yyvsp[-3].str;
2686 ;
2687 break;}
2688case 181:
2689#line 1106 "parser.y"
2690{
2691 yyval.menitm=new_menu_item();
2692 yyval.menitm->prev = yyvsp[-2].menitm;
2693 if(yyvsp[-2].menitm)
2694 yyvsp[-2].menitm->next = yyval.menitm;
2695 ;
2696 break;}
2697case 182:
2698#line 1112 "parser.y"
2699{
2700 yyval.menitm = new_menu_item();
2701 yyval.menitm->prev = yyvsp[-4].menitm;
2702 if(yyvsp[-4].menitm)
2703 yyvsp[-4].menitm->next = yyval.menitm;
2704 yyval.menitm->popup = get_item_head(yyvsp[0].menitm);
2705 yyval.menitm->name = yyvsp[-2].str;
2706 ;
2707 break;}
2708case 183:
2709#line 1131 "parser.y"
2710{ yyval.num = 0; ;
2711 break;}
2712case 184:
2713#line 1132 "parser.y"
2714{ yyval.num = yyvsp[0].num | MF_CHECKED; ;
2715 break;}
2716case 185:
2717#line 1133 "parser.y"
2718{ yyval.num = yyvsp[0].num | MF_GRAYED; ;
2719 break;}
2720case 186:
2721#line 1134 "parser.y"
2722{ yyval.num = yyvsp[0].num | MF_HELP; ;
2723 break;}
2724case 187:
2725#line 1135 "parser.y"
2726{ yyval.num = yyvsp[0].num | MF_DISABLED; ;
2727 break;}
2728case 188:
2729#line 1136 "parser.y"
2730{ yyval.num = yyvsp[0].num | MF_MENUBARBREAK; ;
2731 break;}
2732case 189:
2733#line 1137 "parser.y"
2734{ yyval.num = yyvsp[0].num | MF_MENUBREAK; ;
2735 break;}
2736case 190:
2737#line 1141 "parser.y"
2738{
2739 if(!win32)
2740 yywarning("MENUEX not supported in 16-bit mode");
2741 if(!yyvsp[0].menexitm)
2742 yyerror("MenuEx must contain items");
2743 yyval.menex = new_menuex();
2744 if(yyvsp[-2].iptr)
2745 {
2746 yyval.menex->memopt = *(yyvsp[-2].iptr);
2747 free(yyvsp[-2].iptr);
2748 }
2749 else
2750 yyval.menex->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE;
2751 yyval.menex->items = get_itemex_head(yyvsp[0].menexitm);
2752 if(yyvsp[-1].lvc)
2753 {
2754 yyval.menex->lvc = *(yyvsp[-1].lvc);
2755 free(yyvsp[-1].lvc);
2756 }
2757 if(!yyval.menex->lvc.language)
2758 yyval.menex->lvc.language = dup_language(currentlanguage);
2759 ;
2760 break;}
2761case 191:
2762#line 1166 "parser.y"
2763{ yyval.menexitm = yyvsp[-1].menexitm; ;
2764 break;}
2765case 192:
2766#line 1170 "parser.y"
2767{yyval.menexitm = NULL; ;
2768 break;}
2769case 193:
2770#line 1171 "parser.y"
2771{
2772 yyval.menexitm = new_menuex_item();
2773 yyval.menexitm->prev = yyvsp[-3].menexitm;
2774 if(yyvsp[-3].menexitm)
2775 yyvsp[-3].menexitm->next = yyval.menexitm;
2776 yyval.menexitm->name = yyvsp[-1].str;
2777 yyval.menexitm->id = yyvsp[0].exopt->id;
2778 yyval.menexitm->type = yyvsp[0].exopt->type;
2779 yyval.menexitm->state = yyvsp[0].exopt->state;
2780 yyval.menexitm->helpid = yyvsp[0].exopt->helpid;
2781 yyval.menexitm->gotid = yyvsp[0].exopt->gotid;
2782 yyval.menexitm->gottype = yyvsp[0].exopt->gottype;
2783 yyval.menexitm->gotstate = yyvsp[0].exopt->gotstate;
2784 yyval.menexitm->gothelpid = yyvsp[0].exopt->gothelpid;
2785 free(yyvsp[0].exopt);
2786 ;
2787 break;}
2788case 194:
2789#line 1187 "parser.y"
2790{
2791 yyval.menexitm = new_menuex_item();
2792 yyval.menexitm->prev = yyvsp[-2].menexitm;
2793 if(yyvsp[-2].menexitm)
2794 yyvsp[-2].menexitm->next = yyval.menexitm;
2795 ;
2796 break;}
2797case 195:
2798#line 1193 "parser.y"
2799{
2800 yyval.menexitm = new_menuex_item();
2801 yyval.menexitm->prev = yyvsp[-4].menexitm;
2802 if(yyvsp[-4].menexitm)
2803 yyvsp[-4].menexitm->next = yyval.menexitm;
2804 yyval.menexitm->popup = get_itemex_head(yyvsp[0].menexitm);
2805 yyval.menexitm->name = yyvsp[-2].str;
2806 yyval.menexitm->id = yyvsp[-1].exopt->id;
2807 yyval.menexitm->type = yyvsp[-1].exopt->type;
2808 yyval.menexitm->state = yyvsp[-1].exopt->state;
2809 yyval.menexitm->helpid = yyvsp[-1].exopt->helpid;
2810 yyval.menexitm->gotid = yyvsp[-1].exopt->gotid;
2811 yyval.menexitm->gottype = yyvsp[-1].exopt->gottype;
2812 yyval.menexitm->gotstate = yyvsp[-1].exopt->gotstate;
2813 yyval.menexitm->gothelpid = yyvsp[-1].exopt->gothelpid;
2814 free(yyvsp[-1].exopt);
2815 ;
2816 break;}
2817case 196:
2818#line 1213 "parser.y"
2819{ yyval.exopt = new_itemex_opt(0, 0, 0, 0); ;
2820 break;}
2821case 197:
2822#line 1214 "parser.y"
2823{
2824 yyval.exopt = new_itemex_opt(yyvsp[0].num, 0, 0, 0);
2825 yyval.exopt->gotid = TRUE;
2826 ;
2827 break;}
2828case 198:
2829#line 1218 "parser.y"
2830{
2831 yyval.exopt = new_itemex_opt(yyvsp[-3].iptr ? *(yyvsp[-3].iptr) : 0, yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, yyvsp[0].num, 0);
2832 yyval.exopt->gotid = TRUE;
2833 yyval.exopt->gottype = TRUE;
2834 yyval.exopt->gotstate = TRUE;
2835 if(yyvsp[-3].iptr) free(yyvsp[-3].iptr);
2836 if(yyvsp[-1].iptr) free(yyvsp[-1].iptr);
2837 ;
2838 break;}
2839case 199:
2840#line 1226 "parser.y"
2841{
2842 yyval.exopt = new_itemex_opt(yyvsp[-4].iptr ? *(yyvsp[-4].iptr) : 0, yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0);
2843 yyval.exopt->gotid = TRUE;
2844 yyval.exopt->gottype = TRUE;
2845 yyval.exopt->gotstate = TRUE;
2846 if(yyvsp[-4].iptr) free(yyvsp[-4].iptr);
2847 if(yyvsp[-2].iptr) free(yyvsp[-2].iptr);
2848 ;
2849 break;}
2850case 200:
2851#line 1237 "parser.y"
2852{ yyval.exopt = new_itemex_opt(0, 0, 0, 0); ;
2853 break;}
2854case 201:
2855#line 1238 "parser.y"
2856{
2857 yyval.exopt = new_itemex_opt(yyvsp[0].num, 0, 0, 0);
2858 yyval.exopt->gotid = TRUE;
2859 ;
2860 break;}
2861case 202:
2862#line 1242 "parser.y"
2863{
2864 yyval.exopt = new_itemex_opt(yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0, 0);
2865 if(yyvsp[-2].iptr) free(yyvsp[-2].iptr);
2866 yyval.exopt->gotid = TRUE;
2867 yyval.exopt->gottype = TRUE;
2868 ;
2869 break;}
2870case 203:
2871#line 1248 "parser.y"
2872{
2873 yyval.exopt = new_itemex_opt(yyvsp[-4].iptr ? *(yyvsp[-4].iptr) : 0, yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0);
2874 if(yyvsp[-4].iptr) free(yyvsp[-4].iptr);
2875 if(yyvsp[-2].iptr) free(yyvsp[-2].iptr);
2876 yyval.exopt->gotid = TRUE;
2877 yyval.exopt->gottype = TRUE;
2878 yyval.exopt->gotstate = TRUE;
2879 ;
2880 break;}
2881case 204:
2882#line 1256 "parser.y"
2883{
2884 yyval.exopt = new_itemex_opt(yyvsp[-6].iptr ? *(yyvsp[-6].iptr) : 0, yyvsp[-4].iptr ? *(yyvsp[-4].iptr) : 0, yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num);
2885 if(yyvsp[-6].iptr) free(yyvsp[-6].iptr);
2886 if(yyvsp[-4].iptr) free(yyvsp[-4].iptr);
2887 if(yyvsp[-2].iptr) free(yyvsp[-2].iptr);
2888 yyval.exopt->gotid = TRUE;
2889 yyval.exopt->gottype = TRUE;
2890 yyval.exopt->gotstate = TRUE;
2891 yyval.exopt->gothelpid = TRUE;
2892 ;
2893 break;}
2894case 205:
2895#line 1276 "parser.y"
2896{
2897 if(!yyvsp[-1].stt)
2898 {
2899 yyerror("Stringtable must have at least one entry");
2900 }
2901 else
2902 {
2903 stringtable_t *stt;
2904 /* Check if we added to a language table or created
2905 * a new one.
2906 */
2907 for(stt = sttres; stt; stt = stt->next)
2908 {
2909 if(stt == tagstt)
2910 break;
2911 }
2912 if(!stt)
2913 {
2914 /* It is a new one */
2915 if(sttres)
2916 {
2917 sttres->prev = tagstt;
2918 tagstt->next = sttres;
2919 sttres = tagstt;
2920 }
2921 else
2922 sttres = tagstt;
2923 }
2924 /* Else were done */
2925 }
2926 if(tagstt_memopt)
2927 {
2928 free(tagstt_memopt);
2929 tagstt_memopt = NULL;
2930 }
2931
2932 yyval.stt = tagstt;
2933 ;
2934 break;}
2935case 206:
2936#line 1317 "parser.y"
2937{
2938 if((tagstt = find_stringtable(yyvsp[0].lvc)) == NULL)
2939 tagstt = new_stringtable(yyvsp[0].lvc);
2940 tagstt_memopt = yyvsp[-1].iptr;
2941 tagstt_version = yyvsp[0].lvc->version;
2942 tagstt_characts = yyvsp[0].lvc->characts;
2943 if(yyvsp[0].lvc)
2944 free(yyvsp[0].lvc);
2945 ;
2946 break;}
2947case 207:
2948#line 1328 "parser.y"
2949{ yyval.stt = NULL; ;
2950 break;}
2951case 208:
2952#line 1329 "parser.y"
2953{
2954 int i;
2955 assert(tagstt != NULL);
2956 if(yyvsp[-2].num > 65535 || yyvsp[-2].num < -32768)
2957 yyerror("Stringtable entry's ID out of range (%d)", yyvsp[-2].num);
2958 /* Search for the ID */
2959 for(i = 0; i < tagstt->nentries; i++)
2960 {
2961 if(tagstt->entries[i].id == yyvsp[-2].num)
2962 yyerror("Stringtable ID %d already in use", yyvsp[-2].num);
2963 }
2964 /* If we get here, then we have a new unique entry */
2965 tagstt->nentries++;
2966 tagstt->entries = xrealloc(tagstt->entries, sizeof(tagstt->entries[0]) * tagstt->nentries);
2967 tagstt->entries[tagstt->nentries-1].id = yyvsp[-2].num;
2968 tagstt->entries[tagstt->nentries-1].str = yyvsp[0].str;
2969 if(tagstt_memopt)
2970 tagstt->entries[tagstt->nentries-1].memopt = *tagstt_memopt;
2971 else
2972 tagstt->entries[tagstt->nentries-1].memopt = WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE | WRC_MO_PURE;
2973 tagstt->entries[tagstt->nentries-1].version = tagstt_version;
2974 tagstt->entries[tagstt->nentries-1].characts = tagstt_characts;
2975
2976 if(!win32 && yyvsp[0].str->size > 254)
2977 yyerror("Stringtable entry more than 254 characters");
2978 if(win32 && yyvsp[0].str->size > 65534) /* Hmm..., does this happen? */
2979 yyerror("Stringtable entry more than 65534 characters (probably something else that went wrong)");
2980 yyval.stt = tagstt;
2981 ;
2982 break;}
2983case 211:
2984#line 1367 "parser.y"
2985{
2986 yyval.veri = yyvsp[-3].veri;
2987 yyvsp[-3].veri->blocks = get_ver_block_head(yyvsp[-1].blk);
2988 ;
2989 break;}
2990case 212:
2991#line 1374 "parser.y"
2992{ yyval.veri = new_versioninfo(); ;
2993 break;}
2994case 213:
2995#line 1375 "parser.y"
2996{
2997 if(yyvsp[-8].veri->gotit.fv)
2998 yyerror("FILEVERSION already defined");
2999 yyval.veri = yyvsp[-8].veri;
3000 yyval.veri->filever_maj1 = yyvsp[-6].num;
3001 yyval.veri->filever_maj2 = yyvsp[-4].num;
3002 yyval.veri->filever_min1 = yyvsp[-2].num;
3003 yyval.veri->filever_min2 = yyvsp[0].num;
3004 yyval.veri->gotit.fv = 1;
3005 ;
3006 break;}
3007case 214:
3008#line 1385 "parser.y"
3009{
3010 if(yyvsp[-8].veri->gotit.pv)
3011 yyerror("PRODUCTVERSION already defined");
3012 yyval.veri = yyvsp[-8].veri;
3013 yyval.veri->prodver_maj1 = yyvsp[-6].num;
3014 yyval.veri->prodver_maj2 = yyvsp[-4].num;
3015 yyval.veri->prodver_min1 = yyvsp[-2].num;
3016 yyval.veri->prodver_min2 = yyvsp[0].num;
3017 yyval.veri->gotit.pv = 1;
3018 ;
3019 break;}
3020case 215:
3021#line 1395 "parser.y"
3022{
3023 if(yyvsp[-2].veri->gotit.ff)
3024 yyerror("FILEFLAGS already defined");
3025 yyval.veri = yyvsp[-2].veri;
3026 yyval.veri->fileflags = yyvsp[0].num;
3027 yyval.veri->gotit.ff = 1;
3028 ;
3029 break;}
3030case 216:
3031#line 1402 "parser.y"
3032{
3033 if(yyvsp[-2].veri->gotit.ffm)
3034 yyerror("FILEFLAGSMASK already defined");
3035 yyval.veri = yyvsp[-2].veri;
3036 yyval.veri->fileflagsmask = yyvsp[0].num;
3037 yyval.veri->gotit.ffm = 1;
3038 ;
3039 break;}
3040case 217:
3041#line 1409 "parser.y"
3042{
3043 if(yyvsp[-2].veri->gotit.fo)
3044 yyerror("FILEOS already defined");
3045 yyval.veri = yyvsp[-2].veri;
3046 yyval.veri->fileos = yyvsp[0].num;
3047 yyval.veri->gotit.fo = 1;
3048 ;
3049 break;}
3050case 218:
3051#line 1416 "parser.y"
3052{
3053 if(yyvsp[-2].veri->gotit.ft)
3054 yyerror("FILETYPE already defined");
3055 yyval.veri = yyvsp[-2].veri;
3056 yyval.veri->filetype = yyvsp[0].num;
3057 yyval.veri->gotit.ft = 1;
3058 ;
3059 break;}
3060case 219:
3061#line 1423 "parser.y"
3062{
3063 if(yyvsp[-2].veri->gotit.fst)
3064 yyerror("FILESUBTYPE already defined");
3065 yyval.veri = yyvsp[-2].veri;
3066 yyval.veri->filesubtype = yyvsp[0].num;
3067 yyval.veri->gotit.fst = 1;
3068 ;
3069 break;}
3070case 220:
3071#line 1433 "parser.y"
3072{ yyval.blk = NULL; ;
3073 break;}
3074case 221:
3075#line 1434 "parser.y"
3076{
3077 yyval.blk = yyvsp[0].blk;
3078 yyval.blk->prev = yyvsp[-1].blk;
3079 if(yyvsp[-1].blk)
3080 yyvsp[-1].blk->next = yyval.blk;
3081 ;
3082 break;}
3083case 222:
3084#line 1443 "parser.y"
3085{
3086 yyval.blk = new_ver_block();
3087 yyval.blk->name = yyvsp[-3].str;
3088 yyval.blk->values = get_ver_value_head(yyvsp[-1].val);
3089 ;
3090 break;}
3091case 223:
3092#line 1451 "parser.y"
3093{ yyval.val = NULL; ;
3094 break;}
3095case 224:
3096#line 1452 "parser.y"
3097{
3098 yyval.val = yyvsp[0].val;
3099 yyval.val->prev = yyvsp[-1].val;
3100 if(yyvsp[-1].val)
3101 yyvsp[-1].val->next = yyval.val;
3102 ;
3103 break;}
3104case 225:
3105#line 1461 "parser.y"
3106{
3107 yyval.val = new_ver_value();
3108 yyval.val->type = val_block;
3109 yyval.val->value.block = yyvsp[0].blk;
3110 ;
3111 break;}
3112case 226:
3113#line 1466 "parser.y"
3114{
3115 yyval.val = new_ver_value();
3116 yyval.val->type = val_str;
3117 yyval.val->key = yyvsp[-2].str;
3118 yyval.val->value.str = yyvsp[0].str;
3119 ;
3120 break;}
3121case 227:
3122#line 1472 "parser.y"
3123{
3124 yyval.val = new_ver_value();
3125 yyval.val->type = val_words;
3126 yyval.val->key = yyvsp[-2].str;
3127 yyval.val->value.words = yyvsp[0].verw;
3128 ;
3129 break;}
3130case 228:
3131#line 1481 "parser.y"
3132{ yyval.verw = new_ver_words(yyvsp[0].num); ;
3133 break;}
3134case 229:
3135#line 1482 "parser.y"
3136{ yyval.verw = add_ver_words(yyvsp[-2].verw, yyvsp[0].num); ;
3137 break;}
3138case 230:
3139#line 1486 "parser.y"
3140{
3141 int nitems;
3142 toolbar_item_t *items = get_tlbr_buttons_head(yyvsp[-1].tlbarItems, &nitems);
3143 yyval.tlbar = new_toolbar(yyvsp[-6].num, yyvsp[-4].num, items, nitems);
3144 if(yyvsp[-7].iptr)
3145 {
3146 yyval.tlbar->memopt = *(yyvsp[-7].iptr);
3147 free(yyvsp[-7].iptr);
3148 }
3149 else
3150 {
3151 yyval.tlbar->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE;
3152 }
3153 if(yyvsp[-3].lvc)
3154 {
3155 yyval.tlbar->lvc = *(yyvsp[-3].lvc);
3156 free(yyvsp[-3].lvc);
3157 }
3158 if(!yyval.tlbar->lvc.language)
3159 {
3160 yyval.tlbar->lvc.language = dup_language(currentlanguage);
3161 }
3162 ;
3163 break;}
3164case 231:
3165#line 1512 "parser.y"
3166{ yyval.tlbarItems = NULL; ;
3167 break;}
3168case 232:
3169#line 1513 "parser.y"
3170{
3171 toolbar_item_t *idrec = new_toolbar_item();
3172 idrec->id = yyvsp[0].num;
3173 yyval.tlbarItems = ins_tlbr_button(yyvsp[-2].tlbarItems, idrec);
3174 ;
3175 break;}
3176case 233:
3177#line 1518 "parser.y"
3178{
3179 toolbar_item_t *idrec = new_toolbar_item();
3180 idrec->id = 0;
3181 yyval.tlbarItems = ins_tlbr_button(yyvsp[-1].tlbarItems, idrec);
3182 ;
3183 break;}
3184case 234:
3185#line 1527 "parser.y"
3186{ yyval.iptr = NULL; ;
3187 break;}
3188case 235:
3189#line 1528 "parser.y"
3190{
3191 if(yyvsp[-1].iptr)
3192 {
3193 *(yyvsp[-1].iptr) |= *(yyvsp[0].iptr);
3194 yyval.iptr = yyvsp[-1].iptr;
3195 free(yyvsp[0].iptr);
3196 }
3197 else
3198 yyval.iptr = yyvsp[0].iptr;
3199 ;
3200 break;}
3201case 236:
3202#line 1538 "parser.y"
3203{
3204 if(yyvsp[-1].iptr)
3205 {
3206 *(yyvsp[-1].iptr) &= *(yyvsp[0].iptr);
3207 yyval.iptr = yyvsp[-1].iptr;
3208 free(yyvsp[0].iptr);
3209 }
3210 else
3211 {
3212 *yyvsp[0].iptr &= WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE | WRC_MO_PURE;
3213 yyval.iptr = yyvsp[0].iptr;
3214 }
3215 ;
3216 break;}
3217case 237:
3218#line 1553 "parser.y"
3219{ yyval.iptr = new_int(WRC_MO_PRELOAD); ;
3220 break;}
3221case 238:
3222#line 1554 "parser.y"
3223{ yyval.iptr = new_int(WRC_MO_MOVEABLE); ;
3224 break;}
3225case 239:
3226#line 1555 "parser.y"
3227{ yyval.iptr = new_int(WRC_MO_DISCARDABLE); ;
3228 break;}
3229case 240:
3230#line 1556 "parser.y"
3231{ yyval.iptr = new_int(WRC_MO_PURE); ;
3232 break;}
3233case 241:
3234#line 1559 "parser.y"
3235{ yyval.iptr = new_int(~WRC_MO_PRELOAD); ;
3236 break;}
3237case 242:
3238#line 1560 "parser.y"
3239{ yyval.iptr = new_int(~WRC_MO_MOVEABLE); ;
3240 break;}
3241case 243:
3242#line 1561 "parser.y"
3243{ yyval.iptr = new_int(~WRC_MO_PURE); ;
3244 break;}
3245case 244:
3246#line 1565 "parser.y"
3247{ yyval.lvc = new_lvc(); ;
3248 break;}
3249case 245:
3250#line 1566 "parser.y"
3251{
3252 if(!win32)
3253 yywarning("LANGUAGE not supported in 16-bit mode");
3254 if(yyvsp[-1].lvc->language)
3255 yyerror("Language already defined");
3256 yyval.lvc = yyvsp[-1].lvc;
3257 yyvsp[-1].lvc->language = yyvsp[0].lan;
3258 ;
3259 break;}
3260case 246:
3261#line 1574 "parser.y"
3262{
3263 if(!win32)
3264 yywarning("CHARACTERISTICS not supported in 16-bit mode");
3265 if(yyvsp[-1].lvc->characts)
3266 yyerror("Characteristics already defined");
3267 yyval.lvc = yyvsp[-1].lvc;
3268 yyvsp[-1].lvc->characts = yyvsp[0].chars;
3269 ;
3270 break;}
3271case 247:
3272#line 1582 "parser.y"
3273{
3274 if(!win32)
3275 yywarning("VERSION not supported in 16-bit mode");
3276 if(yyvsp[-1].lvc->version)
3277 yyerror("Version already defined");
3278 yyval.lvc = yyvsp[-1].lvc;
3279 yyvsp[-1].lvc->version = yyvsp[0].ver;
3280 ;
3281 break;}
3282case 248:
3283#line 1593 "parser.y"
3284{ yyval.lan = new_language(yyvsp[-2].num, yyvsp[0].num); ;
3285 break;}
3286case 249:
3287#line 1597 "parser.y"
3288{ yyval.chars = new_characts(yyvsp[0].num); ;
3289 break;}
3290case 250:
3291#line 1601 "parser.y"
3292{ yyval.ver = new_version(yyvsp[0].num); ;
3293 break;}
3294case 251:
3295#line 1605 "parser.y"
3296{ yyval.raw = yyvsp[-1].raw; ;
3297 break;}
3298case 252:
3299#line 1609 "parser.y"
3300{ yyval.raw = yyvsp[0].raw; ;
3301 break;}
3302case 253:
3303#line 1610 "parser.y"
3304{ yyval.raw = int2raw_data(yyvsp[0].num); ;
3305 break;}
3306case 254:
3307#line 1611 "parser.y"
3308{ yyval.raw = long2raw_data(yyvsp[0].num); ;
3309 break;}
3310case 255:
3311#line 1612 "parser.y"
3312{ yyval.raw = str2raw_data(yyvsp[0].str); ;
3313 break;}
3314case 256:
3315#line 1613 "parser.y"
3316{ yyval.raw = merge_raw_data(yyvsp[-2].raw, yyvsp[0].raw); free(yyvsp[0].raw->data); free(yyvsp[0].raw); ;
3317 break;}
3318case 257:
3319#line 1614 "parser.y"
3320{ yyval.raw = merge_raw_data_int(yyvsp[-2].raw, yyvsp[0].num); ;
3321 break;}
3322case 258:
3323#line 1615 "parser.y"
3324{ yyval.raw = merge_raw_data_long(yyvsp[-2].raw, yyvsp[0].num); ;
3325 break;}
3326case 259:
3327#line 1616 "parser.y"
3328{ yyval.raw = merge_raw_data_str(yyvsp[-2].raw, yyvsp[0].str); ;
3329 break;}
3330case 260:
3331#line 1623 "parser.y"
3332{ yyval.iptr = 0; ;
3333 break;}
3334case 261:
3335#line 1624 "parser.y"
3336{ yyval.iptr = new_int(yyvsp[0].num); ;
3337 break;}
3338case 262:
3339#line 1626 "parser.y"
3340{ yyval.num = (yyvsp[0].num); ;
3341 break;}
3342case 263:
3343#line 1629 "parser.y"
3344{ yyval.num = (yyvsp[-2].num) + (yyvsp[0].num); ;
3345 break;}
3346case 264:
3347#line 1630 "parser.y"
3348{ yyval.num = (yyvsp[-2].num) - (yyvsp[0].num); ;
3349 break;}
3350case 265:
3351#line 1631 "parser.y"
3352{ yyval.num = (yyvsp[-2].num) | (yyvsp[0].num); ;
3353 break;}
3354case 266:
3355#line 1632 "parser.y"
3356{ yyval.num = (yyvsp[-2].num) & (yyvsp[0].num); ;
3357 break;}
3358case 267:
3359#line 1633 "parser.y"
3360{ yyval.num = (yyvsp[-2].num) * (yyvsp[0].num); ;
3361 break;}
3362case 268:
3363#line 1634 "parser.y"
3364{ yyval.num = (yyvsp[-2].num) / (yyvsp[0].num); ;
3365 break;}
3366case 269:
3367#line 1635 "parser.y"
3368{ yyval.num = ~(yyvsp[0].num); ;
3369 break;}
3370case 270:
3371#line 1636 "parser.y"
3372{ yyval.num = -(yyvsp[0].num); ;
3373 break;}
3374case 271:
3375#line 1638 "parser.y"
3376{ yyval.num = yyvsp[-1].num; ;
3377 break;}
3378case 272:
3379#line 1639 "parser.y"
3380{ yyval.num = yyvsp[0].num; want_rscname = 0; ;
3381 break;}
3382case 273:
3383#line 1640 "parser.y"
3384{ yyval.num = ~(yyvsp[0].num); ;
3385 break;}
3386case 274:
3387#line 1643 "parser.y"
3388{ yyval.num = yyvsp[0].num; ;
3389 break;}
3390case 275:
3391#line 1644 "parser.y"
3392{ yyval.num = yyvsp[0].num; ;
3393 break;}
3394}
3395 /* the action file gets copied in in place of this dollarsign */
3396#line 543 "/emx/share/bison.simple"
3397
3398
3399 yyvsp -= yylen;
3400 yyssp -= yylen;
3401#ifdef YYLSP_NEEDED
3402 yylsp -= yylen;
3403#endif
3404
3405#if YYDEBUG != 0
3406 if (yydebug)
3407 {
3408 short *ssp1 = yyss - 1;
3409 fprintf (stderr, "state stack now");
3410 while (ssp1 != yyssp)
3411 fprintf (stderr, " %d", *++ssp1);
3412 fprintf (stderr, "\n");
3413 }
3414#endif
3415
3416 *++yyvsp = yyval;
3417
3418#ifdef YYLSP_NEEDED
3419 yylsp++;
3420 if (yylen == 0)
3421 {
3422 yylsp->first_line = yylloc.first_line;
3423 yylsp->first_column = yylloc.first_column;
3424 yylsp->last_line = (yylsp-1)->last_line;
3425 yylsp->last_column = (yylsp-1)->last_column;
3426 yylsp->text = 0;
3427 }
3428 else
3429 {
3430 yylsp->last_line = (yylsp+yylen-1)->last_line;
3431 yylsp->last_column = (yylsp+yylen-1)->last_column;
3432 }
3433#endif
3434
3435 /* Now "shift" the result of the reduction.
3436 Determine what state that goes to,
3437 based on the state we popped back to
3438 and the rule number reduced by. */
3439
3440 yyn = yyr1[yyn];
3441
3442 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3443 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3444 yystate = yytable[yystate];
3445 else
3446 yystate = yydefgoto[yyn - YYNTBASE];
3447
3448 goto yynewstate;
3449
3450yyerrlab: /* here on detecting error */
3451
3452 if (! yyerrstatus)
3453 /* If not already recovering from an error, report this error. */
3454 {
3455 ++yynerrs;
3456
3457#ifdef YYERROR_VERBOSE
3458 yyn = yypact[yystate];
3459
3460 if (yyn > YYFLAG && yyn < YYLAST)
3461 {
3462 int size = 0;
3463 char *msg;
3464 int x, count;
3465
3466 count = 0;
3467 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3468 for (x = (yyn < 0 ? -yyn : 0);
3469 x < (sizeof(yytname) / sizeof(char *)); x++)
3470 if (yycheck[x + yyn] == x)
3471 size += strlen(yytname[x]) + 15, count++;
3472 msg = (char *) malloc(size + 15);
3473 if (msg != 0)
3474 {
3475 strcpy(msg, "parse error");
3476
3477 if (count < 5)
3478 {
3479 count = 0;
3480 for (x = (yyn < 0 ? -yyn : 0);
3481 x < (sizeof(yytname) / sizeof(char *)); x++)
3482 if (yycheck[x + yyn] == x)
3483 {
3484 strcat(msg, count == 0 ? ", expecting `" : " or `");
3485 strcat(msg, yytname[x]);
3486 strcat(msg, "'");
3487 count++;
3488 }
3489 }
3490 yyerror(msg);
3491 free(msg);
3492 }
3493 else
3494 yyerror ("parse error; also virtual memory exceeded");
3495 }
3496 else
3497#endif /* YYERROR_VERBOSE */
3498 yyerror("parse error");
3499 }
3500
3501 goto yyerrlab1;
3502yyerrlab1: /* here on error raised explicitly by an action */
3503
3504 if (yyerrstatus == 3)
3505 {
3506 /* if just tried and failed to reuse lookahead token after an error, discard it. */
3507
3508 /* return failure if at end of input */
3509 if (yychar == YYEOF)
3510 YYABORT;
3511
3512#if YYDEBUG != 0
3513 if (yydebug)
3514 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3515#endif
3516
3517 yychar = YYEMPTY;
3518 }
3519
3520 /* Else will try to reuse lookahead token
3521 after shifting the error token. */
3522
3523 yyerrstatus = 3; /* Each real token shifted decrements this */
3524
3525 goto yyerrhandle;
3526
3527yyerrdefault: /* current state does not do anything special for the error token. */
3528
3529#if 0
3530 /* This is wrong; only states that explicitly want error tokens
3531 should shift them. */
3532 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3533 if (yyn) goto yydefault;
3534#endif
3535
3536yyerrpop: /* pop the current state because it cannot handle the error token */
3537
3538 if (yyssp == yyss) YYABORT;
3539 yyvsp--;
3540 yystate = *--yyssp;
3541#ifdef YYLSP_NEEDED
3542 yylsp--;
3543#endif
3544
3545#if YYDEBUG != 0
3546 if (yydebug)
3547 {
3548 short *ssp1 = yyss - 1;
3549 fprintf (stderr, "Error: state stack now");
3550 while (ssp1 != yyssp)
3551 fprintf (stderr, " %d", *++ssp1);
3552 fprintf (stderr, "\n");
3553 }
3554#endif
3555
3556yyerrhandle:
3557
3558 yyn = yypact[yystate];
3559 if (yyn == YYFLAG)
3560 goto yyerrdefault;
3561
3562 yyn += YYTERROR;
3563 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3564 goto yyerrdefault;
3565
3566 yyn = yytable[yyn];
3567 if (yyn < 0)
3568 {
3569 if (yyn == YYFLAG)
3570 goto yyerrpop;
3571 yyn = -yyn;
3572 goto yyreduce;
3573 }
3574 else if (yyn == 0)
3575 goto yyerrpop;
3576
3577 if (yyn == YYFINAL)
3578 YYACCEPT;
3579
3580#if YYDEBUG != 0
3581 if (yydebug)
3582 fprintf(stderr, "Shifting error token, ");
3583#endif
3584
3585 *++yyvsp = yylval;
3586#ifdef YYLSP_NEEDED
3587 *++yylsp = yylloc;
3588#endif
3589
3590 yystate = yyn;
3591 goto yynewstate;
3592
3593 yyacceptlab:
3594 /* YYACCEPT comes here. */
3595 if (yyfree_stacks)
3596 {
3597 free (yyss);
3598 free (yyvs);
3599#ifdef YYLSP_NEEDED
3600 free (yyls);
3601#endif
3602 }
3603 return 0;
3604
3605 yyabortlab:
3606 /* YYABORT comes here. */
3607 if (yyfree_stacks)
3608 {
3609 free (yyss);
3610 free (yyvs);
3611#ifdef YYLSP_NEEDED
3612 free (yyls);
3613#endif
3614 }
3615 return 1;
3616}
3617#line 1647 "parser.y"
3618
3619/* Dialog specific functions */
3620dialog_t *dialog_style(style_t * st, dialog_t *dlg)
3621{
3622 assert(dlg != NULL);
3623 if(dlg->style == NULL)
3624 {
3625 dlg->style = new_style(0,0);
3626 }
3627
3628 if(dlg->gotstyle)
3629 {
3630 yywarning("Style already defined, or-ing together");
3631 }
3632 else
3633 {
3634 dlg->style->or_mask = 0;
3635 dlg->style->and_mask = 0;
3636 }
3637 dlg->style->or_mask |= st->or_mask;
3638 dlg->style->and_mask |= st->and_mask;
3639 dlg->gotstyle = TRUE;
3640 free(st);
3641 return dlg;
3642}
3643
3644dialog_t *dialog_exstyle(style_t *st, dialog_t *dlg)
3645{
3646 assert(dlg != NULL);
3647 if(dlg->exstyle == NULL)
3648 {
3649 dlg->exstyle = new_style(0,0);
3650 }
3651
3652 if(dlg->gotexstyle)
3653 {
3654 yywarning("ExStyle already defined, or-ing together");
3655 }
3656 else
3657 {
3658 dlg->exstyle->or_mask = 0;
3659 dlg->exstyle->and_mask = 0;
3660 }
3661 dlg->exstyle->or_mask |= st->or_mask;
3662 dlg->exstyle->and_mask |= st->and_mask;
3663 dlg->gotexstyle = TRUE;
3664 free(st);
3665 return dlg;
3666}
3667
3668dialog_t *dialog_caption(string_t *s, dialog_t *dlg)
3669{
3670 assert(dlg != NULL);
3671 if(dlg->title)
3672 yyerror("Caption already defined");
3673 dlg->title = s;
3674 return dlg;
3675}
3676
3677dialog_t *dialog_font(font_id_t *f, dialog_t *dlg)
3678{
3679 assert(dlg != NULL);
3680 if(dlg->font)
3681 yyerror("Font already defined");
3682 dlg->font = f;
3683 return dlg;
3684}
3685
3686dialog_t *dialog_class(name_id_t *n, dialog_t *dlg)
3687{
3688 assert(dlg != NULL);
3689 if(dlg->dlgclass)
3690 yyerror("Class already defined");
3691 dlg->dlgclass = n;
3692 return dlg;
3693}
3694
3695dialog_t *dialog_menu(name_id_t *m, dialog_t *dlg)
3696{
3697 assert(dlg != NULL);
3698 if(dlg->menu)
3699 yyerror("Menu already defined");
3700 dlg->menu = m;
3701 return dlg;
3702}
3703
3704dialog_t *dialog_language(language_t *l, dialog_t *dlg)
3705{
3706 assert(dlg != NULL);
3707 if(dlg->lvc.language)
3708 yyerror("Language already defined");
3709 dlg->lvc.language = l;
3710 return dlg;
3711}
3712
3713dialog_t *dialog_characteristics(characts_t *c, dialog_t *dlg)
3714{
3715 assert(dlg != NULL);
3716 if(dlg->lvc.characts)
3717 yyerror("Characteristics already defined");
3718 dlg->lvc.characts = c;
3719 return dlg;
3720}
3721
3722dialog_t *dialog_version(version_t *v, dialog_t *dlg)
3723{
3724 assert(dlg != NULL);
3725 if(dlg->lvc.version)
3726 yyerror("Version already defined");
3727 dlg->lvc.version = v;
3728 return dlg;
3729}
3730
3731/* Controls specific functions */
3732control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control_t *prev)
3733{
3734 /* Hm... this seems to be jammed in at all time... */
3735 int defaultstyle = WS_CHILD | WS_VISIBLE;
3736
3737 assert(ctrl != NULL);
3738 ctrl->prev = prev;
3739
3740 if(prev)
3741 prev->next = ctrl;
3742
3743 if(type != -1)
3744 {
3745 ctrl->ctlclass = new_name_id();
3746 ctrl->ctlclass->type = name_ord;
3747 ctrl->ctlclass->name.i_name = type;
3748 }
3749
3750 switch(type)
3751 {
3752 case CT_BUTTON:
3753 if(special_style != BS_GROUPBOX && special_style != BS_RADIOBUTTON)
3754 defaultstyle |= WS_TABSTOP;
3755 break;
3756 case CT_EDIT:
3757 defaultstyle |= WS_TABSTOP | WS_BORDER;
3758 break;
3759 case CT_LISTBOX:
3760 defaultstyle |= LBS_NOTIFY | WS_BORDER;
3761 break;
3762 case CT_COMBOBOX:
3763 defaultstyle |= CBS_SIMPLE;
3764 break;
3765 case CT_STATIC:
3766 if(special_style == SS_CENTER || special_style == SS_LEFT || special_style == SS_RIGHT)
3767 defaultstyle |= WS_GROUP;
3768 break;
3769 }
3770
3771 if(!ctrl->gotstyle) /* Handle default style setting */
3772 {
3773 switch(type)
3774 {
3775 case CT_EDIT:
3776 defaultstyle |= ES_LEFT;
3777 break;
3778 case CT_LISTBOX:
3779 defaultstyle |= LBS_NOTIFY;
3780 break;
3781 case CT_COMBOBOX:
3782 defaultstyle |= CBS_SIMPLE | WS_TABSTOP;
3783 break;
3784 case CT_SCROLLBAR:
3785 defaultstyle |= SBS_HORZ;
3786 break;
3787 case CT_BUTTON:
3788 switch(special_style)
3789 {
3790 case BS_CHECKBOX:
3791 case BS_DEFPUSHBUTTON:
3792 case BS_PUSHBUTTON:
3793 case BS_GROUPBOX:
3794/* case BS_PUSHBOX: */
3795 case BS_AUTORADIOBUTTON:
3796 case BS_AUTO3STATE:
3797 case BS_3STATE:
3798 case BS_AUTOCHECKBOX:
3799 defaultstyle |= WS_TABSTOP;
3800 break;
3801 default:
3802 yywarning("Unknown default button control-style 0x%08x", special_style);
3803 case BS_RADIOBUTTON:
3804 break;
3805 }
3806 break;
3807
3808 case CT_STATIC:
3809 switch(special_style)
3810 {
3811 case SS_LEFT:
3812 case SS_RIGHT:
3813 case SS_CENTER:
3814 defaultstyle |= WS_GROUP;
3815 break;
3816 case SS_ICON: /* Special case */
3817 break;
3818 default:
3819 yywarning("Unknown default static control-style 0x%08x", special_style);
3820 break;
3821 }
3822 break;
3823 case -1: /* Generic control */
3824 goto byebye;
3825
3826 default:
3827 yyerror("Internal error (report this): Got weird control type 0x%08x", type);
3828 }
3829 }
3830
3831 /* The SS_ICON flag is always forced in for icon controls */
3832 if(type == CT_STATIC && special_style == SS_ICON)
3833 defaultstyle |= SS_ICON;
3834
3835 if (!ctrl->gotstyle)
3836 ctrl->style = new_style(0,0);
3837
3838 /* combine all styles */
3839 ctrl->style->or_mask = ctrl->style->or_mask | defaultstyle | special_style;
3840 ctrl->gotstyle = TRUE;
3841byebye:
3842 /* combine with NOT mask */
3843 if (ctrl->gotstyle)
3844 {
3845 ctrl->style->or_mask &= ~(ctrl->style->and_mask);
3846 ctrl->style->and_mask = 0;
3847 }
3848 if (ctrl->gotexstyle)
3849 {
3850 ctrl->exstyle->or_mask &= ~(ctrl->exstyle->and_mask);
3851 ctrl->exstyle->and_mask = 0;
3852 }
3853 return ctrl;
3854}
3855
3856name_id_t *convert_ctlclass(name_id_t *cls)
3857{
3858 char *cc;
3859 int iclass;
3860
3861 if(cls->type == name_ord)
3862 return cls;
3863 assert(cls->type == name_str);
3864 if(cls->type == str_unicode)
3865 {
3866 yyerror("Don't yet support unicode class comparison");
3867 }
3868 else
3869 cc = cls->name.s_name->str.cstr;
3870
3871 if(!strcasecmp("BUTTON", cc))
3872 iclass = CT_BUTTON;
3873 else if(!strcasecmp("COMBOBOX", cc))
3874 iclass = CT_COMBOBOX;
3875 else if(!strcasecmp("LISTBOX", cc))
3876 iclass = CT_LISTBOX;
3877 else if(!strcasecmp("EDIT", cc))
3878 iclass = CT_EDIT;
3879 else if(!strcasecmp("STATIC", cc))
3880 iclass = CT_STATIC;
3881 else if(!strcasecmp("SCROLLBAR", cc))
3882 iclass = CT_SCROLLBAR;
3883 else
3884 return cls; /* No default, return user controlclass */
3885
3886 free(cls->name.s_name->str.cstr);
3887 free(cls->name.s_name);
3888 cls->type = name_ord;
3889 cls->name.i_name = iclass;
3890 return cls;
3891}
3892
3893/* DialogEx specific functions */
3894dialogex_t *dialogex_style(style_t * st, dialogex_t *dlg)
3895{
3896 assert(dlg != NULL);
3897 if(dlg->style == NULL)
3898 {
3899 dlg->style = new_style(0,0);
3900 }
3901
3902 if(dlg->gotstyle)
3903 {
3904 yywarning("Style already defined, or-ing together");
3905 }
3906 else
3907 {
3908 dlg->style->or_mask = 0;
3909 dlg->style->and_mask = 0;
3910 }
3911 dlg->style->or_mask |= st->or_mask;
3912 dlg->style->and_mask |= st->and_mask;
3913 dlg->gotstyle = TRUE;
3914 free(st);
3915 return dlg;
3916}
3917
3918dialogex_t *dialogex_exstyle(style_t * st, dialogex_t *dlg)
3919{
3920 assert(dlg != NULL);
3921 if(dlg->exstyle == NULL)
3922 {
3923 dlg->exstyle = new_style(0,0);
3924 }
3925
3926 if(dlg->gotexstyle)
3927 {
3928 yywarning("ExStyle already defined, or-ing together");
3929 }
3930 else
3931 {
3932 dlg->exstyle->or_mask = 0;
3933 dlg->exstyle->and_mask = 0;
3934 }
3935 dlg->exstyle->or_mask |= st->or_mask;
3936 dlg->exstyle->and_mask |= st->and_mask;
3937 dlg->gotexstyle = TRUE;
3938 free(st);
3939 return dlg;
3940}
3941
3942dialogex_t *dialogex_caption(string_t *s, dialogex_t *dlg)
3943{
3944 assert(dlg != NULL);
3945 if(dlg->title)
3946 yyerror("Caption already defined");
3947 dlg->title = s;
3948 return dlg;
3949}
3950
3951dialogex_t *dialogex_font(font_id_t *f, dialogex_t *dlg)
3952{
3953 assert(dlg != NULL);
3954 if(dlg->font)
3955 yyerror("Font already defined");
3956 dlg->font = f;
3957 return dlg;
3958}
3959
3960dialogex_t *dialogex_class(name_id_t *n, dialogex_t *dlg)
3961{
3962 assert(dlg != NULL);
3963 if(dlg->dlgclass)
3964 yyerror("Class already defined");
3965 dlg->dlgclass = n;
3966 return dlg;
3967}
3968
3969dialogex_t *dialogex_menu(name_id_t *m, dialogex_t *dlg)
3970{
3971 assert(dlg != NULL);
3972 if(dlg->menu)
3973 yyerror("Menu already defined");
3974 dlg->menu = m;
3975 return dlg;
3976}
3977
3978dialogex_t *dialogex_language(language_t *l, dialogex_t *dlg)
3979{
3980 assert(dlg != NULL);
3981 if(dlg->lvc.language)
3982 yyerror("Language already defined");
3983 dlg->lvc.language = l;
3984 return dlg;
3985}
3986
3987dialogex_t *dialogex_characteristics(characts_t *c, dialogex_t *dlg)
3988{
3989 assert(dlg != NULL);
3990 if(dlg->lvc.characts)
3991 yyerror("Characteristics already defined");
3992 dlg->lvc.characts = c;
3993 return dlg;
3994}
3995
3996dialogex_t *dialogex_version(version_t *v, dialogex_t *dlg)
3997{
3998 assert(dlg != NULL);
3999 if(dlg->lvc.version)
4000 yyerror("Version already defined");
4001 dlg->lvc.version = v;
4002 return dlg;
4003}
4004
4005/* Accelerator specific functions */
4006event_t *add_event(int key, int id, int flags, event_t *prev)
4007{
4008 event_t *ev = new_event();
4009
4010 if((flags & (WRC_AF_VIRTKEY | WRC_AF_ASCII)) == (WRC_AF_VIRTKEY | WRC_AF_ASCII))
4011 yyerror("Cannot use both ASCII and VIRTKEY");
4012
4013 ev->key = key;
4014 ev->id = id;
4015 ev->flags = flags & ~WRC_AF_ASCII;
4016 ev->prev = prev;
4017 if(prev)
4018 prev->next = ev;
4019 return ev;
4020}
4021
4022event_t *add_string_event(string_t *key, int id, int flags, event_t *prev)
4023{
4024 int keycode = 0;
4025 event_t *ev = new_event();
4026
4027 if(key->type != str_char)
4028 yyerror("Key code must be an ascii string");
4029
4030 if((flags & WRC_AF_VIRTKEY) && (!isupper(key->str.cstr[0]) && !isdigit(key->str.cstr[0])))
4031 yyerror("VIRTKEY code is not equal to ascii value");
4032
4033 if(key->str.cstr[0] == '^' && (flags & WRC_AF_CONTROL) != 0)
4034 {
4035 yyerror("Cannot use both '^' and CONTROL modifier");
4036 }
4037 else if(key->str.cstr[0] == '^')
4038 {
4039 keycode = toupper(key->str.cstr[1]) - '@';
4040 if(keycode >= ' ')
4041 yyerror("Control-code out of range");
4042 }
4043 else
4044 keycode = key->str.cstr[0];
4045 ev->key = keycode;
4046 ev->id = id;
4047 ev->flags = flags & ~WRC_AF_ASCII;
4048 ev->prev = prev;
4049 if(prev)
4050 prev->next = ev;
4051 return ev;
4052}
4053
4054/* MenuEx specific functions */
4055itemex_opt_t *new_itemex_opt(int id, int type, int state, int helpid)
4056{
4057 itemex_opt_t *opt = (itemex_opt_t *)xmalloc(sizeof(itemex_opt_t));
4058 opt->id = id;
4059 opt->type = type;
4060 opt->state = state;
4061 opt->helpid = helpid;
4062 return opt;
4063}
4064
4065/* Raw data functions */
4066raw_data_t *load_file(string_t *name)
4067{
4068 FILE *fp;
4069 raw_data_t *rd;
4070 if(name->type != str_char)
4071 yyerror("Filename must be ASCII string");
4072
4073 fp = open_include(name->str.cstr, 1);
4074 if(!fp)
4075 yyerror("Cannot open file %s", name->str.cstr);
4076 rd = new_raw_data();
4077 fseek(fp, 0, SEEK_END);
4078 rd->size = ftell(fp);
4079 fseek(fp, 0, SEEK_SET);
4080 rd->data = (char *)xmalloc(rd->size);
4081 fread(rd->data, rd->size, 1, fp);
4082 fclose(fp);
4083 HEAPCHECK();
4084 return rd;
4085}
4086
4087raw_data_t *int2raw_data(int i)
4088{
4089 raw_data_t *rd;
4090
4091 if((int)((short)i) != i)
4092 yywarning("Integer constant out of 16bit range (%d), truncated to %d\n", i, (short)i);
4093
4094 rd = new_raw_data();
4095 rd->size = sizeof(short);
4096 rd->data = (char *)xmalloc(rd->size);
4097 *(short *)(rd->data) = (short)i;
4098 return rd;
4099}
4100
4101raw_data_t *long2raw_data(int i)
4102{
4103 raw_data_t *rd;
4104 rd = new_raw_data();
4105 rd->size = sizeof(int);
4106 rd->data = (char *)xmalloc(rd->size);
4107 *(int *)(rd->data) = i;
4108 return rd;
4109}
4110
4111raw_data_t *str2raw_data(string_t *str)
4112{
4113 raw_data_t *rd;
4114 rd = new_raw_data();
4115 rd->size = str->size * (str->type == str_char ? 1 : 2);
4116 rd->data = (char *)xmalloc(rd->size);
4117 memcpy(rd->data, str->str.cstr, rd->size);
4118 return rd;
4119}
4120
4121raw_data_t *merge_raw_data(raw_data_t *r1, raw_data_t *r2)
4122{
4123 r1->data = xrealloc(r1->data, r1->size + r2->size);
4124 memcpy(r1->data + r1->size, r2->data, r2->size);
4125 r1->size += r2->size;
4126 return r1;
4127}
4128
4129raw_data_t *merge_raw_data_int(raw_data_t *r1, int i)
4130{
4131 raw_data_t *t = int2raw_data(i);
4132 merge_raw_data(r1, t);
4133 free(t->data);
4134 free(t);
4135 return r1;
4136}
4137
4138raw_data_t *merge_raw_data_long(raw_data_t *r1, int i)
4139{
4140 raw_data_t *t = long2raw_data(i);
4141 merge_raw_data(r1, t);
4142 free(t->data);
4143 free(t);
4144 return r1;
4145}
4146
4147raw_data_t *merge_raw_data_str(raw_data_t *r1, string_t *str)
4148{
4149 raw_data_t *t = str2raw_data(str);
4150 merge_raw_data(r1, t);
4151 free(t->data);
4152 free(t);
4153 return r1;
4154}
4155
4156/* Function the go back in a list to get the head */
4157menu_item_t *get_item_head(menu_item_t *p)
4158{
4159 if(!p)
4160 return NULL;
4161 while(p->prev)
4162 p = p->prev;
4163 return p;
4164}
4165
4166menuex_item_t *get_itemex_head(menuex_item_t *p)
4167{
4168 if(!p)
4169 return NULL;
4170 while(p->prev)
4171 p = p->prev;
4172 return p;
4173}
4174
4175resource_t *get_resource_head(resource_t *p)
4176{
4177 if(!p)
4178 return NULL;
4179 while(p->prev)
4180 p = p->prev;
4181 return p;
4182}
4183
4184ver_block_t *get_ver_block_head(ver_block_t *p)
4185{
4186 if(!p)
4187 return NULL;
4188 while(p->prev)
4189 p = p->prev;
4190 return p;
4191}
4192
4193ver_value_t *get_ver_value_head(ver_value_t *p)
4194{
4195 if(!p)
4196 return NULL;
4197 while(p->prev)
4198 p = p->prev;
4199 return p;
4200}
4201
4202control_t *get_control_head(control_t *p)
4203{
4204 if(!p)
4205 return NULL;
4206 while(p->prev)
4207 p = p->prev;
4208 return p;
4209}
4210
4211event_t *get_event_head(event_t *p)
4212{
4213 if(!p)
4214 return NULL;
4215 while(p->prev)
4216 p = p->prev;
4217 return p;
4218}
4219
4220/* Find a stringtable with given language */
4221stringtable_t *find_stringtable(lvc_t *lvc)
4222{
4223 stringtable_t *stt;
4224
4225 assert(lvc != NULL);
4226
4227 if(!lvc->language)
4228 lvc->language = dup_language(currentlanguage);
4229
4230 for(stt = sttres; stt; stt = stt->next)
4231 {
4232 if(stt->lvc.language->id == lvc->language->id
4233 && stt->lvc.language->id == lvc->language->id)
4234 {
4235 /* Found a table with the same language */
4236 /* The version and characteristics are now handled
4237 * in the generation of the individual stringtables.
4238 * This enables localized analysis.
4239 if((stt->lvc.version && lvc->version && *(stt->lvc.version) != *(lvc->version))
4240 || (!stt->lvc.version && lvc->version)
4241 || (stt->lvc.version && !lvc->version))
4242 yywarning("Stringtable's versions are not the same, using first definition");
4243
4244 if((stt->lvc.characts && lvc->characts && *(stt->lvc.characts) != *(lvc->characts))
4245 || (!stt->lvc.characts && lvc->characts)
4246 || (stt->lvc.characts && !lvc->characts))
4247 yywarning("Stringtable's characteristics are not the same, using first definition");
4248 */
4249 return stt;
4250 }
4251 }
4252 return NULL;
4253}
4254
4255/* qsort sorting function for string table entries */
4256#define STE(p) ((stt_entry_t *)(p))
4257int sort_stt_entry(const void *e1, const void *e2)
4258{
4259 return STE(e1)->id - STE(e2)->id;
4260}
4261#undef STE
4262
4263resource_t *build_stt_resources(stringtable_t *stthead)
4264{
4265 stringtable_t *stt;
4266 stringtable_t *newstt;
4267 resource_t *rsc;
4268 resource_t *rsclist = NULL;
4269 resource_t *rsctail = NULL;
4270 int i;
4271 int j;
4272 DWORD andsum;
4273 DWORD orsum;
4274 characts_t *characts;
4275 version_t *version;
4276
4277 if(!stthead)
4278 return NULL;
4279
4280 /* For all languages defined */
4281 for(stt = stthead; stt; stt = stt->next)
4282 {
4283 assert(stt->nentries > 0);
4284
4285 /* Sort the entries */
4286 if(stt->nentries > 1)
4287 qsort(stt->entries, stt->nentries, sizeof(stt->entries[0]), sort_stt_entry);
4288
4289 for(i = 0; i < stt->nentries; )
4290 {
4291 newstt = new_stringtable(&stt->lvc);
4292 newstt->entries = (stt_entry_t *)xmalloc(16 * sizeof(stt_entry_t));
4293 newstt->nentries = 16;
4294 newstt->idbase = stt->entries[i].id & ~0xf;
4295 for(j = 0; j < 16 && i < stt->nentries; j++)
4296 {
4297 if(stt->entries[i].id - newstt->idbase == j)
4298 {
4299 newstt->entries[j] = stt->entries[i];
4300 i++;
4301 }
4302 }
4303 andsum = ~0;
4304 orsum = 0;
4305 characts = NULL;
4306 version = NULL;
4307 /* Check individual memory options and get
4308 * the first characteristics/version
4309 */
4310 for(j = 0; j < 16; j++)
4311 {
4312 if(!newstt->entries[j].str)
4313 continue;
4314 andsum &= newstt->entries[j].memopt;
4315 orsum |= newstt->entries[j].memopt;
4316 if(!characts)
4317 characts = newstt->entries[j].characts;
4318 if(!version)
4319 version = newstt->entries[j].version;
4320 }
4321 if(andsum != orsum)
4322 {
4323 warning("Stringtable's memory options are not equal (idbase: %d)", newstt->idbase);
4324 }
4325 /* Check version and characteristics */
4326 for(j = 0; j < 16; j++)
4327 {
4328 if(characts
4329 && newstt->entries[j].characts
4330 && *newstt->entries[j].characts != *characts)
4331 warning("Stringtable's characteristics are not the same (idbase: %d)", newstt->idbase);
4332 if(version
4333 && newstt->entries[j].version
4334 && *newstt->entries[j].version != *version)
4335 warning("Stringtable's versions are not the same (idbase: %d)", newstt->idbase);
4336 }
4337 rsc = new_resource(res_stt, newstt, newstt->memopt, newstt->lvc.language);
4338 rsc->name = new_name_id();
4339 rsc->name->type = name_ord;
4340 rsc->name->name.i_name = (newstt->idbase >> 4) + 1;
4341 rsc->memopt = andsum; /* Set to least common denominator */
4342 newstt->memopt = andsum;
4343 newstt->lvc.characts = characts;
4344 newstt->lvc.version = version;
4345 if(!rsclist)
4346 {
4347 rsclist = rsc;
4348 rsctail = rsc;
4349 }
4350 else
4351 {
4352 rsctail->next = rsc;
4353 rsc->prev = rsctail;
4354 rsctail = rsc;
4355 }
4356 }
4357 }
4358 return rsclist;
4359}
4360
4361/* Cursor and icon splitter functions */
4362typedef struct {
4363 language_t lan;
4364 int id;
4365} id_alloc_t;
4366
4367static int get_new_id(id_alloc_t **list, int *n, language_t *lan)
4368{
4369 int i;
4370 assert(lan != NULL);
4371 assert(list != NULL);
4372 assert(n != NULL);
4373
4374 if(!*list)
4375 {
4376 *list = (id_alloc_t *)xmalloc(sizeof(id_alloc_t));
4377 *n = 1;
4378 (*list)[0].lan = *lan;
4379 (*list)[0].id = 1;
4380 return 1;
4381 }
4382
4383 for(i = 0; i < *n; i++)
4384 {
4385 if((*list)[i].lan.id == lan->id && (*list)[i].lan.sub == lan->sub)
4386 return ++((*list)[i].id);
4387 }
4388
4389 *list = (id_alloc_t *)xrealloc(*list, sizeof(id_alloc_t) * (*n+1));
4390 (*list)[*n].lan = *lan;
4391 (*list)[*n].id = 1;
4392 *n += 1;
4393 return 1;
4394}
4395
4396int alloc_icon_id(language_t *lan)
4397{
4398 static id_alloc_t *idlist = NULL;
4399 static int nid = 0;
4400
4401 return get_new_id(&idlist, &nid, lan);
4402}
4403
4404int alloc_cursor_id(language_t *lan)
4405{
4406 static id_alloc_t *idlist = NULL;
4407 static int nid = 0;
4408
4409 return get_new_id(&idlist, &nid, lan);
4410}
4411
4412#define BPTR(base) ((char *)(rd->data + (base)))
4413#define WPTR(base) ((WORD *)(rd->data + (base)))
4414#define DPTR(base) ((DWORD *)(rd->data + (base)))
4415void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico)
4416{
4417 int cnt;
4418 int i;
4419 icon_dir_entry_t *ide;
4420 icon_t *ico;
4421 icon_t *list = NULL;
4422
4423 /* FIXME: Distinguish between normal and animated icons (RIFF format) */
4424 if(WPTR(0)[1] != 1)
4425 yyerror("Icon resource data has invalid type id %d", WPTR(0)[1]);
4426 cnt = WPTR(0)[2];
4427 ide = (icon_dir_entry_t *)&(WPTR(0)[3]);
4428 for(i = 0; i < cnt; i++)
4429 {
4430 ico = new_icon();
4431 ico->id = alloc_icon_id(icog->lvc.language);
4432 ico->lvc.language = dup_language(icog->lvc.language);
4433 if(ide[i].offset > rd->size
4434 || ide[i].offset + ide[i].ressize > rd->size)
4435 yyerror("Icon resource data corrupt");
4436 ico->width = ide[i].width;
4437 ico->height = ide[i].height;
4438 ico->nclr = ide[i].nclr;
4439 ico->planes = ide[i].planes;
4440 ico->bits = ide[i].bits;
4441 if(!ico->planes)
4442 {
4443 /* Argh! They did not fill out the resdir structure */
4444 ico->planes = ((BITMAPINFOHEADER *)BPTR(ide[i].offset))->biPlanes;
4445 }
4446 if(!ico->bits)
4447 {
4448 /* Argh! They did not fill out the resdir structure */
4449 ico->bits = ((BITMAPINFOHEADER *)BPTR(ide[i].offset))->biBitCount;
4450 }
4451 ico->data = new_raw_data();
4452 copy_raw_data(ico->data, rd, ide[i].offset, ide[i].ressize);
4453 if(!list)
4454 {
4455 list = ico;
4456 }
4457 else
4458 {
4459 ico->next = list;
4460 list->prev = ico;
4461 list = ico;
4462 }
4463 }
4464 icog->iconlist = list;
4465 *nico = cnt;
4466}
4467
4468void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur)
4469{
4470 int cnt;
4471 int i;
4472 cursor_dir_entry_t *cde;
4473 cursor_t *cur;
4474 cursor_t *list = NULL;
4475
4476 /* FIXME: Distinguish between normal and animated cursors (RIFF format)*/
4477 if(WPTR(0)[1] != 2)
4478 yyerror("Cursor resource data has invalid type id %d", WPTR(0)[1]);
4479 cnt = WPTR(0)[2];
4480 cde = (cursor_dir_entry_t *)&(WPTR(0)[3]);
4481 for(i = 0; i < cnt; i++)
4482 {
4483 cur = new_cursor();
4484 cur->id = alloc_cursor_id(curg->lvc.language);
4485 cur->lvc.language = dup_language(curg->lvc.language);
4486 if(cde[i].offset > rd->size
4487 || cde[i].offset + cde[i].ressize > rd->size)
4488 yyerror("Cursor resource data corrupt");
4489 cur->width = cde[i].width;
4490 cur->height = cde[i].height;
4491 cur->nclr = cde[i].nclr;
4492 /* The next two are to support color cursors */
4493 cur->planes = ((BITMAPINFOHEADER *)BPTR(cde[i].offset))->biPlanes;
4494 cur->bits = ((BITMAPINFOHEADER *)BPTR(cde[i].offset))->biBitCount;
4495 if(!win32 && (cur->planes != 1 || cur->bits != 1))
4496 yywarning("Win16 cursor contains colors");
4497 cur->xhot = cde[i].xhot;
4498 cur->yhot = cde[i].yhot;
4499 cur->data = new_raw_data();
4500 copy_raw_data(cur->data, rd, cde[i].offset, cde[i].ressize);
4501 if(!list)
4502 {
4503 list = cur;
4504 }
4505 else
4506 {
4507 cur->next = list;
4508 list->prev = cur;
4509 list = cur;
4510 }
4511 }
4512 curg->cursorlist = list;
4513 *ncur = cnt;
4514}
4515
4516#undef BPTR
4517#undef WPTR
4518#undef DPTR
4519
4520
4521toolbar_item_t *ins_tlbr_button(toolbar_item_t *prev, toolbar_item_t *idrec)
4522{
4523 idrec->prev = prev;
4524 if(prev)
4525 prev->next = idrec;
4526
4527 return idrec;
4528}
4529
4530toolbar_item_t *get_tlbr_buttons_head(toolbar_item_t *p, int *nitems)
4531{
4532 if(!p)
4533 {
4534 *nitems = 0;
4535 return NULL;
4536 }
4537
4538 *nitems = 1;
4539
4540 while(p->prev)
4541 {
4542 (*nitems)++;
4543 p = p->prev;
4544 }
4545
4546 return p;
4547}
4548
Note: See TracBrowser for help on using the repository browser.