Changeset 3426 for trunk/tools


Ignore:
Timestamp:
Apr 19, 2000, 4:46:07 PM (26 years ago)
Author:
sandervl
Message:

update with latest wine code

Location:
trunk/tools
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/wrc/CHANGES

    r882 r3426  
     1---------------------------------------------------------------------------
     2Version 1.0.18 (28-Dec-1999)
     3
     4Bertho Stultiens <bertho@akhphd.au.dk>
     5- Bugfix: The named resources were not named correctly for indirectly
     6  addressable resources, which resulted in an undefined variable. The
     7  previous fix was incomplete (I was probably sleeping while I made it).
     8
     9---------------------------------------------------------------------------
     10Version 1.0.17 (20-Dec-1999)
     11
     12Bertho Stultiens <bertho@akhphd.au.dk>
     13- Bugfix: Named resources of different types generated the same assembly-
     14  label twice, resulting in a compile failure.
     15
     16---------------------------------------------------------------------------
     17Version 1.0.16 (6-Nov-1999)
     18
     19Juergen.Schmied@debitel.net
     20- Bugfix: Styles were evaluated as expressions. The NOT in combination
     21  with style flags was not overwriting the default styles like WS_VISIBLE.
     22  Solved by introducing own rules for parsing styles.
     23
     24---------------------------------------------------------------------------
     25Version 1.0.15 (13-Aug-1999)
     26
     27Bertho Stultiens <bertho@akhphd.au.dk>
     28- Bugfix: IDs were not checked which resulted in numbers > 2^16-1 being
     29  accepted as IDs. This resulted in duplicate IDs and all other sort of
     30  trouble.
     31
    132---------------------------------------------------------------------------
    233Version 1.0.14 (08-Aug-1999)
  • trunk/tools/wrc/dumpres.c

    r882 r3426  
    88#include "config.h"
    99
     10#include <assert.h>
    1011#include <stdio.h>
    1112#include <ctype.h>
     
    498499        printf("\tx, y, w, h: %d, %d, %d, %d\n", ctrl->x, ctrl->y, ctrl->width, ctrl->height);
    499500        if(ctrl->gotstyle)
    500                 printf("\tStyle: %08lx\n", ctrl->style);
     501        {
     502                assert(ctrl->style != NULL);
     503                assert(ctrl->style->and_mask == 0);
     504                printf("\tStyle: %08lx\n", ctrl->style->or_mask);
     505        }
    501506        if(ctrl->gotexstyle)
    502                 printf("\tExStyle: %08lx\n", ctrl->exstyle);
     507        {
     508                assert(ctrl->exstyle != NULL);
     509                assert(ctrl->exstyle->and_mask == 0);
     510                printf("\tExStyle: %08lx\n", ctrl->exstyle->or_mask);
     511        }
    503512        if(ctrl->gothelpid)
    504513                printf("\tHelpid: %ld\n", ctrl->helpid);
     
    530539        printf("x, y, w, h: %d, %d, %d, %d\n", dlg->x, dlg->y, dlg->width, dlg->height);
    531540        if(dlg->gotstyle)
    532                 printf("Style: %08lx\n", dlg->style);
     541        {
     542                assert(dlg->style != NULL);
     543                assert(dlg->style->and_mask == 0);
     544                printf("Style: %08lx\n", dlg->style->or_mask);
     545               
     546        }
    533547        if(dlg->gotexstyle)
    534                 printf("ExStyle: %08lx\n", dlg->exstyle);
     548        {
     549                assert(dlg->exstyle != NULL);
     550                assert(dlg->exstyle->and_mask == 0);
     551                printf("ExStyle: %08lx\n", dlg->exstyle->or_mask);
     552        }
    535553        printf("Menu: %s\n", get_nameid_str(dlg->menu));
    536554        printf("Class: %s\n", get_nameid_str(dlg->dlgclass));
     
    571589        printf("x, y, w, h: %d, %d, %d, %d\n", dlgex->x, dlgex->y, dlgex->width, dlgex->height);
    572590        if(dlgex->gotstyle)
    573                 printf("Style: %08lx\n", dlgex->style);
     591        {
     592                assert(dlgex->style != NULL);
     593                assert(dlgex->style->and_mask == 0);
     594                printf("Style: %08lx\n", dlgex->style->or_mask);
     595        }
    574596        if(dlgex->gotexstyle)
    575                 printf("ExStyle: %08lx\n", dlgex->exstyle);
     597        {
     598                assert(dlgex->exstyle != NULL);
     599                assert(dlgex->exstyle->and_mask == 0);
     600                printf("ExStyle: %08lx\n", dlgex->exstyle->or_mask);
     601        }
    576602        if(dlgex->gothelpid)
    577603                printf("Helpid: %ld\n", dlgex->helpid);
  • trunk/tools/wrc/genres.c

    r882 r3426  
    1919#include "genres.h"
    2020#include "utils.h"
     21#include "windef.h"
     22#include "wingdi.h"
    2123#include "winuser.h"
    2224
     
    416418                restag = put_res_header(res, WRC_RT_DIALOG, NULL, name, dlg->memopt, &(dlg->lvc));
    417419
    418                 put_dword(res, dlg->style);
    419                 put_dword(res, dlg->gotexstyle ? dlg->exstyle : 0);
     420                put_dword(res, dlg->style->or_mask);
     421                put_dword(res, dlg->gotexstyle ? dlg->exstyle->or_mask : 0);
    420422                tag_nctrl = res->size;
    421423                put_word(res, 0);               /* Number of controls */
     
    446448                {
    447449                        /* FIXME: what is default control style? */
    448                         put_dword(res, ctrl->gotstyle ? ctrl->style : WS_CHILD);
    449                         put_dword(res, ctrl->gotexstyle ? ctrl->exstyle : 0);
     450                        put_dword(res, ctrl->gotstyle ? ctrl->style->or_mask: WS_CHILD);
     451                        put_dword(res, ctrl->gotexstyle ? ctrl->exstyle->or_mask : 0);
    450452                        put_word(res, ctrl->x);
    451453                        put_word(res, ctrl->y);
     
    482484                restag = put_res_header(res, WRC_RT_DIALOG, NULL, name, dlg->memopt, NULL);
    483485
    484                 put_dword(res, dlg->gotstyle ? dlg->style : WS_POPUPWINDOW);
     486                put_dword(res, dlg->gotstyle ? dlg->style->or_mask : WS_POPUPWINDOW);
    485487                tag_nctrl = res->size;
    486488                put_byte(res, 0);               /* Number of controls */
     
    514516                        put_word(res, ctrl->height);
    515517                        put_word(res, ctrl->id);
    516                         put_dword(res, ctrl->gotstyle ? ctrl->style : WS_CHILD);
     518                        put_dword(res, ctrl->gotstyle ? ctrl->style->or_mask: WS_CHILD);
    517519                        if(ctrl->ctlclass)
    518520                        {
     
    584586                put_word(res, 0xffff);          /* DlgVer */
    585587                put_dword(res, dlgex->gothelpid ? dlgex->helpid : 0);
    586                 put_dword(res, dlgex->gotexstyle ? dlgex->exstyle : 0);
    587                 put_dword(res, dlgex->gotstyle ? dlgex->style : WS_POPUPWINDOW);
     588                put_dword(res, dlgex->gotexstyle ? dlgex->exstyle->or_mask : 0);
     589                put_dword(res, dlgex->gotstyle ? dlgex->style->or_mask : WS_POPUPWINDOW);
    588590                tag_nctrl = res->size;
    589591                put_word(res, 0);               /* Number of controls */
     
    620622                {
    621623                        put_dword(res, ctrl->gothelpid ? ctrl->helpid : 0);
    622                         put_dword(res, ctrl->gotexstyle ? ctrl->exstyle : 0);
     624                        put_dword(res, ctrl->gotexstyle ? ctrl->exstyle->or_mask : 0);
    623625                        /* FIXME: what is default control style? */
    624                         put_dword(res, ctrl->gotstyle ? ctrl->style : WS_CHILD | WS_VISIBLE);
     626                        put_dword(res, ctrl->gotstyle ? ctrl->style->or_mask : WS_CHILD | WS_VISIBLE);
    625627                        put_word(res, ctrl->x);
    626628                        put_word(res, ctrl->y);
  • trunk/tools/wrc/lexyy.c

    r882 r3426  
    22
    33/* Scanner skeleton version:
    4  * $Header: /home/ktk/tmp/odin/2007/netlabs.cvs/odin32/tools/wrc/lexyy.c,v 1.1 1999-09-08 19:34:08 sandervl Exp $
     4 * $Header: /home/ktk/tmp/odin/2007/netlabs.cvs/odin32/tools/wrc/lexyy.c,v 1.2 2000-04-19 14:44:58 sandervl Exp $
    55 */
    66
     
    282282        yy_c_buf_p = yy_cp;
    283283
    284 #define YY_NUM_RULES 117
    285 #define YY_END_OF_BUFFER 118
    286 static yyconst short int yy_accept[346] =
     284#define YY_NUM_RULES 124
     285#define YY_END_OF_BUFFER 125
     286static yyconst short int yy_accept[369] =
    287287    {   0,
    288         0,    0,   59,   59,    0,    0,    0,    0,    0,    0,
    289         0,    0,  107,  107,    0,    0,    0,    0,    0,    0,
     288        0,    0,   66,   66,    0,    0,    0,    0,    0,    0,
     289        0,    0,  114,  114,    0,    0,    0,    0,    0,    0,
    290290        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    291         0,    0,   22,   22,    9,    9,    9,    9,   39,   39,
    292         0,    0,   29,   29,   33,   33,   34,   34,  118,  115,
    293       114,  113,  115,   81,  115,  100,  115,   49,   49,  111,
    294       115,  115,  115,   52,   52,   47,  115,   48,  114,  115,
    295        59,  114,   60,   59,   59,   59,   59,   59,   59,  116,
    296        62,   61,   95,   83,   82,   99,   80,   65,   64,  116,
    297       105,  103,  104,  101,  105,  107,  109,  108,    4,  116,
    298 
    299         4,    4,    8,    6,   14,   22,    9,   12,  116,  116,
    300        39,   38,   38,   38,   29,  116,   27,   25,   26,   29,
    301       116,   33,   30,   31,  116,   33,   37,   34,   36,   35,
    302       114,   56,   54,  106,  112,   49,   52,   49,   52,   52,
    303       111,   57,   55,   58,   63,   53,  114,    0,    0,    0,
    304         0,    0,    0,    0,    0,   59,   59,   59,   59,   59,
    305        59,   59,   59,    0,   61,   95,    0,   96,   94,   94,
    306        84,   86,   87,   88,   89,   90,   91,   92,   93,   94,
    307        80,    0,   77,   76,   76,   66,   68,   69,   70,   71,
    308        72,   73,   74,   75,   76,  103,  102,  107,  108,  108,
    309 
    310       110,    0,    0,    7,    6,   14,   22,    9,   10,    0,
    311        11,   39,    0,    0,    0,    0,    0,   29,   28,   29,
    312        33,   32,   33,   34,  112,   51,   50,    0,    0,    0,
    313         0,   15,    0,    0,    0,    0,   59,   59,   59,   59,
    314        59,   59,   59,   98,   97,   84,   86,    0,   79,   78,
    315        66,   68,    0,    3,    2,   10,   51,   50,    0,    0,
    316         0,    0,    0,   15,    0,    0,    0,    0,    0,    0,
    317        59,   59,   59,   59,   59,   59,   46,   84,   85,   66,
    318         0,    0,   18,   19,    0,    0,    0,    0,    0,   24,
    319         0,    0,   59,   41,   59,   59,   59,   59,   66,    0,
    320 
    321         0,   18,   19,   20,   21,   16,    0,    0,   24,    0,
    322        13,   59,   42,   59,   59,   59,   66,   67,    5,   20,
    323        21,   16,   17,    0,   23,   13,   59,   59,   59,   45,
    324        66,    5,   17,    1,   23,   59,   59,   43,    1,   59,
    325        59,   59,   44,   40,    0
     291        0,    0,   22,   22,    9,    9,    9,    9,   46,   46,
     292        0,    0,   36,   36,   31,   31,   40,   40,   41,   41,
     293      125,  122,  121,  120,  122,   88,  122,  107,  122,   56,
     294       56,  118,  122,  122,  122,   59,   59,   54,  122,   55,
     295      121,  122,   66,  121,   67,   66,   66,   66,   66,   66,
     296       66,  123,   69,   68,  102,   90,   89,  106,   87,   72,
     297       71,  123,  112,  110,  111,  108,  112,  114,  116,  115,
     298
     299        4,  123,    4,    4,    8,    6,   14,   22,    9,   12,
     300      123,  123,   46,   45,   45,   45,   36,  123,   34,   32,
     301       33,   36,  123,   31,  123,   29,   27,   28,   31,   40,
     302       37,   38,  123,   40,   44,   41,   43,   42,  121,   63,
     303       61,  113,  119,   56,   59,   56,   59,   59,  118,   64,
     304       62,   65,   70,   60,  121,    0,    0,    0,    0,    0,
     305        0,    0,    0,   66,   66,   66,   66,   66,   66,   66,
     306       66,    0,   68,  102,    0,  103,  101,  101,   91,   93,
     307       94,   95,   96,   97,   98,   99,  100,  101,   87,    0,
     308       84,   83,   83,   73,   75,   76,   77,   78,   79,   80,
     309
     310       81,   82,   83,  110,  109,  114,  115,  115,  117,    0,
     311        0,    7,    6,   14,   22,    9,   10,    0,   11,   46,
     312        0,    0,    0,    0,    0,   36,   35,   36,    0,    0,
     313       31,   30,   31,   40,   39,   40,   41,  119,   58,   57,
     314        0,    0,    0,    0,    0,   15,    0,    0,    0,    0,
     315       66,   66,   66,   66,   66,   66,   66,  105,  104,   91,
     316       93,    0,   86,   85,   73,   75,    0,    3,    2,   10,
     317        0,   58,   57,    0,    0,    0,    0,    0,    0,   15,
     318        0,    0,    0,    0,    0,    0,   66,   66,   66,   66,
     319       66,   66,   53,   91,   92,   73,    0,    0,    0,   18,
     320
     321       19,    0,    0,    0,    0,    0,    0,   26,    0,    0,
     322       66,   48,   66,   66,   66,   66,   73,    0,    0,    0,
     323       18,   19,   20,   21,   25,   16,    0,    0,   26,    0,
     324       13,   66,   49,   66,   66,   66,   73,   74,   23,    5,
     325       20,   21,   25,   16,   17,    0,   24,   13,   66,   66,
     326       66,   52,   73,   23,    5,   17,    1,   24,   66,   66,
     327       50,    1,   66,   66,   66,   51,   47,    0
    326328    } ;
    327329
     
    368370    } ;
    369371
    370 static yyconst short int yy_base[397] =
     372static yyconst short int yy_base[425] =
    371373    {   0,
    372374        0,   60,  119,  169,   17,   18,   42,   43,   46,   47,
    373375      219,  262,   21,   22,   24,   37,  306,  366,  426,  486,
    374376        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    375         0,    0,  626,  625,   79,   87,   89,   90,  624,  623,
    376       622,   28,   94,  127,  170,  324,   41,   92,  624, 1265,
    377       621, 1265,  604, 1265,  614, 1265,   24,  241,   98,    0,
    378       602,  601,  600,    0,  612, 1265,  557, 1265,   81,  113,
    379         0,  613, 1265,   10,   59,   75,   85,  100,  148,  609,
    380      1265, 1265,    0, 1265,  132,  542,    0, 1265,  136,  595,
    381      1265,  611, 1265, 1265,    0,    0, 1265,  146, 1265, 1265,
    382 
    383         0,    0, 1265,  603,    0,    0,    0, 1265,  166,  186,
    384         0, 1265,  101,  147,    0,  600, 1265, 1265, 1265,  130,
    385       182,    0, 1265, 1265,  596,  189, 1265,  604, 1265, 1265,
    386       603, 1265, 1265, 1265,    0,  191,    0,    0,  194,  640,
    387         0, 1265, 1265, 1265, 1265, 1265,  208,  295,  345,  561,
    388       177,   65,  557,  550,  552,    0,  165,  193,  180,  227,
    389       201,  224,  216,  592, 1265,    0,  269, 1265, 1265,  590,
    390       238,  266, 1265, 1265, 1265, 1265, 1265, 1265, 1265,    0,
    391         0,  287, 1265, 1265,  588,  280,  338, 1265, 1265, 1265,
    392      1265, 1265, 1265, 1265,    0,  590, 1265,    0,  224,  234,
    393 
    394      1265,  585,  570, 1265,  579,    0,    0,    0,    0,  297,
    395      1265,    0,  326,  343,  347,    6,  543,    0, 1265,  329,
    396         0, 1265,  337,  583,    0,  433,  301,  540,   43,  541,
    397       528,  160,  538,  529,  538,  534,  372,  371,  362,  376,
    398       377,  374,  379, 1265, 1265,  341,  344,    0, 1265, 1265,
    399       347,  392,    0,  570, 1265,    0,    0,    0,  528,  529,
    400       529,  525,  520,  567,  525,  525,  519,  522,  519,  520,
    401       428,  426,  417,  420,  432,  422,    0,  395, 1265,  441,
    402         0,  513,  559,  558,  515,  506,  510,  510,  497,    0,
    403       503,  506,  424,    0,  434,  429,  439,  442,  460,    0,
    404 
    405       506,  546,  541,  540,  533,  527,  479,  441,    0,  427,
    406       463,  440,    0,  484,  479,  485,  496, 1265,  421,  417,
    407       414,  413,  410,  368,    0,  396,  492,  493,  490,    0,
    408       502,  361,  294,  288,    0,  497,  491,    0,  271,  492,
    409       493,  498,    0,    0, 1265,  684,  698,  712,  726,  740,
    410       754,  768,  782,  796,  810,  824,  838,  852,  866,  880,
    411       894,  908,  922,  518,  936,  950,  964,  978,  992, 1006,
    412      1020,  213, 1034, 1048, 1062, 1076, 1085,  524, 1097, 1111,
    413      1125, 1139, 1153, 1166, 1180, 1194, 1208,  165,  159, 1222,
    414       143,  130,   29, 1236,   16, 1250
    415 
     377        0,    0, 1053, 1048,   79,   87,   89,   90, 1030, 1021,
     378     1020,   28,   94,  127,  120,  187,  323,  339,   41,   92,
     379     1005, 1334,  994, 1334,  977, 1334,  974, 1334,   24,  241,
     380      191,    0,  950,  949,  948,    0,  948, 1334,  619, 1334,
     381       81,  113,    0,  675, 1334,   10,   59,   83,   85,  103,
     382      174,  671, 1334, 1334,    0, 1334,  102,  542,    0, 1334,
     383      109,  595, 1334,  673, 1334, 1334,    0,    0, 1334,  126,
     384
     385     1334, 1334,    0,    0, 1334,  665,    0,    0,    0, 1334,
     386      129,  147,    0, 1334,  107,  206,    0,  662, 1334, 1334,
     387     1334,  156,  246,    0,  661, 1334, 1334, 1334,  167,    0,
     388     1334, 1334,  660,  173, 1334,  668, 1334, 1334,  667, 1334,
     389     1334, 1334,    0,  253,    0,    0,  163,  640,    0, 1334,
     390     1334, 1334, 1334, 1334,  180,  344,  350,  625,  176,  139,
     391      621,  614,  610,    0,  157,  193,  163,  192,  215,  194,
     392      247,  653, 1334,    0,  325, 1334, 1334,  652,  281,  323,
     393     1334, 1334, 1334, 1334, 1334, 1334, 1334,    0,    0,  326,
     394     1334, 1334,  651,  343,  346, 1334, 1334, 1334, 1334, 1334,
     395
     396     1334, 1334,    0,  648, 1334,    0,  224,  262, 1334,  643,
     397      627, 1334,  636,    0,    0,    0,    0,  351, 1334,    0,
     398      341,  360,  406,  363,   11,    0, 1334,  392,  412,  419,
     399        0, 1334,  407,    0, 1334,  414,  641,    0,  433,  372,
     400      598,   43,  599,  588,  595,  465,  596,  587,  594,  590,
     401      428,  430,  367,  433,  436,  478,  484, 1334, 1334,  463,
     402      468,    0, 1334, 1334,  496,  502,    0,  626, 1334,    0,
     403      578,    0,    0,  583,  584,  584,  580,  575,  575,  621,
     404      579,  579,  573,  576,  573,  574,  492,  490,  485,  488,
     405      500,  490,    0,  515, 1334,  520,    0,  566,  566,  612,
     406
     407      611,  568,  559,  553,  561,  561,  546,    0,  549,  548,
     408      489,    0,  499,  513,  527,  529,  537,    0,  538,  546,
     409      586,  573,  534,  524,    0,  469,  424,  409,    0,  409,
     410      421,  530,    0,  532,  530,  536,  550, 1334,    0,  416,
     411      415,  387,    0,  386,  361,  307,    0,  338,  540,  541,
     412      542,    0,  556,    0,  332,  288,  277,    0,  553,  548,
     413        0,  244,  555,  556,  563,    0,    0, 1334,  684,  698,
     414      712,  726,  740,  754,  768,  782,  796,  810,  824,  838,
     415      852,  866,  880,  894,  908,  922,  936,  190,  950,  964,
     416      978,  992, 1006, 1020, 1034,  214, 1048, 1062, 1076, 1090,
     417
     418     1099,  462, 1111, 1125, 1139, 1153, 1167, 1180, 1194, 1207,
     419     1221, 1235, 1249,  174,  147, 1263,  135,   93,   29, 1277,
     420       16, 1291, 1305, 1319
    416421    } ;
    417422
    418 static yyconst short int yy_def[397] =
     423static yyconst short int yy_def[425] =
    419424    {   0,
    420       346,  346,  347,  347,  348,  348,  349,  349,  350,  350,
    421       351,  351,  352,  352,  353,  353,  354,  354,  355,  355,
    422       356,  356,  356,  356,  356,  356,  356,  356,  356,  356,
    423       356,  356,  357,  357,  358,  358,  358,  358,  359,  359,
    424       360,  360,  361,  361,  362,  362,  363,  363,  345,  345,
    425       345,  345,  345,  345,  345,  345,  345,  364,  364,  365,
    426       345,  345,  345,  364,  364,  345,  345,  345,  345,  345,
    427       366,  345,  345,  366,  366,  366,  366,  366,  366,  367,
    428       345,  345,  368,  345,  345,  369,  370,  345,  345,  371,
    429       345,  345,  345,  345,  372,  373,  345,  374,  345,  345,
    430 
    431       375,  376,  345,  377,  378,  379,  380,  345,  381,  345,
    432       382,  345,  345,  345,  383,  384,  345,  345,  345,  383,
    433       345,  385,  345,  345,  386,  385,  345,  345,  345,  345,
    434       345,  345,  345,  345,  387,  364,  364,  364,  364,  364,
    435       365,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    436       345,  345,  345,  345,  345,  366,  366,  366,  366,  366,
    437       366,  366,  366,  367,  345,  368,  345,  345,  345,  345,
    438       345,  345,  345,  345,  345,  345,  345,  345,  345,  388,
    439       370,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    440       345,  345,  345,  345,  389,  345,  345,  373,  374,  374,
    441 
    442       345,  375,  376,  345,  377,  378,  379,  380,  390,  345,
    443       345,  382,  345,  345,  345,  345,  345,  383,  345,  383,
    444       385,  345,  385,  345,  387,  364,  140,  345,  345,  345,
    445       345,  345,  345,  345,  345,  345,  366,  366,  366,  366,
    446       366,  366,  366,  345,  345,  345,  345,  391,  345,  345,
    447       345,  345,  392,  375,  345,  390,  364,  364,  345,  345,
    448       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    449       366,  366,  366,  366,  366,  366,  366,  345,  345,  345,
    450       393,  345,  345,  345,  345,  345,  345,  345,  345,  394,
    451       345,  345,  366,  366,  366,  366,  366,  366,  345,  395,
    452 
    453       345,  345,  345,  345,  345,  345,  345,  345,  394,  345,
    454       345,  366,  366,  366,  366,  366,  345,  345,  345,  345,
    455       345,  345,  345,  345,  396,  345,  366,  366,  366,  366,
    456       345,  345,  345,  345,  396,  366,  366,  366,  345,  366,
    457       366,  366,  366,  366,    0,  345,  345,  345,  345,  345,
    458       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    459       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    460       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    461       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    462       345,  345,  345,  345,  345,  345
    463 
     425      369,  369,  370,  370,  371,  371,  372,  372,  373,  373,
     426      374,  374,  375,  375,  376,  376,  377,  377,  378,  378,
     427      379,  379,  379,  379,  379,  379,  379,  379,  379,  379,
     428      379,  379,  380,  380,  381,  381,  381,  381,  382,  382,
     429      383,  383,  384,  384,  385,  385,  386,  386,  387,  387,
     430      368,  368,  368,  368,  368,  368,  368,  368,  368,  388,
     431      388,  389,  368,  368,  368,  388,  388,  368,  368,  368,
     432      368,  368,  390,  368,  368,  390,  390,  390,  390,  390,
     433      390,  391,  368,  368,  392,  368,  368,  393,  394,  368,
     434      368,  395,  368,  368,  368,  368,  396,  397,  368,  398,
     435
     436      368,  368,  399,  400,  368,  401,  402,  403,  404,  368,
     437      405,  368,  406,  368,  368,  368,  407,  408,  368,  368,
     438      368,  407,  368,  409,  410,  368,  368,  368,  409,  411,
     439      368,  368,  412,  411,  368,  368,  368,  368,  368,  368,
     440      368,  368,  413,  388,  388,  388,  388,  388,  389,  368,
     441      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     442      368,  368,  368,  390,  390,  390,  390,  390,  390,  390,
     443      390,  391,  368,  392,  368,  368,  368,  368,  368,  368,
     444      368,  368,  368,  368,  368,  368,  368,  414,  394,  368,
     445      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     446
     447      368,  368,  415,  368,  368,  397,  398,  398,  368,  399,
     448      400,  368,  401,  402,  403,  404,  416,  368,  368,  406,
     449      368,  368,  368,  368,  368,  407,  368,  407,  368,  368,
     450      409,  368,  409,  411,  368,  411,  368,  413,  388,  148,
     451      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     452      390,  390,  390,  390,  390,  390,  390,  368,  368,  368,
     453      368,  417,  368,  368,  368,  368,  418,  399,  368,  416,
     454      368,  388,  388,  368,  368,  368,  368,  368,  368,  368,
     455      368,  368,  368,  368,  368,  368,  390,  390,  390,  390,
     456      390,  390,  390,  368,  368,  368,  419,  368,  368,  368,
     457
     458      368,  368,  368,  368,  368,  368,  368,  420,  368,  368,
     459      390,  390,  390,  390,  390,  390,  368,  421,  368,  368,
     460      368,  368,  368,  368,  422,  368,  368,  368,  420,  368,
     461      368,  390,  390,  390,  390,  390,  368,  368,  423,  368,
     462      368,  368,  422,  368,  368,  368,  424,  368,  390,  390,
     463      390,  390,  368,  423,  368,  368,  368,  424,  390,  390,
     464      390,  368,  390,  390,  390,  390,  390,    0,  368,  368,
     465      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     466      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     467      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     468
     469      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     470      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     471      368,  368,  368,  368
    464472    } ;
    465473
    466 static yyconst short int yy_nxt[1326] =
     474static yyconst short int yy_nxt[1395] =
    467475    {   0,
    468        50,   51,   52,   53,   54,   50,   55,   56,   50,   50,
    469        50,   57,   58,   59,   59,   60,   61,   62,   63,   81,
    470        81,   82,   82,   97,   97,  318,  100,   65,  101,  113,
    471        52,   98,   98,  114,  134,  135,  157,   50,  300,  100,
    472       102,  101,  128,  129,   84,   84,   85,   85,   88,   88,
    473        89,   89,  229,  102,  230,  157,  130,   66,   67,   68,
    474        50,   69,   52,   53,   54,   70,   55,   56,   50,   50,
    475        50,   57,   58,   59,   59,   60,   61,   62,   63,   86,
    476        86,  108,  147,   90,   90,  158,  148,   65,  260,  108,
    477       109,  108,  108,  128,  129,  261,   52,   50,  109,  100,
    478 
    479       109,  109,  213,  159,  158,  116,  214,  130,  232,  117,
    480       136,  136,  136,  233,  149,  160,  110,   66,   67,   68,
    481        72,   52,  159,   73,  110,  138,  110,  110,  120,   52,
    482       161,  220,  121,  167,  160,  214,  168,  182,  116,  281,
    483       183,   74,  117,   75,  138,   76,   77,   78,  215,  161,
    484        79,  118,  279,  119,  150,  151,  200,  201,  152,  153,
    485        74,  264,   75,  154,   76,   77,   78,  155,  253,   79,
    486        72,   52,   52,   73,  248,  100,  134,  135,  123,  124,
    487       162,  125,  163,  215,  118,  100,  119,  210,  211,  216,
    488       223,   74,  217,   75,  214,   76,   77,   78,  237,  162,
    489 
    490        79,  265,  163,  136,  136,  136,  226,  226,  266,  147,
    491        74,  239,   75,  148,   76,   77,   78,  237,  138,   79,
    492        92,   93,  197,  229,  216,  230,   94,  217,  231,  238,
    493       239,   95,   95,   95,  345,  345,  241,  138,   95,   95,
    494        95,   95,   95,   95,  200,  201,  240,  242,  243,  238,
    495       246,  246,  247,  136,  136,  136,  241,   95,   95,   95,
    496        95,   95,   95,   92,   93,  240,  242,  243,  138,   94,
    497       167,  139,  339,  244,   95,   95,   95,  140,  247,  247,
    498       247,   95,   95,   95,   95,   95,   95,  138,  182,  339,
    499       139,  249,  251,  251,  252,  333,  149,  140,  210,  211,
    500 
    501        95,   95,   95,   95,   95,   95,  103,  103,  100,  103,
    502       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
    503       103,  103,  103,  103,  103,  126,   52,  213,  258,  121,
    504       220,  214,  123,  124,  214,  125,  150,  151,  223,  100,
    505       152,  153,  214,  103,  215,  154,  149,  258,  215,  155,
    506       252,  252,  252,  278,  278,  247,  247,  247,  247,  280,
    507       280,  252,  332,  103,  103,  103,  103,  103,  100,  103,
    508       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
    509       103,  103,  103,  103,  103,  216,  150,  151,  217,  216,
    510       152,  153,  217,  271,  272,  154,  273,  326,  274,  155,
    511 
    512       275,  276,  277,  103,  252,  252,  252,  247,  247,  247,
    513       334,  333,  271,  272,  322,  321,  273,  274,  320,  275,
    514       276,  277,  332,  103,  103,  103,  100,  100,  100,  100,
    515       100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
    516       100,  100,  100,  100,  100,  226,  226,  293,  294,  295,
    517       296,  297,  298,  299,  299,  252,  312,  313,  314,  315,
    518       257,  316,  327,  100,  326,  325,  293,  294,  295,  296,
    519       297,  298,  317,  317,  252,  312,  313,  314,  315,  257,
    520       316,  327,  324,  100,  100,  100,  100,  100,  100,  100,
    521       100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
    522 
    523       100,  100,  100,  100,  100,  328,  329,  330,  331,  331,
    524       252,  336,  337,  338,  252,  252,  252,  340,  341,  342,
    525       343,  344,  323,  100,  328,  329,  330,  137,  322,  137,
    526       336,  337,  338,  206,  321,  206,  340,  341,  342,  343,
    527       344,  320,  303,  100,  100,  100,  170,  302,  319,  311,
    528       310,  308,  307,  306,  171,  171,  172,  305,  304,  303,
    529       302,  301,  292,  291,  290,  289,  288,  287,  264,  286,
    530       285,  284,  283,  282,  254,  270,  269,  268,  267,  263,
    531       173,  174,  262,  259,  224,  175,  232,  204,  255,  254,
    532       176,  196,  250,  177,  245,  178,  165,  179,  180,  185,
    533 
    534       236,  235,  234,  228,  131,  224,  134,  186,  186,  187,
    535       134,  204,  196,  165,  131,  146,  145,  144,  143,  142,
    536       133,  132,  131,  345,   52,  100,  100,  100,  100,  345,
    537       345,  345,  345,  188,  189,  345,  345,  345,  190,  345,
    538       345,  345,  345,  191,  345,  345,  192,  345,  193,  345,
    539       194,  195,  227,  227,  227,  345,  345,  345,  345,  227,
    540       227,  227,  227,  227,  227,  345,  345,  345,  345,  345,
    541       345,  345,  345,  345,  345,  345,  345,  345,  227,  227,
    542       227,  227,  227,  227,   64,   64,   64,   64,   64,   64,
    543        64,   64,   64,   64,   64,   64,   64,   64,   71,   71,
    544 
    545        71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
    546        71,   71,   80,   80,   80,   80,   80,   80,   80,   80,
    547        80,   80,   80,   80,   80,   80,   83,   83,   83,   83,
    548        83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
    549        87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
    550        87,   87,   87,   87,   91,   91,   91,   91,   91,   91,
    551        91,   91,   91,   91,   91,   91,   91,   91,   96,   96,
    552        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
    553        96,   96,   99,   99,   99,   99,   99,   99,   99,   99,
    554        99,   99,   99,   99,   99,   99,  104,  104,  104,  104,
    555 
    556       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
     476       52,   53,   54,   55,   56,   52,   57,   58,   52,   52,
     477       52,   59,   60,   61,   61,   62,   63,   64,   65,   83,
     478       83,   84,   84,   99,   99,  338,  102,   67,  103,  115,
     479       54,  100,  100,  116,  142,  143,  165,   52,  318,  102,
     480      104,  103,  136,  137,   86,   86,   87,   87,   90,   90,
     481       91,   91,  245,  104,  246,  165,  138,   68,   69,   70,
     482       52,   71,   54,   55,   56,   72,   57,   58,   52,   52,
     483       52,   59,   60,   61,   61,   62,   63,   64,   65,   88,
     484       88,  110,  155,   92,   92,  166,  156,   67,  275,  110,
     485      111,  110,  110,  136,  137,  276,   54,   52,  111,  102,
     486
     487      111,  111,  297,  175,  166,  118,  176,  138,  221,  119,
     488      190,  167,  222,  191,  157,  168,  112,   68,   69,   70,
     489       74,   54,   54,   75,  112,  102,  112,  112,  122,   54,
     490      167,  125,  123,  169,  168,  126,  208,  209,  118,  142,
     491      143,   76,  119,   77,  295,   78,   79,   80,  218,  219,
     492       81,  120,  169,  121,  158,  159,  267,  228,  160,  161,
     493       76,  229,   77,  162,   78,   79,   80,  163,  233,   81,
     494       74,   54,  229,   75,  236,  239,  239,  127,  229,  128,
     495      245,  155,  246,  262,  120,  156,  121,  247,  129,   54,
     496      251,   76,  123,   77,  253,   78,   79,   80,  125,  145,
     497
     498       81,  145,  126,  144,  144,  144,  170,  223,  171,  251,
     499       76,  254,   77,  253,   78,   79,   80,  256,  146,   81,
     500       94,   95,  242,  205,  243,  170,   96,  244,  171,  252,
     501      254,   97,   97,   97,  368,  368,  256,  146,   97,   97,
     502       97,   97,   97,   97,  127,  362,  128,  230,  224,  252,
     503      255,  225,  161,  144,  144,  144,  162,   97,   97,   97,
     504       97,   97,   97,   94,   95,  144,  144,  144,  146,   96,
     505      255,  147,  208,  209,   97,   97,   97,  148,  362,  257,
     506      146,   97,   97,   97,   97,   97,   97,  146,  159,  356,
     507      147,  225,  161,  260,  260,  261,  162,  148,  257,  146,
     508
     509       97,   97,   97,   97,   97,   97,  105,  105,  102,  105,
    557510      105,  105,  105,  105,  105,  105,  105,  105,  105,  105,
    558       105,  105,  105,  105,  100,  100,  100,  100,  100,  100,
    559       100,  100,  100,  100,  100,  100,  100,  100,  106,  106,
     511      105,  105,  105,  105,  105,   54,  175,  190,  102,  258,
     512      263,  131,  132,  355,  133,  261,  261,  261,  102,  348,
     513      134,   54,  221,  105,  123,  157,  222,  131,  132,  357,
     514      133,  157,  218,  219,  102,  265,  265,  266,  266,  266,
     515      266,  223,  356,  105,  105,  105,  105,  105,  102,  105,
     516      105,  105,  105,  105,  105,  105,  105,  105,  105,  105,
     517      105,  105,  105,  105,  105,  158,  159,  344,  342,  160,
     518      161,  158,  159,  228,  162,  160,  161,  229,  163,  273,
     519
     520      162,  289,  224,  105,  163,  225,  161,  223,  233,  242,
     521      162,  243,  229,  230,  271,  236,  341,  355,  273,  229,
     522      230,  289,  348,  105,  105,  105,  102,  102,  102,  102,
     523      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
     524      102,  102,  102,  102,  102,  239,  239,  347,  224,  287,
     525      346,  225,  161,  288,  159,  290,  162,  225,  161,  291,
     526      272,  159,  162,  102,  225,  161,  280,  345,  287,  162,
     527      344,  214,  288,  214,  290,  294,  294,  261,  291,  272,
     528      261,  261,  261,  102,  102,  102,  102,  102,  102,  102,
     529      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
     530
     531      102,  102,  102,  102,  102,  292,  281,  293,  296,  296,
     532      266,  311,  312,  282,  266,  266,  266,  313,  314,  315,
     533      316,  332,  333,  102,  292,  342,  293,  261,  261,  261,
     534      311,  312,  317,  317,  266,  341,  313,  314,  315,  316,
     535      332,  333,  334,  102,  102,  102,  178,  335,  336,  337,
     536      337,  266,  349,  350,  179,  179,  180,  351,  352,  359,
     537      360,  334,  353,  353,  266,  361,  335,  336,  266,  266,
     538      266,  349,  350,  363,  322,  364,  351,  352,  359,  360,
     539      181,  182,  365,  366,  361,  183,  367,  321,  340,  339,
     540      184,  331,  363,  185,  364,  186,  330,  187,  188,  193,
     541
     542      328,  365,  366,  327,  326,  367,  325,  194,  194,  195,
     543      324,  323,  322,  321,  320,  319,  310,  309,  308,  307,
     544      306,  305,  280,  304,  303,  302,  301,  300,  299,  298,
     545      268,  286,  285,  196,  197,  284,  283,  279,  198,  278,
     546      277,  274,  237,  199,  212,  269,  200,  268,  201,  204,
     547      202,  203,  240,  240,  240,  264,  259,  173,  250,  240,
     548      240,  240,  240,  240,  240,  249,  248,  241,  139,  237,
     549      142,  142,  142,  212,  204,  173,  139,  154,  240,  240,
     550      240,  240,  240,  240,   66,   66,   66,   66,   66,   66,
     551       66,   66,   66,   66,   66,   66,   66,   66,   73,   73,
     552
     553       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
     554       73,   73,   82,   82,   82,   82,   82,   82,   82,   82,
     555       82,   82,   82,   82,   82,   82,   85,   85,   85,   85,
     556       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
     557       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
     558       89,   89,   89,   89,   93,   93,   93,   93,   93,   93,
     559       93,   93,   93,   93,   93,   93,   93,   93,   98,   98,
     560       98,   98,   98,   98,   98,   98,   98,   98,   98,   98,
     561       98,   98,  101,  101,  101,  101,  101,  101,  101,  101,
     562      101,  101,  101,  101,  101,  101,  106,  106,  106,  106,
     563
    560564      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
    561       106,  106,  107,  107,  107,  107,  107,  107,  107,  107,
    562       107,  107,  107,  107,  107,  107,  111,  111,  111,  111,
    563       111,  111,  111,  111,  111,  111,  111,  111,  111,  111,
    564       112,  112,  112,  112,  112,  112,  112,  112,  112,  112,
    565       112,  112,  112,  112,  115,  115,  115,  115,  115,  115,
    566 
    567       115,  115,  115,  115,  115,  115,  115,  115,  122,  122,
    568       122,  122,  122,  122,  122,  122,  122,  122,  122,  122,
    569       122,  122,  127,  127,  127,  127,  127,  127,  127,  127,
    570       127,  127,  127,  127,  127,  127,  141,  141,  345,  141,
    571       141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
    572       156,  345,  345,  345,  156,  156,  156,  156,  156,  156,
    573       156,  156,  156,  156,  164,  164,  345,  164,  164,  164,
    574       164,  164,  164,  164,  164,  164,  164,  164,  166,  166,
    575       345,  345,  166,  166,  166,  166,  166,  166,  166,  166,
    576       345,  166,  169,  169,  169,  169,  169,  169,  169,  169,
    577 
    578       169,  169,  169,  169,  169,  169,  181,  181,  345,  345,
    579       181,  181,  181,  181,  181,  181,  181,  181,  345,  181,
    580       184,  184,  184,  184,  184,  184,  184,  184,  184,  184,
    581       184,  184,  184,  184,  198,  198,  345,  198,  198,  198,
    582       198,  345,  198,  198,  198,  198,  198,  198,  199,  199,
    583       345,  199,  199,  199,  199,  199,  199,  199,  199,  199,
    584       199,  199,  202,  202,  345,  202,  202,  202,  202,  202,
    585       202,  202,  345,  202,  202,  202,  203,  203,  345,  203,
    586       203,  203,  203,  203,  203,  203,  345,  203,  203,  203,
    587       205,  345,  345,  345,  205,  345,  205,  207,  207,  345,
    588 
    589       207,  207,  207,  207,  207,  207,  207,  207,  207,  207,
    590       207,  208,  208,  345,  208,  208,  208,  208,  208,  345,
    591       208,  208,  208,  345,  208,  209,  209,  209,  209,  209,
    592       209,  209,  209,  209,  209,  209,  209,  209,  209,  212,
    593       212,  345,  212,  212,  212,  212,  212,  212,  212,  212,
    594       212,  212,  212,  218,  218,  345,  218,  345,  218,  218,
    595       218,  345,  218,  218,  218,  218,  219,  219,  345,  219,
    596       219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
    597       221,  221,  345,  221,  345,  345,  345,  221,  345,  221,
    598       221,  221,  221,  221,  222,  222,  345,  222,  222,  222,
    599 
    600       222,  222,  222,  222,  222,  222,  222,  222,  225,  225,
    601       345,  225,  225,  225,  225,  225,  225,  225,  225,  225,
    602       225,  225,  256,  256,  345,  256,  256,  256,  256,  256,
    603       345,  256,  256,  256,  345,  256,  309,  309,  345,  309,
    604       309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
    605       335,  335,  345,  335,  335,  335,  335,  335,  335,  335,
    606       335,  335,  335,  335,   49,  345,  345,  345,  345,  345,
    607       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    608       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    609       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    610 
    611       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    612       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    613       345,  345,  345,  345,  345
     565      107,  107,  107,  107,  107,  107,  107,  107,  107,  107,
     566      107,  107,  107,  107,  102,  102,  102,  102,  102,  102,
     567      102,  102,  102,  102,  102,  102,  102,  102,  108,  108,
     568      108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
     569      108,  108,  109,  109,  109,  109,  109,  109,  109,  109,
     570      109,  109,  109,  109,  109,  109,  113,  113,  113,  113,
     571      113,  113,  113,  113,  113,  113,  113,  113,  113,  113,
     572      114,  114,  114,  114,  114,  114,  114,  114,  114,  114,
     573      114,  114,  114,  114,  117,  117,  117,  117,  117,  117,
     574
     575      117,  117,  117,  117,  117,  117,  117,  117,  124,  124,
     576      124,  124,  124,  124,  124,  124,  124,  124,  124,  124,
     577      124,  124,  130,  130,  130,  130,  130,  130,  130,  130,
     578      130,  130,  130,  130,  130,  130,  135,  135,  135,  135,
     579      135,  135,  135,  135,  135,  135,  135,  135,  135,  135,
     580      149,  149,  153,  149,  149,  149,  149,  149,  149,  149,
     581      149,  149,  149,  149,  164,  152,  151,  150,  164,  164,
     582      164,  164,  164,  164,  164,  164,  164,  164,  172,  172,
     583      141,  172,  172,  172,  172,  172,  172,  172,  172,  172,
     584      172,  172,  174,  174,  140,  139,  174,  174,  174,  174,
     585
     586      174,  174,  174,  174,  368,  174,  177,  177,  177,  177,
     587      177,  177,  177,  177,  177,  177,  177,  177,  177,  177,
     588      189,  189,   54,  102,  189,  189,  189,  189,  189,  189,
     589      189,  189,  102,  189,  192,  192,  192,  192,  192,  192,
     590      192,  192,  192,  192,  192,  192,  192,  192,  206,  206,
     591      102,  206,  206,  206,  206,  102,  206,  206,  206,  206,
     592      206,  206,  207,  207,  368,  207,  207,  207,  207,  207,
     593      207,  207,  207,  207,  207,  207,  210,  210,  368,  210,
     594      210,  210,  210,  210,  210,  210,  368,  210,  210,  210,
     595      211,  211,  368,  211,  211,  211,  211,  211,  211,  211,
     596
     597      368,  211,  211,  211,  213,  368,  368,  368,  213,  368,
     598      213,  215,  215,  368,  215,  215,  215,  215,  215,  215,
     599      215,  215,  215,  215,  215,  216,  216,  368,  216,  216,
     600      216,  216,  216,  368,  216,  216,  216,  368,  216,  217,
     601      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
     602      217,  217,  217,  220,  220,  368,  220,  220,  220,  220,
     603      220,  220,  220,  220,  220,  220,  220,  226,  226,  368,
     604      226,  368,  226,  226,  226,  368,  226,  226,  226,  226,
     605      227,  227,  368,  227,  227,  227,  227,  227,  227,  227,
     606      227,  227,  227,  227,  231,  231,  368,  231,  368,  231,
     607
     608      231,  231,  368,  231,  231,  231,  231,  232,  232,  368,
     609      232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
     610      232,  234,  234,  368,  234,  368,  368,  368,  234,  368,
     611      234,  234,  234,  234,  234,  235,  235,  368,  235,  235,
     612      235,  235,  235,  235,  235,  235,  235,  235,  235,  238,
     613      238,  368,  238,  238,  238,  238,  238,  238,  238,  238,
     614      238,  238,  238,  270,  270,  368,  270,  270,  270,  270,
     615      270,  368,  270,  270,  270,  368,  270,  329,  329,  368,
     616      329,  329,  329,  329,  329,  329,  329,  329,  329,  329,
     617      329,  343,  343,  368,  343,  343,  343,  343,  343,  343,
     618
     619      343,  343,  343,  343,  343,  354,  354,  368,  354,  354,
     620      354,  354,  354,  354,  354,  354,  354,  354,  354,  358,
     621      358,  368,  358,  358,  358,  358,  358,  358,  358,  358,
     622      358,  358,  358,   51,  368,  368,  368,  368,  368,  368,
     623      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     624      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     625      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     626      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     627      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     628      368,  368,  368,  368
     629
    614630    } ;
    615631
    616 static yyconst short int yy_chk[1326] =
     632static yyconst short int yy_chk[1395] =
    617633    {   0,
    618634        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    619635        1,    1,    1,    1,    1,    1,    1,    1,    1,    5,
    620         6,    5,    6,   13,   14,  395,   15,    1,   15,   42,
    621        42,   13,   14,   42,   57,   57,   74,    1,  393,   16,
    622        15,   16,   47,   47,    7,    8,    7,    8,    9,   10,
    623         9,   10,  216,   16,  216,   74,   47,    1,    1,    1,
     636        6,    5,    6,   13,   14,  421,   15,    1,   15,   42,
     637       42,   13,   14,   42,   59,   59,   76,    1,  419,   16,
     638       15,   16,   49,   49,    7,    8,    7,    8,    9,   10,
     639        9,   10,  225,   16,  225,   76,   49,    1,    1,    1,
    624640        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
    625641        2,    2,    2,    2,    2,    2,    2,    2,    2,    7,
    626         8,   35,   69,    9,   10,   75,   69,    2,  229,   36,
    627        35,   37,   38,   48,   48,  229,   43,    2,   36,   43,
    628 
    629        37,   38,  113,   76,   75,   43,  113,   48,  152,   43,
    630        59,   59,   59,  152,   70,   77,   35,    2,    2,    2,
    631         3,    3,   76,    3,   36,   59,   37,   38,   44,   44,
    632        78,  120,   44,   85,   77,  120,   85,   89,   44,  392,
    633        89,    3,   44,    3,   59,    3,    3,    3,  114,   78,
    634         3,   43,  391,   43,   70,   70,   98,   98,   70,   70,
    635         3,  232,    3,   70,    3,    3,    3,   70,  389,    3,
    636         4,    4,   45,    4,  388,   45,  109,  109,   45,   45,
    637        79,   45,   79,  121,   44,   45,   44,  110,  110,  114,
    638       126,    4,  114,    4,  126,    4,    4,    4,  157,   79,
    639 
    640         4,  232,   79,  136,  136,  136,  139,  139,  232,  147,
    641         4,  159,    4,  147,    4,    4,    4,  157,  136,    4,
    642        11,   11,  372,  151,  121,  151,   11,  121,  151,  158,
    643       159,   11,   11,   11,  199,  199,  161,  136,   11,   11,
    644        11,   11,   11,   11,  200,  200,  160,  162,  163,  158,
    645       171,  171,  171,   58,   58,   58,  161,   11,   11,   11,
    646        11,   11,   11,   12,   12,  160,  162,  163,   58,   12,
    647       167,   58,  339,  167,   12,   12,   12,   58,  172,  172,
    648       172,   12,   12,   12,   12,   12,   12,   58,  182,  334,
    649        58,  182,  186,  186,  186,  333,  148,   58,  210,  210,
     642        8,   35,   71,    9,   10,   77,   71,    2,  242,   36,
     643       35,   37,   38,   50,   50,  242,   43,    2,   36,   43,
     644
     645       37,   38,  418,   87,   77,   43,   87,   50,  115,   43,
     646       91,   78,  115,   91,   72,   79,   35,    2,    2,    2,
     647        3,    3,   45,    3,   36,   45,   37,   38,   44,   44,
     648       78,   45,   44,   80,   79,   45,  100,  100,   44,  111,
     649      111,    3,   44,    3,  417,    3,    3,    3,  112,  112,
     650        3,   43,   80,   43,   72,   72,  415,  122,   72,   72,
     651        3,  122,    3,   72,    3,    3,    3,   72,  129,    3,
     652        4,    4,  129,    4,  134,  147,  147,   45,  134,   45,
     653      160,  155,  160,  414,   44,  155,   44,  160,   46,   46,
     654      165,    4,   46,    4,  167,    4,    4,    4,   46,  388,
     655
     656        4,  388,   46,   61,   61,   61,   81,  116,   81,  165,
     657        4,  168,    4,  167,    4,    4,    4,  170,   61,    4,
     658       11,   11,  159,  396,  159,   81,   11,  159,   81,  166,
     659      168,   11,   11,   11,  207,  207,  170,   61,   11,   11,
     660       11,   11,   11,   11,   46,  362,   46,  123,  116,  166,
     661      169,  116,  116,   60,   60,   60,  116,   11,   11,   11,
     662       11,   11,   11,   12,   12,  144,  144,  144,   60,   12,
     663      169,   60,  208,  208,   12,   12,   12,   60,  357,  171,
     664      144,   12,   12,   12,   12,   12,   12,   60,  123,  356,
     665       60,  123,  123,  179,  179,  179,  123,   60,  171,  144,
    650666
    651667       12,   12,   12,   12,   12,   12,   17,   17,   17,   17,
    652668       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
    653        17,   17,   17,   17,   17,   46,   46,  213,  227,   46,
    654       220,  213,   46,   46,  220,   46,  148,  148,  223,   46,
    655       148,  148,  223,   17,  214,  148,  149,  227,  215,  148,
    656       187,  187,  187,  246,  246,  246,  247,  247,  247,  251,
    657       251,  251,  332,   17,   17,   17,   18,   18,   18,   18,
     669       17,   17,   17,   17,   17,   47,  175,  190,   47,  175,
     670      190,   47,   47,  355,   47,  180,  180,  180,   47,  348,
     671       48,   48,  221,   17,   48,  156,  221,   48,   48,  346,
     672       48,  157,  218,  218,   48,  194,  194,  194,  195,  195,
     673      195,  222,  345,   17,   17,   17,   18,   18,   18,   18,
    658674       18,   18,   18,   18,   18,   18,   18,   18,   18,   18,
    659        18,   18,   18,   18,   18,  214,  149,  149,  214,  215,
    660       149,  149,  215,  237,  238,  149,  239,  326,  240,  149,
    661 
    662       241,  242,  243,   18,  252,  252,  252,  278,  278,  278,
    663       324,  323,  237,  238,  322,  321,  239,  240,  320,  241,
    664       242,  243,  319,   18,   18,   18,   19,   19,   19,   19,
     675       18,   18,   18,   18,   18,  156,  156,  344,  342,  156,
     676      156,  157,  157,  228,  156,  157,  157,  228,  156,  240,
     677
     678      157,  253,  222,   18,  157,  222,  222,  223,  233,  224,
     679      222,  224,  233,  229,  224,  236,  341,  340,  240,  236,
     680      230,  253,  331,   18,   18,   18,   19,   19,   19,   19,
    665681       19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
    666        19,   19,   19,   19,   19,  226,  226,  271,  272,  273,
    667       274,  275,  276,  280,  280,  280,  293,  295,  296,  297,
    668       226,  298,  312,   19,  311,  310,  271,  272,  273,  274,
    669       275,  276,  299,  299,  299,  293,  295,  296,  297,  226,
    670       298,  312,  308,   19,   19,   19,   20,   20,   20,   20,
     682       19,   19,   19,   19,   19,  239,  239,  330,  223,  251,
     683      328,  223,  223,  252,  229,  254,  223,  229,  229,  255,
     684      239,  230,  229,   19,  230,  230,  246,  327,  251,  230,
     685      326,  402,  252,  402,  254,  260,  260,  260,  255,  239,
     686      261,  261,  261,   19,   19,   19,   20,   20,   20,   20,
    671687       20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
    672688
    673        20,   20,   20,   20,   20,  314,  315,  316,  317,  317,
    674       317,  327,  328,  329,  331,  331,  331,  336,  337,  340,
    675       341,  342,  307,   20,  314,  315,  316,  364,  306,  364,
    676       327,  328,  329,  378,  305,  378,  336,  337,  340,  341,
    677       342,  304,  303,   20,   20,   20,   86,  302,  301,  292,
    678       291,  289,  288,  287,   86,   86,   86,  286,  285,  284,
    679       283,  282,  270,  269,  268,  267,  266,  265,  264,  263,
    680       262,  261,  260,  259,  254,  236,  235,  234,  233,  231,
    681        86,   86,  230,  228,  224,   86,  217,  205,  203,  202,
    682        86,  196,  185,   86,  170,   86,  164,   86,   86,   90,
    683 
    684       155,  154,  153,  150,  131,  128,  125,   90,   90,   90,
    685       116,  104,   92,   80,   72,   67,   65,   63,   62,   61,
    686        55,   53,   51,   49,   41,   40,   39,   34,   33,    0,
    687         0,    0,    0,   90,   90,    0,    0,    0,   90,    0,
    688         0,    0,    0,   90,    0,    0,   90,    0,   90,    0,
    689        90,   90,  140,  140,  140,    0,    0,    0,    0,  140,
    690       140,  140,  140,  140,  140,    0,    0,    0,    0,    0,
    691         0,    0,    0,    0,    0,    0,    0,    0,  140,  140,
    692       140,  140,  140,  140,  346,  346,  346,  346,  346,  346,
    693       346,  346,  346,  346,  346,  346,  346,  346,  347,  347,
    694 
    695       347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
    696       347,  347,  348,  348,  348,  348,  348,  348,  348,  348,
    697       348,  348,  348,  348,  348,  348,  349,  349,  349,  349,
    698       349,  349,  349,  349,  349,  349,  349,  349,  349,  349,
    699       350,  350,  350,  350,  350,  350,  350,  350,  350,  350,
    700       350,  350,  350,  350,  351,  351,  351,  351,  351,  351,
    701       351,  351,  351,  351,  351,  351,  351,  351,  352,  352,
    702       352,  352,  352,  352,  352,  352,  352,  352,  352,  352,
    703       352,  352,  353,  353,  353,  353,  353,  353,  353,  353,
    704       353,  353,  353,  353,  353,  353,  354,  354,  354,  354,
    705 
    706       354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
    707       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
    708       355,  355,  355,  355,  356,  356,  356,  356,  356,  356,
    709       356,  356,  356,  356,  356,  356,  356,  356,  357,  357,
    710       357,  357,  357,  357,  357,  357,  357,  357,  357,  357,
    711       357,  357,  358,  358,  358,  358,  358,  358,  358,  358,
    712       358,  358,  358,  358,  358,  358,  359,  359,  359,  359,
    713       359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
    714       360,  360,  360,  360,  360,  360,  360,  360,  360,  360,
    715       360,  360,  360,  360,  361,  361,  361,  361,  361,  361,
    716 
    717       361,  361,  361,  361,  361,  361,  361,  361,  362,  362,
    718       362,  362,  362,  362,  362,  362,  362,  362,  362,  362,
    719       362,  362,  363,  363,  363,  363,  363,  363,  363,  363,
    720       363,  363,  363,  363,  363,  363,  365,  365,    0,  365,
    721       365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
    722       366,    0,    0,    0,  366,  366,  366,  366,  366,  366,
    723       366,  366,  366,  366,  367,  367,    0,  367,  367,  367,
    724       367,  367,  367,  367,  367,  367,  367,  367,  368,  368,
    725         0,    0,  368,  368,  368,  368,  368,  368,  368,  368,
    726         0,  368,  369,  369,  369,  369,  369,  369,  369,  369,
    727 
    728       369,  369,  369,  369,  369,  369,  370,  370,    0,    0,
    729       370,  370,  370,  370,  370,  370,  370,  370,    0,  370,
    730       371,  371,  371,  371,  371,  371,  371,  371,  371,  371,
    731       371,  371,  371,  371,  373,  373,    0,  373,  373,  373,
    732       373,    0,  373,  373,  373,  373,  373,  373,  374,  374,
    733         0,  374,  374,  374,  374,  374,  374,  374,  374,  374,
    734       374,  374,  375,  375,    0,  375,  375,  375,  375,  375,
    735       375,  375,    0,  375,  375,  375,  376,  376,    0,  376,
    736       376,  376,  376,  376,  376,  376,    0,  376,  376,  376,
    737       377,    0,    0,    0,  377,    0,  377,  379,  379,    0,
    738 
    739       379,  379,  379,  379,  379,  379,  379,  379,  379,  379,
    740       379,  380,  380,    0,  380,  380,  380,  380,  380,    0,
    741       380,  380,  380,    0,  380,  381,  381,  381,  381,  381,
    742       381,  381,  381,  381,  381,  381,  381,  381,  381,  382,
    743       382,    0,  382,  382,  382,  382,  382,  382,  382,  382,
    744       382,  382,  382,  383,  383,    0,  383,    0,  383,  383,
    745       383,    0,  383,  383,  383,  383,  384,  384,    0,  384,
    746       384,  384,  384,  384,  384,  384,  384,  384,  384,  384,
    747       385,  385,    0,  385,    0,    0,    0,  385,    0,  385,
    748       385,  385,  385,  385,  386,  386,    0,  386,  386,  386,
    749 
    750       386,  386,  386,  386,  386,  386,  386,  386,  387,  387,
    751         0,  387,  387,  387,  387,  387,  387,  387,  387,  387,
    752       387,  387,  390,  390,    0,  390,  390,  390,  390,  390,
    753         0,  390,  390,  390,    0,  390,  394,  394,    0,  394,
    754       394,  394,  394,  394,  394,  394,  394,  394,  394,  394,
    755       396,  396,    0,  396,  396,  396,  396,  396,  396,  396,
    756       396,  396,  396,  396,  345,  345,  345,  345,  345,  345,
    757       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    758       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    759       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    760 
    761       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    762       345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
    763       345,  345,  345,  345,  345
     689       20,   20,   20,   20,   20,  256,  246,  257,  265,  265,
     690      265,  287,  288,  246,  266,  266,  266,  289,  290,  291,
     691      292,  311,  313,   20,  256,  324,  257,  294,  294,  294,
     692      287,  288,  296,  296,  296,  323,  289,  290,  291,  292,
     693      311,  313,  314,   20,   20,   20,   88,  315,  316,  317,
     694      317,  317,  332,  334,   88,   88,   88,  335,  336,  349,
     695      350,  314,  337,  337,  337,  351,  315,  316,  353,  353,
     696      353,  332,  334,  359,  322,  360,  335,  336,  349,  350,
     697       88,   88,  363,  364,  351,   88,  365,  321,  320,  319,
     698       88,  310,  359,   88,  360,   88,  309,   88,   88,   92,
     699
     700      307,  363,  364,  306,  305,  365,  304,   92,   92,   92,
     701      303,  302,  301,  300,  299,  298,  286,  285,  284,  283,
     702      282,  281,  280,  279,  278,  277,  276,  275,  274,  271,
     703      268,  250,  249,   92,   92,  248,  247,  245,   92,  244,
     704      243,  241,  237,   92,  213,  211,   92,  210,   92,  204,
     705       92,   92,  148,  148,  148,  193,  178,  172,  163,  148,
     706      148,  148,  148,  148,  148,  162,  161,  158,  139,  136,
     707      133,  125,  118,  106,   94,   82,   74,   69,  148,  148,
     708      148,  148,  148,  148,  369,  369,  369,  369,  369,  369,
     709      369,  369,  369,  369,  369,  369,  369,  369,  370,  370,
     710
     711      370,  370,  370,  370,  370,  370,  370,  370,  370,  370,
     712      370,  370,  371,  371,  371,  371,  371,  371,  371,  371,
     713      371,  371,  371,  371,  371,  371,  372,  372,  372,  372,
     714      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
     715      373,  373,  373,  373,  373,  373,  373,  373,  373,  373,
     716      373,  373,  373,  373,  374,  374,  374,  374,  374,  374,
     717      374,  374,  374,  374,  374,  374,  374,  374,  375,  375,
     718      375,  375,  375,  375,  375,  375,  375,  375,  375,  375,
     719      375,  375,  376,  376,  376,  376,  376,  376,  376,  376,
     720      376,  376,  376,  376,  376,  376,  377,  377,  377,  377,
     721
     722      377,  377,  377,  377,  377,  377,  377,  377,  377,  377,
     723      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
     724      378,  378,  378,  378,  379,  379,  379,  379,  379,  379,
     725      379,  379,  379,  379,  379,  379,  379,  379,  380,  380,
     726      380,  380,  380,  380,  380,  380,  380,  380,  380,  380,
     727      380,  380,  381,  381,  381,  381,  381,  381,  381,  381,
     728      381,  381,  381,  381,  381,  381,  382,  382,  382,  382,
     729      382,  382,  382,  382,  382,  382,  382,  382,  382,  382,
     730      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
     731      383,  383,  383,  383,  384,  384,  384,  384,  384,  384,
     732
     733      384,  384,  384,  384,  384,  384,  384,  384,  385,  385,
     734      385,  385,  385,  385,  385,  385,  385,  385,  385,  385,
     735      385,  385,  386,  386,  386,  386,  386,  386,  386,  386,
     736      386,  386,  386,  386,  386,  386,  387,  387,  387,  387,
     737      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
     738      389,  389,   67,  389,  389,  389,  389,  389,  389,  389,
     739      389,  389,  389,  389,  390,   65,   64,   63,  390,  390,
     740      390,  390,  390,  390,  390,  390,  390,  390,  391,  391,
     741       57,  391,  391,  391,  391,  391,  391,  391,  391,  391,
     742      391,  391,  392,  392,   55,   53,  392,  392,  392,  392,
     743
     744      392,  392,  392,  392,   51,  392,  393,  393,  393,  393,
     745      393,  393,  393,  393,  393,  393,  393,  393,  393,  393,
     746      394,  394,   41,   40,  394,  394,  394,  394,  394,  394,
     747      394,  394,   39,  394,  395,  395,  395,  395,  395,  395,
     748      395,  395,  395,  395,  395,  395,  395,  395,  397,  397,
     749       34,  397,  397,  397,  397,   33,  397,  397,  397,  397,
     750      397,  397,  398,  398,    0,  398,  398,  398,  398,  398,
     751      398,  398,  398,  398,  398,  398,  399,  399,    0,  399,
     752      399,  399,  399,  399,  399,  399,    0,  399,  399,  399,
     753      400,  400,    0,  400,  400,  400,  400,  400,  400,  400,
     754
     755        0,  400,  400,  400,  401,    0,    0,    0,  401,    0,
     756      401,  403,  403,    0,  403,  403,  403,  403,  403,  403,
     757      403,  403,  403,  403,  403,  404,  404,    0,  404,  404,
     758      404,  404,  404,    0,  404,  404,  404,    0,  404,  405,
     759      405,  405,  405,  405,  405,  405,  405,  405,  405,  405,
     760      405,  405,  405,  406,  406,    0,  406,  406,  406,  406,
     761      406,  406,  406,  406,  406,  406,  406,  407,  407,    0,
     762      407,    0,  407,  407,  407,    0,  407,  407,  407,  407,
     763      408,  408,    0,  408,  408,  408,  408,  408,  408,  408,
     764      408,  408,  408,  408,  409,  409,    0,  409,    0,  409,
     765
     766      409,  409,    0,  409,  409,  409,  409,  410,  410,    0,
     767      410,  410,  410,  410,  410,  410,  410,  410,  410,  410,
     768      410,  411,  411,    0,  411,    0,    0,    0,  411,    0,
     769      411,  411,  411,  411,  411,  412,  412,    0,  412,  412,
     770      412,  412,  412,  412,  412,  412,  412,  412,  412,  413,
     771      413,    0,  413,  413,  413,  413,  413,  413,  413,  413,
     772      413,  413,  413,  416,  416,    0,  416,  416,  416,  416,
     773      416,    0,  416,  416,  416,    0,  416,  420,  420,    0,
     774      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
     775      420,  422,  422,    0,  422,  422,  422,  422,  422,  422,
     776
     777      422,  422,  422,  422,  422,  423,  423,    0,  423,  423,
     778      423,  423,  423,  423,  423,  423,  423,  423,  423,  424,
     779      424,    0,  424,  424,  424,  424,  424,  424,  424,  424,
     780      424,  424,  424,  368,  368,  368,  368,  368,  368,  368,
     781      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     782      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     783      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     784      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     785      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
     786      368,  368,  368,  368
     787
    764788    } ;
    765789
     
    872896
    873897/* Set when stripping c-junk */
    874 #define pp_strips 21
    875 
    876 #define pp_stripp 22
    877 
    878 #define pp_stripp_final 23
     898#define pp_stripe 21
     899
     900#define pp_strips 22
     901
     902#define pp_stripp 23
     903
     904#define pp_stripp_final 24
    879905
    880906/*%option stack*/
     
    882908/*%option noyywrap */
    883909/* Some shortcut definitions */
    884 #line 90 "parser.l"
     910#line 91 "parser.l"
    885911
    886912#if !defined(YY_FLEX_MAJOR_VERSION) || (1000 * YY_FLEX_MAJOR_VERSION + YY_FLEX_MINOR_VERSION < 2005)
     
    930956static int want_nl = 0;         /* Set when newline needs to go to parser */
    931957static int want_ident = 0;      /* Set is #ifdef, #ifndef or defined is seen */
    932 static int stripslevel = 0;     /* Count {} during pp_strips mode */
     958static int stripslevel = 0;     /* Count {} during pp_strips/pp_stripe mode */
    933959static int stripplevel = 0;     /* Count () during pp_strips mode */
    934960static char *substtext = NULL;  /* Holds the substition text while getting a define */
     
    12011227}
    12021228
    1203 #line 1204 "lexyy.c"
     1229#line 1230 "lexyy.c"
    12041230
    12051231/* Macros after this point can all be overridden by user definitions in
     
    13511377        register int yy_act;
    13521378
    1353 #line 410 "parser.l"
     1379#line 411 "parser.l"
    13541380
    13551381        /* #include handling */
    1356 #line 1357 "lexyy.c"
     1382#line 1383 "lexyy.c"
    13571383
    13581384        if ( yy_init )
     
    14061432                                {
    14071433                                yy_current_state = (int) yy_def[yy_current_state];
    1408                                 if ( yy_current_state >= 346 )
     1434                                if ( yy_current_state >= 369 )
    14091435                                        yy_c = yy_meta[(unsigned int) yy_c];
    14101436                                }
     
    14121438                        ++yy_cp;
    14131439                        }
    1414                 while ( yy_base[yy_current_state] != 1265 );
     1440                while ( yy_base[yy_current_state] != 1334 );
    14151441
    14161442yy_find_action:
     
    14401466case 1:
    14411467YY_RULE_SETUP
    1442 #line 412 "parser.l"
     1468#line 413 "parser.l"
    14431469push_to(pp_incl);
    14441470        YY_BREAK
    14451471case 2:
    1446 YY_RULE_SETUP
    1447 #line 413 "parser.l"
    1448 do_include(yytext, yyleng); pop_start();
    1449         YY_BREAK
    1450 case 3:
    14511472YY_RULE_SETUP
    14521473#line 414 "parser.l"
    14531474do_include(yytext, yyleng); pop_start();
    14541475        YY_BREAK
     1476case 3:
     1477YY_RULE_SETUP
     1478#line 415 "parser.l"
     1479do_include(yytext, yyleng); pop_start();
     1480        YY_BREAK
    14551481case 4:
    14561482YY_RULE_SETUP
    1457 #line 415 "parser.l"
     1483#line 416 "parser.l"
    14581484yyerror("Malformed #include");
    14591485        YY_BREAK
     
    14611487case 5:
    14621488YY_RULE_SETUP
    1463 #line 418 "parser.l"
     1489#line 419 "parser.l"
    14641490push_to(pp_def);
    14651491        YY_BREAK
    14661492case 6:
    14671493YY_RULE_SETUP
    1468 #line 419 "parser.l"
     1494#line 420 "parser.l"
    14691495{
    14701496                                set_define(yytext);
     
    14741500case 7:
    14751501YY_RULE_SETUP
    1476 #line 423 "parser.l"
     1502#line 424 "parser.l"
    14771503push_to(pp_ignore); /* Ignore function-like defines for now*/
    14781504        YY_BREAK
    14791505case 8:
    14801506YY_RULE_SETUP
    1481 #line 424 "parser.l"
     1507#line 425 "parser.l"
    14821508yyerror("Malformed #define");
    14831509        YY_BREAK
    14841510case 9:
    14851511YY_RULE_SETUP
    1486 #line 426 "parser.l"
     1512#line 427 "parser.l"
    14871513{
    14881514                        if(YY_START == pp_def_s)
     
    14921518case 10:
    14931519YY_RULE_SETUP
    1494 #line 430 "parser.l"
     1520#line 431 "parser.l"
    14951521{ /* Comment is handled in normal handling */
    14961522                        if(YY_START == pp_def_s)
     
    15001526case 11:
    15011527YY_RULE_SETUP
    1502 #line 434 "parser.l"
     1528#line 435 "parser.l"
    15031529line_number++;  char_number = 1; /* Line continuation */
    15041530        YY_BREAK
    15051531case 12:
    15061532YY_RULE_SETUP
    1507 #line 435 "parser.l"
     1533#line 436 "parser.l"
    15081534{
    15091535                        if(YY_START == pp_def_s)
     
    15221548case 13:
    15231549YY_RULE_SETUP
    1524 #line 449 "parser.l"
     1550#line 450 "parser.l"
    15251551push_to(pp_undef);
    15261552        YY_BREAK
    15271553case 14:
    15281554YY_RULE_SETUP
    1529 #line 450 "parser.l"
     1555#line 451 "parser.l"
    15301556{
    15311557                                del_define(yytext);
     
    15371563case 15:
    15381564YY_RULE_SETUP
    1539 #line 457 "parser.l"
     1565#line 458 "parser.l"
    15401566{
    15411567                        if(YY_START == pp_false)
     
    15561582case 16:
    15571583YY_RULE_SETUP
    1558 #line 472 "parser.l"
     1584#line 473 "parser.l"
    15591585{
    15601586                        if(YY_START == pp_false)
     
    15761602case 17:
    15771603YY_RULE_SETUP
    1578 #line 488 "parser.l"
     1604#line 489 "parser.l"
    15791605{
    15801606                        if(YY_START == pp_false)
     
    15961622case 18:
    15971623YY_RULE_SETUP
    1598 #line 504 "parser.l"
     1624#line 505 "parser.l"
    15991625{
    16001626                        if(!isnevertrue_if())
     
    16121638case 19:
    16131639YY_RULE_SETUP
    1614 #line 516 "parser.l"
     1640#line 517 "parser.l"
    16151641{
    16161642                        if(!isnevertrue_if())
     
    16261652case 20:
    16271653YY_RULE_SETUP
    1628 #line 526 "parser.l"
     1654#line 527 "parser.l"
    16291655{
    16301656                        if(!isnevertrue_if())
     
    16441670case 21:
    16451671YY_RULE_SETUP
    1646 #line 541 "parser.l"
     1672#line 542 "parser.l"
    16471673push_to(pp_error);
    16481674        YY_BREAK
    16491675case 22:
    16501676YY_RULE_SETUP
    1651 #line 542 "parser.l"
     1677#line 543 "parser.l"
    16521678yyerror("Error directive: %s", yytext);
    16531679        YY_BREAK
     1680case 23:
     1681YY_RULE_SETUP
     1682#line 544 "parser.l"
     1683{
     1684                        if(yydebug)
     1685                                printf("(%d)#error ignored\n", line_number);
     1686                }
     1687        YY_BREAK
    16541688/* preprocessor junk */
    1655 case 23:
    1656 YY_RULE_SETUP
    1657 #line 545 "parser.l"
     1689case 24:
     1690YY_RULE_SETUP
     1691#line 550 "parser.l"
    16581692;       /* Ignore #pragma */
    16591693        YY_BREAK
    1660 case 24:
    1661 YY_RULE_SETUP
    1662 #line 546 "parser.l"
     1694case 25:
     1695YY_RULE_SETUP
     1696#line 551 "parser.l"
     1697;       /* Ignore #ident */
     1698        YY_BREAK
     1699case 26:
     1700YY_RULE_SETUP
     1701#line 552 "parser.l"
    16631702;       /* Ignore #line */
    16641703        YY_BREAK
     
    16681707  */
    16691708/*^{ws}*#{ws}*                  ;        Ignore # */
    1670 case 25:
    1671 YY_RULE_SETUP
    1672 #line 553 "parser.l"
     1709case 27:
     1710YY_RULE_SETUP
     1711#line 559 "parser.l"
    16731712stripslevel++;
    16741713        YY_BREAK
    1675 case 26:
    1676 YY_RULE_SETUP
    1677 #line 554 "parser.l"
     1714case 28:
     1715YY_RULE_SETUP
     1716#line 560 "parser.l"
    16781717stripslevel--;
    16791718        YY_BREAK
    1680 case 27:
    1681 YY_RULE_SETUP
    1682 #line 555 "parser.l"
     1719case 29:
     1720YY_RULE_SETUP
     1721#line 561 "parser.l"
    16831722if(!stripslevel) pop_start();
    16841723        YY_BREAK
    1685 case 28:
    1686 YY_RULE_SETUP
    1687 #line 556 "parser.l"
     1724case 30:
     1725YY_RULE_SETUP
     1726#line 562 "parser.l"
    16881727; /* To catch comments */
    16891728        YY_BREAK
    1690 case 29:
    1691 YY_RULE_SETUP
    1692 #line 557 "parser.l"
     1729case 31:
     1730YY_RULE_SETUP
     1731#line 563 "parser.l"
    16931732; /* Ignore rest */
    16941733        YY_BREAK
    1695 case 30:
    1696 YY_RULE_SETUP
    1697 #line 559 "parser.l"
     1734case 32:
     1735YY_RULE_SETUP
     1736#line 565 "parser.l"
     1737stripslevel++;
     1738        YY_BREAK
     1739case 33:
     1740YY_RULE_SETUP
     1741#line 566 "parser.l"
     1742{
     1743                        stripslevel--;
     1744                        if(!stripslevel) pop_start();
     1745                }
     1746        YY_BREAK
     1747case 34:
     1748YY_RULE_SETUP
     1749#line 570 "parser.l"
     1750if(!stripslevel) pop_start();
     1751        YY_BREAK
     1752case 35:
     1753YY_RULE_SETUP
     1754#line 571 "parser.l"
     1755; /* To catch comments */
     1756        YY_BREAK
     1757case 36:
     1758YY_RULE_SETUP
     1759#line 572 "parser.l"
     1760; /* Ignore rest */
     1761        YY_BREAK
     1762case 37:
     1763YY_RULE_SETUP
     1764#line 574 "parser.l"
    16981765stripplevel++;
    16991766        YY_BREAK
    1700 case 31:
    1701 YY_RULE_SETUP
    1702 #line 560 "parser.l"
     1767case 38:
     1768YY_RULE_SETUP
     1769#line 575 "parser.l"
    17031770{
    17041771                                stripplevel--;
     
    17101777                        }
    17111778        YY_BREAK
    1712 case 32:
    1713 YY_RULE_SETUP
    1714 #line 568 "parser.l"
     1779case 39:
     1780YY_RULE_SETUP
     1781#line 583 "parser.l"
    17151782; /* To catch comments */
    17161783        YY_BREAK
    1717 case 33:
    1718 YY_RULE_SETUP
    1719 #line 569 "parser.l"
     1784case 40:
     1785YY_RULE_SETUP
     1786#line 584 "parser.l"
    17201787; /* Ignore rest */
    17211788        YY_BREAK
    1722 case 34:
    1723 YY_RULE_SETUP
    1724 #line 571 "parser.l"
     1789case 41:
     1790YY_RULE_SETUP
     1791#line 586 "parser.l"
    17251792; /* Ignore */
    17261793        YY_BREAK
    1727 case 35:
    1728 YY_RULE_SETUP
    1729 #line 572 "parser.l"
     1794case 42:
     1795YY_RULE_SETUP
     1796#line 587 "parser.l"
    17301797pop_start(); /* Kill the semicolon */
    17311798        YY_BREAK
    1732 case 36:
    1733 YY_RULE_SETUP
    1734 #line 573 "parser.l"
     1799case 43:
     1800YY_RULE_SETUP
     1801#line 588 "parser.l"
    17351802line_number++; char_number = 1; pop_start();
    17361803        YY_BREAK
    1737 case 37:
    1738 YY_RULE_SETUP
    1739 #line 574 "parser.l"
     1804case 44:
     1805YY_RULE_SETUP
     1806#line 589 "parser.l"
    17401807yyless(0); pop_start();
    17411808        YY_BREAK
    1742 case 38:
    1743 YY_RULE_SETUP
    1744 #line 576 "parser.l"
     1809case 45:
     1810YY_RULE_SETUP
     1811#line 591 "parser.l"
    17451812;       /* Ignore everything except #xxx during false #if state */
    17461813        YY_BREAK
    1747 case 39:
    1748 YY_RULE_SETUP
    1749 #line 578 "parser.l"
     1814case 46:
     1815YY_RULE_SETUP
     1816#line 593 "parser.l"
    17501817pop_start();
    17511818        YY_BREAK
    17521819/* These are special cases due to filename scanning */
    1753 case 40:
    1754 YY_RULE_SETUP
    1755 #line 581 "parser.l"
     1820case 47:
     1821YY_RULE_SETUP
     1822#line 596 "parser.l"
    17561823return DISCARDABLE;
    17571824        YY_BREAK
    1758 case 41:
    1759 YY_RULE_SETUP
    1760 #line 582 "parser.l"
     1825case 48:
     1826YY_RULE_SETUP
     1827#line 597 "parser.l"
    17611828return tFIXED;
    17621829        YY_BREAK
    1763 case 42:
    1764 YY_RULE_SETUP
    1765 #line 583 "parser.l"
     1830case 49:
     1831YY_RULE_SETUP
     1832#line 598 "parser.l"
    17661833return IMPURE;
    17671834        YY_BREAK
    1768 case 43:
    1769 YY_RULE_SETUP
    1770 #line 584 "parser.l"
     1835case 50:
     1836YY_RULE_SETUP
     1837#line 599 "parser.l"
    17711838return MOVEABLE;
    17721839        YY_BREAK
    1773 case 44:
    1774 YY_RULE_SETUP
    1775 #line 585 "parser.l"
     1840case 51:
     1841YY_RULE_SETUP
     1842#line 600 "parser.l"
    17761843return LOADONCALL;
    17771844        YY_BREAK
    1778 case 45:
    1779 YY_RULE_SETUP
    1780 #line 586 "parser.l"
     1845case 52:
     1846YY_RULE_SETUP
     1847#line 601 "parser.l"
    17811848return PRELOAD;
    17821849        YY_BREAK
    1783 case 46:
    1784 YY_RULE_SETUP
    1785 #line 587 "parser.l"
     1850case 53:
     1851YY_RULE_SETUP
     1852#line 602 "parser.l"
    17861853return tPURE;
    17871854        YY_BREAK
    1788 case 47:
    1789 YY_RULE_SETUP
    1790 #line 589 "parser.l"
     1855case 54:
     1856YY_RULE_SETUP
     1857#line 604 "parser.l"
    17911858return tBEGIN;
    17921859        YY_BREAK
    1793 case 48:
    1794 YY_RULE_SETUP
    1795 #line 590 "parser.l"
     1860case 55:
     1861YY_RULE_SETUP
     1862#line 605 "parser.l"
    17961863return tEND;
    17971864        YY_BREAK
    1798 case 49:
    1799 YY_RULE_SETUP
    1800 #line 592 "parser.l"
     1865case 56:
     1866YY_RULE_SETUP
     1867#line 607 "parser.l"
    18011868{ yylval.num = strtoul(yytext,  0, 10); return toupper(yytext[yyleng-1]) == 'L' ? LNUMBER : NUMBER; }
    18021869        YY_BREAK
    1803 case 50:
    1804 YY_RULE_SETUP
    1805 #line 593 "parser.l"
     1870case 57:
     1871YY_RULE_SETUP
     1872#line 608 "parser.l"
    18061873{ yylval.num = strtoul(yytext,  0, 16); return toupper(yytext[yyleng-1]) == 'L' ? LNUMBER : NUMBER; }
    18071874        YY_BREAK
    1808 case 51:
    1809 YY_RULE_SETUP
    1810 #line 594 "parser.l"
     1875case 58:
     1876YY_RULE_SETUP
     1877#line 609 "parser.l"
    18111878{ yylval.num = strtoul(yytext+2, 0, 8); return toupper(yytext[yyleng-1]) == 'L' ? LNUMBER : NUMBER; }
    18121879        YY_BREAK
    1813 case 52:
    1814 YY_RULE_SETUP
    1815 #line 595 "parser.l"
     1880case 59:
     1881YY_RULE_SETUP
     1882#line 610 "parser.l"
    18161883{
    18171884                                struct keyword *token;
     
    18871954                        }
    18881955        YY_BREAK
    1889 case 53:
    1890 YY_RULE_SETUP
    1891 #line 667 "parser.l"
     1956case 60:
     1957YY_RULE_SETUP
     1958#line 682 "parser.l"
    18921959return LOGOR;
    18931960        YY_BREAK
    1894 case 54:
    1895 YY_RULE_SETUP
    1896 #line 668 "parser.l"
     1961case 61:
     1962YY_RULE_SETUP
     1963#line 683 "parser.l"
    18971964return LOGAND;
    18981965        YY_BREAK
    1899 case 55:
    1900 YY_RULE_SETUP
    1901 #line 669 "parser.l"
     1966case 62:
     1967YY_RULE_SETUP
     1968#line 684 "parser.l"
    19021969return EQ;
    19031970        YY_BREAK
    1904 case 56:
    1905 YY_RULE_SETUP
    1906 #line 670 "parser.l"
     1971case 63:
     1972YY_RULE_SETUP
     1973#line 685 "parser.l"
    19071974return NE;
    19081975        YY_BREAK
    1909 case 57:
    1910 YY_RULE_SETUP
    1911 #line 671 "parser.l"
     1976case 64:
     1977YY_RULE_SETUP
     1978#line 686 "parser.l"
    19121979return LTE;
    19131980        YY_BREAK
    1914 case 58:
    1915 YY_RULE_SETUP
    1916 #line 672 "parser.l"
     1981case 65:
     1982YY_RULE_SETUP
     1983#line 687 "parser.l"
    19171984return GTE;
    19181985        YY_BREAK
    1919 case 59:
    1920 YY_RULE_SETUP
    1921 #line 674 "parser.l"
     1986case 66:
     1987YY_RULE_SETUP
     1988#line 689 "parser.l"
    19221989{ pop_start(); yylval.str = make_filename(yytext, yyleng); return FILENAME; }
    19231990        YY_BREAK
    1924 case 60:
    1925 YY_RULE_SETUP
    1926 #line 675 "parser.l"
     1991case 67:
     1992YY_RULE_SETUP
     1993#line 690 "parser.l"
    19271994push_to(yywf_s);
    19281995        YY_BREAK
    1929 case 61:
    1930 YY_RULE_SETUP
    1931 #line 676 "parser.l"
     1996case 68:
     1997YY_RULE_SETUP
     1998#line 691 "parser.l"
    19321999{ pop_start(); pop_start(); yylval.str = make_filename(yytext, yyleng-1); return FILENAME; }
    19332000        YY_BREAK
    1934 case 62:
    1935 YY_RULE_SETUP
    1936 #line 677 "parser.l"
     2001case 69:
     2002YY_RULE_SETUP
     2003#line 692 "parser.l"
    19372004yyerror("Newline in filename");
    19382005        YY_BREAK
    1939 case 63:
    1940 YY_RULE_SETUP
    1941 #line 679 "parser.l"
     2006case 70:
     2007YY_RULE_SETUP
     2008#line 694 "parser.l"
    19422009{
    19432010                                push_to(yylstr);
     
    19472014                        }
    19482015        YY_BREAK
    1949 case 64:
    1950 YY_RULE_SETUP
    1951 #line 685 "parser.l"
     2016case 71:
     2017YY_RULE_SETUP
     2018#line 700 "parser.l"
    19522019{
    19532020                                pop_start();
     
    19562023                        }
    19572024        YY_BREAK
    1958 case 65:
    1959 YY_RULE_SETUP
    1960 #line 690 "parser.l"
     2025case 72:
     2026YY_RULE_SETUP
     2027#line 705 "parser.l"
    19612028yyerror("Unterminated string");
    19622029        YY_BREAK
    1963 case 66:
    1964 YY_RULE_SETUP
    1965 #line 691 "parser.l"
     2030case 73:
     2031YY_RULE_SETUP
     2032#line 706 "parser.l"
    19662033{ /* octal escape sequence */
    19672034                                int result;
     
    19722039                        }
    19732040        YY_BREAK
    1974 case 67:
    1975 YY_RULE_SETUP
    1976 #line 698 "parser.l"
     2041case 74:
     2042YY_RULE_SETUP
     2043#line 713 "parser.l"
    19772044{  /* hex escape sequence */
    19782045                                int result;
     
    19812048                        }
    19822049        YY_BREAK
    1983 case 68:
    1984 YY_RULE_SETUP
    1985 #line 703 "parser.l"
     2050case 75:
     2051YY_RULE_SETUP
     2052#line 718 "parser.l"
    19862053yyerror("Bad escape secuence");
    19872054        YY_BREAK
    1988 case 69:
    1989 YY_RULE_SETUP
    1990 #line 704 "parser.l"
     2055case 76:
     2056YY_RULE_SETUP
     2057#line 719 "parser.l"
    19912058addwchar('\a');
    19922059        YY_BREAK
    1993 case 70:
    1994 YY_RULE_SETUP
    1995 #line 705 "parser.l"
     2060case 77:
     2061YY_RULE_SETUP
     2062#line 720 "parser.l"
    19962063addwchar('\b');
    19972064        YY_BREAK
    1998 case 71:
    1999 YY_RULE_SETUP
    2000 #line 706 "parser.l"
     2065case 78:
     2066YY_RULE_SETUP
     2067#line 721 "parser.l"
    20012068addwchar('\f');
    20022069        YY_BREAK
    2003 case 72:
    2004 YY_RULE_SETUP
    2005 #line 707 "parser.l"
     2070case 79:
     2071YY_RULE_SETUP
     2072#line 722 "parser.l"
    20062073addwchar('\n');
    20072074        YY_BREAK
    2008 case 73:
    2009 YY_RULE_SETUP
    2010 #line 708 "parser.l"
     2075case 80:
     2076YY_RULE_SETUP
     2077#line 723 "parser.l"
    20112078addwchar('\r');
    20122079        YY_BREAK
    2013 case 74:
    2014 YY_RULE_SETUP
    2015 #line 709 "parser.l"
     2080case 81:
     2081YY_RULE_SETUP
     2082#line 724 "parser.l"
    20162083addwchar('\t');
    20172084        YY_BREAK
    2018 case 75:
    2019 YY_RULE_SETUP
    2020 #line 710 "parser.l"
     2085case 82:
     2086YY_RULE_SETUP
     2087#line 725 "parser.l"
    20212088addwchar('\v');
    20222089        YY_BREAK
    2023 case 76:
    2024 YY_RULE_SETUP
    2025 #line 711 "parser.l"
     2090case 83:
     2091YY_RULE_SETUP
     2092#line 726 "parser.l"
    20262093addwchar(yytext[1]);
    20272094        YY_BREAK
    2028 case 77:
    2029 YY_RULE_SETUP
    2030 #line 712 "parser.l"
     2095case 84:
     2096YY_RULE_SETUP
     2097#line 727 "parser.l"
    20312098addcchar('\"');         /* "bla""bla"  -> "bla\"bla" */
    20322099        YY_BREAK
    2033 case 78:
    2034 YY_RULE_SETUP
    2035 #line 713 "parser.l"
     2100case 85:
     2101YY_RULE_SETUP
     2102#line 728 "parser.l"
    20362103addcchar('\"');         /* "bla\""bla" -> "bla\"bla" */
    20372104        YY_BREAK
    2038 case 79:
    2039 YY_RULE_SETUP
    2040 #line 714 "parser.l"
     2105case 86:
     2106YY_RULE_SETUP
     2107#line 729 "parser.l"
    20412108;                       /* "bla" "bla" -> "blabla" */
    20422109        YY_BREAK
    2043 case 80:
    2044 YY_RULE_SETUP
    2045 #line 715 "parser.l"
     2110case 87:
     2111YY_RULE_SETUP
     2112#line 730 "parser.l"
    20462113{
    20472114                                char *yptr = yytext;
     
    20502117                        }
    20512118        YY_BREAK
    2052 case 81:
    2053 YY_RULE_SETUP
    2054 #line 721 "parser.l"
     2119case 88:
     2120YY_RULE_SETUP
     2121#line 736 "parser.l"
    20552122{
    20562123                                push_to(yystr);
     
    20582125                        }
    20592126        YY_BREAK
    2060 case 82:
    2061 YY_RULE_SETUP
    2062 #line 725 "parser.l"
     2127case 89:
     2128YY_RULE_SETUP
     2129#line 740 "parser.l"
    20632130{
    20642131                                pop_start();
     
    20672134                        }
    20682135        YY_BREAK
    2069 case 83:
    2070 YY_RULE_SETUP
    2071 #line 730 "parser.l"
     2136case 90:
     2137YY_RULE_SETUP
     2138#line 745 "parser.l"
    20722139yyerror("Unterminated string");
    20732140        YY_BREAK
    2074 case 84:
    2075 YY_RULE_SETUP
    2076 #line 731 "parser.l"
     2141case 91:
     2142YY_RULE_SETUP
     2143#line 746 "parser.l"
    20772144{ /* octal escape sequence */
    20782145                                int result;
     
    20832150                        }
    20842151        YY_BREAK
    2085 case 85:
    2086 YY_RULE_SETUP
    2087 #line 738 "parser.l"
     2152case 92:
     2153YY_RULE_SETUP
     2154#line 753 "parser.l"
    20882155{  /* hex escape sequence */
    20892156                                int result;
     
    20922159                        }
    20932160        YY_BREAK
    2094 case 86:
    2095 YY_RULE_SETUP
    2096 #line 743 "parser.l"
     2161case 93:
     2162YY_RULE_SETUP
     2163#line 758 "parser.l"
    20972164yyerror("Bad escape secuence");
    20982165        YY_BREAK
    2099 case 87:
    2100 YY_RULE_SETUP
    2101 #line 744 "parser.l"
     2166case 94:
     2167YY_RULE_SETUP
     2168#line 759 "parser.l"
    21022169addcchar('\a');
    21032170        YY_BREAK
    2104 case 88:
    2105 YY_RULE_SETUP
    2106 #line 745 "parser.l"
     2171case 95:
     2172YY_RULE_SETUP
     2173#line 760 "parser.l"
    21072174addcchar('\b');
    21082175        YY_BREAK
    2109 case 89:
    2110 YY_RULE_SETUP
    2111 #line 746 "parser.l"
     2176case 96:
     2177YY_RULE_SETUP
     2178#line 761 "parser.l"
    21122179addcchar('\f');
    21132180        YY_BREAK
    2114 case 90:
    2115 YY_RULE_SETUP
    2116 #line 747 "parser.l"
     2181case 97:
     2182YY_RULE_SETUP
     2183#line 762 "parser.l"
    21172184addcchar('\n');
    21182185        YY_BREAK
    2119 case 91:
    2120 YY_RULE_SETUP
    2121 #line 748 "parser.l"
     2186case 98:
     2187YY_RULE_SETUP
     2188#line 763 "parser.l"
    21222189addcchar('\r');
    21232190        YY_BREAK
    2124 case 92:
    2125 YY_RULE_SETUP
    2126 #line 749 "parser.l"
     2191case 99:
     2192YY_RULE_SETUP
     2193#line 764 "parser.l"
    21272194addcchar('\t');
    21282195        YY_BREAK
    2129 case 93:
    2130 YY_RULE_SETUP
    2131 #line 750 "parser.l"
     2196case 100:
     2197YY_RULE_SETUP
     2198#line 765 "parser.l"
    21322199addcchar('\v');
    21332200        YY_BREAK
    2134 case 94:
    2135 YY_RULE_SETUP
    2136 #line 751 "parser.l"
     2201case 101:
     2202YY_RULE_SETUP
     2203#line 766 "parser.l"
    21372204addcchar(yytext[1]);
    21382205        YY_BREAK
    2139 case 95:
    2140 YY_RULE_SETUP
    2141 #line 752 "parser.l"
     2206case 102:
     2207YY_RULE_SETUP
     2208#line 767 "parser.l"
    21422209{
    21432210                                char *yptr = yytext;
     
    21462213                        }
    21472214        YY_BREAK
    2148 case 96:
    2149 YY_RULE_SETUP
    2150 #line 757 "parser.l"
     2215case 103:
     2216YY_RULE_SETUP
     2217#line 772 "parser.l"
    21512218addcchar('\"');         /* "bla""bla"   -> "bla\"bla" */
    21522219        YY_BREAK
    2153 case 97:
    2154 YY_RULE_SETUP
    2155 #line 758 "parser.l"
     2220case 104:
     2221YY_RULE_SETUP
     2222#line 773 "parser.l"
    21562223addcchar('\"');         /* "bla\""bla"  -> "bla\"bla" */
    21572224        YY_BREAK
    2158 case 98:
    2159 YY_RULE_SETUP
    2160 #line 759 "parser.l"
     2225case 105:
     2226YY_RULE_SETUP
     2227#line 774 "parser.l"
    21612228;                       /* "bla" "bla"  -> "blabla" */
    21622229        YY_BREAK
    2163 case 99:
    2164 YY_RULE_SETUP
    2165 #line 760 "parser.l"
    2166 yywarning("Matched %c");
    2167         YY_BREAK
    2168 case 100:
    2169 YY_RULE_SETUP
    2170 #line 763 "parser.l"
     2230case 106:
     2231YY_RULE_SETUP
     2232#line 775 "parser.l"
     2233yywarning("Matched %c", *yytext);
     2234        YY_BREAK
     2235case 107:
     2236YY_RULE_SETUP
     2237#line 778 "parser.l"
    21712238{
    21722239                                push_to(yyrcd);
     
    21742241                        }
    21752242        YY_BREAK
    2176 case 101:
    2177 YY_RULE_SETUP
    2178 #line 767 "parser.l"
     2243case 108:
     2244YY_RULE_SETUP
     2245#line 782 "parser.l"
    21792246{
    21802247                                pop_start();
     
    21862253                        }
    21872254        YY_BREAK
    2188 case 102:
    2189 YY_RULE_SETUP
    2190 #line 775 "parser.l"
     2255case 109:
     2256YY_RULE_SETUP
     2257#line 790 "parser.l"
    21912258{
    21922259                                int result;
     
    21952262                        }
    21962263        YY_BREAK
    2197 case 103:
    2198 YY_RULE_SETUP
    2199 #line 780 "parser.l"
     2264case 110:
     2265YY_RULE_SETUP
     2266#line 795 "parser.l"
    22002267;       /* Ignore space */
    22012268        YY_BREAK
    2202 case 104:
    2203 YY_RULE_SETUP
    2204 #line 781 "parser.l"
     2269case 111:
     2270YY_RULE_SETUP
     2271#line 796 "parser.l"
    22052272line_number++; char_number = 1;
    22062273        YY_BREAK
    2207 case 105:
    2208 YY_RULE_SETUP
    2209 #line 782 "parser.l"
     2274case 112:
     2275YY_RULE_SETUP
     2276#line 797 "parser.l"
    22102277yyerror("Malformed data-line");
    22112278        YY_BREAK
    2212 case 106:
    2213 YY_RULE_SETUP
    2214 #line 784 "parser.l"
     2279case 113:
     2280YY_RULE_SETUP
     2281#line 799 "parser.l"
    22152282push_to(comment);       /* Eat comment */
    22162283        YY_BREAK
    2217 case 107:
    2218 YY_RULE_SETUP
    2219 #line 785 "parser.l"
     2284case 114:
     2285YY_RULE_SETUP
     2286#line 800 "parser.l"
    22202287;
    22212288        YY_BREAK
    2222 case 108:
    2223 YY_RULE_SETUP
    2224 #line 786 "parser.l"
     2289case 115:
     2290YY_RULE_SETUP
     2291#line 801 "parser.l"
    22252292;
    22262293        YY_BREAK
    2227 case 109:
    2228 YY_RULE_SETUP
    2229 #line 787 "parser.l"
     2294case 116:
     2295YY_RULE_SETUP
     2296#line 802 "parser.l"
    22302297line_number++; char_number = 1;
    22312298        YY_BREAK
    2232 case 110:
    2233 YY_RULE_SETUP
    2234 #line 788 "parser.l"
     2299case 117:
     2300YY_RULE_SETUP
     2301#line 803 "parser.l"
    22352302pop_start();
    22362303        YY_BREAK
    2237 case 111:
    2238 YY_RULE_SETUP
    2239 #line 790 "parser.l"
     2304case 118:
     2305YY_RULE_SETUP
     2306#line 805 "parser.l"
    22402307; /* Eat comment */
    22412308        YY_BREAK
    2242 case 112:
    2243 YY_RULE_SETUP
    2244 #line 791 "parser.l"
     2309case 119:
     2310YY_RULE_SETUP
     2311#line 806 "parser.l"
    22452312; /* Eat comment */
    22462313        YY_BREAK
    2247 case 113:
    2248 YY_RULE_SETUP
    2249 #line 793 "parser.l"
     2314case 120:
     2315YY_RULE_SETUP
     2316#line 808 "parser.l"
    22502317{
    22512318                                if(YY_START == yywf)
     
    22602327                        }
    22612328        YY_BREAK
    2262 case 114:
    2263 YY_RULE_SETUP
    2264 #line 804 "parser.l"
     2329case 121:
     2330YY_RULE_SETUP
     2331#line 819 "parser.l"
    22652332;       /* Eat whitespace */
    22662333        YY_BREAK
    2267 case 115:
    2268 YY_RULE_SETUP
    2269 #line 806 "parser.l"
     2334case 122:
     2335YY_RULE_SETUP
     2336#line 821 "parser.l"
    22702337return yytext[0];
    22712338        YY_BREAK
     
    22912358case YY_STATE_EOF(pp_ignore_eol):
    22922359case YY_STATE_EOF(pp_false):
     2360case YY_STATE_EOF(pp_stripe):
    22932361case YY_STATE_EOF(pp_strips):
    22942362case YY_STATE_EOF(pp_stripp):
    22952363case YY_STATE_EOF(pp_stripp_final):
    2296 #line 807 "parser.l"
     2364#line 822 "parser.l"
    22972365{
    22982366                                YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
    22992367                                if(!pop_buffer())
    23002368                                {
    2301                                         if(YY_START == pp_strips || YY_START == pp_stripp || YY_START == pp_stripp_final)
     2369                                        if(YY_START == pp_strips || YY_START == pp_stripe || YY_START == pp_stripp || YY_START == pp_stripp_final)
    23022370                                                yyerror("Unexpected end of file during c-junk scanning (started at %d)", cjunk_tagline);
    23032371                                        else
     
    23072375                        }
    23082376        YY_BREAK
    2309 case 116:
    2310 YY_RULE_SETUP
    2311 #line 819 "parser.l"
     2377case 123:
     2378YY_RULE_SETUP
     2379#line 834 "parser.l"
    23122380{
    23132381                                /* Catch all rule to find any unmatched text */
     
    23172385                                        char_number = 1;
    23182386                                }
    2319                                 yywarning("Unmatched text '%c' (0x%02x) YY_START=%d",
    2320                                         isprint(*yytext) ? *yytext : '.', *yytext, YY_START);
    2321                         }
    2322         YY_BREAK
    2323 case 117:
    2324 YY_RULE_SETUP
    2325 #line 830 "parser.l"
     2387                                yywarning("Unmatched text '%c' (0x%02x) YY_START=%d stripslevel=%d",
     2388                                        isprint(*yytext) ? *yytext : '.', *yytext, YY_START,stripslevel);
     2389                        }
     2390        YY_BREAK
     2391case 124:
     2392YY_RULE_SETUP
     2393#line 845 "parser.l"
    23262394ECHO;
    23272395        YY_BREAK
    2328 #line 2329 "lexyy.c"
     2396#line 2397 "lexyy.c"
    23292397
    23302398        case YY_END_OF_BUFFER:
     
    26142682                        {
    26152683                        yy_current_state = (int) yy_def[yy_current_state];
    2616                         if ( yy_current_state >= 346 )
     2684                        if ( yy_current_state >= 369 )
    26172685                                yy_c = yy_meta[(unsigned int) yy_c];
    26182686                        }
     
    26492717                {
    26502718                yy_current_state = (int) yy_def[yy_current_state];
    2651                 if ( yy_current_state >= 346 )
     2719                if ( yy_current_state >= 369 )
    26522720                        yy_c = yy_meta[(unsigned int) yy_c];
    26532721                }
    26542722        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
    2655         yy_is_jam = (yy_current_state == 345);
     2723        yy_is_jam = (yy_current_state == 368);
    26562724
    26572725        return yy_is_jam ? 0 : yy_current_state;
     
    31863254        }
    31873255#endif
    3188 #line 830 "parser.l"
     3256#line 845 "parser.l"
    31893257
    31903258
     
    33183386
    33193387/* Called from the parser to kill c-junk */
     3388void strip_extern(void)
     3389{
     3390        cjunk_tagline = line_number;
     3391        push_to(pp_stripe);
     3392}
     3393
    33203394void strip_til_semicolon(void)
    33213395{
     
    33313405}
    33323406
    3333 
  • trunk/tools/wrc/newstruc.c

    r882 r3426  
    1313#include <string.h>
    1414#include <assert.h>
    15 #include <string.h>
    1615
    1716#include "wrc.h"
     
    280279}
    281280
    282 style_pair_t *new_style_pair(int style, int exstyle)
     281style_pair_t *new_style_pair(style_t *style, style_t *exstyle)
    283282{
    284283        style_pair_t *sp = (style_pair_t *)xmalloc(sizeof(style_pair_t));
     
    287286        return sp;
    288287}
     288
     289style_t *new_style(DWORD or_mask, DWORD and_mask)
     290{
     291        style_t *st = (style_t *)xmalloc(sizeof(style_t));
     292        st->or_mask = or_mask;
     293        st->and_mask = and_mask;
     294        return st;
     295}
  • trunk/tools/wrc/newstruc.h

    r882 r3426  
    6565stringtable_t *new_stringtable(lvc_t *lvc);
    6666toolbar_t *new_toolbar(int button_width, int button_Height, toolbar_item_t *items, int nitems);
    67 style_pair_t *new_style_pair(int style, int exstyle);
     67style_pair_t *new_style_pair(style_t *style, style_t *exstyle);
     68style_t *new_style(DWORD or_mask, DWORD and_mask);
    6869
    6970#endif
  • trunk/tools/wrc/parser.h

    r882 r3426  
    2828void push_to(int start);
    2929void pop_start(void);
     30void strip_extern(void);
    3031void strip_til_semicolon(void);
    3132void strip_til_parenthesis(void);
  • trunk/tools/wrc/parser.l

    r882 r3426  
    7676%x pp_false
    7777/* Set when stripping c-junk */
     78%x pp_stripe
    7879%x pp_strips
    7980%x pp_stripp
     
    135136static int want_nl = 0;         /* Set when newline needs to go to parser */
    136137static int want_ident = 0;      /* Set is #ifdef, #ifndef or defined is seen */
    137 static int stripslevel = 0;     /* Count {} during pp_strips mode */
     138static int stripslevel = 0;     /* Count {} during pp_strips/pp_stripe mode */
    138139static int stripplevel = 0;     /* Count () during pp_strips mode */
    139140static char *substtext = NULL;  /* Holds the substition text while getting a define */
     
    455456
    456457        /* Conditional handling */
    457 <INITIAL,pp_strips,pp_stripp,pp_false>^{ws}*#{ws}*if{ws}*       {
     458<INITIAL,pp_strips,pp_stripe,pp_stripp,pp_false>^{ws}*#{ws}*if{ws}*     {
    458459                        if(YY_START == pp_false)
    459460                        {
     
    470471                        }
    471472                }
    472 <INITIAL,pp_strips,pp_stripp,pp_false>^{ws}*#{ws}*ifdef{ws}*    {
     473<INITIAL,pp_strips,pp_stripe,pp_stripp,pp_false>^{ws}*#{ws}*ifdef{ws}*  {
    473474                        if(YY_START == pp_false)
    474475                        {
     
    486487                        }
    487488                }
    488 <INITIAL,pp_strips,pp_stripp,pp_false>^{ws}*#{ws}*ifndef{ws}*   {
     489<INITIAL,pp_strips,pp_stripe,pp_stripp,pp_false>^{ws}*#{ws}*ifndef{ws}* {
    489490                        if(YY_START == pp_false)
    490491                        {
     
    502503                        }
    503504                }
    504 <INITIAL,pp_strips,pp_stripp,pp_false>^{ws}*#{ws}*elif{ws}*     {
     505<INITIAL,pp_strips,pp_stripe,pp_stripp,pp_false>^{ws}*#{ws}*elif{ws}*   {
    505506                        if(!isnevertrue_if())
    506507                        {
     
    514515                                printf("(%d)#elif ignored\n", line_number);
    515516                }
    516 <INITIAL,pp_strips,pp_stripp,pp_false>^{ws}*#{ws}*else{ws}*     {
     517<INITIAL,pp_strips,pp_stripe,pp_stripp,pp_false>^{ws}*#{ws}*else{ws}*   {
    517518                        if(!isnevertrue_if())
    518519                        {
     
    524525                                printf("(%d)#else ignored\n", line_number);
    525526                }
    526 <INITIAL,pp_strips,pp_stripp,pp_false>^{ws}*#{ws}*endif{ws}*    {
     527<INITIAL,pp_strips,pp_stripe,pp_stripp,pp_false>^{ws}*#{ws}*endif{ws}*  {
    527528                        if(!isnevertrue_if())
    528529                        {
     
    539540
    540541        /* The error directive */
    541 ^{ws}*#{ws}*error{ws}*  push_to(pp_error);
    542 <pp_error>[^\n]*        yyerror("Error directive: %s", yytext);
     542<INITIAL,pp_strips,pp_stripe,pp_stripp>^{ws}*#{ws}*error{ws}*   push_to(pp_error);
     543<pp_error>[^\n]*        yyerror("Error directive: %s", yytext);
     544<pp_false>^{ws}*#{ws}*error[^\n]* {
     545                        if(yydebug)
     546                                printf("(%d)#error ignored\n", line_number);
     547                }
    543548
    544549        /* preprocessor junk */
    545 ^{ws}*#{ws}*pragma[^\n]*        ;       /* Ignore #pragma */
    546 ^{ws}*#{ws}*line[^\n]*          ;       /* Ignore #line */
     550<INITIAL,pp_strips,pp_stripe,pp_stripp,pp_false>^{ws}*#{ws}*pragma[^\n]*        ;       /* Ignore #pragma */
     551<INITIAL,pp_strips,pp_stripe,pp_stripp,pp_false>^{ws}*#{ws}*ident[^\n]*         ;       /* Ignore #ident */
     552<INITIAL,pp_strips,pp_stripe,pp_stripp,pp_false>^{ws}*#{ws}*line[^\n]*          ;       /* Ignore #line */
    547553 /* We'll get an error on malformed #xxx statements
    548554  * by not recognising '#' at all. This helps tracking
     
    556562<pp_strips>\/[^*\n]             ; /* To catch comments */
    557563<pp_strips>[^\{\};\n#/]*        ; /* Ignore rest */
     564
     565<pp_stripe>\{           stripslevel++;
     566<pp_stripe>\}   {
     567                        stripslevel--;
     568                        if(!stripslevel) pop_start();
     569                }
     570<pp_stripe>;            if(!stripslevel) pop_start();
     571<pp_stripe>\/[^*\n]             ; /* To catch comments */
     572<pp_stripe>[^\{\};\n#/]*        ; /* Ignore rest */
    558573
    559574<pp_stripp>\(           stripplevel++;
     
    758773<yystr>\\\"\"           addcchar('\"');         /* "bla\""bla"  -> "bla\"bla" */
    759774<yystr>\"{ws}+\"        ;                       /* "bla" "bla"  -> "blabla" */
    760 <yystr>.                yywarning("Matched %c");
     775<yystr>.                yywarning("Matched %c", *yytext);
    761776
    762777
     
    782797<yyrcd>.                yyerror("Malformed data-line");
    783798
    784 <INITIAL,pp_ignore,pp_def_s,pp_strips,pp_stripp>"/*"    push_to(comment);       /* Eat comment */
     799<INITIAL,pp_ignore,pp_def_s,pp_strips,pp_stripe,pp_stripp>"/*"  push_to(comment);       /* Eat comment */
    785800<comment>[^*\n]*        ;
    786801<comment>"*"+[^*/\n]*   ;
     
    791806<INITIAL,pp_ignore,pp_def_s>"//"[^\n]*          ; /* Eat comment */
    792807
    793 <INITIAL,yywf,pp_false,pp_strips,pp_stripp>\n   {
     808<INITIAL,yywf,pp_false,pp_strips,pp_stripe,pp_stripp>\n {
    794809                                if(YY_START == yywf)
    795810                                        pop_start();
     
    809824                                if(!pop_buffer())
    810825                                {
    811                                         if(YY_START == pp_strips || YY_START == pp_stripp || YY_START == pp_stripp_final)
     826                                        if(YY_START == pp_strips || YY_START == pp_stripe || YY_START == pp_stripp || YY_START == pp_stripp_final)
    812827                                                yyerror("Unexpected end of file during c-junk scanning (started at %d)", cjunk_tagline);
    813828                                        else
     
    824839                                        char_number = 1;
    825840                                }
    826                                 yywarning("Unmatched text '%c' (0x%02x) YY_START=%d",
    827                                         isprint(*yytext) ? *yytext : '.', *yytext, YY_START);
     841                                yywarning("Unmatched text '%c' (0x%02x) YY_START=%d stripslevel=%d",
     842                                        isprint(*yytext) ? *yytext : '.', *yytext, YY_START,stripslevel);
    828843                        }
    829844
     
    959974
    960975/* Called from the parser to kill c-junk */
     976void strip_extern(void)
     977{
     978        cjunk_tagline = line_number;
     979        push_to(pp_stripe);
     980}
     981
    961982void strip_til_semicolon(void)
    962983{
     
    972993}
    973994
    974 
  • trunk/tools/wrc/parser.y

    r882 r3426  
    33 * Copyright  Martin von Loewis, 1994
    44 * Copyright 1998 Bertho A. Stultiens (BS)
     5 *           1999 Juergen Schmied (JS)
    56 *
     7 * 6-Nov-1999 JS        - see CHANGES
     8 *
    69 * 29-Dec-1998 AdH      - Grammar and function extensions.
    710 *                           grammar: TOOLBAR resources, Named ICONs in
     
    104107#include "preproc.h"
    105108#include "parser.h"
     109#include "windef.h"
     110#include "wingdi.h"
    106111#include "winuser.h"
    107112
     
    110115#endif
    111116
    112 DWORD andmask;          /* Used to parse 'NOT NUMBER' expressions */
    113117int indialog = 0;       /* Signal flex that we're parsing a dialog */
    114118int want_rscname = 0;   /* Set when a resource's name is required */
     
    158162dialogex_t *dialogex_font(font_id_t *f, dialogex_t *dlg);
    159163dialogex_t *dialogex_caption(string_t *s, dialogex_t *dlg);
    160 dialogex_t *dialogex_exstyle(int st, dialogex_t *dlg);
    161 dialogex_t *dialogex_style(int st, dialogex_t *dlg);
     164dialogex_t *dialogex_exstyle(style_t *st, dialogex_t *dlg);
     165dialogex_t *dialogex_style(style_t *st, dialogex_t *dlg);
    162166name_id_t *convert_ctlclass(name_id_t *cls);
    163 control_t *ins_ctrl(int type, int style, control_t *ctrl, control_t *prev);
     167control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control_t *prev);
    164168dialog_t *dialog_version(version_t *v, dialog_t *dlg);
    165169dialog_t *dialog_characteristics(characts_t *c, dialog_t *dlg);
     
    169173dialog_t *dialog_font(font_id_t *f, dialog_t *dlg);
    170174dialog_t *dialog_caption(string_t *s, dialog_t *dlg);
    171 dialog_t *dialog_exstyle(int st, dialog_t *dlg);
    172 dialog_t *dialog_style(int st, dialog_t *dlg);
     175dialog_t *dialog_exstyle(style_t * st, dialog_t *dlg);
     176dialog_t *dialog_style(style_t * st, dialog_t *dlg);
    173177resource_t *build_stt_resources(stringtable_t *stthead);
    174178stringtable_t *find_stringtable(lvc_t *lvc);
     
    218222        dlginit_t       *dginit;
    219223        style_pair_t    *styles;
     224        style_t         *style;
    220225}
    221226
     
    264269%type <dlg>     dialog dlg_attributes
    265270%type <ctl>     ctrls gen_ctrl lab_ctrl ctrl_desc iconinfo
    266 %type <iptr>    optional_style helpid
     271%type <iptr>    helpid
    267272%type <dlgex>   dialogex dlgex_attribs
    268273%type <ctl>     exctrls gen_exctrl lab_exctrl exctrl_desc
     
    289294%type <chars>   opt_characts
    290295%type <ver>     opt_version
    291 %type <num>     expr xpr dummy
     296%type <num>     expr xpr
    292297%type <iptr>    e_expr
    293298%type <iptr>    pp_expr pp_constant
     
    297302%type <styles>  optional_style_pair
    298303%type <num>     any_num
     304%type <style>   optional_style
     305%type <style>   style
    299306
    300307%%
     
    389396/* C ignore stuff */
    390397cjunk   : tTYPEDEF                      { strip_til_semicolon(); }
    391         | tEXTERN                       { strip_til_semicolon(); }
     398        | tEXTERN                       { strip_extern(); }
    392399        | IDENT IDENT                   { strip_til_semicolon(); }
    393400        | IDENT '('                     { strip_til_parenthesis(); }
     
    434441 */
    435442nameid  : expr  {
     443                if($1 > 65535 || $1 < -32768)
     444                        yyerror("Resource's ID out of range (%d)", $1);
    436445                $$ = new_name_id();
    437446                $$->type = name_ord;
     
    672681                if(!$$->gotstyle)
    673682                {
    674                         $$->style = WS_POPUP;
     683                        $$->style->or_mask = WS_POPUP;
    675684                        $$->gotstyle = TRUE;
    676685                }
    677686                if($$->title)
    678                         $$->style |= WS_CAPTION;
     687                        $$->style->or_mask |= WS_CAPTION;
    679688                if($$->font)
    680                         $$->style |= DS_SETFONT;
     689                        $$->style->or_mask |= DS_SETFONT;
     690
     691                $$->style->or_mask &= ~($$->style->and_mask);
     692                $$->style->and_mask = 0;
     693
    681694                indialog = FALSE;
    682695                if(!$$->lvc.language)
     
    687700dlg_attributes
    688701        : /* Empty */                   { $$=new_dialog(); }
    689         | dlg_attributes STYLE expr     { $$=dialog_style($3,$1); }
    690         | dlg_attributes EXSTYLE expr   { $$=dialog_exstyle($3,$1); }
     702        | dlg_attributes STYLE style    { $$=dialog_style($3,$1); }
     703        | dlg_attributes EXSTYLE style  { $$=dialog_exstyle($3,$1); }
    691704        | dlg_attributes CAPTION tSTRING { $$=dialog_caption($3,$1); }
    692705        | dlg_attributes opt_font       { $$=dialog_font($2,$1); }
     
    718731        | ctrls RTEXT           lab_ctrl        { $$=ins_ctrl(CT_STATIC, SS_RIGHT, $3, $1); }
    719732        /* special treatment for icons, as the extent is optional */
    720         | ctrls ICON nameid_s ',' expr ',' expr ',' expr iconinfo {
     733        | ctrls ICON nameid_s opt_comma expr ',' expr ',' expr iconinfo {
    721734                $10->title = $3;
    722735                $10->id = $5;
     
    728741
    729742lab_ctrl
    730         : tSTRING ',' expr ',' expr ',' expr ',' expr ',' expr optional_style {
     743        : tSTRING opt_comma expr ',' expr ',' expr ',' expr ',' expr optional_style {
    731744                $$=new_control();
    732745                $$->title = new_name_id();
     
    740753                if($12)
    741754                {
    742                         $$->style = *($12);
     755                        $$->style = $12;
    743756                        $$->gotstyle = TRUE;
    744                         free($12);
    745757                }
    746758                }
     
    757769                if($10)
    758770                {
    759                         $$->style = *($10);
     771                        $$->style = $10;
    760772                        $$->gotstyle = TRUE;
    761                         free($10);
    762773                }
    763774                }
     
    772783                $$->height = $4;
    773784                }
    774         | ',' expr ',' expr ',' expr {
     785        | ',' expr ',' expr ',' style {
    775786                $$ = new_control();
    776787                $$->width = $2;
     
    779790                $$->gotstyle = TRUE;
    780791                }
    781         | ',' expr ',' expr ',' expr ',' expr {
     792        | ',' expr ',' expr ',' style ',' style {
    782793                $$ = new_control();
    783794                $$->width = $2;
     
    790801        ;
    791802
    792 gen_ctrl: nameid_s ',' expr ',' ctlclass ',' expr ',' expr ',' expr ',' expr ',' expr ',' expr {
     803gen_ctrl: nameid_s opt_comma expr ',' ctlclass ',' style ',' expr ',' expr ',' expr ',' expr ',' style {
    793804                $$=new_control();
    794805                $$->title = $1;
     
    804815                $$->gotexstyle = TRUE;
    805816                }
    806         | nameid_s ',' expr ',' ctlclass ',' expr ',' expr ',' expr ',' expr ',' expr {
     817        | nameid_s opt_comma expr ',' ctlclass ',' style ',' expr ',' expr ',' expr ',' expr {
    807818                $$=new_control();
    808819                $$->title = $1;
     
    822833        ;
    823834
     835/* ------------------------------ style flags ------------------------------ */
    824836optional_style          /* Abbused once to get optional ExStyle */
    825837        : /* Empty */   { $$ = NULL; }
    826         | ',' expr      { $$ = new_int($2); }
     838        | ',' style     { $$ = $2; }
    827839        ;
    828840
    829841optional_style_pair
    830         : /* Enpty */           { $$ = NULL; }
    831         | ',' expr              { $$ = new_style_pair($2, 0); }
    832         | ',' expr ',' expr     { $$ = new_style_pair($2, $4); }
    833         ;
     842        : /* Empty */           { $$ = NULL; }
     843        | ',' style             { $$ = new_style_pair($2, 0); }
     844        | ',' style ',' style   { $$ = new_style_pair($2, $4); }
     845        ;
     846
     847style
     848        : style '|' style       { $$ = new_style($1->or_mask | $3->or_mask, $1->and_mask | $3->and_mask); free($1); free($3);}
     849        | '(' style ')'         { $$ = $2; }
     850        | any_num               { $$ = new_style($1, 0); }
     851        | NOT any_num           { $$ = new_style(0, $2); }
     852        ;   
    834853
    835854ctlclass
     
    870889                $11->controls = get_control_head($13);
    871890                $$ = $11;
     891
     892                assert($$->style != NULL);
    872893                if(!$$->gotstyle)
    873894                {
    874                         $$->style = WS_POPUP;
     895                        $$->style->or_mask = WS_POPUP;
    875896                        $$->gotstyle = TRUE;
    876897                }
    877898                if($$->title)
    878                         $$->style |= WS_CAPTION;
     899                        $$->style->or_mask |= WS_CAPTION;
    879900                if($$->font)
    880                         $$->style |= DS_SETFONT;
     901                        $$->style->or_mask |= DS_SETFONT;
     902
     903                $$->style->or_mask &= ~($$->style->and_mask);
     904                $$->style->and_mask = 0;
     905
    881906                indialog = FALSE;
    882907                if(!$$->lvc.language)
     
    887912dlgex_attribs
    888913        : /* Empty */                   { $$=new_dialogex(); }
    889         | dlgex_attribs STYLE expr      { $$=dialogex_style($3,$1); }
    890         | dlgex_attribs EXSTYLE expr    { $$=dialogex_exstyle($3,$1); }
     914        | dlgex_attribs STYLE style     { $$=dialogex_style($3,$1); }
     915        | dlgex_attribs EXSTYLE style   { $$=dialogex_exstyle($3,$1); }
    891916        | dlgex_attribs CAPTION tSTRING { $$=dialogex_caption($3,$1); }
    892917        | dlgex_attribs opt_font        { $$=dialogex_font($2,$1); }
     
    919944        | exctrls RTEXT         lab_exctrl      { $$=ins_ctrl(CT_STATIC, SS_RIGHT, $3, $1); }
    920945        /* special treatment for icons, as the extent is optional */
    921         | exctrls ICON nameid_s ',' expr ',' expr ',' expr iconinfo {
     946        | exctrls ICON nameid_s opt_comma expr ',' expr ',' expr iconinfo {
    922947                $10->title = $3;
    923948                $10->id = $5;
     
    929954
    930955gen_exctrl
    931         : nameid_s ',' expr ',' ctlclass ',' expr ',' expr ',' expr ',' expr ','
    932           expr ',' e_expr helpid opt_data {
     956        : nameid_s opt_comma expr ',' ctlclass ',' style ',' expr ',' expr ',' expr ','
     957          expr ',' style helpid opt_data {
    933958                $$=new_control();
    934959                $$->title = $1;
     
    943968                if($17)
    944969                {
    945                         $$->exstyle = *($17);
     970                        $$->exstyle = $17;
    946971                        $$->gotexstyle = TRUE;
    947                         free($17);
    948972                }
    949973                if($18)
     
    955979                $$->extra = $19;
    956980                }
    957         | nameid_s ',' expr ',' ctlclass ',' expr ',' expr ',' expr ',' expr ',' expr opt_data {
     981        | nameid_s opt_comma expr ',' ctlclass ',' style ',' expr ',' expr ',' expr ',' expr opt_data {
    958982                $$=new_control();
    959983                $$->title = $1;
     
    971995
    972996lab_exctrl
    973         : tSTRING ',' expr ',' expr ',' expr ',' expr ',' expr optional_style_pair opt_data {
     997        : tSTRING opt_comma expr ',' expr ',' expr ',' expr ',' expr optional_style_pair opt_data {
    974998                $$=new_control();
    975999                $$->title = new_name_id();
     
    10711095item_definitions
    10721096        : /* Empty */   {$$ = NULL;}
    1073         | item_definitions MENUITEM tSTRING ',' expr item_options {
     1097        | item_definitions MENUITEM tSTRING opt_comma expr item_options {
    10741098                $$=new_menu_item();
    10751099                $$->prev = $1;
     
    13061330                int i;
    13071331                assert(tagstt != NULL);
     1332                if($2 > 65535 || $2 < -32768)
     1333                        yyerror("Stringtable entry's ID out of range (%d)", $2);
    13081334                /* Search for the ID */
    13091335                for(i = 0; i < tagstt->nentries; i++)
     
    15981624        | expr          { $$ = new_int($1); }
    15991625        ;
    1600 expr    : dummy xpr     { $$ = ($2) & andmask; }
    1601         ;
    1602 
    1603 dummy   : /* Empty */   { $$ = 0; andmask = -1; }
     1626expr    : xpr   { $$ = ($1); }
    16041627        ;
    16051628
     
    16151638        | '(' xpr ')'   { $$ = $2; }
    16161639        | any_num       { $$ = $1; want_rscname = 0; }
    1617         | NOT any_num   { $$ = 0; andmask &= ~($2); }
     1640        | NOT any_num   { $$ = ~($2); }
    16181641        ;
    16191642
     
    16241647%%
    16251648/* Dialog specific functions */
    1626 dialog_t *dialog_style(int st, dialog_t *dlg)
    1627 {
    1628         DWORD s = 0;
     1649dialog_t *dialog_style(style_t * st, dialog_t *dlg)
     1650{
    16291651        assert(dlg != NULL);
     1652        if(dlg->style == NULL)
     1653        {
     1654                dlg->style = new_style(0,0);
     1655        }
     1656
    16301657        if(dlg->gotstyle)
    16311658        {
    16321659                yywarning("Style already defined, or-ing together");
    1633                 s = dlg->style;
    1634         }
    1635         dlg->style = st | s;
     1660        }
     1661        else
     1662        {
     1663                dlg->style->or_mask = 0;
     1664                dlg->style->and_mask = 0;
     1665        }
     1666        dlg->style->or_mask |= st->or_mask;
     1667        dlg->style->and_mask |= st->and_mask;
    16361668        dlg->gotstyle = TRUE;
     1669        free(st);
    16371670        return dlg;
    16381671}
    16391672
    1640 dialog_t *dialog_exstyle(int st, dialog_t *dlg)
    1641 {
    1642         DWORD s = 0;
     1673dialog_t *dialog_exstyle(style_t *st, dialog_t *dlg)
     1674{
    16431675        assert(dlg != NULL);
     1676        if(dlg->exstyle == NULL)
     1677        {
     1678                dlg->exstyle = new_style(0,0);
     1679        }
     1680
    16441681        if(dlg->gotexstyle)
    16451682        {
    16461683                yywarning("ExStyle already defined, or-ing together");
    1647                 s = dlg->style;
    1648         }
    1649         dlg->exstyle = st | s;
     1684        }
     1685        else
     1686        {
     1687                dlg->exstyle->or_mask = 0;
     1688                dlg->exstyle->and_mask = 0;
     1689        }
     1690        dlg->exstyle->or_mask |= st->or_mask;
     1691        dlg->exstyle->and_mask |= st->and_mask;
    16501692        dlg->gotexstyle = TRUE;
     1693        free(st);
    16511694        return dlg;
    16521695}
     
    17161759
    17171760/* Controls specific functions */
    1718 control_t *ins_ctrl(int type, int style, control_t *ctrl, control_t *prev)
    1719 {
     1761control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control_t *prev)
     1762{
     1763        /* Hm... this seems to be jammed in at all time... */
     1764        int defaultstyle = WS_CHILD | WS_VISIBLE;
     1765
    17201766        assert(ctrl != NULL);
    17211767        ctrl->prev = prev;
     1768
    17221769        if(prev)
    17231770                prev->next = ctrl;
     1771
    17241772        if(type != -1)
    17251773        {
     
    17291777        }
    17301778
    1731         /* Hm... this seems to be jammed in at all time... */
    1732         ctrl->style |= WS_CHILD | WS_VISIBLE;
    17331779        switch(type)
    17341780        {
    17351781        case CT_BUTTON:
    1736                 ctrl->style |= style;
    1737                 if(style != BS_GROUPBOX && style != BS_RADIOBUTTON)
    1738                         ctrl->style |= WS_TABSTOP;
     1782                if(special_style != BS_GROUPBOX && special_style != BS_RADIOBUTTON)
     1783                        defaultstyle |= WS_TABSTOP;
    17391784                break;
    17401785        case CT_EDIT:
    1741                 ctrl->style |= WS_TABSTOP | WS_BORDER;
     1786                defaultstyle |= WS_TABSTOP | WS_BORDER;
    17421787                break;
    17431788        case CT_LISTBOX:
    1744                 ctrl->style |= LBS_NOTIFY | WS_BORDER;
     1789                defaultstyle |= LBS_NOTIFY | WS_BORDER;
    17451790                break;
    17461791        case CT_COMBOBOX:
    1747                 ctrl->style |= CBS_SIMPLE;
     1792                defaultstyle |= CBS_SIMPLE;
    17481793                break;
    17491794        case CT_STATIC:
    1750                 ctrl->style |= style;
    1751                 if(style == SS_CENTER || style == SS_LEFT || style == SS_RIGHT)
    1752                         ctrl->style |= WS_GROUP;
     1795                if(special_style == SS_CENTER || special_style == SS_LEFT || special_style == SS_RIGHT)
     1796                        defaultstyle |= WS_GROUP;
    17531797                break;
    17541798        }
     
    17591803                {
    17601804                case CT_EDIT:
    1761                         ctrl->style |= ES_LEFT;
     1805                        defaultstyle |= ES_LEFT;
    17621806                        break;
    17631807                case CT_LISTBOX:
    1764                         ctrl->style |= LBS_NOTIFY;
     1808                        defaultstyle |= LBS_NOTIFY;
    17651809                        break;
    17661810                case CT_COMBOBOX:
    1767                         ctrl->style |= CBS_SIMPLE | WS_TABSTOP;
     1811                        defaultstyle |= CBS_SIMPLE | WS_TABSTOP;
    17681812                        break;
    17691813                case CT_SCROLLBAR:
    1770                         ctrl->style |= SBS_HORZ;
     1814                        defaultstyle |= SBS_HORZ;
    17711815                        break;
    17721816                case CT_BUTTON:
    1773                         switch(style)
     1817                        switch(special_style)
    17741818                        {
    17751819                        case BS_CHECKBOX:
     
    17821826                        case BS_3STATE:
    17831827                        case BS_AUTOCHECKBOX:
    1784                                 ctrl->style |= WS_TABSTOP;
     1828                                defaultstyle |= WS_TABSTOP;
    17851829                                break;
    17861830                        default:
    1787                                 yywarning("Unknown default button control-style 0x%08x", style);
     1831                                yywarning("Unknown default button control-style 0x%08x", special_style);
    17881832                        case BS_RADIOBUTTON:
    17891833                                break;
     
    17921836
    17931837                case CT_STATIC:
    1794                         switch(style)
     1838                        switch(special_style)
    17951839                        {
    17961840                        case SS_LEFT:
    17971841                        case SS_RIGHT:
    17981842                        case SS_CENTER:
    1799                                 ctrl->style |= WS_GROUP;
     1843                                defaultstyle |= WS_GROUP;
    18001844                                break;
    18011845                        case SS_ICON:   /* Special case */
    18021846                                break;
    18031847                        default:
    1804                                 yywarning("Unknown default static control-style 0x%08x", style);
     1848                                yywarning("Unknown default static control-style 0x%08x", special_style);
    18051849                                break;
    18061850                        }
     
    18151859
    18161860        /* The SS_ICON flag is always forced in for icon controls */
    1817         if(type == CT_STATIC && style == SS_ICON)
    1818                 ctrl->style |= SS_ICON;
    1819 
     1861        if(type == CT_STATIC && special_style == SS_ICON)
     1862                defaultstyle |= SS_ICON;
     1863
     1864        if (!ctrl->gotstyle)
     1865                ctrl->style = new_style(0,0);
     1866
     1867        /* combine all styles */
     1868        ctrl->style->or_mask = ctrl->style->or_mask | defaultstyle | special_style;
    18201869        ctrl->gotstyle = TRUE;
    18211870byebye:
     1871        /* combine with NOT mask */
     1872        if (ctrl->gotstyle)
     1873        {
     1874                ctrl->style->or_mask &= ~(ctrl->style->and_mask);
     1875                ctrl->style->and_mask = 0;
     1876        }
     1877        if (ctrl->gotexstyle)
     1878        {
     1879                ctrl->exstyle->or_mask &= ~(ctrl->exstyle->and_mask);
     1880                ctrl->exstyle->and_mask = 0;
     1881        }
    18221882        return ctrl;
    18231883}
     
    18611921
    18621922/* DialogEx specific functions */
    1863 dialogex_t *dialogex_style(int st, dialogex_t *dlg)
    1864 {
    1865         DWORD s = 0;
     1923dialogex_t *dialogex_style(style_t * st, dialogex_t *dlg)
     1924{
    18661925        assert(dlg != NULL);
     1926        if(dlg->style == NULL)
     1927        {
     1928                dlg->style = new_style(0,0);
     1929        }
     1930
    18671931        if(dlg->gotstyle)
    18681932        {
    18691933                yywarning("Style already defined, or-ing together");
    1870                 s = dlg->style;
    1871         }
    1872         dlg->style = st | s;
     1934        }
     1935        else
     1936        {
     1937                dlg->style->or_mask = 0;
     1938                dlg->style->and_mask = 0;
     1939        }
     1940        dlg->style->or_mask |= st->or_mask;
     1941        dlg->style->and_mask |= st->and_mask;
    18731942        dlg->gotstyle = TRUE;
     1943        free(st);
    18741944        return dlg;
    18751945}
    18761946
    1877 dialogex_t *dialogex_exstyle(int st, dialogex_t *dlg)
    1878 {
    1879         DWORD s = 0;
     1947dialogex_t *dialogex_exstyle(style_t * st, dialogex_t *dlg)
     1948{
    18801949        assert(dlg != NULL);
     1950        if(dlg->exstyle == NULL)
     1951        {
     1952                dlg->exstyle = new_style(0,0);
     1953        }
     1954
    18811955        if(dlg->gotexstyle)
    18821956        {
    18831957                yywarning("ExStyle already defined, or-ing together");
    1884                 s = dlg->exstyle;
    1885         }
    1886         dlg->exstyle = st | s;
     1958        }
     1959        else
     1960        {
     1961                dlg->exstyle->or_mask = 0;
     1962                dlg->exstyle->and_mask = 0;
     1963        }
     1964        dlg->exstyle->or_mask |= st->or_mask;
     1965        dlg->exstyle->and_mask |= st->and_mask;
    18871966        dlg->gotexstyle = TRUE;
     1967        free(st);
    18881968        return dlg;
    18891969}
  • trunk/tools/wrc/preproc.c

    r904 r3426  
    1616
    1717
    18 extern void set_pp_ignore(int); /* From parser.l */
     18extern void set_pp_ignore(int); /* From parser.l */
    1919
    2020static char *current_define;
    2121
    22 #define HASHKEY     2039
     22#define HASHKEY         2039
    2323static struct pp_entry *pp_defines[HASHKEY];
    2424
    25 #define MAXIFSTACK  64
     25#define MAXIFSTACK      64
    2626static struct if_state ifstack[MAXIFSTACK];
    2727static int ifstackidx = 0;
     
    3030void pp_status(void)
    3131{
    32     int i;
    33     int sum;
    34     int total = 0;
    35     struct pp_entry *ppp;
    36 
    37     printf("Defines statistics:\n");
    38     for(i = 0; i < HASHKEY; i++)
    39     {
    40         sum = 0;
    41         for(ppp = pp_defines[i]; ppp; ppp = ppp->next)
    42             sum++;
    43         total += sum;
    44         printf("%4d, %3d\n", i, sum);
    45     }
    46     printf("Total defines: %d\n", total);
     32        int i;
     33        int sum;
     34        int total = 0;
     35        struct pp_entry *ppp;
     36
     37        printf("Defines statistics:\n");
     38        for(i = 0; i < HASHKEY; i++)
     39        {
     40                sum = 0;
     41                for(ppp = pp_defines[i]; ppp; ppp = ppp->next)
     42                        sum++;
     43                total += sum;
     44                printf("%4d, %3d\n", i, sum);
     45        }
     46        printf("Total defines: %d\n", total);
    4747}
    4848#pragma exit pp_status
     
    5252int pp_hash(char *str)
    5353{
    54     int sum = 0;
    55     while(*str)
    56         sum += *str++;
    57     return sum % HASHKEY;
     54        int sum = 0;
     55        while(*str)
     56                sum += *str++;
     57        return sum % HASHKEY;
    5858}
    5959
    6060struct pp_entry *pp_lookup(char *ident)
    6161{
    62     int index = pp_hash(ident);
    63     struct pp_entry *ppp;
    64     for(ppp = pp_defines[index]; ppp; ppp = ppp->next)
    65     {
    66         if(!strcmp(ident, ppp->ident))
    67             return ppp;
    68     }
    69     return NULL;
     62        int index = pp_hash(ident);
     63        struct pp_entry *ppp;
     64        for(ppp = pp_defines[index]; ppp; ppp = ppp->next)
     65        {
     66                if(!strcmp(ident, ppp->ident))
     67                        return ppp;
     68        }
     69        return NULL;
    7070}
    7171
    7272void set_define(char *name)
    7373{
    74     current_define = xstrdup(name);
     74        current_define = xstrdup(name);
    7575}
    7676
    7777void del_define(char *name)
    7878{
    79     int index;
    80     struct pp_entry *ppp;
    81 
    82     if((ppp = pp_lookup(name)) == NULL)
    83     {
    84         if(pedantic)
    85             yywarning("%s was not defined", name);
    86         return;
    87     }
    88 
    89     index = pp_hash(name);
    90     if(pp_defines[index] == ppp)
    91     {
    92         pp_defines[index] = ppp->next;
    93         if(pp_defines[index])
    94             pp_defines[index]->prev = NULL;
    95     }
    96     else
    97     {
    98         ppp->prev->next = ppp->next;
    99         if(ppp->next)
    100             ppp->next->prev = ppp->prev;
    101     }
    102     free(ppp);
     79        int index;
     80        struct pp_entry *ppp;
     81
     82        if((ppp = pp_lookup(name)) == NULL)
     83        {
     84                if(pedantic)
     85                        yywarning("%s was not defined", name);
     86                return;
     87        }
     88
     89        index = pp_hash(name);
     90        if(pp_defines[index] == ppp)
     91        {
     92                pp_defines[index] = ppp->next;
     93                if(pp_defines[index])
     94                        pp_defines[index]->prev = NULL;
     95        }
     96        else
     97        {
     98                ppp->prev->next = ppp->next;
     99                if(ppp->next)
     100                        ppp->next->prev = ppp->prev;
     101        }
     102        free(ppp);
    103103}
    104104
    105105void add_define(char *text)
    106106{
    107     int len;
    108     char *cptr;
    109     int index = pp_hash(current_define);
    110     struct pp_entry *ppp;
    111     if(pp_lookup(current_define) != NULL)
    112     {
    113         if(pedantic)
    114             yywarning("Redefinition of %s", current_define);
    115         del_define(current_define);
    116     }
    117     ppp = (struct pp_entry *)xmalloc(sizeof(struct pp_entry));
    118     ppp->ident = current_define;
    119     ppp->subst = xstrdup(text);
    120     ppp->next = pp_defines[index];
    121     pp_defines[index] = ppp;
    122     if(ppp->next)
    123         ppp->next->prev = ppp;
    124     /* Strip trailing white space from subst text */
    125     len = strlen(ppp->subst);
    126     while(len && strchr(" \t\r\n", ppp->subst[len-1]))
    127     {
    128         ppp->subst[--len] = '\0';
    129     }
    130     /* Strip leading white space from subst text */
    131     for(cptr = ppp->subst; *cptr && strchr(" \t\r", *cptr); cptr++)
    132         ;
    133     if(ppp->subst != cptr)
    134         memmove(ppp->subst, cptr, strlen(cptr)+1);
    135     if(yydebug)
    136         printf("Added (%s, %d) <%s> to <%s>\n", input_name, line_number, ppp->ident, ppp->subst);
     107        int len;
     108        char *cptr;
     109        int index = pp_hash(current_define);
     110        struct pp_entry *ppp;
     111        if(pp_lookup(current_define) != NULL)
     112        {
     113                if(pedantic)
     114                        yywarning("Redefinition of %s", current_define);
     115                del_define(current_define);
     116        }
     117        ppp = (struct pp_entry *)xmalloc(sizeof(struct pp_entry));
     118        ppp->ident = current_define;
     119        ppp->subst = xstrdup(text);
     120        ppp->next = pp_defines[index];
     121        pp_defines[index] = ppp;
     122        if(ppp->next)
     123                ppp->next->prev = ppp;
     124        /* Strip trailing white space from subst text */
     125        len = strlen(ppp->subst);
     126        while(len && strchr(" \t\r\n", ppp->subst[len-1]))
     127        {
     128                ppp->subst[--len] = '\0';
     129        }
     130        /* Strip leading white space from subst text */
     131        for(cptr = ppp->subst; *cptr && strchr(" \t\r", *cptr); cptr++)
     132                ;
     133        if(ppp->subst != cptr)
     134                memmove(ppp->subst, cptr, strlen(cptr)+1);
     135        if(yydebug)
     136                printf("Added (%s, %d) <%s> to <%s>\n", input_name, line_number, ppp->ident, ppp->subst);
    137137}
    138138
    139139void add_cmdline_define(char *set)
    140140{
    141     char *cpy = xstrdup(set);   /* Because gcc passes a R/O string */
    142     char *cptr = strchr(cpy, '=');
    143     if(cptr)
    144         *cptr = '\0';
    145     set_define(cpy);
    146     add_define(cptr ? cptr+1 : "");
    147     free(cpy);
    148 }
    149 
    150 #if defined(_Windows) || defined(__MSDOS__) || defined(__WIN32OS2__)
    151 #define INCLUDESEPARATOR    ";"
     141        char *cpy = xstrdup(set);       /* Because gcc passes a R/O string */
     142        char *cptr = strchr(cpy, '=');
     143        if(cptr)
     144                *cptr = '\0';
     145        set_define(cpy);
     146        add_define(cptr ? cptr+1 : "");
     147        free(cpy);
     148}
     149
     150#if defined(_Windows) || defined(__MSDOS__)
     151#define INCLUDESEPARATOR        ";"
    152152#else
    153 #define INCLUDESEPARATOR    ":"
     153#define INCLUDESEPARATOR        ":"
    154154#endif
    155155
     
    159159void add_include_path(char *path)
    160160{
    161     char *tok;
    162     char *cpy = xstrdup(path);
    163 
    164     tok = strtok(cpy, INCLUDESEPARATOR);
    165     while(tok)
    166     {
    167         char *dir;
    168         char *cptr;
    169         if(strlen(tok) == 0)
    170             continue;
    171         dir = xstrdup(tok);
    172         for(cptr = dir; *cptr; cptr++)
    173         {
    174             /* Convert to forward slash */
    175             if(*cptr == '\\')
    176                 *cptr = '/';
    177         }
    178         /* Kill eventual trailing '/' */
    179         if(*(cptr = dir + strlen(dir)-1) == '/')
    180             *cptr = '\0';
    181 
    182         /* Add to list */
    183         nincludepath++;
    184         includepath = (char **)xrealloc(includepath, nincludepath * sizeof(*includepath));
    185         includepath[nincludepath-1] = dir;
    186         tok = strtok(NULL, INCLUDESEPARATOR);
    187     }
    188     free(cpy);
     161        char *tok;
     162        char *cpy = xstrdup(path);
     163
     164        tok = strtok(cpy, INCLUDESEPARATOR);
     165        while(tok)
     166        {
     167                char *dir;
     168                char *cptr;
     169                if(strlen(tok) == 0)
     170                        continue;
     171                dir = xstrdup(tok);
     172                for(cptr = dir; *cptr; cptr++)
     173                {
     174                        /* Convert to forward slash */
     175                        if(*cptr == '\\')
     176                                *cptr = '/';
     177                }
     178                /* Kill eventual trailing '/' */
     179                if(*(cptr = dir + strlen(dir)-1) == '/')
     180                        *cptr = '\0';
     181
     182                /* Add to list */
     183                nincludepath++;
     184                includepath = (char **)xrealloc(includepath, nincludepath * sizeof(*includepath));
     185                includepath[nincludepath-1] = dir;
     186                tok = strtok(NULL, INCLUDESEPARATOR);
     187        }
     188        free(cpy);
    189189}
    190190
    191191FILE *open_include(const char *name, int search)
    192192{
    193     char *cpy = xstrdup(name);
    194     char *cptr;
    195     FILE *fp;
    196     int i;
    197 
    198     for(cptr = cpy; *cptr; cptr++)
    199     {
    200         /* kill double backslash */
    201         if(*cptr == '\\' && *(cptr+1) == '\\')
    202             memmove(cptr, cptr+1, strlen(cptr));
    203         /* Convert to forward slash */
    204         if(*cptr == '\\')
    205             *cptr = '/';
    206     }
    207 
    208     if(search)
    209     {
    210         /* Search current dir and then -I path */
    211         fp = fopen(name, "rt");
    212         if(fp)
    213         {
    214             if(yydebug)
    215                 printf("Going to include <%s>\n", name);
    216             free(cpy);
    217             return fp;
    218         }
    219     }
    220     /* Search -I path */
    221     for(i = 0; i < nincludepath; i++)
    222     {
    223         char *path;
    224         path = (char *)xmalloc(strlen(includepath[i]) + strlen(cpy) + 2);
    225         strcpy(path, includepath[i]);
    226         strcat(path, "/");
    227         strcat(path, cpy);
    228         fp = fopen(path, "rt");
    229         if(fp && yydebug)
    230             printf("Going to include <%s>\n", path);
    231         free(path);
    232         if(fp)
    233         {
    234             free(cpy);
    235             return fp;
    236         }
    237 
    238     }
    239     free(cpy);
    240     return NULL;
     193        char *cpy = xstrdup(name);
     194        char *cptr;
     195        FILE *fp;
     196        int i;
     197
     198        for(cptr = cpy; *cptr; cptr++)
     199        {
     200                /* kill double backslash */
     201                if(*cptr == '\\' && *(cptr+1) == '\\')
     202                        memmove(cptr, cptr+1, strlen(cptr));
     203                /* Convert to forward slash */
     204                if(*cptr == '\\')
     205                        *cptr = '/';
     206        }
     207
     208        if(search)
     209        {
     210                /* Search current dir and then -I path */
     211                fp = fopen(name, "rt");
     212                if(fp)
     213                {
     214                        if(yydebug)
     215                                printf("Going to include <%s>\n", name);
     216                        free(cpy);
     217                        return fp;
     218                }
     219        }
     220        /* Search -I path */
     221        for(i = 0; i < nincludepath; i++)
     222        {
     223                char *path;
     224                path = (char *)xmalloc(strlen(includepath[i]) + strlen(cpy) + 2);
     225                strcpy(path, includepath[i]);
     226                strcat(path, "/");
     227                strcat(path, cpy);
     228                fp = fopen(path, "rt");
     229                if(fp && yydebug)
     230                        printf("Going to include <%s>\n", path);
     231                free(path);
     232                if(fp)
     233                {
     234                        free(cpy);
     235                        return fp;
     236                }
     237
     238        }
     239        free(cpy);
     240        return NULL;
    241241}
    242242
    243243void push_if(int truecase, int wastrue, int nevertrue)
    244244{
    245     if(ifstackidx >= MAXIFSTACK-1)
    246         internal_error(__FILE__, __LINE__, "#if stack overflow");
    247     ifstack[ifstackidx].current = truecase && !wastrue;
    248     ifstack[ifstackidx].hasbeentrue = wastrue;
    249     ifstack[ifstackidx].nevertrue = nevertrue;
    250     if(nevertrue || !(truecase && !wastrue))
    251         set_pp_ignore(1);
    252     if(yydebug)
    253         printf("push_if: %d %d %d (%d %d %d)\n",
    254             truecase,
    255             wastrue,
    256             nevertrue,
    257             ifstack[ifstackidx].current,
    258             ifstack[ifstackidx].hasbeentrue,
    259             ifstack[ifstackidx].nevertrue);
    260     ifstackidx++;
     245        if(ifstackidx >= MAXIFSTACK-1)
     246                internal_error(__FILE__, __LINE__, "#if stack overflow");
     247        ifstack[ifstackidx].current = truecase && !wastrue;
     248        ifstack[ifstackidx].hasbeentrue = wastrue;
     249        ifstack[ifstackidx].nevertrue = nevertrue;
     250        if(nevertrue || !(truecase && !wastrue))
     251                set_pp_ignore(1);
     252        if(yydebug)
     253                printf("push_if: %d %d %d (%d %d %d)\n",
     254                        truecase,
     255                        wastrue,
     256                        nevertrue,
     257                        ifstack[ifstackidx].current,
     258                        ifstack[ifstackidx].hasbeentrue,
     259                        ifstack[ifstackidx].nevertrue);
     260        ifstackidx++;
    261261}
    262262
    263263int pop_if(void)
    264264{
    265     if(ifstackidx <= 0)
    266         yyerror("#endif without #if|#ifdef|#ifndef (#if stack underflow)");
    267     ifstackidx--;
    268     if(yydebug)
    269         printf("pop_if: %d %d %d\n",
    270             ifstack[ifstackidx].current,
    271             ifstack[ifstackidx].hasbeentrue,
    272             ifstack[ifstackidx].nevertrue);
    273     if(ifstack[ifstackidx].nevertrue || !ifstack[ifstackidx].current)
    274         set_pp_ignore(0);
    275     return ifstack[ifstackidx].hasbeentrue || ifstack[ifstackidx].current;
     265        if(ifstackidx <= 0)
     266                yyerror("#endif without #if|#ifdef|#ifndef (#if stack underflow)");
     267        ifstackidx--;
     268        if(yydebug)
     269                printf("pop_if: %d %d %d\n",
     270                        ifstack[ifstackidx].current,
     271                        ifstack[ifstackidx].hasbeentrue,
     272                        ifstack[ifstackidx].nevertrue);
     273        if(ifstack[ifstackidx].nevertrue || !ifstack[ifstackidx].current)
     274                set_pp_ignore(0);
     275        return ifstack[ifstackidx].hasbeentrue || ifstack[ifstackidx].current;
    276276}
    277277
    278278int isnevertrue_if(void)
    279279{
    280     return ifstackidx > 0 && ifstack[ifstackidx-1].nevertrue;
    281 }
    282 
     280        return ifstackidx > 0 && ifstack[ifstackidx-1].nevertrue;
     281}
     282
  • trunk/tools/wrc/wrc.c

    r882 r3426  
    4040#include <assert.h>
    4141#include <ctype.h>
    42 
    43 #include "resource.h"   /* For HAVE_WINE_CONSTRUCTOR */
    4442
    4543#include "wrc.h"
     
    393391        }
    394392
    395 #if !defined(HAVE_WINE_CONSTRUCTOR)
    396         if(auto_register)
    397         {
    398                 warning("Autoregister code non-operable (HAVE_WINE_CONSTRUCTOR not defined)");
    399                 auto_register = 0;
    400         }
    401 #endif
    402 
    403393        /* Set alignment power */
    404394        a = alignment;
  • trunk/tools/wrc/wrc.h

    r882 r3426  
    1010
    1111#ifndef __WRC_WRCTYPES_H
    12 #include "odin.h"
    1312#include "wrctypes.h"
    14 #include "ver.h"
    1513#endif
    1614
     15//ifdef __WIN32OS2__
    1716#define strcasecmp stricmp
    1817
    19 #define WRC_VERSION     "1.0.14"
    20 #define WRC_RELEASEDATE "(08-Aug-1999)"
     18#define WRC_VERSION     "1.0.18"
     19#define WRC_RELEASEDATE "(28-Dec-1999)"
    2120#define WRC_FULLVERSION WRC_VERSION " " WRC_RELEASEDATE
    2221
  • trunk/tools/wrc/wrctypes.h

    r882 r3426  
    111111        int             italic;
    112112} font_id_t;
     113
     114/* control styles */
     115typedef struct style {
     116        DWORD                   or_mask;
     117        DWORD                   and_mask;
     118} style_t;
    113119
    114120/* resource types */
     
    172178        int             width;          /* Size */
    173179        int             height;
    174         DWORD           style;          /* Style */
    175         DWORD           exstyle;
     180        style_t         *style;         /* Style */
     181        style_t         *exstyle;
    176182        DWORD           helpid;         /* EX: */
    177183        int             gotstyle;       /* Used to determine whether the default */
     
    187193        int             width;          /* Size */
    188194        int             height;
    189         DWORD           style;          /* Style */
    190         DWORD           exstyle;
     195        style_t         *style;         /* Style */
     196        style_t         *exstyle;
    191197        int             gotstyle;       /* Used to determine whether the default */
    192198        int             gotexstyle;     /* styles must be set */
     
    206212        int             width;          /* Size */
    207213        int             height;
    208         DWORD           style;          /* Style */
    209         DWORD           exstyle;
     214        style_t         *style;         /* Style */
     215        style_t         *exstyle;
    210216        DWORD           helpid;         /* EX: */
    211217        int             gotstyle;       /* Used to determine whether the default */
     
    530536
    531537typedef struct style_pair {
    532         int                     style;
    533         int                     exstyle;
     538        style_t                 *style;
     539        style_t                 *exstyle;
    534540} style_pair_t;
    535541
  • trunk/tools/wrc/writeres.c

    r979 r3426  
    66 */
    77
    8 /*******************************************************************************
    9 *   Defined Constants And Macros                                               *
    10 *******************************************************************************/
     8#include "config.h"
     9
     10#include <stdio.h>
     11#include <stdlib.h>
     12#include <string.h>
     13#include <assert.h>
     14#include <time.h>
     15
     16#include "wrc.h"
     17#include "writeres.h"
     18#include "genres.h"
     19#include "newstruc.h"
     20#include "utils.h"
     21
     22#ifdef NEED_UNDERSCORE_PREFIX
     23char Underscore[] = "_";
     24#else
     25char Underscore[] = "";
     26#endif
     27
    1128#define MASM 1
    1229#ifdef MASM
     
    2340    #define COMMENT_LINE    ";"
    2441    #define OR              "or"
     42char s_file_head_str[] =
     43        ";/* This file is generated with wrc version " WRC_FULLVERSION ". Do not edit! */\n"
     44        ";/* Source : %s */\n"
     45        ";/* Cmdline: %s */\n"
     46        ";/* Date   : %s */\n"
     47        "\n"
     48        "\t.386p\n"
     49        "\t.model flat\n"
     50        "\t.data\n"
     51        "\n"
     52        ;
     53
     54char s_file_tail_str[] =
     55        "\tend\n"
     56        ";/* <eof> */\n"
     57        "\n"
     58        ;
     59
    2560#else
    2661    #define DIRECTIVE_BYTE  ".byte"
     
    3671    #define COMMENT_LINE
    3772    #define OR              "|"
     73
     74char s_file_head_str[] =
     75        "/* This file is generated with wrc version " WRC_FULLVERSION ". Do not edit! */\n"
     76        "/* Source : %s */\n"
     77        "/* Cmdline: %s */\n"
     78        "/* Date   : %s */\n"
     79        "\n"
     80        "\t.data\n"
     81        "\n"
     82        ;
     83
     84char s_file_tail_str[] =
     85        "/* <eof> */\n"
     86        "\n"
     87        ;
     88
    3889#endif
    3990
    40 /*******************************************************************************
    41 *   Header Files                                                               *
    42 *******************************************************************************/
    43 #include "config.h"
    44 
    45 #include <stdio.h>
    46 #include <stdlib.h>
    47 #include <string.h>
    48 #include <assert.h>
    49 #include <time.h>
    50 
    51 #include "wrc.h"
    52 #include "writeres.h"
    53 #include "genres.h"
    54 #include "newstruc.h"
    55 #include "utils.h"
    56 
     91char s_file_autoreg_str[] =
     92        "\t.text\n"
     93        ".LAuto_Register:\n"
     94        "\tpushl\t$%s%s\n"
    5795#ifdef NEED_UNDERSCORE_PREFIX
    58 char Underscore[] = "_";
     96        "\tcall\t_LIBRES_RegisterResources\n"
    5997#else
    60 char Underscore[] = "";
     98        "\tcall\tLIBRES_RegisterResources\n"
    6199#endif
    62 
    63 char s_file_head_str[] =
    64     COMMENT_LINE"/* This file is generated with wrc version " WRC_FULLVERSION ". Do not edit! */\n"
    65     COMMENT_LINE"/* Source : %s */\n"
    66     COMMENT_LINE"/* Cmdline: %s */\n"
    67     COMMENT_LINE"/* Date   : %s */\n"
    68                 "\n"
    69     #ifdef MASM
    70                 "\t.386p\n"
    71                 "\t.model flat\n"
    72     #endif
    73                 "\t.data\n"
    74                 "\n"
    75     ;
    76 
    77 char s_file_tail_str[] =
    78 #ifdef MASM
    79     "\tend\n"
     100        "\taddl\t$4,%%esp\n"
     101        "\tret\n\n"
     102#ifdef __NetBSD__
     103        ".stabs \"___CTOR_LIST__\",22,0,0,.LAuto_Register\n\n"
    80104#else
    81     "/* <eof> */\n"
    82     "\n"
     105        "\t.section .ctors,\"aw\"\n"
     106        "\t.long\t.LAuto_Register\n\n"
    83107#endif
    84     ;
    85 
    86 char s_file_autoreg_str[] =
    87 #ifdef MASM
    88     ""
    89 #else
    90     "\t.text\n"
    91     LOCAL_PREFIX"LAuto_Register:\n"
    92     "\tpushl\t$%s%s\n"
    93 #ifdef NEED_UNDERSCORE_PREFIX
    94     "\tcall\t_LIBRES_RegisterResources\n"
    95 #else
    96     "\tcall\tLIBRES_RegisterResources\n"
    97 #endif
    98     "\taddl\t$4,%%esp\n"
    99     "\tret\n\n"
    100 #ifdef __NetBSD__
    101     ".stabs \"___CTOR_LIST__\",22,0,0,.LAuto_Register\n\n"
    102 #else
    103     "\t.section .ctors,\"aw\"\n"
    104     "\t"DIRECTIVE_LONG"\t.LAuto_Register\n\n"
    105 #endif
    106 #endif
    107     ;
     108        ;
    108109
    109110char h_file_head_str[] =
    110     "/*\n"
    111     " * This file is generated with wrc version " WRC_FULLVERSION ". Do not edit!\n"
    112     " * Source : %s\n"
    113     " * Cmdline: %s\n"
    114     " * Date   : %s"
    115     " */\n"
     111        "/*\n"
     112        " * This file is generated with wrc version " WRC_FULLVERSION ". Do not edit!\n"
     113        " * Source : %s\n"
     114        " * Cmdline: %s\n"
     115        " * Date   : %s"
     116        " */\n"
    116117        "\n"
    117     "#ifndef __%08lx_H\n"   /* This becomes the date of compile */
    118     "#define __%08lx_H\n"
    119     "\n"
    120     "#include <wrc_rsc.h>\n"
    121     "\n"
    122     ;
     118        "#ifndef __%08lx_H\n"   /* This becomes the date of compile */
     119        "#define __%08lx_H\n"
     120        "\n"
     121        "#include <wrc_rsc.h>\n"
     122        "\n"
     123        ;
    123124
    124125char h_file_tail_str[] =
    125     "#endif\n"
    126     "/* <eof> */\n\n"
    127     ;
     126        "#endif\n"
     127        "/* <eof> */\n\n"
     128        ;
    128129
    129130char _NEResTab[] = "_NEResTab";
     
    132133
    133134/* Variables used for resource sorting */
    134 res_count_t *rcarray = NULL;    /* Type-level count array */
    135 int rccount = 0;        /* Nr of entries in the type-level array */
    136 int n_id_entries = 0;       /* win32 only: Nr of unique ids in the type-level array */
    137 int n_name_entries = 0;     /* win32 only: Nr of unique namess in the type-level array */
    138 
    139 static int direntries;      /* win32 only: Total number of unique resources */
     135res_count_t *rcarray = NULL;    /* Type-level count array */
     136int rccount = 0;                /* Nr of entries in the type-level array */
     137int n_id_entries = 0;           /* win32 only: Nr of unique ids in the type-level array */
     138int n_name_entries = 0;         /* win32 only: Nr of unique namess in the type-level array */
     139
     140static int direntries;          /* win32 only: Total number of unique resources */
    140141
    141142time_t now;
     
    143144/*
    144145 *****************************************************************************
    145  * Function : write_resfile
    146  * Syntax   : void write_resfile(char *outname, resource_t *top)
    147  * Input    :
    148  *  outname - Filename to write to
    149  *  top - The resource-tree to convert
    150  * Output   :
    151  * Description  :
    152  * Remarks  :
     146 * Function     : write_resfile
     147 * Syntax       : void write_resfile(char *outname, resource_t *top)
     148 * Input        :
     149 *      outname - Filename to write to
     150 *      top     - The resource-tree to convert
     151 * Output       :
     152 * Description  :
     153 * Remarks      :
    153154 *****************************************************************************
    154155*/
    155156void write_resfile(char *outname, resource_t *top)
    156157{
    157     FILE *fo;
    158     int ret;
    159     char zeros[3] = {0, 0, 0};
    160 
    161     fo = fopen(outname, "wb");
    162     if(!fo)
    163     {
    164         error("Could not open %s\n", outname);
    165     }
    166 
    167     if(win32)
    168     {
    169         /* Put an empty resource first to signal win32 format */
    170         res_t *res = new_res();
    171         put_dword(res, 0);      /* ResSize */
    172         put_dword(res, 0x00000020); /* HeaderSize */
    173         put_word(res, 0xffff);      /* ResType */
    174         put_word(res, 0);
    175         put_word(res, 0xffff);      /* ResName */
    176         put_word(res, 0);
    177         put_dword(res, 0);      /* DataVersion */
    178         put_word(res, 0);       /* Memory options */
    179         put_word(res, 0);       /* Language */
    180         put_dword(res, 0);      /* Version */
    181         put_dword(res, 0);      /* Charateristics */
    182         ret = fwrite(res->data, 1, res->size, fo);
    183         if(ret != res->size)
    184         {
    185             fclose(fo);
    186             error("Error writing %s", outname);
    187         }
    188         free(res);
    189     }
    190 
    191     for(; top; top = top->next)
    192     {
    193         if(!top->binres)
    194             continue;
    195 
    196         ret = fwrite(top->binres->data, 1, top->binres->size, fo);
    197         if(ret != top->binres->size)
    198         {
    199             fclose(fo);
    200             error("Error writing %s", outname);
    201         }
    202         if(win32 && (top->binres->size & 0x03))
    203         {
    204             /* Write padding */
    205             ret = fwrite(zeros, 1, 4 - (top->binres->size & 0x03), fo);
    206             if(ret != 4 - (top->binres->size & 0x03))
    207             {
    208                 fclose(fo);
    209                 error("Error writing %s", outname);
    210             }
    211         }
    212     }
    213     fclose(fo);
     158        FILE *fo;
     159        int ret;
     160        char zeros[3] = {0, 0, 0};
     161
     162        fo = fopen(outname, "wb");
     163        if(!fo)
     164        {
     165                error("Could not open %s\n", outname);
     166        }
     167
     168        if(win32)
     169        {
     170                /* Put an empty resource first to signal win32 format */
     171                res_t *res = new_res();
     172                put_dword(res, 0);              /* ResSize */
     173                put_dword(res, 0x00000020);     /* HeaderSize */
     174                put_word(res, 0xffff);          /* ResType */
     175                put_word(res, 0);
     176                put_word(res, 0xffff);          /* ResName */
     177                put_word(res, 0);
     178                put_dword(res, 0);              /* DataVersion */
     179                put_word(res, 0);               /* Memory options */
     180                put_word(res, 0);               /* Language */
     181                put_dword(res, 0);              /* Version */
     182                put_dword(res, 0);              /* Charateristics */
     183                ret = fwrite(res->data, 1, res->size, fo);
     184                if(ret != res->size)
     185                {
     186                        fclose(fo);
     187                        error("Error writing %s", outname);
     188                }
     189                free(res);
     190        }
     191
     192        for(; top; top = top->next)
     193        {
     194                if(!top->binres)
     195                        continue;
     196
     197                ret = fwrite(top->binres->data, 1, top->binres->size, fo);
     198                if(ret != top->binres->size)
     199                {
     200                        fclose(fo);
     201                        error("Error writing %s", outname);
     202                }
     203                if(win32 && (top->binres->size & 0x03))
     204                {
     205                        /* Write padding */
     206                        ret = fwrite(zeros, 1, 4 - (top->binres->size & 0x03), fo);
     207                        if(ret != 4 - (top->binres->size & 0x03))
     208                        {
     209                                fclose(fo);
     210                                error("Error writing %s", outname);
     211                        }
     212                }
     213        }
     214        fclose(fo);
    214215}
    215216
    216217/*
    217218 *****************************************************************************
    218  * Function : write_s_res
    219  * Syntax   : void write_s_res(FILE *fp, res_t *res)
    220  * Input    :
    221  * Output   :
    222  * Description  :
    223  * Remarks  :
     219 * Function     : write_s_res
     220 * Syntax       : void write_s_res(FILE *fp, res_t *res)
     221 * Input        :
     222 * Output       :
     223 * Description  :
     224 * Remarks      :
    224225 *****************************************************************************
    225226*/
    226 #define BYTESPERLINE    8
     227#define BYTESPERLINE    8
    227228void write_s_res(FILE *fp, res_t *res)
    228229{
    229     int idx = res->dataidx;
    230     int end = res->size;
    231     int rest = (end - idx) % BYTESPERLINE;
    232     int lines = (end - idx) / BYTESPERLINE;
    233     int i, j;
    234 
    235     for(i = 0 ; i < lines; i++)
    236     {
    237         fprintf(fp, "\t"DIRECTIVE_BYTE"\t");
    238         for(j = 0; j < BYTESPERLINE; j++, idx++)
    239         {
    240             fprintf(fp, BYTEFRMT"%s", res->data[idx] & 0xff,
    241                     j == BYTESPERLINE-1 ? "" : ", ");
    242         }
    243         fprintf(fp, "\n");
    244     }
    245     if(rest)
    246     {
    247         fprintf(fp, "\t"DIRECTIVE_BYTE"\t");
    248         for(j = 0; j < rest; j++, idx++)
    249         {
    250             fprintf(fp, BYTEFRMT"%s", res->data[idx] & 0xff,
    251                     j == rest-1 ? "" : ", ");
    252         }
    253         fprintf(fp, "\n");
    254     }
     230        int idx = res->dataidx;
     231        int end = res->size;
     232        int rest = (end - idx) % BYTESPERLINE;
     233        int lines = (end - idx) / BYTESPERLINE;
     234        int i, j;
     235
     236        for(i = 0 ; i < lines; i++)
     237        {
     238                fprintf(fp, "\t%s\t", DIRECTIVE_BYTE);
     239                for(j = 0; j < BYTESPERLINE; j++, idx++)
     240                {
     241                        fprintf(fp, BYTEFRMT"%s", res->data[idx] & 0xff,
     242                                        j == BYTESPERLINE-1 ? "" : ", ");
     243                }
     244                fprintf(fp, "\n");
     245        }
     246        if(rest)
     247        {
     248                fprintf(fp, "\t%s\t", DIRECTIVE_BYTE);
     249                for(j = 0; j < rest; j++, idx++)
     250                {
     251                        fprintf(fp, BYTEFRMT"%s", res->data[idx] & 0xff,
     252                                        j == rest-1 ? "" : ", ");
     253                }
     254                fprintf(fp, "\n");
     255        }
    255256}
    256257
    257258/*
    258259 *****************************************************************************
    259  * Function : write_name_str
    260  * Syntax   : void write_name_str(FILE *fp, name_id_t *nid)
    261  * Input    :
    262  * Output   :
    263  * Description  :
    264  * Remarks  : One level self recursive for string type conversion
     260 * Function     : write_name_str
     261 * Syntax       : void write_name_str(FILE *fp, name_id_t *nid)
     262 * Input        :
     263 * Output       :
     264 * Description  :
     265 * Remarks      : One level self recursive for string type conversion
    265266 *****************************************************************************
    266267*/
    267268void write_name_str(FILE *fp, name_id_t *nid)
    268269{
    269     res_t res;
    270     assert(nid->type == name_str);
    271 
    272     if(!win32 && nid->name.s_name->type == str_char)
    273     {
    274         res.size = strlen(nid->name.s_name->str.cstr);
    275         if(res.size > 254)
    276             error("Can't write strings larger than 254 bytes");
    277         if(res.size == 0)
    278             internal_error(__FILE__, __LINE__, "Attempt to write empty string");
    279         res.dataidx = 0;
    280         res.data = (char *)xmalloc(res.size + 1);
    281         res.data[0] = (char)res.size;
    282         res.size++; /* We need to write the lenth byte as well */
    283         strcpy(res.data+1, nid->name.s_name->str.cstr);
    284         write_s_res(fp, &res);
    285         free(res.data);
    286     }
    287     else if(!win32 && nid->name.s_name->type == str_unicode)
    288     {
    289         name_id_t lnid;
    290         string_t str;
    291 
    292         lnid.type = name_str;
    293         lnid.name.s_name = &str;
    294         str.type = str_char;
    295         str.str.cstr = dupwstr2cstr(nid->name.s_name->str.wstr);
    296         write_name_str(fp, &lnid);
    297         free(str.str.cstr);
    298     }
    299     else if(win32 && nid->name.s_name->type == str_char)
    300     {
    301         name_id_t lnid;
    302         string_t str;
    303 
    304         lnid.type = name_str;
    305         lnid.name.s_name = &str;
    306         str.type = str_unicode;
    307         str.str.wstr = dupcstr2wstr(nid->name.s_name->str.cstr);
    308         write_name_str(fp, &lnid);
    309         free(str.str.wstr);
    310     }
    311     else  if(win32 && nid->name.s_name->type == str_unicode)
    312     {
    313         res.size = wstrlen(nid->name.s_name->str.wstr);
    314         if(res.size > 65534)
    315             error("Can't write strings larger than 65534 bytes");
    316         if(res.size == 0)
    317             internal_error(__FILE__, __LINE__, "Attempt to write empty string");
    318         res.dataidx = 0;
    319         res.data = (char *)xmalloc((res.size + 1) * 2);
    320         ((short *)res.data)[0] = (short)res.size;
    321         wstrcpy((short *)(res.data+2), nid->name.s_name->str.wstr);
    322         res.size *= 2; /* Function writes bytes, not shorts... */
    323         res.size += 2; /* We need to write the length word as well */
    324         write_s_res(fp, &res);
    325         free(res.data);
    326     }
    327     else
    328     {
    329         internal_error(__FILE__, __LINE__, "Hmm, requested to write a string of unknown type %d",
    330                 nid->name.s_name->type);
    331     }
     270        res_t res;
     271        assert(nid->type == name_str);
     272
     273        if(!win32 && nid->name.s_name->type == str_char)
     274        {
     275                res.size = strlen(nid->name.s_name->str.cstr);
     276                if(res.size > 254)
     277                        error("Can't write strings larger than 254 bytes");
     278                if(res.size == 0)
     279                        internal_error(__FILE__, __LINE__, "Attempt to write empty string");
     280                res.dataidx = 0;
     281                res.data = (char *)xmalloc(res.size + 1);
     282                res.data[0] = (char)res.size;
     283                res.size++;     /* We need to write the lenth byte as well */
     284                strcpy(res.data+1, nid->name.s_name->str.cstr);
     285                write_s_res(fp, &res);
     286                free(res.data);
     287        }
     288        else if(!win32 && nid->name.s_name->type == str_unicode)
     289        {
     290                name_id_t lnid;
     291                string_t str;
     292
     293                lnid.type = name_str;
     294                lnid.name.s_name = &str;
     295                str.type = str_char;
     296                str.str.cstr = dupwstr2cstr(nid->name.s_name->str.wstr);
     297                write_name_str(fp, &lnid);
     298                free(str.str.cstr);
     299        }
     300        else if(win32 && nid->name.s_name->type == str_char)
     301        {
     302                name_id_t lnid;
     303                string_t str;
     304
     305                lnid.type = name_str;
     306                lnid.name.s_name = &str;
     307                str.type = str_unicode;
     308                str.str.wstr = dupcstr2wstr(nid->name.s_name->str.cstr);
     309                write_name_str(fp, &lnid);
     310                free(str.str.wstr);
     311        }
     312        else  if(win32 && nid->name.s_name->type == str_unicode)
     313        {
     314                res.size = wstrlen(nid->name.s_name->str.wstr);
     315                if(res.size > 65534)
     316                        error("Can't write strings larger than 65534 bytes");
     317                if(res.size == 0)
     318                        internal_error(__FILE__, __LINE__, "Attempt to write empty string");
     319                res.dataidx = 0;
     320                res.data = (char *)xmalloc((res.size + 1) * 2);
     321                ((short *)res.data)[0] = (short)res.size;
     322                wstrcpy((short *)(res.data+2), nid->name.s_name->str.wstr);
     323                res.size *= 2; /* Function writes bytes, not shorts... */
     324                res.size += 2; /* We need to write the length word as well */
     325                write_s_res(fp, &res);
     326                free(res.data);
     327        }
     328        else
     329        {
     330                internal_error(__FILE__, __LINE__, "Hmm, requested to write a string of unknown type %d",
     331                                nid->name.s_name->type);
     332        }
    332333}
    333334
    334335/*
    335336 *****************************************************************************
    336  * Function : compare_name_id
    337  * Syntax   : int compare_name_id(name_id_t *n1, name_id_t *n2)
    338  * Input    :
    339  * Output   :
    340  * Description  :
    341  * Remarks  :
     337 * Function     : compare_name_id
     338 * Syntax       : int compare_name_id(name_id_t *n1, name_id_t *n2)
     339 * Input        :
     340 * Output       :
     341 * Description  :
     342 * Remarks      :
    342343 *****************************************************************************
    343344*/
    344345int compare_name_id(name_id_t *n1, name_id_t *n2)
    345346{
    346     if(n1->type == name_ord && n2->type == name_ord)
    347     {
    348         return n1->name.i_name - n2->name.i_name;
    349     }
    350     else if(n1->type == name_str && n2->type == name_str)
    351     {
    352         if(n1->name.s_name->type == str_char
    353         && n2->name.s_name->type == str_char)
    354         {
    355             return strcasecmp(n1->name.s_name->str.cstr, n2->name.s_name->str.cstr);
    356         }
    357         else if(n1->name.s_name->type == str_unicode
    358         && n2->name.s_name->type == str_unicode)
    359         {
    360             return wstricmp(n1->name.s_name->str.wstr, n2->name.s_name->str.wstr);
    361         }
    362         else
    363         {
    364             internal_error(__FILE__, __LINE__, "Can't yet compare strings of mixed type");
    365         }
    366     }
    367     else if(n1->type == name_ord && n2->type == name_str)
    368         return 1;
    369     else if(n1->type == name_str && n2->type == name_ord)
    370         return -1;
    371     else
    372         internal_error(__FILE__, __LINE__, "Comparing name-ids with unknown types (%d, %d)",
    373                 n1->type, n2->type);
    374 
    375     return 0; /* Keep the compiler happy */
     347        if(n1->type == name_ord && n2->type == name_ord)
     348        {
     349                return n1->name.i_name - n2->name.i_name;
     350        }
     351        else if(n1->type == name_str && n2->type == name_str)
     352        {
     353                if(n1->name.s_name->type == str_char
     354                && n2->name.s_name->type == str_char)
     355                {
     356                        return strcasecmp(n1->name.s_name->str.cstr, n2->name.s_name->str.cstr);
     357                }
     358                else if(n1->name.s_name->type == str_unicode
     359                && n2->name.s_name->type == str_unicode)
     360                {
     361                        return wstricmp(n1->name.s_name->str.wstr, n2->name.s_name->str.wstr);
     362                }
     363                else
     364                {
     365                        internal_error(__FILE__, __LINE__, "Can't yet compare strings of mixed type");
     366                }
     367        }
     368        else if(n1->type == name_ord && n2->type == name_str)
     369                return 1;
     370        else if(n1->type == name_str && n2->type == name_ord)
     371                return -1;
     372        else
     373                internal_error(__FILE__, __LINE__, "Comparing name-ids with unknown types (%d, %d)",
     374                                n1->type, n2->type);
     375
     376        return 0; /* Keep the compiler happy */
    376377}
    377378
    378379/*
    379380 *****************************************************************************
    380  * Function : find_counter
    381  * Syntax   : res_count_t *find_counter(name_id_t *type)
    382  * Input    :
    383  * Output   :
    384  * Description  :
    385  * Remarks  :
     381 * Function     : find_counter
     382 * Syntax       : res_count_t *find_counter(name_id_t *type)
     383 * Input        :
     384 * Output       :
     385 * Description  :
     386 * Remarks      :
    386387 *****************************************************************************
    387388*/
    388389res_count_t *find_counter(name_id_t *type)
    389390{
    390     int i;
    391     for(i = 0; i < rccount; i++)
    392     {
    393         if(!compare_name_id(type, &(rcarray[i].type)))
    394             return &rcarray[i];
    395     }
    396     return NULL;
     391        int i;
     392        for(i = 0; i < rccount; i++)
     393        {
     394                if(!compare_name_id(type, &(rcarray[i].type)))
     395                        return &rcarray[i];
     396        }
     397        return NULL;
    397398}
    398399
    399400/*
    400401 *****************************************************************************
    401  * Function : count_resources
    402  * Syntax   : res_count_t *count_resources(resource_t *top)
    403  * Input    :
    404  * Output   :
    405  * Description  :
    406  * Remarks  : The whole lot is converted into arrays because they are
    407  *        easy sortable. Makes the lot almost unreadable, but it
    408  *        works (I hope). Basically you have to keep in mind that
    409  *        the lot is a three-dimensional structure for win32 and a
    410  *        two-dimensional structure for win16.
     402 * Function     : count_resources
     403 * Syntax       : res_count_t *count_resources(resource_t *top)
     404 * Input        :
     405 * Output       :
     406 * Description  :
     407 * Remarks      : The whole lot is converted into arrays because they are
     408 *                easy sortable. Makes the lot almost unreadable, but it
     409 *                works (I hope). Basically you have to keep in mind that
     410 *                the lot is a three-dimensional structure for win32 and a
     411 *                two-dimensional structure for win16.
    411412 *****************************************************************************
    412413*/
    413 #define RCT(v)  (*((resource_t **)(v)))
     414#define RCT(v)  (*((resource_t **)(v)))
    414415/* qsort sorting function */
    415416int sort_name_id(const void *e1, const void *e2)
    416417{
    417     return compare_name_id(RCT(e1)->name, RCT(e2)->name);
     418        return compare_name_id(RCT(e1)->name, RCT(e2)->name);
    418419}
    419420
    420421int sort_language(const void *e1, const void *e2)
    421422{
    422     assert((RCT(e1)->lan) != NULL);
    423     assert((RCT(e2)->lan) != NULL);
    424 
    425     return MAKELANGID(RCT(e1)->lan->id, RCT(e1)->lan->sub)
    426          - MAKELANGID(RCT(e2)->lan->id, RCT(e2)->lan->sub);
     423        assert((RCT(e1)->lan) != NULL);
     424        assert((RCT(e2)->lan) != NULL);
     425
     426        return MAKELANGID(RCT(e1)->lan->id, RCT(e1)->lan->sub)
     427             - MAKELANGID(RCT(e2)->lan->id, RCT(e2)->lan->sub);
    427428}
    428429#undef RCT
    429 #define RCT(v)  ((res_count_t *)(v))
     430#define RCT(v)  ((res_count_t *)(v))
    430431int sort_type(const void *e1, const void *e2)
    431432{
    432     return compare_name_id(&(RCT(e1)->type), &(RCT(e2)->type));
     433        return compare_name_id(&(RCT(e1)->type), &(RCT(e2)->type));
    433434}
    434435#undef RCT
     
    436437void count_resources(resource_t *top)
    437438{
    438     resource_t *rsc;
    439     res_count_t *rcp;
    440     name_id_t nid;
    441     int i, j;
    442 
    443     for(rsc = top; rsc; rsc = rsc->next)
    444     {
    445         if(!rsc->binres)
    446             continue;
    447         switch(rsc->type)
    448         {
    449         case res_dlgex:
    450             nid.name.i_name = WRC_RT_DIALOG;
    451             nid.type = name_ord;
    452             break;
    453         case res_menex:
    454             nid.name.i_name = WRC_RT_MENU;
    455             nid.type = name_ord;
    456             break;
    457         case res_usr:
    458             nid = *(rsc->res.usr->type);
    459             break;
    460         default:
    461             nid.name.i_name = rsc->type;
    462             nid.type = name_ord;
    463         }
    464 
    465         if((rcp = find_counter(&nid)) == NULL)
    466         {
    467             /* Count the number of uniq ids and names */
    468 
    469             if(nid.type == name_ord)
    470                 n_id_entries++;
    471             else
    472                 n_name_entries++;
    473 
    474             if(!rcarray)
    475             {
    476                 rcarray = (res_count_t *)xmalloc(sizeof(res_count_t));
    477                 rccount = 1;
    478                 rcarray[0].count = 1;
    479                 rcarray[0].type = nid;
    480                 rcarray[0].rscarray = (resource_t **)xmalloc(sizeof(resource_t *));
    481                 rcarray[0].rscarray[0] = rsc;
    482             }
    483             else
    484             {
    485                 rccount++;
    486                 rcarray = (res_count_t *)xrealloc(rcarray, rccount * sizeof(res_count_t));
    487                 rcarray[rccount-1].count = 1;
    488                 rcarray[rccount-1].type = nid;
    489                 rcarray[rccount-1].rscarray = (resource_t **)xmalloc(sizeof(resource_t *));
    490                 rcarray[rccount-1].rscarray[0] = rsc;
    491             }
    492         }
    493         else
    494         {
    495             rcp->count++;
    496             rcp->rscarray = (resource_t **)xrealloc(rcp->rscarray, rcp->count * sizeof(resource_t *));
    497             rcp->rscarray[rcp->count-1] = rsc;
    498         }
    499     }
    500 
    501     if(!win32)
    502     {
    503         /* We're done, win16 requires no special sorting */
    504         return;
    505     }
    506 
    507     /* We now have a unsorted list of types with an array of res_count_t
    508     * in rcarray[0..rccount-1]. And we have names of one type in the
    509     * rcarray[x].rsc[0..rcarray[x].count-1] arrays.
    510     * The list needs to be sorted for win32's top level tree structure.
    511     */
    512 
    513     /* Sort the types */
    514     if(rccount > 1)
    515         qsort(rcarray, rccount, sizeof(rcarray[0]), sort_type);
    516 
    517     /* Now sort the name-id arrays */
    518     for(i = 0; i < rccount; i++)
    519     {
    520         if(rcarray[i].count > 1)
    521             qsort(rcarray[i].rscarray, rcarray[i].count, sizeof(rcarray[0].rscarray[0]), sort_name_id);
    522     }
    523 
    524     /* Now split the name-id arrays into name/language
    525     * subs. Don't look at the awfull expressions...
    526     * We do this by taking the array elements out of rscarray and putting
    527     * together a new array in rsc32array.
    528     */
    529     for(i = 0; i < rccount; i++)
    530     {
    531         res_count_t *rcap;
    532 
    533         assert(rcarray[i].count >= 1);
    534 
    535         /* rcap points to the current type we are dealing with */
    536         rcap = &(rcarray[i]);
    537 
    538         /* Insert the first name-id */
    539         rcap->rsc32array = (res32_count_t *)xmalloc(sizeof(res32_count_t));
    540         rcap->count32 = 1;
    541         rcap->rsc32array[0].rsc = (resource_t **)xmalloc(sizeof(resource_t *));
    542         rcap->rsc32array[0].count = 1;
    543         rcap->rsc32array[0].rsc[0] = rcap->rscarray[0];
    544         if(rcap->rscarray[0]->name->type == name_ord)
    545         {
    546             rcap->n_id_entries = 1;
    547             rcap->n_name_entries = 0;
    548         }
    549         else
    550         {
    551             rcap->n_id_entries = 0;
    552             rcap->n_name_entries = 1;
    553         }
    554 
    555         /* Now loop over the resting resources of the current type
    556         * to find duplicate names (which should have different
    557         * languages).
    558         */
    559         for(j = 1; j < rcap->count; j++)
    560         {
    561             res32_count_t *r32cp;
    562 
    563             /* r32cp points to the current res32_count structure
    564             * that holds the resource name we are processing.
    565             */
    566             r32cp = &(rcap->rsc32array[rcap->count32-1]);
    567 
    568             if(!compare_name_id(r32cp->rsc[0]->name, rcarray[i].rscarray[j]->name))
    569             {
    570                 /* Names are the same, add to list */
    571                 r32cp->count++;
    572                 r32cp->rsc = (resource_t **)xrealloc(r32cp->rsc, r32cp->count * sizeof(resource_t *));
    573                 r32cp->rsc[r32cp->count-1] = rcap->rscarray[j];
    574             }
    575             else
    576             {
    577                 /* New name-id, sort the old one by
    578                 * language and create new list
    579                 */
    580                 if(r32cp->count > 1)
    581                     qsort(r32cp->rsc, r32cp->count, sizeof(r32cp->rsc[0]), sort_language);
    582                 rcap->count32++;
    583                 rcap->rsc32array = (res32_count_t*)xrealloc(rcap->rsc32array, rcap->count32 * sizeof(res32_count_t));
    584                 rcap->rsc32array[rcap->count32-1].rsc = (resource_t **)xmalloc(sizeof(resource_t *));
    585                 rcap->rsc32array[rcap->count32-1].count = 1;
    586                 rcap->rsc32array[rcap->count32-1].rsc[0] = rcap->rscarray[j];
    587 
    588                 if(rcap->rscarray[j]->name->type == name_ord)
    589                     rcap->n_id_entries++;
    590                 else
    591                     rcap->n_name_entries++;
    592             }
    593         }
    594         /* Also sort the languages of the last name group */
    595         if(rcap->rsc32array[rcap->count32-1].count > 1)
    596             qsort(rcap->rsc32array[rcap->count32-1].rsc,
    597                   rcap->rsc32array[rcap->count32-1].count,
    598                   sizeof(rcap->rsc32array[rcap->count32-1].rsc[0]),
    599                   sort_language);
    600     }
     439        resource_t *rsc;
     440        res_count_t *rcp;
     441        name_id_t nid;
     442        int i, j;
     443
     444        for(rsc = top; rsc; rsc = rsc->next)
     445        {
     446                if(!rsc->binres)
     447                        continue;
     448                switch(rsc->type)
     449                {
     450                case res_dlgex:
     451                        nid.name.i_name = WRC_RT_DIALOG;
     452                        nid.type = name_ord;
     453                        break;
     454                case res_menex:
     455                        nid.name.i_name = WRC_RT_MENU;
     456                        nid.type = name_ord;
     457                        break;
     458                case res_usr:
     459                        nid = *(rsc->res.usr->type);
     460                        break;
     461                default:
     462                        nid.name.i_name = rsc->type;
     463                        nid.type = name_ord;
     464                }
     465
     466                if((rcp = find_counter(&nid)) == NULL)
     467                {
     468                        /* Count the number of uniq ids and names */
     469
     470                        if(nid.type == name_ord)
     471                                n_id_entries++;
     472                        else
     473                                n_name_entries++;
     474
     475                        if(!rcarray)
     476                        {
     477                                rcarray = (res_count_t *)xmalloc(sizeof(res_count_t));
     478                                rccount = 1;
     479                                rcarray[0].count = 1;
     480                                rcarray[0].type = nid;
     481                                rcarray[0].rscarray = (resource_t **)xmalloc(sizeof(resource_t *));
     482                                rcarray[0].rscarray[0] = rsc;
     483                        }
     484                        else
     485                        {
     486                                rccount++;
     487                                rcarray = (res_count_t *)xrealloc(rcarray, rccount * sizeof(res_count_t));
     488                                rcarray[rccount-1].count = 1;
     489                                rcarray[rccount-1].type = nid;
     490                                rcarray[rccount-1].rscarray = (resource_t **)xmalloc(sizeof(resource_t *));
     491                                rcarray[rccount-1].rscarray[0] = rsc;
     492                        }
     493                }
     494                else
     495                {
     496                        rcp->count++;
     497                        rcp->rscarray = (resource_t **)xrealloc(rcp->rscarray, rcp->count * sizeof(resource_t *));
     498                        rcp->rscarray[rcp->count-1] = rsc;
     499                }
     500        }
     501
     502        if(!win32)
     503        {
     504                /* We're done, win16 requires no special sorting */
     505                return;
     506        }
     507
     508        /* We now have a unsorted list of types with an array of res_count_t
     509        * in rcarray[0..rccount-1]. And we have names of one type in the
     510        * rcarray[x].rsc[0..rcarray[x].count-1] arrays.
     511        * The list needs to be sorted for win32's top level tree structure.
     512        */
     513
     514        /* Sort the types */
     515        if(rccount > 1)
     516                qsort(rcarray, rccount, sizeof(rcarray[0]), sort_type);
     517
     518        /* Now sort the name-id arrays */
     519        for(i = 0; i < rccount; i++)
     520        {
     521                if(rcarray[i].count > 1)
     522                        qsort(rcarray[i].rscarray, rcarray[i].count, sizeof(rcarray[0].rscarray[0]), sort_name_id);
     523        }
     524
     525        /* Now split the name-id arrays into name/language
     526        * subs. Don't look at the awfull expressions...
     527        * We do this by taking the array elements out of rscarray and putting
     528        * together a new array in rsc32array.
     529        */
     530        for(i = 0; i < rccount; i++)
     531        {
     532                res_count_t *rcap;
     533
     534                assert(rcarray[i].count >= 1);
     535
     536                /* rcap points to the current type we are dealing with */
     537                rcap = &(rcarray[i]);
     538
     539                /* Insert the first name-id */
     540                rcap->rsc32array = (res32_count_t *)xmalloc(sizeof(res32_count_t));
     541                rcap->count32 = 1;
     542                rcap->rsc32array[0].rsc = (resource_t **)xmalloc(sizeof(resource_t *));
     543                rcap->rsc32array[0].count = 1;
     544                rcap->rsc32array[0].rsc[0] = rcap->rscarray[0];
     545                if(rcap->rscarray[0]->name->type == name_ord)
     546                {
     547                        rcap->n_id_entries = 1;
     548                        rcap->n_name_entries = 0;
     549                }
     550                else
     551                {
     552                        rcap->n_id_entries = 0;
     553                        rcap->n_name_entries = 1;
     554                }
     555
     556                /* Now loop over the resting resources of the current type
     557                * to find duplicate names (which should have different
     558                * languages).
     559                */
     560                for(j = 1; j < rcap->count; j++)
     561                {
     562                        res32_count_t *r32cp;
     563
     564                        /* r32cp points to the current res32_count structure
     565                        * that holds the resource name we are processing.
     566                        */
     567                        r32cp = &(rcap->rsc32array[rcap->count32-1]);
     568
     569                        if(!compare_name_id(r32cp->rsc[0]->name, rcarray[i].rscarray[j]->name))
     570                        {
     571                                /* Names are the same, add to list */
     572                                r32cp->count++;
     573                                r32cp->rsc = (resource_t **)xrealloc(r32cp->rsc, r32cp->count * sizeof(resource_t *));
     574                                r32cp->rsc[r32cp->count-1] = rcap->rscarray[j];
     575                        }
     576                        else
     577                        {
     578                                /* New name-id, sort the old one by
     579                                * language and create new list
     580                                */
     581                                if(r32cp->count > 1)
     582                                        qsort(r32cp->rsc, r32cp->count, sizeof(r32cp->rsc[0]), sort_language);
     583                                rcap->count32++;
     584                                rcap->rsc32array = (res32_count_t*)xrealloc(rcap->rsc32array, rcap->count32 * sizeof(res32_count_t));
     585                                rcap->rsc32array[rcap->count32-1].rsc = (resource_t **)xmalloc(sizeof(resource_t *));
     586                                rcap->rsc32array[rcap->count32-1].count = 1;
     587                                rcap->rsc32array[rcap->count32-1].rsc[0] = rcap->rscarray[j];
     588
     589                                if(rcap->rscarray[j]->name->type == name_ord)
     590                                        rcap->n_id_entries++;
     591                                else
     592                                        rcap->n_name_entries++;
     593                        }
     594                }
     595                /* Also sort the languages of the last name group */
     596                if(rcap->rsc32array[rcap->count32-1].count > 1)
     597                        qsort(rcap->rsc32array[rcap->count32-1].rsc,
     598                              rcap->rsc32array[rcap->count32-1].count,
     599                              sizeof(rcap->rsc32array[rcap->count32-1].rsc[0]),
     600                              sort_language);
     601        }
    601602}
    602603
    603604/*
    604605 *****************************************************************************
    605  * Function : write_pe_segment
    606  * Syntax   : void write_pe_segment(FILE *fp, resource_t *top)
    607  * Input    :
    608  * Output   :
    609  * Description  :
    610  * Remarks  :
     606 * Function     : write_pe_segment
     607 * Syntax       : void write_pe_segment(FILE *fp, resource_t *top)
     608 * Input        :
     609 * Output       :
     610 * Description  :
     611 * Remarks      :
    611612 *****************************************************************************
    612613*/
    613614void write_pe_segment(FILE *fp, resource_t *top)
    614615{
    615     int i;
    616 
    617     fprintf(fp, "\t"DIRECTIVE_ALIGN"\t4\n");
    618     fprintf(fp, "%s%s:\n", prefix, _PEResTab);
    619     fprintf(fp, "\t"DIRECTIVE_GLOBAL"\t%s%s\n", prefix, _PEResTab);
    620     /* Flags */
    621     fprintf(fp, "\t"DIRECTIVE_LONG"\t0\n");
    622     /* Time/Date stamp */
    623     fprintf(fp, "\t"DIRECTIVE_LONG"\t"LONGFRMT"\n", (long)now);
    624     /* Version */
    625     fprintf(fp, "\t"DIRECTIVE_LONG"\t0\n");    /* FIXME: must version be filled out? */
    626     /* # of id entries, # of name entries */
    627     fprintf(fp, "\t"DIRECTIVE_WORD"\t%d, %d\n", n_name_entries, n_id_entries);
    628 
    629     /* Write the type level of the tree */
    630     for(i = 0; i < rccount; i++)
    631     {
    632         res_count_t *rcp;
    633         char *label;
    634 
    635         rcp = &rcarray[i];
    636 
    637         /* TypeId */
    638         if(rcp->type.type == name_ord)
    639             fprintf(fp, "\t"DIRECTIVE_LONG"\t%d\n", rcp->type.name.i_name);
    640         else
    641         {
    642             char *name = prep_nid_for_label(&(rcp->type));
    643             fprintf(fp, "\t"DIRECTIVE_LONG"\t(%s_%s_typename - %s%s) "OR" "HEXBIT31"\n",
    644                 prefix,
    645                 name,
    646                 prefix,
    647                 _PEResTab);
    648         }
    649         /* Offset */
    650         label = prep_nid_for_label(&(rcp->type));
    651         fprintf(fp, "\t"DIRECTIVE_LONG"\t("LOCAL_PREFIX"L%s - %s%s) "OR" "HEXBIT31"\n",
    652             label,
    653             prefix,
    654             _PEResTab);
    655     }
    656 
    657     /* Write the name level of the tree */
    658 
    659     for(i = 0; i < rccount; i++)
    660     {
    661         res_count_t *rcp;
    662         char *typelabel;
    663         char *namelabel;
    664         int j;
    665 
    666         rcp = &rcarray[i];
    667 
    668         typelabel = xstrdup(prep_nid_for_label(&(rcp->type)));
    669         fprintf(fp, LOCAL_PREFIX"L%s:\n", typelabel);
    670 
    671         fprintf(fp, "\t"DIRECTIVE_LONG"\t0\n");        /* Flags */
    672         fprintf(fp, "\t"DIRECTIVE_LONG"\t"LONGFRMT"\n", (long)now);   /* TimeDate */
    673         fprintf(fp, "\t"DIRECTIVE_LONG"\t0\n");    /* FIXME: must version be filled out? */
    674         fprintf(fp, "\t"DIRECTIVE_WORD"\t%d, %d\n", rcp->n_name_entries, rcp->n_id_entries);
    675         for(j = 0; j < rcp->count32; j++)
    676         {
    677             resource_t *rsc = rcp->rsc32array[j].rsc[0];
    678             /* NameId */
    679             if(rsc->name->type == name_ord)
    680                 fprintf(fp, "\t"DIRECTIVE_LONG"\t%d\n", rsc->name->name.i_name);
    681             else
    682             {
    683                 char *label = prep_nid_for_label(rsc->name);
    684                 fprintf(fp, "\t"DIRECTIVE_LONG"\t(%s_%d_%s_name - %s%s) "OR" "HEXBIT31"\n",
    685                     prefix,
    686                     rsc->type,
    687                     label,
    688                     prefix,
    689                     _PEResTab);
    690             }
    691             /* Maybe FIXME: Unescape the tree (ommit 0x80000000) and
    692              * put the offset to the resource data entry.
    693              * ?? Is unescaping worth while ??
    694              */
    695             /* Offset */
    696             namelabel = prep_nid_for_label(rsc->name);
    697             fprintf(fp, "\t"DIRECTIVE_LONG"\t("LOCAL_PREFIX"L%s_%s - %s%s) "OR" "HEXBIT31"\n",
    698                 typelabel,
    699                 namelabel,
    700                 prefix,
    701                 _PEResTab);
    702         }
    703         free(typelabel);
    704     }
    705 
    706     /* Write the language level of the tree */
    707 
    708     for(i = 0; i < rccount; i++)
    709     {
    710         res_count_t *rcp;
    711         char *namelabel;
    712         char *typelabel;
    713         int j;
    714 
    715         rcp = &rcarray[i];
    716         typelabel = xstrdup(prep_nid_for_label(&(rcp->type)));
    717 
    718         for(j = 0; j < rcp->count32; j++)
    719         {
    720             res32_count_t *r32cp = &(rcp->rsc32array[j]);
    721             int k;
    722 
    723             namelabel = xstrdup(prep_nid_for_label(r32cp->rsc[0]->name));
    724             fprintf(fp, LOCAL_PREFIX"L%s_%s:\n", typelabel, namelabel);
    725 
    726             fprintf(fp, "\t"DIRECTIVE_LONG"\t0\n");        /* Flags */
    727             fprintf(fp, "\t"DIRECTIVE_LONG"\t"LONGFRMT"\n", (long)now);   /* TimeDate */
    728             fprintf(fp, "\t"DIRECTIVE_LONG"\t0\n");    /* FIXME: must version be filled out? */
    729             fprintf(fp, "\t"DIRECTIVE_WORD"\t0, %d\n", r32cp->count);
    730 
    731             for(k = 0; k < r32cp->count; k++)
    732             {
    733                 resource_t *rsc = r32cp->rsc[k];
    734                 assert(rsc->lan != NULL);
    735                 /* LanguageId */
    736                 fprintf(fp, "\t"DIRECTIVE_LONG"\t"LONGFRMT"\n", rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0);
    737                 /* Offset */
    738                 fprintf(fp, "\t"DIRECTIVE_LONG"\t"LOCAL_PREFIX"L%s_%s_%d - %s%s\n",
    739                     typelabel,
    740                     namelabel,
    741                     rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0,
    742                     prefix,
    743                     _PEResTab);
    744             }
    745             free(namelabel);
    746         }
    747         free(typelabel);
    748     }
    749 
    750     /* Write the resource table itself */
    751     fprintf(fp, "%s_ResourceDirectory:\n", prefix);
    752     fprintf(fp, "\t"DIRECTIVE_GLOBAL"\t%s_ResourceDirectory\n", prefix);
    753     direntries = 0;
    754 
    755     for(i = 0; i < rccount; i++)
    756     {
    757         res_count_t *rcp;
    758         char *namelabel;
    759         char *typelabel;
    760         int j;
    761 
    762         rcp = &rcarray[i];
    763         typelabel = xstrdup(prep_nid_for_label(&(rcp->type)));
    764 
    765         for(j = 0; j < rcp->count32; j++)
    766         {
    767             res32_count_t *r32cp = &(rcp->rsc32array[j]);
    768             int k;
    769 
    770             namelabel = xstrdup(prep_nid_for_label(r32cp->rsc[0]->name));
    771 
    772             for(k = 0; k < r32cp->count; k++)
    773             {
    774                 resource_t *rsc = r32cp->rsc[k];
    775 
    776                 assert(rsc->lan != NULL);
    777 
    778                 fprintf(fp, LOCAL_PREFIX"L%s_%s_%d:\n",
    779                     typelabel,
    780                     namelabel,
    781                     rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0);
    782 
    783                 /* Data RVA */
    784                 fprintf(fp, "\t"DIRECTIVE_LONG"\t%s%s_data - %s%s\n",
    785                     prefix,
    786                     rsc->c_name,
    787                     prefix,
    788                     _PEResTab);
    789                 /* Size */
    790                 fprintf(fp, "\t"DIRECTIVE_LONG"\t%d\n",
    791                     rsc->binres->size - rsc->binres->dataidx);
    792                 /* CodePage */
    793                 fprintf(fp, "\t"DIRECTIVE_LONG"\t%ld\n", codepage);
    794                 /* Reserved */
    795                 fprintf(fp, "\t"DIRECTIVE_LONG"\t0\n");
    796 
    797                 direntries++;
    798             }
    799             free(namelabel);
    800         }
    801         free(typelabel);
    802     }
     616        int i;
     617
     618        fprintf(fp, "\t%s\t4\n", DIRECTIVE_ALIGN);
     619        fprintf(fp, "%s%s:\n", prefix, _PEResTab);
     620        fprintf(fp, "\t%s\t%s%s\n", DIRECTIVE_GLOBAL, prefix, _PEResTab);
     621        /* Flags */
     622        fprintf(fp, "\t%s\t0\n", DIRECTIVE_LONG);
     623        /* Time/Date stamp */
     624        fprintf(fp, "\t%s\t"LONGFRMT"\n", DIRECTIVE_LONG, (long)now);
     625        /* Version */
     626        fprintf(fp, "\t%s\t0\n", DIRECTIVE_LONG);       /* FIXME: must version be filled out? */
     627        /* # of id entries, # of name entries */
     628        fprintf(fp, "\t%s\t%d, %d\n", DIRECTIVE_WORD, n_name_entries, n_id_entries);
     629
     630        /* Write the type level of the tree */
     631        for(i = 0; i < rccount; i++)
     632        {
     633                res_count_t *rcp;
     634                char *label;
     635
     636                rcp = &rcarray[i];
     637
     638                /* TypeId */
     639                if(rcp->type.type == name_ord)
     640                        fprintf(fp, "\t%s\t%d\n", DIRECTIVE_LONG, rcp->type.name.i_name);
     641                else
     642                {
     643                        char *name = prep_nid_for_label(&(rcp->type));
     644                        fprintf(fp, "\t%s\t(%s_%s_typename - %s%s) %s %s\n",
     645                                DIRECTIVE_LONG, prefix,
     646                                name,
     647                                prefix,
     648                                _PEResTab, OR, HEXBIT31);
     649                }
     650                /* Offset */
     651                label = prep_nid_for_label(&(rcp->type));
     652                fprintf(fp, "\t%s\t(%sL%s - %s%s) %s %s\n",
     653                        DIRECTIVE_LONG, LOCAL_PREFIX, label,
     654                        prefix,
     655                        _PEResTab, OR, HEXBIT31);
     656        }
     657
     658        /* Write the name level of the tree */
     659
     660        for(i = 0; i < rccount; i++)
     661        {
     662                res_count_t *rcp;
     663                char *typelabel;
     664                char *namelabel;
     665                int j;
     666
     667                rcp = &rcarray[i];
     668
     669                typelabel = xstrdup(prep_nid_for_label(&(rcp->type)));
     670                fprintf(fp, "%sL%s:\n", LOCAL_PREFIX, typelabel);
     671
     672                fprintf(fp, "\t%s\t0\n", DIRECTIVE_LONG);               /* Flags */
     673                fprintf(fp, "\t%s\t"LONGFRMT"\n", DIRECTIVE_LONG, (long)now);   /* TimeDate */
     674                fprintf(fp, "\t%s\t0\n", DIRECTIVE_LONG);       /* FIXME: must version be filled out? */
     675                fprintf(fp, "\t%s\t%d, %d\n", DIRECTIVE_WORD, rcp->n_name_entries, rcp->n_id_entries);
     676                for(j = 0; j < rcp->count32; j++)
     677                {
     678                        resource_t *rsc = rcp->rsc32array[j].rsc[0];
     679                        /* NameId */
     680                        if(rsc->name->type == name_ord)
     681                                fprintf(fp, "\t%s\t%d\n", DIRECTIVE_LONG, rsc->name->name.i_name);
     682                        else
     683                        {
     684                                fprintf(fp, "\t%s\t(%s%s_name - %s%s) %s %s\n",
     685                                        DIRECTIVE_LONG, prefix,
     686                                        rsc->c_name,
     687                                        prefix,
     688                                        _PEResTab, OR, HEXBIT31);
     689                        }
     690                        /* Maybe FIXME: Unescape the tree (ommit 0x80000000) and
     691                         * put the offset to the resource data entry.
     692                         * ?? Is unescaping worth while ??
     693                         */
     694                        /* Offset */
     695                        namelabel = prep_nid_for_label(rsc->name);
     696                        fprintf(fp, "\t%s\t(%sL%s_%s - %s%s) %s %s\n",
     697                                DIRECTIVE_LONG, LOCAL_PREFIX, typelabel,
     698                                namelabel,
     699                                prefix,
     700                                _PEResTab, OR, HEXBIT31);
     701                }
     702                free(typelabel);
     703        }
     704
     705        /* Write the language level of the tree */
     706
     707        for(i = 0; i < rccount; i++)
     708        {
     709                res_count_t *rcp;
     710                char *namelabel;
     711                char *typelabel;
     712                int j;
     713
     714                rcp = &rcarray[i];
     715                typelabel = xstrdup(prep_nid_for_label(&(rcp->type)));
     716
     717                for(j = 0; j < rcp->count32; j++)
     718                {
     719                        res32_count_t *r32cp = &(rcp->rsc32array[j]);
     720                        int k;
     721
     722                        namelabel = xstrdup(prep_nid_for_label(r32cp->rsc[0]->name));
     723                        fprintf(fp, "%sL%s_%s:\n", LOCAL_PREFIX, typelabel, namelabel);
     724
     725                        fprintf(fp, "\t%s\t0\n", DIRECTIVE_LONG);               /* Flags */
     726                        fprintf(fp, "\t%s\t"LONGFRMT"\n", DIRECTIVE_LONG, (long)now);   /* TimeDate */
     727                        fprintf(fp, "\t%s\t0\n", DIRECTIVE_LONG);       /* FIXME: must version be filled out? */
     728                        fprintf(fp, "\t%s\t0, %d\n", DIRECTIVE_WORD, r32cp->count);
     729
     730                        for(k = 0; k < r32cp->count; k++)
     731                        {
     732                                resource_t *rsc = r32cp->rsc[k];
     733                                assert(rsc->lan != NULL);
     734                                /* LanguageId */
     735                                fprintf(fp, "\t%s\t"LONGFRMT"\n", DIRECTIVE_LONG, rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0);
     736                                /* Offset */
     737                                fprintf(fp, "\t%s\t%sL%s_%s_%d - %s%s\n",
     738                                        DIRECTIVE_LONG, LOCAL_PREFIX, typelabel,
     739                                        namelabel,
     740                                        rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0,
     741                                        prefix,
     742                                        _PEResTab);
     743                        }
     744                        free(namelabel);
     745                }
     746                free(typelabel);
     747        }
     748
     749        /* Write the resource table itself */
     750        fprintf(fp, "%s_ResourceDirectory:\n", prefix);
     751        fprintf(fp, "\t%s\t%s_ResourceDirectory\n", DIRECTIVE_GLOBAL, prefix);
     752        direntries = 0;
     753
     754        for(i = 0; i < rccount; i++)
     755        {
     756                res_count_t *rcp;
     757                char *namelabel;
     758                char *typelabel;
     759                int j;
     760
     761                rcp = &rcarray[i];
     762                typelabel = xstrdup(prep_nid_for_label(&(rcp->type)));
     763
     764                for(j = 0; j < rcp->count32; j++)
     765                {
     766                        res32_count_t *r32cp = &(rcp->rsc32array[j]);
     767                        int k;
     768
     769                        namelabel = xstrdup(prep_nid_for_label(r32cp->rsc[0]->name));
     770
     771                        for(k = 0; k < r32cp->count; k++)
     772                        {
     773                                resource_t *rsc = r32cp->rsc[k];
     774
     775                                assert(rsc->lan != NULL);
     776
     777                                fprintf(fp, "%sL%s_%s_%d:\n",
     778                                        LOCAL_PREFIX, typelabel,
     779                                        namelabel,
     780                                        rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0);
     781
     782                                /* Data RVA */
     783                                fprintf(fp, "\t%s\t%s%s_data - %s%s\n",
     784                                        DIRECTIVE_LONG, prefix,
     785                                        rsc->c_name,
     786                                        prefix,
     787                                        _PEResTab);
     788                                /* Size */
     789                                fprintf(fp, "\t%s\t%d\n",
     790                                        DIRECTIVE_LONG, rsc->binres->size - rsc->binres->dataidx);
     791                                /* CodePage */
     792                                fprintf(fp, "\t%s\t%ld\n", DIRECTIVE_LONG, codepage);
     793                                /* Reserved */
     794                                fprintf(fp, "\t%s\t0\n", DIRECTIVE_LONG);
     795
     796                                direntries++;
     797                        }
     798                        free(namelabel);
     799                }
     800                free(typelabel);
     801        }
    803802}
    804803
    805804/*
    806805 *****************************************************************************
    807  * Function : write_ne_segment
    808  * Syntax   : void write_ne_segment(FILE *fp, resource_t *top)
    809  * Input    :
    810  * Output   :
    811  * Description  :
    812  * Remarks  :
     806 * Function     : write_ne_segment
     807 * Syntax       : void write_ne_segment(FILE *fp, resource_t *top)
     808 * Input        :
     809 * Output       :
     810 * Description  :
     811 * Remarks      :
    813812 *****************************************************************************
    814813*/
    815814void write_ne_segment(FILE *fp, resource_t *top)
    816815{
    817     int i, j;
    818 
    819     fprintf(fp, "\t"DIRECTIVE_ALIGN"\t4\n");
    820     fprintf(fp, "%s%s:\n", prefix, _NEResTab);
    821     fprintf(fp, "\t"DIRECTIVE_GLOBAL"\t%s%s\n", prefix, _NEResTab);
    822 
    823     /* AlignmentShift */
    824     fprintf(fp, "\t"DIRECTIVE_WORD"\t%d\n", alignment_pwr);
    825 
    826     /* TypeInfo */
    827     for(i = 0; i < rccount; i++)
    828     {
    829         res_count_t *rcp = &rcarray[i];
    830 
    831         /* TypeId */
    832         if(rcp->type.type == name_ord)
    833             fprintf(fp, "\t"DIRECTIVE_WORD"\t"SHORTFRMT"\n", rcp->type.name.i_name | 0x8000);
    834         else
    835             fprintf(fp, "\t"DIRECTIVE_WORD"\t%s_%s_typename - %s%s\n",
    836                 prefix,
    837                 rcp->type.name.s_name->str.cstr,
    838                 prefix,
    839                 _NEResTab);
    840         /* ResourceCount */
    841         fprintf(fp, "\t"DIRECTIVE_WORD"\t%d\n", rcp->count);
    842         /* Reserved */
    843         fprintf(fp, "\t"DIRECTIVE_LONG"\t0\n");
    844         /* NameInfo */
    845         for(j = 0; j < rcp->count; j++)
    846         {
     816        int i, j;
     817
     818        fprintf(fp, "\t%s\t4\n", DIRECTIVE_ALIGN);
     819        fprintf(fp, "%s%s:\n", prefix, _NEResTab);
     820        fprintf(fp, "\t%s\t%s%s\n", DIRECTIVE_GLOBAL, prefix, _NEResTab);
     821
     822        /* AlignmentShift */
     823        fprintf(fp, "\t%s\t%d\n", DIRECTIVE_WORD, alignment_pwr);
     824
     825        /* TypeInfo */
     826        for(i = 0; i < rccount; i++)
     827        {
     828                res_count_t *rcp = &rcarray[i];
     829
     830                /* TypeId */
     831                if(rcp->type.type == name_ord)
     832                        fprintf(fp, "\t%s\t"SHORTFRMT"\n", DIRECTIVE_WORD, rcp->type.name.i_name | 0x8000);
     833                else
     834                        fprintf(fp, "\t%s\t%s_%s_typename - %s%s\n",
     835                                DIRECTIVE_WORD, prefix,
     836                                rcp->type.name.s_name->str.cstr,
     837                                prefix,
     838                                _NEResTab);
     839                /* ResourceCount */
     840                fprintf(fp, "\t%s\t%d\n", DIRECTIVE_WORD, rcp->count);
     841                /* Reserved */
     842                fprintf(fp, "\t%s\t0\n", DIRECTIVE_LONG);
     843                /* NameInfo */
     844                for(j = 0; j < rcp->count; j++)
     845                {
    847846/*
    848847 * VERY IMPORTANT:
     
    853852 * All other things are as the MS doc describes (alignment etc.)
    854853 */
    855             /* Offset */
    856             fprintf(fp, "\t"DIRECTIVE_WORD"\t(%s%s_data - %s%s) >> %d\n",
    857                 prefix,
    858                 rcp->rscarray[j]->c_name,
    859                 prefix,
    860                 _NEResTab,
    861                 alignment_pwr);
    862             /* Length */
    863             fprintf(fp, "\t"DIRECTIVE_WORD"\t%d\n",
    864                 rcp->rscarray[j]->binres->size - rcp->rscarray[j]->binres->dataidx);
    865             /* Flags */
    866             fprintf(fp, "\t"DIRECTIVE_WORD"\t"SHORTFRMT"\n", (WORD)rcp->rscarray[j]->memopt);
    867             /* Id */
    868             if(rcp->rscarray[j]->name->type == name_ord)
    869                 fprintf(fp, "\t"DIRECTIVE_WORD"\t"SHORTFRMT"\n", rcp->rscarray[j]->name->name.i_name | 0x8000);
    870             else
    871                 fprintf(fp, "\t"DIRECTIVE_WORD"\t%s%s_name - %s%s\n",
    872                 prefix,
    873                 rcp->rscarray[j]->c_name,
    874                 prefix,
    875                 _NEResTab);
    876             /* Handle and Usage */
    877             fprintf(fp, "\t"DIRECTIVE_WORD"\t0, 0\n");
    878         }
    879     }
    880     /* EndTypes */
    881     fprintf(fp, "\t"DIRECTIVE_WORD"\t0\n");
     854                        /* Offset */
     855                        fprintf(fp, "\t%s\t(%s%s_data - %s%s) >> %d\n",
     856                                DIRECTIVE_WORD, prefix,
     857                                rcp->rscarray[j]->c_name,
     858                                prefix,
     859                                _NEResTab,
     860                                alignment_pwr);
     861                        /* Length */
     862                        fprintf(fp, "\t%s\t%d\n",
     863                                DIRECTIVE_WORD, rcp->rscarray[j]->binres->size - rcp->rscarray[j]->binres->dataidx);
     864                        /* Flags */
     865                        fprintf(fp, "\t%s\t"SHORTFRMT"\n", DIRECTIVE_WORD, (WORD)rcp->rscarray[j]->memopt);
     866                        /* Id */
     867                        if(rcp->rscarray[j]->name->type == name_ord)
     868                                fprintf(fp, "\t%s\t"SHORTFRMT"\n", DIRECTIVE_WORD, rcp->rscarray[j]->name->name.i_name | 0x8000);
     869                        else
     870                                fprintf(fp, "\t%s\t%s%s_name - %s%s\n",
     871                                DIRECTIVE_WORD, prefix,
     872                                rcp->rscarray[j]->c_name,
     873                                prefix,
     874                                _NEResTab);
     875                        /* Handle and Usage */
     876                        fprintf(fp, "\t%s\t0, 0\n", DIRECTIVE_WORD);
     877                }
     878        }
     879        /* EndTypes */
     880        fprintf(fp, "\t%s\t0\n", DIRECTIVE_WORD);
    882881}
    883882
    884883/*
    885884 *****************************************************************************
    886  * Function : write_rsc_names
    887  * Syntax   : void write_rsc_names(FILE *fp, resource_t *top)
    888  * Input    :
    889  * Output   :
    890  * Description  :
    891  * Remarks  :
     885 * Function     : write_rsc_names
     886 * Syntax       : void write_rsc_names(FILE *fp, resource_t *top)
     887 * Input        :
     888 * Output       :
     889 * Description  :
     890 * Remarks      :
    892891 *****************************************************************************
    893892*/
    894893void write_rsc_names(FILE *fp, resource_t *top)
    895894{
    896     int i, j;
    897 
    898     if(win32)
    899     {
    900         /* Write the names */
    901 
    902         for(i = 0; i < rccount; i++)
    903         {
    904             res_count_t *rcp;
    905 
    906             rcp = &rcarray[i];
    907 
    908             if(rcp->type.type == name_str)
    909             {
    910                 char *name = prep_nid_for_label(&(rcp->type));
    911                 fprintf(fp, "%s_%s_typename:\n",
    912                     prefix,
    913                     name);
    914                 write_name_str(fp, &(rcp->type));
    915             }
    916 
    917             for(j = 0; j < rcp->count32; j++)
    918             {
    919                 resource_t *rsc = rcp->rsc32array[j].rsc[0];
    920 
    921                 if(rsc->name->type == name_str)
    922                 {
    923                     char *name = prep_nid_for_label(rsc->name);
    924 
    925                     fprintf(fp, "%s_%d_%s_name:\n",
    926                         prefix, rsc->type,
    927                         name);
    928                     write_name_str(fp, rsc->name);
    929                 }
    930             }
    931         }
    932     }
    933     else
    934     {
    935         /* ResourceNames */
    936         for(i = 0; i < rccount; i++)
    937         {
    938             res_count_t *rcp = &rcarray[i];
    939 
    940             for(j = 0; j < rcp->count; j++)
    941             {
    942                 if(rcp->type.type == name_str)
    943                 {
    944                     fprintf(fp, "%s_%s_typename:\n",
    945                         prefix,
    946                         rcp->type.name.s_name->str.cstr);
    947                     write_name_str(fp, &(rcp->type));
    948                 }
    949                 if(rcp->rscarray[j]->name->type == name_str)
    950                 {
    951                     fprintf(fp, "%s%s_name:\n",
    952                         prefix,
    953                         rcp->rscarray[j]->c_name);
    954                     write_name_str(fp, rcp->rscarray[j]->name);
    955                 }
    956             }
    957         }
    958         /* EndNames */
    959 
    960         /* This is to end the NE resource table */
    961         if(create_dir)
    962             fprintf(fp, "\t"DIRECTIVE_BYTE"\t0\n");
    963     }
    964 
    965     fprintf(fp, "\n");
     895        int i, j;
     896       
     897        if(win32)
     898        {
     899                /* Write the names */
     900
     901                for(i = 0; i < rccount; i++)
     902                {
     903                        res_count_t *rcp;
     904
     905                        rcp = &rcarray[i];
     906
     907                        if(rcp->type.type == name_str)
     908                        {
     909                                char *name = prep_nid_for_label(&(rcp->type));
     910                                fprintf(fp, "%s_%s_typename:\n",
     911                                        prefix,
     912                                        name);
     913                                write_name_str(fp, &(rcp->type));
     914                        }
     915
     916                        for(j = 0; j < rcp->count32; j++)
     917                        {
     918                                resource_t *rsc = rcp->rsc32array[j].rsc[0];
     919
     920                                if(rsc->name->type == name_str)
     921                                {
     922                                        fprintf(fp, "%s%s_name:\n",
     923                                                prefix,
     924                                                rsc->c_name);
     925                                        write_name_str(fp, rsc->name);
     926                                }
     927                        }
     928                }
     929        }
     930        else
     931        {
     932                /* ResourceNames */
     933                for(i = 0; i < rccount; i++)
     934                {
     935                        res_count_t *rcp = &rcarray[i];
     936
     937                        for(j = 0; j < rcp->count; j++)
     938                        {
     939                                if(rcp->type.type == name_str)
     940                                {
     941                                        fprintf(fp, "%s_%s_typename:\n",
     942                                                prefix,
     943                                                rcp->type.name.s_name->str.cstr);
     944                                        write_name_str(fp, &(rcp->type));
     945                                }
     946                                if(rcp->rscarray[j]->name->type == name_str)
     947                                {
     948                                        fprintf(fp, "%s%s_name:\n",
     949                                                prefix,
     950                                                rcp->rscarray[j]->c_name);
     951                                        write_name_str(fp, rcp->rscarray[j]->name);
     952                                }
     953                        }
     954                }
     955                /* EndNames */
     956               
     957                /* This is to end the NE resource table */
     958                if(create_dir)
     959                        fprintf(fp, "\t%s\t0\n", DIRECTIVE_BYTE);
     960        }
     961
     962        fprintf(fp, "\n");
    966963}
    967964
    968965/*
    969966 *****************************************************************************
    970  * Function : write_s_file
    971  * Syntax   : void write_s_file(char *outname, resource_t *top)
    972  * Input    :
    973  *  outname - Filename to write to
    974  *  top - The resource-tree to convert
    975  * Output   :
    976  * Description  :
    977  * Remarks  :
     967 * Function     : write_s_file
     968 * Syntax       : void write_s_file(char *outname, resource_t *top)
     969 * Input        :
     970 *      outname - Filename to write to
     971 *      top     - The resource-tree to convert
     972 * Output       :
     973 * Description  :
     974 * Remarks      :
    978975 *****************************************************************************
    979976*/
    980977void write_s_file(char *outname, resource_t *top)
    981978{
    982     FILE *fo;
    983     resource_t *rsc;
    984 
    985     fo = fopen(outname, "wt");
    986     if(!fo)
    987     {
    988         error("Could not open %s\n", outname);
    989         return;
    990     }
    991 
    992     {
    993         char *s, *p;
    994         now = time(NULL);
    995         s = ctime(&now);
    996         p = strchr(s, '\n');
    997         if(p) *p = '\0';
    998         fprintf(fo, s_file_head_str, input_name ? input_name : "stdin",
    999             cmdline, s);
    1000     }
    1001 
    1002     /* Get an idea how many we have and restructure the tables */
    1003     count_resources(top);
    1004 
    1005     /* First write the segment tables */
    1006     if(create_dir)
    1007     {
    1008         if(win32)
    1009             write_pe_segment(fo, top);
    1010         else
    1011             write_ne_segment(fo, top);
    1012     }
    1013 
    1014     /* Dump the names */
    1015     write_rsc_names(fo, top);
    1016 
    1017     if(create_dir)
    1018         fprintf(fo, LOCAL_PREFIX"LResTabEnd:\n");
    1019 
    1020     if(!indirect_only)
    1021     {
    1022         /* Write the resource data */
    1023             fprintf(fo, "\n"COMMENT_LINE"/* Resource binary data */\n\n");
    1024         for(rsc = top; rsc; rsc = rsc->next)
    1025         {
    1026             if(!rsc->binres)
    1027                 continue;
    1028 
    1029             fprintf(fo, "\t"DIRECTIVE_ALIGN"\t%d\n", win32 ? 4 : alignment);
    1030             fprintf(fo, "%s%s_data:\n", prefix, rsc->c_name);
    1031             if(global)
    1032                 fprintf(fo, "\t"DIRECTIVE_GLOBAL"\t%s%s_data\n", prefix, rsc->c_name);
    1033 
    1034             write_s_res(fo, rsc->binres);
    1035 
    1036             fprintf(fo, "\n");
    1037         }
    1038 
    1039         if(create_dir)
    1040         {
    1041             /* Add a resource descriptor for built-in and elf-dlls */
    1042             fprintf(fo, "\t"DIRECTIVE_ALIGN"\t4\n");
    1043             fprintf(fo, "%s_ResourceDescriptor:\n", prefix);
    1044             fprintf(fo, "\t"DIRECTIVE_GLOBAL"\t%s_ResourceDescriptor\n", prefix);
    1045             fprintf(fo, "%s_ResourceTable:\n", prefix);
    1046             if(global)
    1047                 fprintf(fo, "\t"DIRECTIVE_GLOBAL"\t%s_ResourceTable\n", prefix);
    1048             fprintf(fo, "\t"DIRECTIVE_LONG"\t%s%s\n", prefix, win32 ? _PEResTab : _NEResTab);
    1049             fprintf(fo, "%s_NumberOfResources:\n", prefix);
    1050             if(global)
    1051                 fprintf(fo, "\t"DIRECTIVE_GLOBAL"\t%s_NumberOfResources\n", prefix);
    1052             fprintf(fo, "\t"DIRECTIVE_LONG"\t%d\n", direntries);
    1053             fprintf(fo, "%s_ResourceSectionSize:\n", prefix);
    1054             if(global)
    1055                 fprintf(fo, "\t"DIRECTIVE_GLOBAL"\t%s_ResourceSectionSize\n", prefix);
    1056             fprintf(fo, "\t"DIRECTIVE_LONG"\t"LOCAL_PREFIX"LResTabEnd - %s%s\n", prefix, win32 ? _PEResTab : _NEResTab);
    1057             if(win32)
    1058             {
    1059                 fprintf(fo, "%s_ResourcesEntries:\n", prefix);
    1060                 if(global)
    1061                     fprintf(fo, "\t"DIRECTIVE_GLOBAL"\t%s_ResourcesEntries\n", prefix);
    1062                 fprintf(fo, "\t"DIRECTIVE_LONG"\t%s_ResourceDirectory\n", prefix);
    1063             }
    1064         }
    1065     }
    1066 
    1067     if(indirect)
    1068     {
    1069         /* Write the indirection structures */
    1070         fprintf(fo, "\n"COMMENT_LINE"/* Resource indirection structures */\n\n");
    1071         fprintf(fo, "\t"DIRECTIVE_ALIGN"\t4\n");
    1072         for(rsc = top; rsc; rsc = rsc->next)
    1073         {
    1074             int type;
    1075             char *type_name = NULL;
    1076             char *label;
    1077 
    1078             if(!rsc->binres)
    1079                 continue;
    1080 
    1081             switch(rsc->type)
    1082             {
    1083             case res_menex:
    1084                 type = WRC_RT_MENU;
    1085                 break;
    1086             case res_dlgex:
    1087                 type = WRC_RT_DIALOG;
    1088                 break;
    1089             case res_usr:
    1090                 assert(rsc->res.usr->type != NULL);
    1091                 type_name = prep_nid_for_label(rsc->res.usr->type);
    1092                 type = 0;
    1093                 break;
    1094             default:
    1095                 type = rsc->type;
    1096             }
    1097 
    1098             /*
    1099              * This follows a structure like:
    1100              * struct wrc_resource {
    1101              *  INT32   id;
    1102              *  RSCNAME *resname;
    1103              *  INT32   restype;
    1104              *  RSCNAME *typename;
    1105              *  void    *data;
    1106              *  UINT32  datasize;
    1107              * };
    1108              * The 'RSCNAME' is a pascal-style string where the
    1109              * first byte/word denotes the size and the rest the string
    1110              * itself.
    1111              */
    1112             fprintf(fo, "%s%s:\n", prefix, rsc->c_name);
    1113             if(global)
    1114                 fprintf(fo, "\t"DIRECTIVE_GLOBAL"\t%s%s\n", prefix, rsc->c_name);
    1115             label = prep_nid_for_label(rsc->name);
    1116             fprintf(fo, "\t"DIRECTIVE_LONG"\t%d, %s%s%s%s, %d, %s%s%s%s, %s%s_data, %d\n",
    1117                 rsc->name->type == name_ord ? rsc->name->name.i_name : 0,
    1118                 rsc->name->type == name_ord ? "0" : prefix,
    1119                 rsc->name->type == name_ord ? "" : "_",
    1120                 rsc->name->type == name_ord ? "" : label,
    1121                 rsc->name->type == name_ord ? "" : "_name",
    1122                 type,
    1123                 type ? "0" : prefix,
    1124                 type ? "" : "_",
    1125                 type ? "" : type_name,
    1126                 type ? "" : "_typename",
    1127                 prefix,
    1128                 rsc->c_name,
    1129                 rsc->binres->size - rsc->binres->dataidx);
    1130             fprintf(fo, "\n");
    1131         }
    1132         fprintf(fo, "\n");
    1133 
    1134         /* Write the indirection table */
    1135         fprintf(fo, COMMENT_LINE"/* Resource indirection table */\n\n");
    1136         fprintf(fo, "\t"DIRECTIVE_ALIGN"\t4\n");
    1137         fprintf(fo, "%s%s:\n", prefix, _ResTable);
    1138         fprintf(fo, "\t"DIRECTIVE_GLOBAL"\t%s%s\n", prefix, _ResTable);
    1139         for(rsc = top; rsc; rsc = rsc->next)
    1140         {
    1141             fprintf(fo, "\t"DIRECTIVE_LONG"\t%s%s\n", prefix, rsc->c_name);
    1142         }
    1143         fprintf(fo, "\t"DIRECTIVE_LONG"\t0\n");
    1144         fprintf(fo, "\n");
    1145     }
    1146 
    1147     if(auto_register)
    1148         fprintf(fo, s_file_autoreg_str, prefix, _ResTable);
    1149 
    1150     fprintf(fo, s_file_tail_str);
    1151     fclose(fo);
     979        FILE *fo;
     980        resource_t *rsc;
     981
     982        fo = fopen(outname, "wt");
     983        if(!fo)
     984        {
     985                error("Could not open %s\n", outname);
     986                return;
     987        }
     988
     989        {
     990                char *s, *p;
     991                now = time(NULL);
     992                s = ctime(&now);
     993                p = strchr(s, '\n');
     994                if(p) *p = '\0';
     995                fprintf(fo, s_file_head_str, input_name ? input_name : "stdin",
     996                        cmdline, s);
     997        }
     998
     999        /* Get an idea how many we have and restructure the tables */
     1000        count_resources(top);
     1001
     1002        /* First write the segment tables */
     1003        if(create_dir)
     1004        {
     1005                if(win32)
     1006                        write_pe_segment(fo, top);
     1007                else
     1008                        write_ne_segment(fo, top);
     1009        }
     1010
     1011        /* Dump the names */
     1012        write_rsc_names(fo, top);
     1013
     1014        if(create_dir)
     1015                fprintf(fo, "%sLResTabEnd:\n", LOCAL_PREFIX);
     1016       
     1017        if(!indirect_only)
     1018        {
     1019                /* Write the resource data */
     1020#ifdef MASM
     1021                fprintf(fo, "\n;/* Resource binary data */\n\n");
     1022#else
     1023                fprintf(fo, "\n/* Resource binary data */\n\n");
     1024#endif
     1025                for(rsc = top; rsc; rsc = rsc->next)
     1026                {
     1027                        if(!rsc->binres)
     1028                                continue;
     1029
     1030                        fprintf(fo, "\t%s\t%d\n", DIRECTIVE_ALIGN, win32 ? 4 : alignment);
     1031                        fprintf(fo, "%s%s_data:\n", prefix, rsc->c_name);
     1032                        if(global)
     1033                                fprintf(fo, "\t%s\t%s%s_data\n", DIRECTIVE_GLOBAL, prefix, rsc->c_name);
     1034
     1035                        write_s_res(fo, rsc->binres);
     1036
     1037                        fprintf(fo, "\n");
     1038                }
     1039
     1040                if(create_dir)
     1041                {
     1042                        /* Add a resource descriptor for built-in and elf-dlls */
     1043                        fprintf(fo, "\t%s\t4\n", DIRECTIVE_ALIGN);
     1044                        fprintf(fo, "%s_ResourceDescriptor:\n", prefix);
     1045                        fprintf(fo, "\t%s\t%s_ResourceDescriptor\n", DIRECTIVE_GLOBAL, prefix);
     1046                        fprintf(fo, "%s_ResourceTable:\n", prefix);
     1047                        if(global)
     1048                                fprintf(fo, "\t%s\t%s_ResourceTable\n", DIRECTIVE_GLOBAL, prefix);
     1049                        fprintf(fo, "\t%s\t%s%s\n", DIRECTIVE_LONG, prefix, win32 ? _PEResTab : _NEResTab);
     1050                        fprintf(fo, "%s_NumberOfResources:\n", prefix);
     1051                        if(global)
     1052                                fprintf(fo, "\t%s\t%s_NumberOfResources\n", DIRECTIVE_GLOBAL, prefix);
     1053                        fprintf(fo, "\t%s\t%d\n", DIRECTIVE_LONG, direntries);
     1054                        fprintf(fo, "%s_ResourceSectionSize:\n", prefix);
     1055                        if(global)
     1056                                fprintf(fo, "\t%s\t%s_ResourceSectionSize\n", DIRECTIVE_GLOBAL, prefix);
     1057                        fprintf(fo, "\t%s\t%sLResTabEnd - %s%s\n", DIRECTIVE_LONG, LOCAL_PREFIX, prefix, win32 ? _PEResTab : _NEResTab);
     1058                        if(win32)
     1059                        {
     1060                                fprintf(fo, "%s_ResourcesEntries:\n", prefix);
     1061                                if(global)
     1062                                        fprintf(fo, "\t%s\t%s_ResourcesEntries\n", DIRECTIVE_GLOBAL, prefix);
     1063                                fprintf(fo, "\t%s\t%s_ResourceDirectory\n", DIRECTIVE_LONG, prefix);
     1064                        }
     1065                }
     1066        }
     1067
     1068        if(indirect)
     1069        {
     1070                /* Write the indirection structures */
     1071                fprintf(fo, "\n/* Resource indirection structures */\n\n");
     1072                fprintf(fo, "\t%s\t4\n", DIRECTIVE_ALIGN);
     1073                for(rsc = top; rsc; rsc = rsc->next)
     1074                {
     1075                        int type;
     1076                        char *type_name = NULL;
     1077
     1078                        if(!rsc->binres)
     1079                                continue;
     1080
     1081                        switch(rsc->type)
     1082                        {
     1083                        case res_menex:
     1084                                type = WRC_RT_MENU;
     1085                                break;
     1086                        case res_dlgex:
     1087                                type = WRC_RT_DIALOG;
     1088                                break;
     1089                        case res_usr:
     1090                                assert(rsc->res.usr->type != NULL);
     1091                                type_name = prep_nid_for_label(rsc->res.usr->type);
     1092                                type = 0;
     1093                                break;
     1094                        default:
     1095                                type = rsc->type;
     1096                        }
     1097
     1098                        /*
     1099                         * This follows a structure like:
     1100                         * struct wrc_resource {
     1101                         *      INT32   id;
     1102                         *      RSCNAME *resname;
     1103                         *      INT32   restype;
     1104                         *      RSCNAME *typename;
     1105                         *      void    *data;
     1106                         *      UINT32  datasize;
     1107                         * };
     1108                         * The 'RSCNAME' is a pascal-style string where the
     1109                         * first byte/word denotes the size and the rest the string
     1110                         * itself.
     1111                         */
     1112                        fprintf(fo, "%s%s:\n", prefix, rsc->c_name);
     1113                        if(global)
     1114                                fprintf(fo, "\t%s\t%s%s\n", DIRECTIVE_GLOBAL, prefix, rsc->c_name);
     1115                        fprintf(fo, "\t%s\t%d, %s%s%s, %d, %s%s%s%s, %s%s_data, %d\n",
     1116                                DIRECTIVE_LONG,
     1117                                rsc->name->type == name_ord ? rsc->name->name.i_name : 0,
     1118                                rsc->name->type == name_ord ? "0" : prefix,
     1119                                rsc->name->type == name_ord ? "" : rsc->c_name,
     1120                                rsc->name->type == name_ord ? "" : "_name",
     1121                                type,
     1122                                type ? "0" : prefix,
     1123                                type ? "" : "_",
     1124                                type ? "" : type_name,
     1125                                type ? "" : "_typename",
     1126                                prefix,
     1127                                rsc->c_name,
     1128                                rsc->binres->size - rsc->binres->dataidx);
     1129                        fprintf(fo, "\n");
     1130                }
     1131                fprintf(fo, "\n");
     1132
     1133                /* Write the indirection table */
     1134                fprintf(fo, "/* Resource indirection table */\n\n");
     1135                fprintf(fo, "\t%s\t4\n", DIRECTIVE_ALIGN);
     1136                fprintf(fo, "%s%s:\n", prefix, _ResTable);
     1137                fprintf(fo, "\t%s\t%s%s\n", DIRECTIVE_GLOBAL, prefix, _ResTable);
     1138                for(rsc = top; rsc; rsc = rsc->next)
     1139                {
     1140                        fprintf(fo, "\t%s\t%s%s\n", DIRECTIVE_LONG, prefix, rsc->c_name);
     1141                }
     1142                fprintf(fo, "\t%s\t0\n", DIRECTIVE_LONG);
     1143                fprintf(fo, "\n");
     1144        }
     1145
     1146        if(auto_register)
     1147                fprintf(fo, s_file_autoreg_str, prefix, _ResTable);
     1148
     1149        fprintf(fo, s_file_tail_str);
     1150        fclose(fo);
    11521151}
    11531152
    11541153/*
    11551154 *****************************************************************************
    1156  * Function : write_h_file
    1157  * Syntax   : void write_h_file(char *outname, resource_t *top)
    1158  * Input    :
    1159  *  outname - Filename to write to
    1160  *  top - The resource-tree to convert
    1161  * Output   :
    1162  * Description  :
    1163  * Remarks  :
     1155 * Function     : write_h_file
     1156 * Syntax       : void write_h_file(char *outname, resource_t *top)
     1157 * Input        :
     1158 *      outname - Filename to write to
     1159 *      top     - The resource-tree to convert
     1160 * Output       :
     1161 * Description  :
     1162 * Remarks      :
    11641163 *****************************************************************************
    11651164*/
    11661165void write_h_file(char *outname, resource_t *top)
    11671166{
    1168     FILE *fo;
    1169     resource_t *rsc;
    1170     char *h_prefix;
     1167        FILE *fo;
     1168        resource_t *rsc;
     1169        char *h_prefix;
    11711170
    11721171#ifdef NEED_UNDERSCORE_PREFIX
    1173     h_prefix = prefix + 1;
     1172        h_prefix = prefix + 1;
    11741173#else
    1175     h_prefix = prefix;
     1174        h_prefix = prefix;
    11761175#endif
    11771176
    1178     fo = fopen(outname, "wt");
    1179     if(!fo)
    1180     {
    1181         error("Could not open %s\n", outname);
    1182     }
    1183 
    1184     time(&now);
    1185     fprintf(fo, h_file_head_str, input_name ? input_name : "stdin",
     1177        fo = fopen(outname, "wt");
     1178        if(!fo)
     1179        {
     1180                error("Could not open %s\n", outname);
     1181        }
     1182
     1183        time(&now);
     1184        fprintf(fo, h_file_head_str, input_name ? input_name : "stdin",
    11861185                cmdline, ctime(&now), (long)now, (long)now);
    11871186
    1188     /* First write the segment tables reference */
    1189     if(create_dir)
    1190     {
    1191         fprintf(fo, "extern %schar %s%s[];\n\n",
    1192             constant ? "const " : "",
    1193             h_prefix,
    1194             win32 ? _PEResTab : _NEResTab);
    1195     }
    1196 
    1197     /* Write the resource data */
    1198     for(rsc = top; global && rsc; rsc = rsc->next)
    1199     {
    1200         if(!rsc->binres)
    1201             continue;
    1202 
    1203         fprintf(fo, "extern %schar %s%s_data[];\n",
    1204             constant ? "const " : "",
    1205             h_prefix,
    1206             rsc->c_name);
    1207     }
    1208 
    1209     if(indirect)
    1210     {
    1211         if(global)
    1212             fprintf(fo, "\n");
    1213 
    1214         /* Write the indirection structures */
    1215         for(rsc = top; global && rsc; rsc = rsc->next)
    1216         {
    1217             fprintf(fo, "extern %swrc_resource%d_t %s%s;\n",
    1218                 constant ? "const " : "",
    1219                 win32 ? 32 : 16,
    1220                 h_prefix,
    1221                 rsc->c_name);
    1222         }
    1223 
    1224         if(global)
    1225             fprintf(fo, "\n");
    1226 
    1227         /* Write the indirection table */
    1228         fprintf(fo, "extern %swrc_resource%d_t %s%s[];\n\n",
    1229             constant ? "const " : "",
    1230             win32 ? 32 : 16,
    1231             h_prefix,
    1232             _ResTable);
    1233     }
    1234 
    1235     fprintf(fo, h_file_tail_str);
    1236     fclose(fo);
    1237 }
    1238 
    1239 
     1187        /* First write the segment tables reference */
     1188        if(create_dir)
     1189        {
     1190                fprintf(fo, "extern %schar %s%s[];\n\n",
     1191                        constant ? "const " : "",
     1192                        h_prefix,
     1193                        win32 ? _PEResTab : _NEResTab);
     1194        }
     1195
     1196        /* Write the resource data */
     1197        for(rsc = top; global && rsc; rsc = rsc->next)
     1198        {
     1199                if(!rsc->binres)
     1200                        continue;
     1201
     1202                fprintf(fo, "extern %schar %s%s_data[];\n",
     1203                        constant ? "const " : "",
     1204                        h_prefix,
     1205                        rsc->c_name);
     1206        }
     1207
     1208        if(indirect)
     1209        {
     1210                if(global)
     1211                        fprintf(fo, "\n");
     1212
     1213                /* Write the indirection structures */
     1214                for(rsc = top; global && rsc; rsc = rsc->next)
     1215                {
     1216                        fprintf(fo, "extern %swrc_resource%d_t %s%s;\n",
     1217                                constant ? "const " : "",
     1218                                win32 ? 32 : 16,
     1219                                h_prefix,
     1220                                rsc->c_name);
     1221                }
     1222
     1223                if(global)
     1224                        fprintf(fo, "\n");
     1225
     1226                /* Write the indirection table */
     1227                fprintf(fo, "extern %swrc_resource%d_t %s%s[];\n\n",
     1228                        constant ? "const " : "",
     1229                        win32 ? 32 : 16,
     1230                        h_prefix,
     1231                        _ResTable);
     1232        }
     1233
     1234        fprintf(fo, h_file_tail_str);
     1235        fclose(fo);
     1236}
     1237
     1238
  • trunk/tools/wrc/y.tab.c

    r1355 r3426  
    107107 * Copyright  Martin von Loewis, 1994
    108108 * Copyright 1998 Bertho A. Stultiens (BS)
     109 *           1999 Juergen Schmied (JS)
    109110 *
     111 * 6-Nov-1999 JS        - see CHANGES
     112 *
    110113 * 29-Dec-1998 AdH      - Grammar and function extensions.
    111114 *                           grammar: TOOLBAR resources, Named ICONs in
     
    208211#include "preproc.h"
    209212#include "parser.h"
     213#include "windef.h"
     214#include "wingdi.h"
    210215#include "winuser.h"
    211216
     
    214219#endif
    215220
    216 DWORD andmask;          /* Used to parse 'NOT NUMBER' expressions */
    217221int indialog = 0;       /* Signal flex that we're parsing a dialog */
    218222int want_rscname = 0;   /* Set when a resource's name is required */
     
    262266dialogex_t *dialogex_font(font_id_t *f, dialogex_t *dlg);
    263267dialogex_t *dialogex_caption(string_t *s, dialogex_t *dlg);
    264 dialogex_t *dialogex_exstyle(int st, dialogex_t *dlg);
    265 dialogex_t *dialogex_style(int st, dialogex_t *dlg);
     268dialogex_t *dialogex_exstyle(style_t *st, dialogex_t *dlg);
     269dialogex_t *dialogex_style(style_t *st, dialogex_t *dlg);
    266270name_id_t *convert_ctlclass(name_id_t *cls);
    267 control_t *ins_ctrl(int type, int style, control_t *ctrl, control_t *prev);
     271control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control_t *prev);
    268272dialog_t *dialog_version(version_t *v, dialog_t *dlg);
    269273dialog_t *dialog_characteristics(characts_t *c, dialog_t *dlg);
     
    273277dialog_t *dialog_font(font_id_t *f, dialog_t *dlg);
    274278dialog_t *dialog_caption(string_t *s, dialog_t *dlg);
    275 dialog_t *dialog_exstyle(int st, dialog_t *dlg);
    276 dialog_t *dialog_style(int st, dialog_t *dlg);
     279dialog_t *dialog_exstyle(style_t * st, dialog_t *dlg);
     280dialog_t *dialog_style(style_t * st, dialog_t *dlg);
    277281resource_t *build_stt_resources(stringtable_t *stthead);
    278282stringtable_t *find_stringtable(lvc_t *lvc);
     
    281285
    282286
    283 #line 179 "parser.y"
     287#line 183 "parser.y"
    284288typedef union{
    285289        string_t        *str;
     
    323327        dlginit_t       *dginit;
    324328        style_pair_t    *styles;
     329        style_t         *style;
    325330} YYSTYPE;
    326331#ifndef YYDEBUG
     
    338343
    339344
    340 #define YYFINAL         597
     345#define YYFINAL         604
    341346#define YYFLAG          -32768
    342347#define YYNTBASE        112
     
    397402   328,   332,   336,   340,   344,   348,   352,   356,   360,   364,
    398403   368,   372,   376,   380,   391,   404,   415,   416,   421,   428,
    399    437,   455,   471,   476,   477,   480,   481,   484,   489,   491,
    400    493,   508,   509,   513,   517,   521,   524,   527,   531,   535,
    401    538,   541,   544,   545,   549,   553,   557,   561,   565,   569,
    402    573,   577,   581,   585,   589,   593,   597,   601,   605,   609,
    403    613,   624,   644,   661,   675,   687,   688,   690,   691,   694,
    404    704,   705,   708,   713,   717,   718,   725,   729,   735,   736,
    405    740,   744,   748,   752,   756,   760,   765,   769,   770,   775,
    406    779,   785,   786,   789,   795,   802,   803,   806,   811,   818,
    407    827,   832,   836,   837,   842,   843,   845,   851,   852,   862,
    408    872,   876,   880,   884,   888,   892,   893,   896,   902,   903,
    409    906,   908,   913,   918,   920,   924,   934,   935,   939,   942,
    410    943,   946,   949,   951,   953,   955,   957,   959,   961,   963,
    411    964,   967,   970,   973,   978,   981,   984,   988,   990,   992,
    412    994,   996,  1000,  1004,  1008,  1012,  1013,  1015,  1018,  1019,
    413   1023,  1027,  1031,  1035,  1039,  1043,  1046,  1049,  1053,  1055,
    414   1058,  1060
     404   437,   455,   471,   476,   477,   480,   481,   484,   489,   493,
     405   497,   499,   502,   504,   506,   521,   522,   526,   530,   534,
     406   537,   540,   544,   548,   551,   554,   557,   558,   562,   566,
     407   570,   574,   578,   582,   586,   590,   594,   598,   602,   606,
     408   610,   614,   618,   622,   626,   637,   657,   674,   688,   700,
     409   701,   703,   704,   707,   717,   718,   721,   726,   730,   731,
     410   738,   742,   748,   749,   753,   757,   761,   765,   769,   773,
     411   778,   782,   783,   788,   792,   798,   799,   802,   808,   815,
     412   816,   819,   824,   831,   840,   845,   849,   850,   855,   856,
     413   858,   864,   865,   875,   885,   889,   893,   897,   901,   905,
     414   906,   909,   915,   916,   919,   921,   926,   931,   933,   937,
     415   947,   948,   952,   955,   956,   959,   962,   964,   966,   968,
     416   970,   972,   974,   976,   977,   980,   983,   986,   991,   994,
     417   997,  1001,  1003,  1005,  1007,  1009,  1013,  1017,  1021,  1025,
     418  1026,  1028,  1030,  1034,  1038,  1042,  1046,  1050,  1054,  1057,
     419  1060,  1064,  1066,  1069,  1071
    415420};
    416421
     
    428433    16,     0,     9,   109,    16,   110,     0,    11,     0,    12,
    429434     0,    16,    16,     0,    16,   109,     0,    16,   104,     0,
    430    119,   121,     0,   164,     0,   181,     0,   187,     0,    16,
     435   119,   121,     0,   165,     0,   182,     0,   188,     0,    16,
    431436     0,   119,     0,    15,     0,   131,     0,   122,     0,   123,
    432      0,   134,     0,   145,     0,   128,     0,   124,     0,   125,
    433      0,   155,     0,   159,     0,   126,     0,   127,     0,   175,
    434      0,   129,     0,   168,     0,    20,   177,    17,     0,    20,
    435    177,   184,     0,    21,   177,    17,     0,    21,   177,   184,
    436      0,    30,   177,    17,     0,    31,   177,    17,     0,    31,
    437    177,   184,     0,    26,    17,     0,    27,   177,   180,   184,
    438      0,    90,   177,   180,   184,     0,   130,   177,    17,     0,
    439    130,   177,   184,     0,    13,     0,    15,     0,    19,   177,
    440    180,    88,   132,    89,     0,     0,   132,    15,   111,   187,
    441    133,     0,   132,   187,   111,   187,   133,     0,     0,   133,
     437     0,   134,     0,   146,     0,   128,     0,   124,     0,   125,
     438     0,   156,     0,   160,     0,   126,     0,   127,     0,   176,
     439     0,   129,     0,   169,     0,    20,   178,    17,     0,    20,
     440   178,   185,     0,    21,   178,    17,     0,    21,   178,   185,
     441     0,    30,   178,    17,     0,    31,   178,    17,     0,    31,
     442   178,   185,     0,    26,    17,     0,    27,   178,   181,   185,
     443     0,    90,   178,   181,   185,     0,   130,   178,    17,     0,
     444   130,   178,   185,     0,    13,     0,    15,     0,    19,   178,
     445   181,    88,   132,    89,     0,     0,   132,    15,   111,   188,
     446   133,     0,   132,   188,   111,   188,   133,     0,     0,   133,
    442447   111,    58,     0,   133,   111,    51,     0,   133,   111,    44,
    443448     0,   133,   111,    52,     0,   133,   111,    53,     0,   133,
    444    111,    54,     0,    22,   177,   187,   111,   187,   111,   187,
    445    111,   187,   135,    88,   136,    89,     0,     0,   135,    70,
    446    187,     0,   135,    69,   187,     0,   135,    67,    15,     0,
     449   111,    54,     0,    22,   178,   188,   111,   188,   111,   188,
     450   111,   188,   135,    88,   136,    89,     0,     0,   135,    70,
     451   144,     0,   135,    69,   144,     0,   135,    67,    15,     0,
    447452   135,   141,     0,   135,    66,   120,     0,   135,    24,   119,
    448      0,   135,   181,     0,   135,   182,     0,   135,   183,     0,
     453     0,   135,   182,     0,   135,   183,     0,   135,   184,     0,
    449454     0,   136,    44,   140,     0,   136,    45,   138,     0,   136,
    450455    42,   138,     0,   136,    41,   138,     0,   136,    43,   138,
     
    454459    33,   137,     0,   136,    34,   137,     0,   136,    48,   137,
    455460     0,   136,    47,   137,     0,   136,    46,   137,     0,   136,
    456     31,   120,   111,   187,   111,   187,   111,   187,   139,     0,
    457     15,   111,   187,   111,   187,   111,   187,   111,   187,   111,
    458    187,   142,     0,   187,   111,   187,   111,   187,   111,   187,
    459    111,   187,   142,     0,     0,   111,   187,   111,   187,     0,
    460    111,   187,   111,   187,   111,   187,     0,   111,   187,   111,
    461    187,   111,   187,   111,   187,     0,   120,   111,   187,   111,
    462    144,   111,   187,   111,   187,   111,   187,   111,   187,   111,
    463    187,   111,   187,     0,   120,   111,   187,   111,   144,   111,
    464    187,   111,   187,   111,   187,   111,   187,   111,   187,     0,
    465     30,   187,   111,    15,     0,     0,   111,   187,     0,     0,
    466    111,   187,     0,   111,   187,   111,   187,     0,   187,     0,
    467     15,     0,    23,   177,   187,   111,   187,   111,   187,   111,
    468    187,   152,   146,    88,   147,    89,     0,     0,   146,    70,
    469    187,     0,   146,    69,   187,     0,   146,    67,    15,     0,
    470    146,   141,     0,   146,   153,     0,   146,    66,   120,     0,
    471    146,    24,   119,     0,   146,   181,     0,   146,   182,     0,
    472    146,   183,     0,     0,   147,    44,   148,     0,   147,    45,
    473    150,     0,   147,    42,   150,     0,   147,    41,   150,     0,
    474    147,    43,   150,     0,   147,    35,   149,     0,   147,    36,
    475    149,     0,   147,    40,   149,     0,   147,    37,   149,     0,
    476    147,    38,   149,     0,   147,    32,   149,     0,   147,    39,
    477    149,     0,   147,    33,   149,     0,   147,    34,   149,     0,
    478    147,    48,   149,     0,   147,    47,   149,     0,   147,    46,
    479    149,     0,   147,    31,   120,   111,   187,   111,   187,   111,
    480    187,   139,     0,   120,   111,   187,   111,   144,   111,   187,
    481    111,   187,   111,   187,   111,   187,   111,   187,   111,   186,
    482    152,   151,     0,   120,   111,   187,   111,   144,   111,   187,
    483    111,   187,   111,   187,   111,   187,   111,   187,   151,     0,
    484     15,   111,   187,   111,   187,   111,   187,   111,   187,   111,
    485    187,   143,   151,     0,   187,   111,   187,   111,   187,   111,
    486    187,   111,   187,   143,   151,     0,     0,   184,     0,     0,
    487    111,   187,     0,    30,   187,   111,    15,   111,   187,   111,
    488    187,   154,     0,     0,   111,   187,     0,    24,   177,   180,
    489    156,     0,    88,   157,    89,     0,     0,   157,    82,    15,
    490    111,   187,   158,     0,   157,    82,    84,     0,   157,    83,
    491     15,   158,   156,     0,     0,   111,    56,   158,     0,   111,
    492     55,   158,     0,   111,    85,   158,     0,   111,    57,   158,
    493      0,   111,    80,   158,     0,   111,    81,   158,     0,    25,
    494    177,   180,   160,     0,    88,   161,    89,     0,     0,   161,
    495     82,    15,   162,     0,   161,    82,    84,     0,   161,    83,
    496     15,   163,   160,     0,     0,   111,   187,     0,   111,   186,
    497    111,   186,   158,     0,   111,   186,   111,   186,   111,   187,
    498      0,     0,   111,   187,     0,   111,   186,   111,   187,     0,
    499    111,   186,   111,   186,   111,   187,     0,   111,   186,   111,
    500    186,   111,   186,   111,   187,     0,   165,    88,   166,    89,
    501      0,    29,   177,   180,     0,     0,   166,   187,   167,    15,
    502      0,     0,   111,     0,    28,   169,    88,   170,    89,     0,
    503      0,   169,    73,   187,   111,   187,   111,   187,   111,   187,
    504      0,   169,    74,   187,   111,   187,   111,   187,   111,   187,
    505      0,   169,    78,   187,     0,   169,    75,   187,     0,   169,
    506     76,   187,     0,   169,    77,   187,     0,   169,    79,   187,
    507      0,     0,   170,   171,     0,    49,    15,    88,   172,    89,
    508      0,     0,   172,   173,     0,   171,     0,    50,    15,   111,
    509     15,     0,    50,    15,   111,   174,     0,   187,     0,   174,
    510    111,   187,     0,    86,   177,   187,   111,   187,   180,    88,
    511    176,    89,     0,     0,   176,    87,   187,     0,   176,    84,
    512      0,     0,   177,   178,     0,   177,   179,     0,    63,     0,
    513     65,     0,    61,     0,    59,     0,    62,     0,    64,     0,
    514     60,     0,     0,   180,   181,     0,   180,   182,     0,   180,
    515    183,     0,    72,   187,   111,   187,     0,    68,   187,     0,
    516     71,   187,     0,    88,   185,    89,     0,    18,     0,    13,
    517      0,    14,     0,    15,     0,   185,   167,    18,     0,   185,
    518    167,    13,     0,   185,   167,    14,     0,   185,   167,    15,
    519      0,     0,   187,     0,   188,   189,     0,     0,   189,   102,
    520    189,     0,   189,   103,   189,     0,   189,    93,   189,     0,
    521    189,    95,   189,     0,   189,   104,   189,     0,   189,   105,
    522    189,     0,   106,   189,     0,   103,   189,     0,   109,   189,
    523    110,     0,   190,     0,   108,   190,     0,    13,     0,    14,
    524      0
     461    31,   120,   168,   188,   111,   188,   111,   188,   139,     0,
     462    15,   168,   188,   111,   188,   111,   188,   111,   188,   111,
     463   188,   142,     0,   188,   111,   188,   111,   188,   111,   188,
     464   111,   188,   142,     0,     0,   111,   188,   111,   188,     0,
     465   111,   188,   111,   188,   111,   144,     0,   111,   188,   111,
     466   188,   111,   144,   111,   144,     0,   120,   168,   188,   111,
     467   145,   111,   144,   111,   188,   111,   188,   111,   188,   111,
     468   188,   111,   144,     0,   120,   168,   188,   111,   145,   111,
     469   144,   111,   188,   111,   188,   111,   188,   111,   188,     0,
     470    30,   188,   111,    15,     0,     0,   111,   144,     0,     0,
     471   111,   144,     0,   111,   144,   111,   144,     0,   144,    93,
     472   144,     0,   109,   144,   110,     0,   190,     0,   108,   190,
     473     0,   188,     0,    15,     0,    23,   178,   188,   111,   188,
     474   111,   188,   111,   188,   153,   147,    88,   148,    89,     0,
     475     0,   147,    70,   144,     0,   147,    69,   144,     0,   147,
     476    67,    15,     0,   147,   141,     0,   147,   154,     0,   147,
     477    66,   120,     0,   147,    24,   119,     0,   147,   182,     0,
     478   147,   183,     0,   147,   184,     0,     0,   148,    44,   149,
     479     0,   148,    45,   151,     0,   148,    42,   151,     0,   148,
     480    41,   151,     0,   148,    43,   151,     0,   148,    35,   150,
     481     0,   148,    36,   150,     0,   148,    40,   150,     0,   148,
     482    37,   150,     0,   148,    38,   150,     0,   148,    32,   150,
     483     0,   148,    39,   150,     0,   148,    33,   150,     0,   148,
     484    34,   150,     0,   148,    48,   150,     0,   148,    47,   150,
     485     0,   148,    46,   150,     0,   148,    31,   120,   168,   188,
     486   111,   188,   111,   188,   139,     0,   120,   168,   188,   111,
     487   145,   111,   144,   111,   188,   111,   188,   111,   188,   111,
     488   188,   111,   144,   153,   152,     0,   120,   168,   188,   111,
     489   145,   111,   144,   111,   188,   111,   188,   111,   188,   111,
     490   188,   152,     0,    15,   168,   188,   111,   188,   111,   188,
     491   111,   188,   111,   188,   143,   152,     0,   188,   111,   188,
     492   111,   188,   111,   188,   111,   188,   143,   152,     0,     0,
     493   185,     0,     0,   111,   188,     0,    30,   188,   111,    15,
     494   111,   188,   111,   188,   155,     0,     0,   111,   188,     0,
     495    24,   178,   181,   157,     0,    88,   158,    89,     0,     0,
     496   158,    82,    15,   168,   188,   159,     0,   158,    82,    84,
     497     0,   158,    83,    15,   159,   157,     0,     0,   111,    56,
     498   159,     0,   111,    55,   159,     0,   111,    85,   159,     0,
     499   111,    57,   159,     0,   111,    80,   159,     0,   111,    81,
     500   159,     0,    25,   178,   181,   161,     0,    88,   162,    89,
     501     0,     0,   162,    82,    15,   163,     0,   162,    82,    84,
     502     0,   162,    83,    15,   164,   161,     0,     0,   111,   188,
     503     0,   111,   187,   111,   187,   159,     0,   111,   187,   111,
     504   187,   111,   188,     0,     0,   111,   188,     0,   111,   187,
     505   111,   188,     0,   111,   187,   111,   187,   111,   188,     0,
     506   111,   187,   111,   187,   111,   187,   111,   188,     0,   166,
     507    88,   167,    89,     0,    29,   178,   181,     0,     0,   167,
     508   188,   168,    15,     0,     0,   111,     0,    28,   170,    88,
     509   171,    89,     0,     0,   170,    73,   188,   111,   188,   111,
     510   188,   111,   188,     0,   170,    74,   188,   111,   188,   111,
     511   188,   111,   188,     0,   170,    78,   188,     0,   170,    75,
     512   188,     0,   170,    76,   188,     0,   170,    77,   188,     0,
     513   170,    79,   188,     0,     0,   171,   172,     0,    49,    15,
     514    88,   173,    89,     0,     0,   173,   174,     0,   172,     0,
     515    50,    15,   111,    15,     0,    50,    15,   111,   175,     0,
     516   188,     0,   175,   111,   188,     0,    86,   178,   188,   111,
     517   188,   181,    88,   177,    89,     0,     0,   177,    87,   188,
     518     0,   177,    84,     0,     0,   178,   179,     0,   178,   180,
     519     0,    63,     0,    65,     0,    61,     0,    59,     0,    62,
     520     0,    64,     0,    60,     0,     0,   181,   182,     0,   181,
     521   183,     0,   181,   184,     0,    72,   188,   111,   188,     0,
     522    68,   188,     0,    71,   188,     0,    88,   186,    89,     0,
     523    18,     0,    13,     0,    14,     0,    15,     0,   186,   168,
     524    18,     0,   186,   168,    13,     0,   186,   168,    14,     0,
     525   186,   168,    15,     0,     0,   188,     0,   189,     0,   189,
     526   102,   189,     0,   189,   103,   189,     0,   189,    93,   189,
     527     0,   189,    95,   189,     0,   189,   104,   189,     0,   189,
     528   105,   189,     0,   106,   189,     0,   103,   189,     0,   109,
     529   189,   110,     0,   190,     0,   108,   190,     0,    13,     0,
     530    14,     0
    525531};
    526532
     
    529535#if YYDEBUG != 0
    530536static const short yyrline[] = { 0,
    531    303,   323,   324,   349,   350,   355,   356,   357,   358,   359,
    532    360,   363,   364,   365,   366,   367,   368,   369,   370,   371,
    533    372,   373,   374,   375,   376,   377,   378,   379,   383,   384,
    534    385,   386,   390,   391,   392,   393,   394,   399,   414,   422,
    535    435,   441,   452,   453,   463,   464,   465,   479,   480,   486,
    536    487,   488,   502,   503,   509,   510,   511,   512,   513,   517,
    537    518,   522,   523,   528,   532,   533,   541,   549,   562,   575,
    538    576,   595,   607,   617,   641,   642,   643,   646,   647,   648,
    539    649,   650,   651,   652,   657,   688,   689,   690,   691,   692,
    540    693,   694,   695,   696,   697,   700,   701,   702,   703,   704,
    541    705,   706,   707,   708,   709,   711,   712,   713,   714,   715,
    542    716,   717,   718,   720,   730,   750,   766,   769,   774,   781,
    543    792,   806,   821,   825,   826,   830,   831,   832,   836,   841,
    544    849,   888,   889,   890,   891,   892,   893,   894,   895,   896,
    545    897,   898,   901,   902,   903,   904,   905,   906,   907,   908,
    546    909,   910,   912,   913,   914,   915,   916,   917,   918,   919,
    547    921,   931,   957,   973,  1001,  1024,  1025,  1028,  1029,  1033,
    548   1040,  1041,  1045,  1068,  1072,  1073,  1082,  1088,  1107,  1108,
    549   1109,  1110,  1111,  1112,  1113,  1117,  1142,  1146,  1147,  1163,
    550   1169,  1189,  1190,  1194,  1202,  1213,  1214,  1218,  1224,  1232,
    551   1252,  1293,  1304,  1305,  1335,  1336,  1341,  1348,  1349,  1359,
    552   1369,  1376,  1383,  1390,  1397,  1407,  1408,  1417,  1425,  1426,
    553   1435,  1440,  1446,  1455,  1456,  1460,  1486,  1487,  1492,  1501,
    554   1502,  1512,  1527,  1528,  1529,  1530,  1533,  1534,  1535,  1539,
    555   1540,  1548,  1556,  1567,  1571,  1575,  1579,  1583,  1584,  1585,
    556   1586,  1587,  1588,  1589,  1590,  1597,  1598,  1600,  1603,  1606,
    557   1607,  1608,  1609,  1610,  1611,  1612,  1613,  1615,  1616,  1617,
    558   1620,  1621
     537   310,   330,   331,   356,   357,   362,   363,   364,   365,   366,
     538   367,   370,   371,   372,   373,   374,   375,   376,   377,   378,
     539   379,   380,   381,   382,   383,   384,   385,   386,   390,   391,
     540   392,   393,   397,   398,   399,   400,   401,   406,   421,   429,
     541   442,   450,   461,   462,   472,   473,   474,   488,   489,   495,
     542   496,   497,   511,   512,   518,   519,   520,   521,   522,   526,
     543   527,   531,   532,   537,   541,   542,   550,   558,   571,   584,
     544   585,   604,   616,   626,   650,   651,   652,   655,   656,   657,
     545   658,   659,   660,   661,   666,   701,   702,   703,   704,   705,
     546   706,   707,   708,   709,   710,   713,   714,   715,   716,   717,
     547   718,   719,   720,   721,   722,   724,   725,   726,   727,   728,
     548   729,   730,   731,   733,   743,   762,   777,   780,   785,   792,
     549   803,   817,   832,   837,   838,   842,   843,   844,   848,   849,
     550   850,   851,   855,   860,   868,   913,   914,   915,   916,   917,
     551   918,   919,   920,   921,   922,   923,   926,   927,   928,   929,
     552   930,   931,   932,   933,   934,   935,   937,   938,   939,   940,
     553   941,   942,   943,   944,   946,   956,   981,   997,  1025,  1048,
     554  1049,  1052,  1053,  1057,  1064,  1065,  1069,  1092,  1096,  1097,
     555  1106,  1112,  1131,  1132,  1133,  1134,  1135,  1136,  1137,  1141,
     556  1166,  1170,  1171,  1187,  1193,  1213,  1214,  1218,  1226,  1237,
     557  1238,  1242,  1248,  1256,  1276,  1317,  1328,  1329,  1361,  1362,
     558  1367,  1374,  1375,  1385,  1395,  1402,  1409,  1416,  1423,  1433,
     559  1434,  1443,  1451,  1452,  1461,  1466,  1472,  1481,  1482,  1486,
     560  1512,  1513,  1518,  1527,  1528,  1538,  1553,  1554,  1555,  1556,
     561  1559,  1560,  1561,  1565,  1566,  1574,  1582,  1593,  1597,  1601,
     562  1605,  1609,  1610,  1611,  1612,  1613,  1614,  1615,  1616,  1623,
     563  1624,  1626,  1629,  1630,  1631,  1632,  1633,  1634,  1635,  1636,
     564  1638,  1639,  1640,  1643,  1644
    559565};
    560566#endif
     
    581587"usertype","accelerators","events","acc_opt","dialog","dlg_attributes","ctrls",
    582588"lab_ctrl","ctrl_desc","iconinfo","gen_ctrl","opt_font","optional_style","optional_style_pair",
    583 "ctlclass","dialogex","dlgex_attribs","exctrls","gen_exctrl","lab_exctrl","exctrl_desc",
    584 "opt_data","helpid","opt_exfont","opt_expr","menu","menu_body","item_definitions",
    585 "item_options","menuex","menuex_body","itemex_definitions","itemex_options",
    586 "itemex_p_options","stringtable","stt_head","strings","opt_comma","versioninfo",
    587 "fix_version","ver_blocks","ver_block","ver_values","ver_value","ver_words",
    588 "toolbar","toolbar_items","loadmemopts","lamo","lama","opt_lvc","opt_language",
    589 "opt_characts","opt_version","raw_data","raw_elements","e_expr","expr","dummy",
    590 "xpr","any_num", NULL
     589"style","ctlclass","dialogex","dlgex_attribs","exctrls","gen_exctrl","lab_exctrl",
     590"exctrl_desc","opt_data","helpid","opt_exfont","opt_expr","menu","menu_body",
     591"item_definitions","item_options","menuex","menuex_body","itemex_definitions",
     592"itemex_options","itemex_p_options","stringtable","stt_head","strings","opt_comma",
     593"versioninfo","fix_version","ver_blocks","ver_block","ver_values","ver_value",
     594"ver_words","toolbar","toolbar_items","loadmemopts","lamo","lama","opt_lvc",
     595"opt_language","opt_characts","opt_version","raw_data","raw_elements","e_expr",
     596"expr","xpr","any_num", NULL
    591597};
    592598#endif
     
    606612   136,   136,   136,   136,   137,   138,   139,   139,   139,   139,
    607613   140,   140,   141,   142,   142,   143,   143,   143,   144,   144,
    608    145,   146,   146,   146,   146,   146,   146,   146,   146,   146,
    609    146,   146,   147,   147,   147,   147,   147,   147,   147,   147,
    610    147,   147,   147,   147,   147,   147,   147,   147,   147,   147,
    611    147,   148,   148,   149,   150,   151,   151,   152,   152,   153,
    612    154,   154,   155,   156,   157,   157,   157,   157,   158,   158,
    613    158,   158,   158,   158,   158,   159,   160,   161,   161,   161,
    614    161,   162,   162,   162,   162,   163,   163,   163,   163,   163,
    615    164,   165,   166,   166,   167,   167,   168,   169,   169,   169,
    616    169,   169,   169,   169,   169,   170,   170,   171,   172,   172,
    617    173,   173,   173,   174,   174,   175,   176,   176,   176,   177,
    618    177,   177,   178,   178,   178,   178,   179,   179,   179,   180,
    619    180,   180,   180,   181,   182,   183,   184,   185,   185,   185,
    620    185,   185,   185,   185,   185,   186,   186,   187,   188,   189,
    621    189,   189,   189,   189,   189,   189,   189,   189,   189,   189,
    622    190,   190
     614   144,   144,   145,   145,   146,   147,   147,   147,   147,   147,
     615   147,   147,   147,   147,   147,   147,   148,   148,   148,   148,
     616   148,   148,   148,   148,   148,   148,   148,   148,   148,   148,
     617   148,   148,   148,   148,   148,   149,   149,   150,   151,   152,
     618   152,   153,   153,   154,   155,   155,   156,   157,   158,   158,
     619   158,   158,   159,   159,   159,   159,   159,   159,   159,   160,
     620   161,   162,   162,   162,   162,   163,   163,   163,   163,   164,
     621   164,   164,   164,   164,   165,   166,   167,   167,   168,   168,
     622   169,   170,   170,   170,   170,   170,   170,   170,   170,   171,
     623   171,   172,   173,   173,   174,   174,   174,   175,   175,   176,
     624   177,   177,   177,   178,   178,   178,   179,   179,   179,   179,
     625   180,   180,   180,   181,   181,   181,   181,   182,   183,   184,
     626   185,   186,   186,   186,   186,   186,   186,   186,   186,   187,
     627   187,   188,   189,   189,   189,   189,   189,   189,   189,   189,
     628   189,   189,   189,   190,   190
    623629};
    624630
     
    636642     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
    637643     3,     3,     3,    10,    12,    10,     0,     4,     6,     8,
    638     17,    15,     4,     0,     2,     0,     2,     4,     1,     1,
    639     14,     0,     3,     3,     3,     2,     2,     3,     3,     2,
    640      2,     2,     0,     3,     3,     3,     3,     3,     3,     3,
     644    17,    15,     4,     0,     2,     0,     2,     4,     3,     3,
     645     1,     2,     1,     1,    14,     0,     3,     3,     3,     2,
     646     2,     3,     3,     2,     2,     2,     0,     3,     3,     3,
    641647     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
    642     10,    19,    16,    13,    11,     0,     1,     0,     2,     9,
    643      0,     2,     4,     3,     0,     6,     3,     5,     0,     3,
    644      3,     3,     3,     3,     3,     4,     3,     0,     4,     3,
    645      5,     0,     2,     5,     6,     0,     2,     4,     6,     8,
    646      4,     3,     0,     4,     0,     1,     5,     0,     9,     9,
    647      3,     3,     3,     3,     3,     0,     2,     5,     0,     2,
    648      1,     4,     4,     1,     3,     9,     0,     3,     2,     0,
    649      2,     2,     1,     1,     1,     1,     1,     1,     1,     0,
    650      2,     2,     2,     4,     2,     2,     3,     1,     1,     1,
    651      1,     3,     3,     3,     3,     0,     1,     2,     0,     3,
    652      3,     3,     3,     3,     3,     2,     2,     3,     1,     2,
    653      1,     1
     648     3,     3,     3,     3,    10,    19,    16,    13,    11,     0,
     649     1,     0,     2,     9,     0,     2,     4,     3,     0,     6,
     650     3,     5,     0,     3,     3,     3,     3,     3,     3,     4,
     651     3,     0,     4,     3,     5,     0,     2,     5,     6,     0,
     652     2,     4,     6,     8,     4,     3,     0,     4,     0,     1,
     653     5,     0,     9,     9,     3,     3,     3,     3,     3,     0,
     654     2,     5,     0,     2,     1,     4,     4,     1,     3,     9,
     655     0,     3,     2,     0,     2,     2,     1,     1,     1,     1,
     656     1,     1,     1,     0,     2,     2,     2,     4,     2,     2,
     657     3,     1,     1,     1,     1,     3,     3,     3,     3,     0,
     658     1,     1,     3,     3,     3,     3,     3,     3,     2,     2,
     659     3,     1,     2,     1,     1
    654660};
    655661
    656662static const short yydefact[] = {     2,
    657    259,     0,     0,     0,     0,     0,     0,    33,    34,    42,
    658    230,   259,     4,     5,     3,     0,    39,     0,    40,    41,
    659      0,     0,   271,   272,    30,     0,     0,     0,     0,     0,
    660      0,    12,    29,     0,     0,    10,     0,    11,    35,    37,
    661     36,   240,     0,    72,    73,   230,   230,   230,   230,   230,
    662    230,   230,     0,   230,   208,   230,   230,   230,   230,    38,
    663     46,    47,    51,    52,    55,    56,    50,    58,   230,    45,
    664     48,    49,    53,    54,    59,    57,   203,     0,     0,     0,
    665      0,   258,   269,    31,     0,    25,    26,    24,    27,     0,
    666      6,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    667      0,     0,     7,     8,     9,   236,   239,   235,   237,   233,
    668    238,   234,   231,   232,   202,   259,   240,     0,     0,   259,
    669    259,   240,   240,    67,   240,     0,     0,     0,   259,   240,
    670      0,   259,   267,   266,   270,     0,     0,     0,     0,     0,
    671      0,     0,     0,    28,    13,    14,    17,    18,    19,    20,
    672     22,    21,    23,    15,    16,   259,   259,   241,   242,   243,
    673    244,     0,    60,     0,    61,    62,    63,     0,     0,     0,
    674      0,     0,   259,   259,   259,   259,   259,   259,   259,   216,
    675     64,    65,    66,     0,     0,    70,    71,   201,   205,   268,
    676    262,   263,   260,   261,   264,   265,    32,   245,   246,    75,
    677    249,   250,   251,   248,   205,   259,   259,   175,   173,   188,
    678    186,    68,     0,     0,   212,   213,   214,   211,   215,     0,
    679    259,    69,   206,     0,   259,   247,     0,     0,     0,     0,
    680      0,   259,   259,     0,   207,   217,   240,   204,     0,    74,
    681      0,   253,   254,   255,   252,   259,   259,     0,     0,   174,
    682      0,     0,   187,     0,     0,     0,     0,   259,   259,     0,
    683      0,     0,   177,   179,   192,   190,   196,   259,   259,   219,
    684    227,    78,    78,   259,   259,   259,     0,     0,   259,   189,
    685    259,     0,     0,     0,     0,     0,    76,    77,    86,   168,
    686    179,   179,   179,   179,   179,   179,   179,   178,     0,   193,
    687      0,   197,   191,   259,   259,     0,   218,   221,   220,   229,
    688    259,   226,     0,     0,   259,   132,   176,   181,   180,   183,
    689    184,   185,   182,   259,   259,   209,   210,     0,   228,    81,
    690     80,    82,    83,    84,    79,   259,   259,   259,     0,   259,
    691    259,    96,    90,    93,    94,    95,   169,     0,   179,   257,
    692      0,   198,   259,    42,    92,     0,    44,    43,    91,    89,
    693     88,    87,     0,   259,   259,   259,     0,   259,   259,   143,
    694    136,   137,   140,   141,   142,   259,   194,   259,   222,   223,
    695    224,     0,   259,     0,     0,     0,     0,     0,     0,     0,
    696      0,     0,   259,   259,   259,   259,   259,     0,     0,     0,
    697     85,   139,     0,   138,   135,   134,   133,     0,   195,     0,
    698    199,   259,   123,     0,     0,   107,   109,   110,   102,   103,
    699    105,   106,   108,   104,   100,     0,    99,   101,     0,    97,
    700     98,   113,   112,   111,     0,   259,     0,     0,     0,     0,
    701      0,     0,     0,     0,     0,   259,   259,   259,   259,   259,
    702      0,     0,     0,   131,   259,   225,   259,   259,   259,   259,
    703    123,     0,     0,   154,   156,   157,   149,   150,   152,   153,
    704    155,   151,   147,     0,   146,   148,     0,   144,   145,   160,
    705    159,   158,   200,     0,     0,     0,     0,   259,   259,   259,
    706    259,   259,   259,   259,   259,   259,     0,     0,     0,     0,
    707      0,     0,     0,     0,   130,     0,   129,   259,   259,   259,
    708    259,   259,   259,   259,   259,   259,   171,     0,     0,     0,
    709      0,   117,     0,     0,     0,   259,   170,   259,   259,   259,
    710    259,   259,   114,   259,   259,   259,   172,   117,     0,     0,
    711      0,     0,     0,   124,     0,   161,   259,   259,   259,   259,
    712    259,   259,   116,   259,     0,   126,     0,   118,   124,   125,
    713      0,   259,   259,   166,   259,   259,   115,   259,   126,   127,
    714    165,   167,     0,   119,     0,   166,   259,   259,   259,   259,
    715    164,   128,     0,   120,   122,   259,   259,   166,   121,   256,
    716    163,   168,   166,   162,     0,     0,     0
     663     1,     0,     0,     0,     0,     0,     0,    33,    34,   274,
     664   275,    42,   234,     0,     0,     0,     0,     0,     4,     5,
     665     3,     0,    39,     0,    40,    41,   262,   272,     0,    30,
     666     0,     0,     0,     0,     0,     0,    12,    29,     0,     0,
     667    10,     0,    11,    35,    37,    36,   244,     0,   270,   269,
     668   273,     0,    72,    73,   234,   234,   234,   234,   234,   234,
     669   234,     0,   234,   212,   234,   234,   234,   234,    38,    46,
     670    47,    51,    52,    55,    56,    50,    58,   234,    45,    48,
     671    49,    53,    54,    59,    57,   207,     0,     0,     0,     0,
     672     0,     0,    31,     0,    25,    26,    24,    27,     0,     6,
     673     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     674     0,     7,     8,     9,   240,   243,   239,   241,   237,   242,
     675   238,   235,   236,   206,     0,   271,   244,     0,     0,     0,
     676     0,   244,   244,    67,   244,     0,     0,     0,     0,   244,
     677     0,     0,   265,   266,   263,   264,   267,   268,     0,    28,
     678    13,    14,    17,    18,    19,    20,    22,    21,    23,    15,
     679    16,     0,     0,   245,   246,   247,   248,     0,    60,     0,
     680    61,    62,    63,     0,     0,     0,     0,     0,     0,     0,
     681     0,     0,     0,     0,     0,   220,    64,    65,    66,     0,
     682     0,    70,    71,   205,   209,    32,   249,   250,    75,   253,
     683   254,   255,   252,   209,     0,     0,   179,   177,   192,   190,
     684    68,     0,     0,   216,   217,   218,   215,   219,     0,     0,
     685    69,   210,     0,     0,   251,     0,     0,     0,     0,     0,
     686     0,     0,     0,   211,   221,   244,   208,     0,    74,     0,
     687   257,   258,   259,   256,     0,     0,     0,     0,   178,     0,
     688     0,   191,     0,     0,     0,     0,     0,     0,     0,     0,
     689   209,   181,   183,   196,   194,   200,     0,     0,   223,   231,
     690    78,    78,     0,     0,     0,     0,     0,   260,   193,   260,
     691     0,     0,     0,     0,     0,    76,    77,    86,   172,   183,
     692   183,   183,   183,   183,   183,   183,   182,     0,   197,     0,
     693   201,   195,     0,     0,     0,   222,   225,   224,   233,     0,
     694   230,     0,     0,     0,   136,   180,   185,   184,   187,   188,
     695   189,   186,   260,   260,   213,   214,     0,   232,    81,    80,
     696    82,    83,    84,    79,     0,     0,     0,     0,     0,     0,
     697    96,    90,    93,    94,    95,   173,     0,   183,   261,     0,
     698   202,     0,    42,    92,     0,    44,    43,    91,    89,     0,
     699     0,    88,   131,    87,     0,     0,     0,     0,     0,     0,
     700     0,   147,   140,   141,   144,   145,   146,     0,   198,   260,
     701   226,   227,   228,     0,   132,     0,     0,     0,     0,     0,
     702     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     703     0,     0,     0,     0,     0,    85,   143,     0,   142,   139,
     704   138,   137,     0,   199,     0,   203,     0,   123,   130,   129,
     705   209,   209,   107,   109,   110,   102,   103,   105,   106,   108,
     706   104,   100,     0,    99,   101,   209,    97,    98,   113,   112,
     707   111,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     708     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     709   135,     0,   229,     0,     0,     0,     0,   123,   209,   209,
     710   158,   160,   161,   153,   154,   156,   157,   159,   155,   151,
     711     0,   150,   152,   209,   148,   149,   164,   163,   162,   204,
     712     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     713     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     714     0,   134,     0,   133,     0,     0,     0,     0,     0,     0,
     715     0,     0,     0,   175,     0,     0,     0,     0,   117,     0,
     716     0,     0,     0,   174,     0,     0,     0,     0,     0,   114,
     717     0,     0,     0,   176,   117,     0,     0,     0,     0,     0,
     718   124,     0,   165,     0,     0,     0,     0,     0,     0,   116,
     719     0,     0,   126,     0,   118,   124,   125,     0,     0,     0,
     720   170,     0,     0,   115,     0,   126,   127,   169,   171,     0,
     721   119,     0,   170,     0,     0,     0,     0,   168,   128,     0,
     722   120,   122,     0,     0,   170,   121,     0,   167,   172,   170,
     723   166,     0,     0,     0
    717724};
    718725
    719 static const short yydefgoto[] = {   595,
    720      1,    13,    31,    32,    14,    15,   358,   359,    60,    61,
    721     62,    63,    64,    65,    66,    67,    68,    69,    70,   225,
    722    287,    71,   314,   363,   416,   425,   533,   430,   343,   553,
    723    564,   506,    72,   348,   408,   478,   464,   473,   571,   316,
    724    372,   527,    73,   209,   230,   278,    74,   211,   231,   280,
    725    282,    17,    18,   132,   224,    75,   126,   220,   236,   285,
    726    309,   380,    76,   286,    42,   113,   114,   115,   158,   159,
    727    160,   572,   205,   299,    20,    21,    82,    33
     726static const short yydefgoto[] = {   602,
     727     1,    19,    36,    37,    20,    21,   357,   358,    69,    70,
     728    71,    72,    73,    74,    75,    76,    77,    78,    79,   224,
     729   286,    80,   313,   365,   423,   432,   540,   437,   342,   560,
     730   571,   362,   513,    81,   347,   413,   485,   471,   480,   578,
     731   315,   374,   534,    82,   208,   229,   277,    83,   210,   230,
     732   279,   281,    23,    24,   142,   223,    84,   136,   219,   235,
     733   284,   308,   382,    85,   285,    47,   122,   123,   124,   164,
     734   165,   166,   579,   204,   298,    26,    27,    28
    728735};
    729736
    730737static const short yypact[] = {-32768,
    731    199,     9,    20,    28,     6,     9,    51,-32768,-32768,    -7,
    732 -32768,-32768,-32768,-32768,-32768,   253,-32768,    18,-32768,-32768,
    733    -10,    -8,-32768,-32768,-32768,     9,     9,     9,     9,     9,
    734     77,-32768,-32768,    61,    70,-32768,    90,-32768,-32768,-32768,
    735 -32768,   484,     8,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    736 -32768,-32768,   126,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
     738    39,    10,    -4,     0,    -1,    10,    15,-32768,-32768,-32768,
     739-32768,   -15,-32768,   197,   197,   197,    82,   197,-32768,-32768,
     740-32768,   442,-32768,   -68,-32768,-32768,   390,-32768,     6,-32768,
     741    10,    10,    10,    10,    10,   298,-32768,-32768,    31,    56,
     742-32768,   351,-32768,-32768,-32768,-32768,   611,   -41,    50,-32768,
     743-32768,   483,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
     744-32768,    55,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    737745-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    738 -32768,-32768,-32768,-32768,-32768,-32768,-32768,   -10,   -10,    13,
    739    -10,   570,-32768,-32768,   137,-32768,-32768,-32768,-32768,   525,
    740 -32768,     9,     9,     9,     9,     9,     9,     9,     9,     9,
    741      9,     9,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    742 -32768,-32768,-32768,-32768,   308,-32768,   484,   271,   309,   484,
    743    484,   484,   484,-32768,   484,   453,   179,   327,   484,   484,
    744    343,    81,   -70,-32768,-32768,   467,   -10,   -10,   -10,   -10,
    745    -10,   -10,    62,-32768,   584,   391,   371,   311,   311,   116,
    746    116,   116,   116,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    747 -32768,    42,-32768,   237,-32768,-32768,-32768,    72,    74,   129,
    748    214,   219,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    749 -32768,-32768,-32768,    87,   219,-32768,-32768,-32768,    97,-32768,
    750    206,   -14,   -70,   -70,-32768,-32768,-32768,-32768,-32768,-32768,
    751 -32768,-32768,-32768,-32768,    -4,-32768,-32768,-32768,-32768,-32768,
    752 -32768,-32768,   103,   105,-32768,-32768,-32768,-32768,-32768,   -30,
    753 -32768,-32768,-32768,   222,    -5,-32768,   336,   134,   143,   144,
    754    215,-32768,-32768,   245,-32768,-32768,-32768,-32768,   154,-32768,
    755    159,-32768,-32768,-32768,-32768,-32768,-32768,    -1,   281,-32768,
    756      2,   285,-32768,   194,   195,   201,   274,-32768,-32768,   205,
    757    212,   213,-32768,   216,   227,-32768,   229,-32768,-32768,-32768,
    758 -32768,-32768,-32768,-32768,-32768,-32768,   168,   259,   241,-32768,
    759    241,   267,   247,   250,   -17,   -44,   252,   252,-32768,   256,
    760    216,   216,   216,   216,   216,   216,   216,-32768,   264,   266,
    761    282,   266,-32768,-32768,-32768,   379,-32768,-32768,-32768,-32768,
    762 -32768,-32768,   178,     7,-32768,-32768,-32768,-32768,-32768,-32768,
    763 -32768,-32768,-32768,   -29,   241,-32768,-32768,   284,-32768,-32768,
    764 -32768,-32768,-32768,-32768,-32768,   380,-32768,   279,   383,-32768,
    765 -32768,-32768,-32768,-32768,-32768,-32768,-32768,   354,   288,-32768,
    766    290,   266,   401,-32768,-32768,   306,-32768,-32768,-32768,-32768,
    767 -32768,-32768,   418,   380,-32768,   279,   403,-32768,-32768,-32768,
    768 -32768,-32768,-32768,-32768,-32768,   168,-32768,   241,-32768,   316,
    769 -32768,   404,   279,   413,   413,   413,   413,   413,   413,   413,
    770    413,   413,-32768,-32768,-32768,   279,-32768,   413,   413,   413,
    771 -32768,-32768,   318,-32768,-32768,-32768,-32768,   548,-32768,   319,
    772    266,-32768,-32768,   321,   322,-32768,-32768,-32768,-32768,-32768,
    773 -32768,-32768,-32768,-32768,-32768,   326,-32768,-32768,   328,-32768,
    774 -32768,-32768,-32768,-32768,   425,   279,   426,   426,   426,   426,
    775    426,   426,   426,   426,   426,-32768,-32768,-32768,   279,-32768,
    776    426,   426,   426,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    777    333,   364,   375,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    778 -32768,-32768,-32768,   384,-32768,-32768,   394,-32768,-32768,-32768,
    779 -32768,-32768,-32768,   395,   397,   398,   399,-32768,-32768,-32768,
    780 -32768,-32768,-32768,-32768,-32768,   496,   402,   410,   414,   422,
    781    423,   441,   444,   446,-32768,   447,-32768,-32768,-32768,-32768,
    782 -32768,   496,-32768,-32768,-32768,-32768,   448,   450,   452,   462,
    783    465,   493,   495,   500,   501,-32768,-32768,-32768,-32768,-32768,
    784 -32768,-32768,-32768,-32768,-32768,-32768,-32768,   493,   502,   503,
    785    504,   507,   518,   519,   520,-32768,-32768,-32768,-32768,-32768,
    786 -32768,-32768,-32768,-32768,   521,   522,   523,   527,   519,-32768,
    787    536,-32768,-32768,   424,-32768,-32768,-32768,-32768,   522,   537,
    788 -32768,-32768,   538,   539,   540,   424,-32768,-32768,-32768,-32768,
    789 -32768,-32768,   553,-32768,   555,-32768,-32768,   -59,-32768,    43,
    790 -32768,   256,   424,-32768,   515,   564,-32768
     746-32768,-32768,-32768,-32768,-32768,-32768,   197,   197,   197,   197,
     747   197,   197,-32768,    58,-32768,-32768,-32768,-32768,   449,-32768,
     748    10,    10,    10,    10,    10,    10,    10,    10,    10,    10,
     749    10,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
     750-32768,-32768,-32768,   349,   197,-32768,   611,   345,   417,   110,
     751   110,   611,   611,-32768,   611,   558,    19,   439,   110,   611,
     752   454,   114,   517,   125,    50,    50,-32768,-32768,   -25,-32768,
     753   690,   700,   556,   706,   706,    85,    85,    85,    85,-32768,
     754-32768,   197,   197,-32768,-32768,-32768,-32768,   153,-32768,   401,
     755-32768,-32768,-32768,   -14,     7,   195,   255,   262,   197,   197,
     756   197,   197,   197,   197,   197,-32768,-32768,-32768,-32768,    53,
     757   262,-32768,-32768,-32768,    78,-32768,-32768,-32768,-32768,-32768,
     758-32768,-32768,-32768,   -13,   197,   197,-32768,-32768,-32768,-32768,
     759-32768,    88,   123,-32768,-32768,-32768,-32768,-32768,   -22,   197,
     760-32768,-32768,   135,    73,-32768,   516,   132,   148,    74,    95,
     761   197,   197,   178,-32768,-32768,-32768,-32768,   154,-32768,   157,
     762-32768,-32768,-32768,-32768,   197,   197,    -9,   254,-32768,    -7,
     763   257,-32768,   173,   184,    22,   276,   197,   197,   214,   220,
     764    78,-32768,   224,   230,-32768,   234,   197,   197,-32768,-32768,
     765-32768,-32768,   197,   197,   197,   111,   209,   197,-32768,   197,
     766   258,   240,   245,    76,   268,   252,   252,-32768,   267,   224,
     767   224,   224,   224,   224,   224,   224,-32768,   269,   273,   280,
     768   273,-32768,   197,   197,   297,-32768,-32768,-32768,-32768,   197,
     769-32768,   723,   530,   197,-32768,-32768,-32768,-32768,-32768,-32768,
     770-32768,-32768,   197,   197,-32768,-32768,   282,-32768,-32768,-32768,
     771-32768,-32768,-32768,-32768,   193,   197,    77,   364,    35,    35,
     772-32768,-32768,-32768,-32768,-32768,-32768,   618,   291,-32768,   292,
     773   273,    43,-32768,-32768,   302,-32768,-32768,-32768,-32768,    82,
     774    35,   294,-32768,   294,   676,   193,   197,    77,   420,    35,
     775    35,-32768,-32768,-32768,-32768,-32768,-32768,   201,-32768,   197,
     776-32768,   328,-32768,   425,-32768,    48,    35,    77,   426,   426,
     777   426,   426,   426,   426,   426,   426,   426,   197,   197,   197,
     778    77,   197,   426,   426,   426,-32768,-32768,   335,-32768,-32768,
     779   294,   294,   694,-32768,   347,   273,   197,-32768,-32768,-32768,
     780    78,    78,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
     781-32768,-32768,   348,-32768,-32768,    78,-32768,-32768,-32768,-32768,
     782-32768,   459,    77,   469,   469,   469,   469,   469,   469,   469,
     783   469,   469,   197,   197,   197,    77,   197,   469,   469,   469,
     784-32768,   197,-32768,   197,   197,   197,   197,   376,    78,    78,
     785-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
     786   378,-32768,-32768,    78,-32768,-32768,-32768,-32768,-32768,-32768,
     787   379,   380,   385,   386,   197,   197,   197,   197,   197,   197,
     788   197,   197,   146,   398,   400,   409,   411,   412,   413,   415,
     789   422,-32768,   424,-32768,   197,   197,   197,   197,   146,   197,
     790   197,   197,    35,   427,   428,   433,   444,   445,   447,   453,
     791   455,   101,   197,-32768,   197,   197,   197,    35,   197,-32768,
     792   197,   197,   197,-32768,   447,   456,   458,   149,   466,   468,
     793   470,   472,-32768,   197,   197,   197,   197,   197,    35,-32768,
     794   197,   478,   479,   480,   502,   470,   294,   503,   197,    35,
     795   465,   197,    35,-32768,   197,   479,   151,-32768,-32768,   504,
     796   218,   505,   465,    35,   197,    35,   197,-32768,   294,   506,
     797   294,   527,   197,    35,   -71,   294,    35,-32768,   231,   465,
     798-32768,   512,   537,-32768
    791799};
    792800
    793801static const short yypgoto[] = {-32768,
    794 -32768,-32768,    40,-32768,-32768,-32768,     1,  -355,-32768,-32768,
     802-32768,-32768,    28,-32768,-32768,-32768,     1,  -248,-32768,-32768,
    795803-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    796    363,-32768,-32768,-32768,   254,  -266,   133,-32768,   329,   108,
    797    110,   176,-32768,-32768,-32768,-32768,   217,  -300,  -546,    98,
    798 -32768,-32768,-32768,   411,-32768,  -137,-32768,   409,-32768,-32768,
    799 -32768,-32768,-32768,-32768,   487,-32768,-32768,-32768,   408,-32768,
    800 -32768,-32768,-32768,-32768,   551,-32768,-32768,  -110,     0,  -293,
    801   -290,   -80,-32768,  -275,   -12,-32768,   180,   -16
     804   308,-32768,-32768,-32768,    33,  -202,    49,-32768,   293,    94,
     805    63,  -333,   142,-32768,-32768,-32768,-32768,   312,   -84,  -223,
     806    68,-32768,-32768,-32768,   391,-32768,    26,-32768,   397,-32768,
     807-32768,-32768,-32768,-32768,-32768,  -190,-32768,-32768,-32768,   395,
     808-32768,-32768,-32768,-32768,-32768,   688,-32768,-32768,  -122,     2,
     809  -278,  -274,   107,-32768,  -259,   108,   186,    -2
    802810};
    803811
    804812
    805 #define YYLAST          693
    806 
    807 
    808 static const short yytable[] = {    43,
    809     19,    16,    23,    24,    83,   301,   162,    84,    39,   239,
    810    404,   170,   171,   262,   172,    36,   265,    22,   234,   185,
    811    345,    23,    24,   346,    25,    23,    24,   414,   164,   581,
    812    336,   234,   306,   141,   142,    34,   337,   165,   167,   310,
    813    429,   591,   311,    35,   312,    37,   594,   183,   349,   351,
    814    187,   590,  -256,  -256,   374,  -259,  -259,   375,   235,  -256,
    815     38,    83,    83,   135,    83,    86,    87,    88,    89,    90,
    816    103,   307,   338,   339,   156,   340,   341,   157,    12,   104,
    817    462,  -256,   263,   240,   226,   266,    91,   139,   140,   141,
    818    142,   212,    78,   477,   342,    79,    40,    80,    81,   105,
    819     85,    41,   410,   161,   222,    77,   223,   168,   169,   156,
    820     26,    27,   157,    12,    28,    29,   184,    30,   116,   189,
    821     83,    83,    83,    83,    83,    83,   257,   427,   428,   200,
    822    431,   145,   146,   147,   148,   149,   150,   151,   152,   153,
    823    154,   155,   124,   198,   199,  -259,   475,   476,  -259,   479,
    824   -259,  -259,   143,   317,   318,   319,   320,   321,   322,   323,
    825    213,   214,   215,   216,   217,   218,   219,    92,    93,   188,
    826     94,   197,    95,    96,    97,    98,    99,   100,   101,   102,
    827     92,    93,   206,    94,   207,    95,    96,    97,    98,    99,
    828    100,   101,   102,   228,   229,   181,   156,   221,    -1,   157,
    829     12,     2,     3,     4,     5,     6,     7,   223,   237,     8,
    830      9,   377,   241,   232,    10,   233,   208,   101,   102,   254,
    831    255,   330,   292,   293,   294,   248,   249,    11,   331,   332,
    832    333,   334,   250,   260,   261,   335,   238,   106,   107,   108,
    833    109,   110,   111,   112,   246,   272,   273,   295,   296,   201,
    834    202,   203,   297,   247,   204,   283,   284,   133,   134,   256,
    835    136,   289,   290,   291,   258,    44,   300,    45,   302,   259,
    836     12,    46,    47,    48,    49,    50,    51,    52,    53,    54,
    837     55,   156,    56,    57,   157,    12,   156,   163,   270,   157,
    838     12,   326,   327,   357,   354,   264,   251,   252,   329,   267,
    839    138,   210,   347,   253,   268,   269,   164,   139,   140,   141,
    840    142,   350,   352,   344,   592,   274,   191,   192,   193,   194,
    841    195,   196,   275,   276,   356,   166,   277,   361,   362,   106,
    842    107,   108,   109,   110,   111,   112,   355,   279,    58,   281,
    843    381,   156,    59,   182,   157,    12,   208,   373,   242,   243,
    844    244,  -256,   403,   245,   210,   406,   407,   304,   164,   186,
    845    305,   271,   313,   409,   402,   411,   315,   106,   107,   108,
    846    109,   110,   111,   112,   324,   156,  -257,   364,   157,    12,
    847    426,   426,   426,   365,   426,   106,   107,   108,   109,   110,
    848    111,   112,   325,   328,   353,   354,   164,   360,   376,   456,
    849    378,   106,   107,   108,   109,   110,   111,   112,    97,    98,
    850     99,   100,   101,   102,   164,   379,   382,   405,   413,   366,
    851    367,   156,   368,   369,   157,    12,   412,   415,   435,   455,
    852    164,   457,   458,   474,   474,   474,   459,   474,   460,   461,
    853    463,   370,   483,   488,   484,   485,   486,   487,   383,   384,
    854    385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
    855    395,   396,   397,   398,   399,   400,    95,    96,    97,    98,
    856     99,   100,   101,   102,   489,   497,   498,   499,   500,   501,
    857    502,   503,   504,   507,    94,   490,    95,    96,    97,    98,
    858     99,   100,   101,   102,   491,   517,   518,   519,   520,   507,
    859    522,   523,   524,   525,   492,   493,   401,   494,   495,   496,
    860    505,   164,   508,   537,   596,   538,   539,   540,   541,   542,
    861    509,   543,   544,   545,   510,   173,   174,   175,   176,   177,
    862    178,   179,   511,   512,   555,   556,   557,   558,   559,   560,
    863    180,   561,   106,   107,   108,   109,   110,   111,   112,   569,
    864    570,   513,   573,   574,   514,   575,   515,   516,   526,   137,
    865    528,   138,   529,   597,   582,   583,   584,   585,   139,   140,
    866    141,   142,   530,   588,   589,   531,   190,   350,   436,   437,
    867    438,   439,   440,   441,   442,   443,   444,   445,   446,   447,
    868    448,   449,   450,   451,   452,   453,   117,   118,   119,   120,
    869    121,   122,   123,   532,   125,   534,   127,   128,   129,   130,
    870    535,   536,   547,   548,   549,    92,    93,   550,    94,   131,
    871     95,    96,    97,    98,    99,   100,   101,   102,   551,   552,
    872    554,   562,   563,   565,   144,   288,   454,   566,   417,   418,
    873    419,   420,   421,   422,   423,   424,   568,   577,   578,   579,
    874    580,   432,   433,   434,   465,   466,   467,   468,   469,   470,
    875    471,   472,   137,   586,   138,   587,   567,   480,   481,   482,
    876    546,   139,   140,   141,   142,    93,   371,    94,   576,    95,
    877     96,    97,    98,    99,   100,   101,   102,   521,   298,   593,
    878    303,   227,   308
     813#define YYLAST          809
     814
     815
     816static const short yytable[] = {    38,
     817    44,    22,    25,    38,   168,   261,   364,   264,    41,   176,
     818   177,    39,   178,   226,    51,    40,   170,   191,    29,    86,
     819   300,    93,    10,    11,    43,    30,   233,   386,    38,    38,
     820    38,    38,    38,    42,   344,   187,   411,   412,   345,   597,
     821   112,     2,     3,     4,     5,     6,     7,    10,    11,     8,
     822     9,    10,    11,   420,    12,    10,    11,   381,    95,    96,
     823    97,    98,    99,   348,   350,   113,   234,    13,   376,   125,
     824   275,   134,   377,   149,   262,   225,   265,   115,   116,   117,
     825   118,   119,   120,   121,   196,    10,    11,   238,    45,    10,
     826    11,   356,   353,    46,    10,    11,   205,   222,    38,    38,
     827    38,    38,    38,    38,    38,    38,    38,    38,    38,   269,
     828    14,    31,    32,   256,    94,    33,    34,   206,    35,   409,
     829   415,    48,    10,    11,   233,   305,    10,    11,   151,   152,
     830   153,   154,   155,   156,   157,   158,   159,   160,   161,   421,
     831   387,    15,   360,   361,    16,    15,    17,    18,    16,   237,
     832    17,    18,   436,    91,    92,   247,   248,   419,    10,    11,
     833   512,   239,   249,   220,   306,   291,   292,   293,   115,   116,
     834   117,   118,   119,   120,   121,    15,   250,   251,    16,    15,
     835    17,    18,    16,   252,    17,    18,   110,   111,   222,   532,
     836   294,   295,   255,   387,   469,   296,   434,   435,   231,   438,
     837    49,    50,   194,    52,   548,    10,    11,   484,   353,    10,
     838    11,   543,    15,    10,    11,    16,    15,    17,    18,    16,
     839   162,    17,    18,   163,    14,   567,    89,    90,    91,    92,
     840   464,   465,   167,   232,   171,   173,   577,   174,   175,   581,
     841   199,   387,   245,   387,   189,   467,   190,   193,    15,   195,
     842   589,    16,   591,    17,    18,   291,   292,   293,   246,   556,
     843   596,   584,   162,   599,   257,   163,    14,   258,   263,   197,
     844   198,   266,   143,   144,   145,   146,   147,   148,   496,   497,
     845   294,   295,   207,   267,   211,   296,   212,   213,   214,   215,
     846   216,   217,   218,   499,   268,    15,   207,   221,    16,    15,
     847    17,    18,    16,    15,    17,    18,    16,   100,    17,    18,
     848   387,   327,   227,   228,   343,   316,   317,   318,   319,   320,
     849   321,   322,   162,   387,   273,   163,    14,   236,   586,   162,
     850   274,   240,   163,    14,   276,   354,   363,   363,   253,   254,
     851   278,   314,   209,   162,   280,   209,   163,    14,   375,   170,
     852   303,   309,   259,   260,   310,   304,   311,   385,   363,   588,
     853   114,   169,   312,   270,   271,   272,   407,   363,   363,   482,
     854   483,   598,   486,   379,   282,   283,   601,   314,   359,   323,
     855   288,   289,   290,  -261,   363,   299,   387,   301,   101,   102,
     856   324,   103,   352,   104,   105,   106,   107,   108,   109,   110,
     857   111,   378,   380,   115,   116,   117,   118,   119,   120,   121,
     858   325,   326,   384,   200,   201,   202,   162,   328,   203,   163,
     859    14,   346,   424,   425,   426,   427,   428,   429,   430,   431,
     860   349,   351,   170,   172,   410,   439,   440,   441,   417,   418,
     861   422,   101,   102,   355,   103,   442,   104,   105,   106,   107,
     862   108,   109,   110,   111,    53,   188,    54,   462,   466,   383,
     863    55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
     864   192,    65,    66,   468,   408,   115,   116,   117,   118,   119,
     865   120,   121,    87,   470,    88,   414,   495,   416,   498,   500,
     866   501,    89,    90,    91,    92,   502,   503,   115,   116,   117,
     867   118,   119,   120,   121,   170,   433,   433,   433,   515,   433,
     868   516,   603,   115,   116,   117,   118,   119,   120,   121,   517,
     869   363,   518,   519,   520,   463,   521,   170,    67,   241,   242,
     870   243,    68,   522,   244,   523,   363,   604,   533,   535,   101,
     871   102,   170,   103,   536,   104,   105,   106,   107,   108,   109,
     872   110,   111,   170,   335,   537,   538,   363,   539,   150,   336,
     873   481,   481,   481,   541,   481,   542,   554,   363,   555,   490,
     874   363,   491,   492,   493,   494,    87,   557,    88,   558,   287,
     875   559,   363,   561,   363,    89,    90,    91,    92,   569,   570,
     876   572,   363,   126,   553,   363,   337,   338,   162,   339,   340,
     877   163,    14,   504,   505,   506,   507,   508,   509,   510,   511,
     878   514,    88,   573,   575,   585,   587,   593,   341,    89,    90,
     879    91,    92,   524,   525,   526,   527,   514,   529,   530,   531,
     880   179,   180,   181,   182,   183,   184,   185,   594,   583,   373,
     881   544,   366,   545,   546,   547,   186,   549,   367,   550,   551,
     882   552,   104,   105,   106,   107,   108,   109,   110,   111,   574,
     883   528,   562,   563,   564,   565,   566,   600,   297,   568,   115,
     884   116,   117,   118,   119,   120,   121,   576,   302,   307,   580,
     885     0,     0,   582,   368,   369,   162,   370,   371,   163,    14,
     886     0,     0,   590,     0,   592,     0,     0,     0,     0,     0,
     887   595,     0,     0,     0,     0,   372,   388,   389,   390,   391,
     888   392,   393,   394,   395,   396,   397,   398,   399,   400,   401,
     889   402,   403,   404,   405,   443,   444,   445,   446,   447,   448,
     890   449,   450,   451,   452,   453,   454,   455,   456,   457,   458,
     891   459,   460,   127,   128,   129,   130,   131,   132,   133,     0,
     892   135,     0,   137,   138,   139,   140,   472,   473,   474,   475,
     893   476,   477,   478,   479,   406,   141,   329,     0,     0,   487,
     894   488,   489,     0,   330,   331,   332,   333,     0,     0,     0,
     895   334,   102,   461,   103,     0,   104,   105,   106,   107,   108,
     896   109,   110,   111,   103,     0,   104,   105,   106,   107,   108,
     897   109,   110,   111,   106,   107,   108,   109,   110,   111
    879898};
    880899
    881 static const short yycheck[] = {    12,
    882      1,     1,    13,    14,    21,   281,   117,    16,    16,    15,
    883    366,   122,   123,    15,   125,    10,    15,     9,    49,   130,
    884    314,    13,    14,   314,    16,    13,    14,   383,    88,   576,
    885     24,    49,    50,   104,   105,    16,    30,   118,   119,    84,
    886    396,   588,    87,    16,    89,     6,   593,   128,   324,   325,
    887    131,   111,    82,    83,   348,    13,    14,   348,    89,    89,
    888     10,    78,    79,    80,    81,    26,    27,    28,    29,    30,
    889     10,    89,    66,    67,    68,    69,    70,    71,    72,    10,
    890    436,   111,    84,    89,    89,    84,    10,   102,   103,   104,
    891    105,   172,   103,   449,    88,   106,   104,   108,   109,    10,
    892    109,   109,   378,   116,   185,    88,   111,   120,   121,    68,
    893    102,   103,    71,    72,   106,   107,   129,   109,   111,   132,
    894    137,   138,   139,   140,   141,   142,   237,   394,   395,    88,
    895    397,    92,    93,    94,    95,    96,    97,    98,    99,   100,
    896    101,   102,    17,   156,   157,   103,   447,   448,   106,   450,
    897    108,   109,    16,   291,   292,   293,   294,   295,   296,   297,
    898    173,   174,   175,   176,   177,   178,   179,    91,    92,    89,
    899     94,   110,    96,    97,    98,    99,   100,   101,   102,   103,
    900     91,    92,   111,    94,   111,    96,    97,    98,    99,   100,
    901    101,   102,   103,   206,   207,    17,    68,   111,     0,    71,
    902     72,     3,     4,     5,     6,     7,     8,   111,   221,    11,
    903     12,   349,   225,   111,    16,   111,    88,   102,   103,   232,
    904    233,    44,    55,    56,    57,    82,    83,    29,    51,    52,
    905     53,    54,    89,   246,   247,    58,    15,    59,    60,    61,
    906     62,    63,    64,    65,   111,   258,   259,    80,    81,    13,
    907     14,    15,    85,   111,    18,   268,   269,    78,    79,    15,
    908     81,   274,   275,   276,   111,    13,   279,    15,   281,   111,
    909     72,    19,    20,    21,    22,    23,    24,    25,    26,    27,
    910     28,    68,    30,    31,    71,    72,    68,    17,    88,    71,
    911     72,   304,   305,    15,    16,    15,    82,    83,   311,    15,
    912     95,    88,   315,    89,   111,   111,    88,   102,   103,   104,
    913    105,   324,   325,   314,   590,   111,   137,   138,   139,   140,
    914    141,   142,   111,   111,   337,    17,   111,   340,   341,    59,
    915     60,    61,    62,    63,    64,    65,   336,   111,    86,   111,
    916    353,    68,    90,    17,    71,    72,    88,   348,    13,    14,
    917     15,   111,   365,    18,    88,   368,   369,   111,    88,    17,
    918    111,    88,   111,   376,   364,   378,   111,    59,    60,    61,
    919     62,    63,    64,    65,   111,    68,   111,    24,    71,    72,
    920    393,   394,   395,    30,   397,    59,    60,    61,    62,    63,
    921     64,    65,   111,    15,   111,    16,    88,    15,   111,   412,
    922    111,    59,    60,    61,    62,    63,    64,    65,    98,    99,
    923    100,   101,   102,   103,    88,    15,   111,    15,    15,    66,
    924     67,    68,    69,    70,    71,    72,   111,    15,   111,   111,
    925     88,   111,   111,   446,   447,   448,   111,   450,   111,    15,
    926     15,    88,   455,   111,   457,   458,   459,   460,    31,    32,
    927     33,    34,    35,    36,    37,    38,    39,    40,    41,    42,
    928     43,    44,    45,    46,    47,    48,    96,    97,    98,    99,
    929    100,   101,   102,   103,   111,   488,   489,   490,   491,   492,
    930    493,   494,   495,   496,    94,   111,    96,    97,    98,    99,
    931    100,   101,   102,   103,   111,   508,   509,   510,   511,   512,
    932    513,   514,   515,   516,   111,   111,    89,   111,   111,   111,
    933     15,    88,   111,   526,     0,   528,   529,   530,   531,   532,
    934    111,   534,   535,   536,   111,    73,    74,    75,    76,    77,
    935     78,    79,   111,   111,   547,   548,   549,   550,   551,   552,
    936     88,   554,    59,    60,    61,    62,    63,    64,    65,   562,
    937    563,   111,   565,   566,   111,   568,   111,   111,   111,    93,
    938    111,    95,   111,     0,   577,   578,   579,   580,   102,   103,
    939    104,   105,   111,   586,   587,   111,   110,   590,    31,    32,
    940     33,    34,    35,    36,    37,    38,    39,    40,    41,    42,
    941     43,    44,    45,    46,    47,    48,    46,    47,    48,    49,
    942     50,    51,    52,   111,    54,   111,    56,    57,    58,    59,
    943    111,   111,   111,   111,   111,    91,    92,   111,    94,    69,
    944     96,    97,    98,    99,   100,   101,   102,   103,   111,   111,
    945    111,   111,   111,   111,   110,   273,    89,   111,   385,   386,
    946    387,   388,   389,   390,   391,   392,   111,   111,   111,   111,
    947    111,   398,   399,   400,   438,   439,   440,   441,   442,   443,
    948    444,   445,    93,   111,    95,   111,   559,   451,   452,   453,
    949    538,   102,   103,   104,   105,    92,   348,    94,   569,    96,
    950     97,    98,    99,   100,   101,   102,   103,   512,   278,   592,
    951    282,   205,   285
     900static const short yycheck[] = {     2,
     901    16,     1,     1,     6,   127,    15,   340,    15,    10,   132,
     902   133,    16,   135,   204,    17,    16,    88,   140,     9,    88,
     903   280,    16,    13,    14,    10,    16,    49,   361,    31,    32,
     904    33,    34,    35,     6,   313,    17,   370,   371,   313,   111,
     905    10,     3,     4,     5,     6,     7,     8,    13,    14,    11,
     906    12,    13,    14,   387,    16,    13,    14,    15,    31,    32,
     907    33,    34,    35,   323,   324,    10,    89,    29,   347,   111,
     908   261,    17,   347,    16,    84,    89,    84,    59,    60,    61,
     909    62,    63,    64,    65,   110,    13,    14,    15,   104,    13,
     910    14,    15,    16,   109,    13,    14,   111,   111,   101,   102,
     911   103,   104,   105,   106,   107,   108,   109,   110,   111,    88,
     912    72,   102,   103,   236,   109,   106,   107,   111,   109,   368,
     913   380,    14,    13,    14,    49,    50,    13,    14,   101,   102,
     914   103,   104,   105,   106,   107,   108,   109,   110,   111,   388,
     915    93,   103,   108,   109,   106,   103,   108,   109,   106,    15,
     916   108,   109,   401,   104,   105,    82,    83,   110,    13,    14,
     917    15,    89,    89,   111,    89,    55,    56,    57,    59,    60,
     918    61,    62,    63,    64,    65,   103,    82,    83,   106,   103,
     919   108,   109,   106,    89,   108,   109,   102,   103,   111,   523,
     920    80,    81,    15,    93,   443,    85,   399,   400,   111,   402,
     921    15,    16,    89,    18,   538,    13,    14,   456,    16,    13,
     922    14,   111,   103,    13,    14,   106,   103,   108,   109,   106,
     923    68,   108,   109,    71,    72,   559,   102,   103,   104,   105,
     924   421,   422,   125,   111,   128,   129,   570,   130,   131,   573,
     925    88,    93,   111,    93,   138,   436,   139,   141,   103,   142,
     926   584,   106,   586,   108,   109,    55,    56,    57,   111,   111,
     927   594,   111,    68,   597,   111,    71,    72,   111,    15,   162,
     928   163,    15,    87,    88,    89,    90,    91,    92,   469,   470,
     929    80,    81,    88,   111,   178,    85,   179,   180,   181,   182,
     930   183,   184,   185,   484,   111,   103,    88,   191,   106,   103,
     931   108,   109,   106,   103,   108,   109,   106,    10,   108,   109,
     932    93,    15,   205,   206,   313,   290,   291,   292,   293,   294,
     933   295,   296,    68,    93,   111,    71,    72,   220,   111,    68,
     934   111,   224,    71,    72,   111,   335,   339,   340,   231,   232,
     935   111,   111,    88,    68,   111,    88,    71,    72,   347,    88,
     936   111,    84,   245,   246,    87,   111,    89,   360,   361,   583,
     937    10,    17,   111,    88,   257,   258,   366,   370,   371,   454,
     938   455,   595,   457,   348,   267,   268,   600,   111,    15,   111,
     939   273,   274,   275,   111,   387,   278,    93,   280,    91,    92,
     940   111,    94,   111,    96,    97,    98,    99,   100,   101,   102,
     941   103,   111,   111,    59,    60,    61,    62,    63,    64,    65,
     942   303,   304,   111,    13,    14,    15,    68,   310,    18,    71,
     943    72,   314,   390,   391,   392,   393,   394,   395,   396,   397,
     944   323,   324,    88,    17,    15,   403,   404,   405,   111,    15,
     945    15,    91,    92,   336,    94,   111,    96,    97,    98,    99,
     946   100,   101,   102,   103,    13,    17,    15,   111,   111,   352,
     947    19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
     948    17,    30,    31,    15,   367,    59,    60,    61,    62,    63,
     949    64,    65,    93,    15,    95,   378,   111,   380,   111,   111,
     950   111,   102,   103,   104,   105,   111,   111,    59,    60,    61,
     951    62,    63,    64,    65,    88,   398,   399,   400,   111,   402,
     952   111,     0,    59,    60,    61,    62,    63,    64,    65,   111,
     953   523,   111,   111,   111,   417,   111,    88,    86,    13,    14,
     954    15,    90,   111,    18,   111,   538,     0,   111,   111,    91,
     955    92,    88,    94,   111,    96,    97,    98,    99,   100,   101,
     956   102,   103,    88,    24,   111,   111,   559,   111,   110,    30,
     957   453,   454,   455,   111,   457,   111,   111,   570,   111,   462,
     958   573,   464,   465,   466,   467,    93,   111,    95,   111,   272,
     959   111,   584,   111,   586,   102,   103,   104,   105,   111,   111,
     960   111,   594,   110,   545,   597,    66,    67,    68,    69,    70,
     961    71,    72,   495,   496,   497,   498,   499,   500,   501,   502,
     962   503,    95,   111,   111,   111,   111,   111,    88,   102,   103,
     963   104,   105,   515,   516,   517,   518,   519,   520,   521,   522,
     964    73,    74,    75,    76,    77,    78,    79,   111,   576,   347,
     965   533,    24,   535,   536,   537,    88,   539,    30,   541,   542,
     966   543,    96,    97,    98,    99,   100,   101,   102,   103,   566,
     967   519,   554,   555,   556,   557,   558,   599,   277,   561,    59,
     968    60,    61,    62,    63,    64,    65,   569,   281,   284,   572,
     969    -1,    -1,   575,    66,    67,    68,    69,    70,    71,    72,
     970    -1,    -1,   585,    -1,   587,    -1,    -1,    -1,    -1,    -1,
     971   593,    -1,    -1,    -1,    -1,    88,    31,    32,    33,    34,
     972    35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
     973    45,    46,    47,    48,    31,    32,    33,    34,    35,    36,
     974    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
     975    47,    48,    55,    56,    57,    58,    59,    60,    61,    -1,
     976    63,    -1,    65,    66,    67,    68,   445,   446,   447,   448,
     977   449,   450,   451,   452,    89,    78,    44,    -1,    -1,   458,
     978   459,   460,    -1,    51,    52,    53,    54,    -1,    -1,    -1,
     979    58,    92,    89,    94,    -1,    96,    97,    98,    99,   100,
     980   101,   102,   103,    94,    -1,    96,    97,    98,    99,   100,
     981   101,   102,   103,    98,    99,   100,   101,   102,   103
    952982};
    953983/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
     
    14521482
    14531483case 1:
    1454 #line 303 "parser.y"
     1484#line 310 "parser.y"
    14551485{
    14561486                resource_t *rsc;
     
    14711501    break;}
    14721502case 2:
    1473 #line 323 "parser.y"
     1503#line 330 "parser.y"
    14741504{ yyval.res = NULL; want_rscname = 1; ;
    14751505    break;}
    14761506case 3:
    1477 #line 324 "parser.y"
     1507#line 331 "parser.y"
    14781508{
    14791509                if(yyvsp[0].res)
     
    15031533    break;}
    15041534case 4:
    1505 #line 349 "parser.y"
     1535#line 356 "parser.y"
    15061536{ yyval.res = yyvsp[-1].res; want_rscname = 1; ;
    15071537    break;}
    15081538case 5:
    1509 #line 350 "parser.y"
     1539#line 357 "parser.y"
    15101540{ yyval.res = yyvsp[-1].res; want_rscname = 1; ;
    15111541    break;}
    15121542case 6:
    1513 #line 355 "parser.y"
     1543#line 362 "parser.y"
    15141544{ pop_start(); push_if(yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, 0, 0); if(yyvsp[-1].iptr) free(yyvsp[-1].iptr);;
    15151545    break;}
    15161546case 7:
    1517 #line 356 "parser.y"
     1547#line 363 "parser.y"
    15181548{ pop_start(); push_if(pp_lookup(yyvsp[-1].str->str.cstr) != NULL, 0, 0); ;
    15191549    break;}
    15201550case 8:
    1521 #line 357 "parser.y"
     1551#line 364 "parser.y"
    15221552{ pop_start(); push_if(pp_lookup(yyvsp[-1].str->str.cstr) == NULL, 0, 0); ;
    15231553    break;}
    15241554case 9:
    1525 #line 358 "parser.y"
     1555#line 365 "parser.y"
    15261556{ pop_start(); push_if(yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, pop_if(), 0); if(yyvsp[-1].iptr) free(yyvsp[-1].iptr); ;
    15271557    break;}
    15281558case 10:
    1529 #line 359 "parser.y"
     1559#line 366 "parser.y"
    15301560{ pop_start(); push_if(1, pop_if(), 0); ;
    15311561    break;}
    15321562case 11:
    1533 #line 360 "parser.y"
     1563#line 367 "parser.y"
    15341564{ pop_if(); ;
    15351565    break;}
    15361566case 12:
    1537 #line 363 "parser.y"
     1567#line 370 "parser.y"
    15381568{ yyval.iptr = yyvsp[0].iptr; ;
    15391569    break;}
    15401570case 13:
    1541 #line 364 "parser.y"
     1571#line 371 "parser.y"
    15421572{ 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); ;
    15431573    break;}
    15441574case 14:
    1545 #line 365 "parser.y"
     1575#line 372 "parser.y"
    15461576{ 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); ;
    15471577    break;}
    15481578case 15:
    1549 #line 366 "parser.y"
     1579#line 373 "parser.y"
    15501580{ 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); ;
    15511581    break;}
    15521582case 16:
    1553 #line 367 "parser.y"
     1583#line 374 "parser.y"
    15541584{ 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); ;
    15551585    break;}
    15561586case 17:
    1557 #line 368 "parser.y"
     1587#line 375 "parser.y"
    15581588{ 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); ;
    15591589    break;}
    15601590case 18:
    1561 #line 369 "parser.y"
     1591#line 376 "parser.y"
    15621592{ 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); ;
    15631593    break;}
    15641594case 19:
    1565 #line 370 "parser.y"
     1595#line 377 "parser.y"
    15661596{ 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); ;
    15671597    break;}
    15681598case 20:
    1569 #line 371 "parser.y"
     1599#line 378 "parser.y"
    15701600{ 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); ;
    15711601    break;}
    15721602case 21:
    1573 #line 372 "parser.y"
     1603#line 379 "parser.y"
    15741604{ 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); ;
    15751605    break;}
    15761606case 22:
    1577 #line 373 "parser.y"
     1607#line 380 "parser.y"
    15781608{ 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); ;
    15791609    break;}
    15801610case 23:
    1581 #line 374 "parser.y"
     1611#line 381 "parser.y"
    15821612{ 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); ;
    15831613    break;}
    15841614case 24:
    1585 #line 375 "parser.y"
     1615#line 382 "parser.y"
    15861616{ yyval.iptr = yyvsp[0].iptr; if(yyvsp[0].iptr) *yyvsp[0].iptr = ~(*yyvsp[0].iptr); ;
    15871617    break;}
    15881618case 25:
    1589 #line 376 "parser.y"
     1619#line 383 "parser.y"
    15901620{ yyval.iptr = yyvsp[0].iptr; ;
    15911621    break;}
    15921622case 26:
    1593 #line 377 "parser.y"
     1623#line 384 "parser.y"
    15941624{ yyval.iptr = yyvsp[0].iptr; if(yyvsp[0].iptr) *yyvsp[0].iptr = -(*yyvsp[0].iptr); ;
    15951625    break;}
    15961626case 27:
    1597 #line 378 "parser.y"
     1627#line 385 "parser.y"
    15981628{ yyval.iptr = yyvsp[0].iptr; if(yyvsp[0].iptr) *yyvsp[0].iptr = !(*yyvsp[0].iptr); ;
    15991629    break;}
    16001630case 28:
    1601 #line 379 "parser.y"
     1631#line 386 "parser.y"
    16021632{ yyval.iptr = yyvsp[-1].iptr; ;
    16031633    break;}
    16041634case 29:
    1605 #line 383 "parser.y"
     1635#line 390 "parser.y"
    16061636{ yyval.iptr = new_int(yyvsp[0].num); ;
    16071637    break;}
    16081638case 30:
    1609 #line 384 "parser.y"
     1639#line 391 "parser.y"
    16101640{ yyval.iptr = NULL; ;
    16111641    break;}
    16121642case 31:
    1613 #line 385 "parser.y"
     1643#line 392 "parser.y"
    16141644{ yyval.iptr = new_int(pp_lookup(yyvsp[0].str->str.cstr) != NULL); ;
    16151645    break;}
    16161646case 32:
    1617 #line 386 "parser.y"
     1647#line 393 "parser.y"
    16181648{ yyval.iptr = new_int(pp_lookup(yyvsp[-1].str->str.cstr) != NULL); ;
    16191649    break;}
    16201650case 33:
    1621 #line 390 "parser.y"
     1651#line 397 "parser.y"
    16221652{ strip_til_semicolon(); ;
    16231653    break;}
    16241654case 34:
    1625 #line 391 "parser.y"
     1655#line 398 "parser.y"
     1656{ strip_extern(); ;
     1657    break;}
     1658case 35:
     1659#line 399 "parser.y"
    16261660{ strip_til_semicolon(); ;
    16271661    break;}
    1628 case 35:
    1629 #line 392 "parser.y"
     1662case 36:
     1663#line 400 "parser.y"
     1664{ strip_til_parenthesis(); ;
     1665    break;}
     1666case 37:
     1667#line 401 "parser.y"
    16301668{ strip_til_semicolon(); ;
    16311669    break;}
    1632 case 36:
    1633 #line 393 "parser.y"
    1634 { strip_til_parenthesis(); ;
    1635     break;}
    1636 case 37:
    1637 #line 394 "parser.y"
    1638 { strip_til_semicolon(); ;
    1639     break;}
    16401670case 38:
    1641 #line 399 "parser.y"
     1671#line 406 "parser.y"
    16421672{
    16431673                yyval.res = yyvsp[0].res;
     
    16571687    break;}
    16581688case 39:
    1659 #line 414 "parser.y"
     1689#line 421 "parser.y"
    16601690{
    16611691                /* Don't do anything, stringtables are converted to
     
    16681698    break;}
    16691699case 40:
    1670 #line 422 "parser.y"
     1700#line 429 "parser.y"
    16711701{
    16721702                if(!win32)
     
    16791709    break;}
    16801710case 41:
    1681 #line 435 "parser.y"
    1682 {
     1711#line 442 "parser.y"
     1712{
     1713                if(yyvsp[0].num > 65535 || yyvsp[0].num < -32768)
     1714                        yyerror("Resource's ID out of range (%d)", yyvsp[0].num);
    16831715                yyval.nid = new_name_id();
    16841716                yyval.nid->type = name_ord;
     
    16881720    break;}
    16891721case 42:
    1690 #line 441 "parser.y"
     1722#line 450 "parser.y"
    16911723{
    16921724                yyval.nid = new_name_id();
     
    16971729    break;}
    16981730case 43:
    1699 #line 452 "parser.y"
     1731#line 461 "parser.y"
    17001732{ yyval.nid = yyvsp[0].nid; ;
    17011733    break;}
    17021734case 44:
    1703 #line 453 "parser.y"
     1735#line 462 "parser.y"
    17041736{
    17051737                yyval.nid = new_name_id();
     
    17101742    break;}
    17111743case 45:
    1712 #line 463 "parser.y"
     1744#line 472 "parser.y"
    17131745{ yyval.res = new_resource(res_acc, yyvsp[0].acc, yyvsp[0].acc->memopt, yyvsp[0].acc->lvc.language); ;
    17141746    break;}
    17151747case 46:
    1716 #line 464 "parser.y"
     1748#line 473 "parser.y"
    17171749{ yyval.res = new_resource(res_bmp, yyvsp[0].bmp, yyvsp[0].bmp->memopt, dup_language(currentlanguage)); ;
    17181750    break;}
    17191751case 47:
    1720 #line 465 "parser.y"
     1752#line 474 "parser.y"
    17211753{
    17221754                resource_t *rsc;
     
    17351767    break;}
    17361768case 48:
    1737 #line 479 "parser.y"
     1769#line 488 "parser.y"
    17381770{ yyval.res = new_resource(res_dlg, yyvsp[0].dlg, yyvsp[0].dlg->memopt, yyvsp[0].dlg->lvc.language); ;
    17391771    break;}
    17401772case 49:
    1741 #line 480 "parser.y"
     1773#line 489 "parser.y"
    17421774{
    17431775                if(win32)
     
    17481780    break;}
    17491781case 50:
    1750 #line 486 "parser.y"
     1782#line 495 "parser.y"
    17511783{ yyval.res = new_resource(res_dlginit, yyvsp[0].dginit, yyvsp[0].dginit->memopt, yyvsp[0].dginit->lvc.language); ;
    17521784    break;}
    17531785case 51:
    1754 #line 487 "parser.y"
     1786#line 496 "parser.y"
    17551787{ yyval.res = new_resource(res_fnt, yyvsp[0].fnt, yyvsp[0].fnt->memopt, dup_language(currentlanguage)); ;
    17561788    break;}
    17571789case 52:
    1758 #line 488 "parser.y"
     1790#line 497 "parser.y"
    17591791{
    17601792                resource_t *rsc;
     
    17731805    break;}
    17741806case 53:
    1775 #line 502 "parser.y"
     1807#line 511 "parser.y"
    17761808{ yyval.res = new_resource(res_men, yyvsp[0].men, yyvsp[0].men->memopt, yyvsp[0].men->lvc.language); ;
    17771809    break;}
    17781810case 54:
    1779 #line 503 "parser.y"
     1811#line 512 "parser.y"
    17801812{
    17811813                if(win32)
     
    17861818    break;}
    17871819case 55:
    1788 #line 509 "parser.y"
     1820#line 518 "parser.y"
    17891821{ yyval.res = new_resource(res_msg, yyvsp[0].msg, WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, dup_language(currentlanguage)); ;
    17901822    break;}
    17911823case 56:
    1792 #line 510 "parser.y"
     1824#line 519 "parser.y"
    17931825{ yyval.res = new_resource(res_rdt, yyvsp[0].rdt, yyvsp[0].rdt->memopt, yyvsp[0].rdt->lvc.language); ;
    17941826    break;}
    17951827case 57:
    1796 #line 511 "parser.y"
     1828#line 520 "parser.y"
    17971829{ yyval.res = new_resource(res_toolbar, yyvsp[0].tlbar, yyvsp[0].tlbar->memopt, yyvsp[0].tlbar->lvc.language); ;
    17981830    break;}
    17991831case 58:
    1800 #line 512 "parser.y"
     1832#line 521 "parser.y"
    18011833{ yyval.res = new_resource(res_usr, yyvsp[0].usr, yyvsp[0].usr->memopt, dup_language(currentlanguage)); ;
    18021834    break;}
    18031835case 59:
    1804 #line 513 "parser.y"
     1836#line 522 "parser.y"
    18051837{ yyval.res = new_resource(res_ver, yyvsp[0].veri, WRC_MO_MOVEABLE | WRC_MO_DISCARDABLE, dup_language(currentlanguage)); ;
    18061838    break;}
    18071839case 60:
    1808 #line 517 "parser.y"
     1840#line 526 "parser.y"
    18091841{ yyval.bmp = new_bitmap(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
    18101842    break;}
    18111843case 61:
    1812 #line 518 "parser.y"
     1844#line 527 "parser.y"
    18131845{ yyval.bmp = new_bitmap(yyvsp[0].raw, yyvsp[-1].iptr); ;
    18141846    break;}
    18151847case 62:
    1816 #line 522 "parser.y"
     1848#line 531 "parser.y"
    18171849{ yyval.curg = new_cursor_group(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
    18181850    break;}
    18191851case 63:
    1820 #line 523 "parser.y"
     1852#line 532 "parser.y"
    18211853{ yyval.curg = new_cursor_group(yyvsp[0].raw, yyvsp[-1].iptr); ;
    18221854    break;}
    18231855case 64:
    1824 #line 528 "parser.y"
     1856#line 537 "parser.y"
    18251857{ yyval.fnt = new_font(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
    18261858    break;}
    18271859case 65:
    1828 #line 532 "parser.y"
     1860#line 541 "parser.y"
    18291861{ yyval.icog = new_icon_group(load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
    18301862    break;}
    18311863case 66:
    1832 #line 533 "parser.y"
     1864#line 542 "parser.y"
    18331865{ yyval.icog = new_icon_group(yyvsp[0].raw, yyvsp[-1].iptr); ;
    18341866    break;}
    18351867case 67:
    1836 #line 541 "parser.y"
     1868#line 550 "parser.y"
    18371869{
    18381870                if(!win32)
     
    18421874    break;}
    18431875case 68:
    1844 #line 549 "parser.y"
     1876#line 558 "parser.y"
    18451877{
    18461878                yyval.rdt = new_rcdata(yyvsp[0].raw, yyvsp[-2].iptr);
     
    18551887    break;}
    18561888case 69:
    1857 #line 562 "parser.y"
     1889#line 571 "parser.y"
    18581890{
    18591891                yyval.dginit = new_dlginit(yyvsp[0].raw, yyvsp[-2].iptr);
     
    18681900    break;}
    18691901case 70:
    1870 #line 575 "parser.y"
     1902#line 584 "parser.y"
    18711903{ yyval.usr = new_user(yyvsp[-2].nid, load_file(yyvsp[0].str), yyvsp[-1].iptr); ;
    18721904    break;}
    18731905case 71:
    1874 #line 576 "parser.y"
     1906#line 585 "parser.y"
    18751907{ yyval.usr = new_user(yyvsp[-2].nid, yyvsp[0].raw, yyvsp[-1].iptr); ;
    18761908    break;}
    18771909case 72:
    1878 #line 595 "parser.y"
     1910#line 604 "parser.y"
    18791911{
    18801912                yyval.nid = new_name_id();
     
    18851917    break;}
    18861918case 73:
    1887 #line 607 "parser.y"
     1919#line 616 "parser.y"
    18881920{
    18891921                yyval.nid = new_name_id();
     
    18941926    break;}
    18951927case 74:
    1896 #line 617 "parser.y"
     1928#line 626 "parser.y"
    18971929{
    18981930                yyval.acc = new_accelerator();
     
    19191951    break;}
    19201952case 75:
    1921 #line 641 "parser.y"
     1953#line 650 "parser.y"
    19221954{ yyval.event=NULL; ;
    19231955    break;}
    19241956case 76:
    1925 #line 642 "parser.y"
     1957#line 651 "parser.y"
    19261958{ yyval.event=add_string_event(yyvsp[-3].str, yyvsp[-1].num, yyvsp[0].num, yyvsp[-4].event); ;
    19271959    break;}
    19281960case 77:
    1929 #line 643 "parser.y"
     1961#line 652 "parser.y"
    19301962{ yyval.event=add_event(yyvsp[-3].num, yyvsp[-1].num, yyvsp[0].num, yyvsp[-4].event); ;
    19311963    break;}
    19321964case 78:
    1933 #line 646 "parser.y"
     1965#line 655 "parser.y"
    19341966{ yyval.num=0; ;
    19351967    break;}
    19361968case 79:
    1937 #line 647 "parser.y"
     1969#line 656 "parser.y"
    19381970{ yyval.num=yyvsp[-2].num | WRC_AF_NOINVERT; ;
    19391971    break;}
    19401972case 80:
    1941 #line 648 "parser.y"
     1973#line 657 "parser.y"
    19421974{ yyval.num=yyvsp[-2].num | WRC_AF_SHIFT; ;
    19431975    break;}
    19441976case 81:
    1945 #line 649 "parser.y"
     1977#line 658 "parser.y"
    19461978{ yyval.num=yyvsp[-2].num | WRC_AF_CONTROL; ;
    19471979    break;}
    19481980case 82:
    1949 #line 650 "parser.y"
     1981#line 659 "parser.y"
    19501982{ yyval.num=yyvsp[-2].num | WRC_AF_ALT; ;
    19511983    break;}
    19521984case 83:
    1953 #line 651 "parser.y"
     1985#line 660 "parser.y"
    19541986{ yyval.num=yyvsp[-2].num | WRC_AF_ASCII; ;
    19551987    break;}
    19561988case 84:
    1957 #line 652 "parser.y"
     1989#line 661 "parser.y"
    19581990{ yyval.num=yyvsp[-2].num | WRC_AF_VIRTKEY; ;
    19591991    break;}
    19601992case 85:
    1961 #line 658 "parser.y"
     1993#line 667 "parser.y"
    19621994{
    19631995                if(yyvsp[-11].iptr)
     
    19762008                if(!yyval.dlg->gotstyle)
    19772009                {
    1978                         yyval.dlg->style = WS_POPUP;
     2010                        yyval.dlg->style->or_mask = WS_POPUP;
    19792011                        yyval.dlg->gotstyle = TRUE;
    19802012                }
    19812013                if(yyval.dlg->title)
    1982                         yyval.dlg->style |= WS_CAPTION;
     2014                        yyval.dlg->style->or_mask |= WS_CAPTION;
    19832015                if(yyval.dlg->font)
    1984                         yyval.dlg->style |= DS_SETFONT;
     2016                        yyval.dlg->style->or_mask |= DS_SETFONT;
     2017
     2018                yyval.dlg->style->or_mask &= ~(yyval.dlg->style->and_mask);
     2019                yyval.dlg->style->and_mask = 0;
     2020
    19852021                indialog = FALSE;
    19862022                if(!yyval.dlg->lvc.language)
     
    19892025    break;}
    19902026case 86:
    1991 #line 688 "parser.y"
     2027#line 701 "parser.y"
    19922028{ yyval.dlg=new_dialog(); ;
    19932029    break;}
    19942030case 87:
    1995 #line 689 "parser.y"
    1996 { yyval.dlg=dialog_style(yyvsp[0].num,yyvsp[-2].dlg); ;
     2031#line 702 "parser.y"
     2032{ yyval.dlg=dialog_style(yyvsp[0].style,yyvsp[-2].dlg); ;
    19972033    break;}
    19982034case 88:
    1999 #line 690 "parser.y"
    2000 { yyval.dlg=dialog_exstyle(yyvsp[0].num,yyvsp[-2].dlg); ;
     2035#line 703 "parser.y"
     2036{ yyval.dlg=dialog_exstyle(yyvsp[0].style,yyvsp[-2].dlg); ;
    20012037    break;}
    20022038case 89:
    2003 #line 691 "parser.y"
     2039#line 704 "parser.y"
    20042040{ yyval.dlg=dialog_caption(yyvsp[0].str,yyvsp[-2].dlg); ;
    20052041    break;}
    20062042case 90:
    2007 #line 692 "parser.y"
     2043#line 705 "parser.y"
    20082044{ yyval.dlg=dialog_font(yyvsp[0].fntid,yyvsp[-1].dlg); ;
    20092045    break;}
    20102046case 91:
    2011 #line 693 "parser.y"
     2047#line 706 "parser.y"
    20122048{ yyval.dlg=dialog_class(yyvsp[0].nid,yyvsp[-2].dlg); ;
    20132049    break;}
    20142050case 92:
    2015 #line 694 "parser.y"
     2051#line 707 "parser.y"
    20162052{ yyval.dlg=dialog_menu(yyvsp[0].nid,yyvsp[-2].dlg); ;
    20172053    break;}
    20182054case 93:
    2019 #line 695 "parser.y"
     2055#line 708 "parser.y"
    20202056{ yyval.dlg=dialog_language(yyvsp[0].lan,yyvsp[-1].dlg); ;
    20212057    break;}
    20222058case 94:
    2023 #line 696 "parser.y"
     2059#line 709 "parser.y"
    20242060{ yyval.dlg=dialog_characteristics(yyvsp[0].chars,yyvsp[-1].dlg); ;
    20252061    break;}
    20262062case 95:
    2027 #line 697 "parser.y"
     2063#line 710 "parser.y"
    20282064{ yyval.dlg=dialog_version(yyvsp[0].ver,yyvsp[-1].dlg); ;
    20292065    break;}
    20302066case 96:
    2031 #line 700 "parser.y"
     2067#line 713 "parser.y"
    20322068{ yyval.ctl = NULL; ;
    20332069    break;}
    20342070case 97:
    2035 #line 701 "parser.y"
     2071#line 714 "parser.y"
    20362072{ yyval.ctl=ins_ctrl(-1, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20372073    break;}
    20382074case 98:
    2039 #line 702 "parser.y"
     2075#line 715 "parser.y"
    20402076{ yyval.ctl=ins_ctrl(CT_EDIT, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20412077    break;}
    20422078case 99:
    2043 #line 703 "parser.y"
     2079#line 716 "parser.y"
    20442080{ yyval.ctl=ins_ctrl(CT_LISTBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20452081    break;}
    20462082case 100:
    2047 #line 704 "parser.y"
     2083#line 717 "parser.y"
    20482084{ yyval.ctl=ins_ctrl(CT_COMBOBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20492085    break;}
    20502086case 101:
    2051 #line 705 "parser.y"
     2087#line 718 "parser.y"
    20522088{ yyval.ctl=ins_ctrl(CT_SCROLLBAR, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20532089    break;}
    20542090case 102:
    2055 #line 706 "parser.y"
     2091#line 719 "parser.y"
    20562092{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_CHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20572093    break;}
    20582094case 103:
    2059 #line 707 "parser.y"
     2095#line 720 "parser.y"
    20602096{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20612097    break;}
    20622098case 104:
    2063 #line 708 "parser.y"
     2099#line 721 "parser.y"
    20642100{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_GROUPBOX, yyvsp[0].ctl, yyvsp[-2].ctl);;
    20652101    break;}
    20662102case 105:
    2067 #line 709 "parser.y"
     2103#line 722 "parser.y"
    20682104{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20692105    break;}
    20702106case 106:
    2071 #line 711 "parser.y"
     2107#line 724 "parser.y"
    20722108{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20732109    break;}
    20742110case 107:
    2075 #line 712 "parser.y"
     2111#line 725 "parser.y"
    20762112{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20772113    break;}
    20782114case 108:
    2079 #line 713 "parser.y"
     2115#line 726 "parser.y"
    20802116{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20812117    break;}
    20822118case 109:
    2083 #line 714 "parser.y"
     2119#line 727 "parser.y"
    20842120{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20852121    break;}
    20862122case 110:
    2087 #line 715 "parser.y"
     2123#line 728 "parser.y"
    20882124{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20892125    break;}
    20902126case 111:
    2091 #line 716 "parser.y"
     2127#line 729 "parser.y"
    20922128{ yyval.ctl=ins_ctrl(CT_STATIC, SS_LEFT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20932129    break;}
    20942130case 112:
    2095 #line 717 "parser.y"
     2131#line 730 "parser.y"
    20962132{ yyval.ctl=ins_ctrl(CT_STATIC, SS_CENTER, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    20972133    break;}
    20982134case 113:
    2099 #line 718 "parser.y"
     2135#line 731 "parser.y"
    21002136{ yyval.ctl=ins_ctrl(CT_STATIC, SS_RIGHT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    21012137    break;}
    21022138case 114:
    2103 #line 720 "parser.y"
     2139#line 733 "parser.y"
    21042140{
    21052141                yyvsp[0].ctl->title = yyvsp[-7].nid;
     
    21112147    break;}
    21122148case 115:
    2113 #line 730 "parser.y"
     2149#line 743 "parser.y"
    21142150{
    21152151                yyval.ctl=new_control();
     
    21222158                yyval.ctl->width = yyvsp[-3].num;
    21232159                yyval.ctl->height = yyvsp[-1].num;
    2124                 if(yyvsp[0].iptr)
    2125                 {
    2126                         yyval.ctl->style = *(yyvsp[0].iptr);
     2160                if(yyvsp[0].style)
     2161                {
     2162                        yyval.ctl->style = yyvsp[0].style;
    21272163                        yyval.ctl->gotstyle = TRUE;
    2128                         free(yyvsp[0].iptr);
    21292164                }
    21302165                ;
    21312166    break;}
    21322167case 116:
    2133 #line 750 "parser.y"
     2168#line 762 "parser.y"
    21342169{
    21352170                yyval.ctl = new_control();
     
    21392174                yyval.ctl->width = yyvsp[-3].num;
    21402175                yyval.ctl->height = yyvsp[-1].num;
    2141                 if(yyvsp[0].iptr)
    2142                 {
    2143                         yyval.ctl->style = *(yyvsp[0].iptr);
     2176                if(yyvsp[0].style)
     2177                {
     2178                        yyval.ctl->style = yyvsp[0].style;
    21442179                        yyval.ctl->gotstyle = TRUE;
    2145                         free(yyvsp[0].iptr);
    21462180                }
    21472181                ;
    21482182    break;}
    21492183case 117:
    2150 #line 767 "parser.y"
     2184#line 778 "parser.y"
    21512185{ yyval.ctl = new_control(); ;
    21522186    break;}
    21532187case 118:
    2154 #line 769 "parser.y"
     2188#line 780 "parser.y"
    21552189{
    21562190                yyval.ctl = new_control();
     
    21602194    break;}
    21612195case 119:
    2162 #line 774 "parser.y"
     2196#line 785 "parser.y"
    21632197{
    21642198                yyval.ctl = new_control();
    21652199                yyval.ctl->width = yyvsp[-4].num;
    21662200                yyval.ctl->height = yyvsp[-2].num;
    2167                 yyval.ctl->style = yyvsp[0].num;
     2201                yyval.ctl->style = yyvsp[0].style;
    21682202                yyval.ctl->gotstyle = TRUE;
    21692203                ;
    21702204    break;}
    21712205case 120:
    2172 #line 781 "parser.y"
     2206#line 792 "parser.y"
    21732207{
    21742208                yyval.ctl = new_control();
    21752209                yyval.ctl->width = yyvsp[-6].num;
    21762210                yyval.ctl->height = yyvsp[-4].num;
    2177                 yyval.ctl->style = yyvsp[-2].num;
     2211                yyval.ctl->style = yyvsp[-2].style;
    21782212                yyval.ctl->gotstyle = TRUE;
    2179                 yyval.ctl->exstyle = yyvsp[0].num;
     2213                yyval.ctl->exstyle = yyvsp[0].style;
    21802214                yyval.ctl->gotexstyle = TRUE;
    21812215                ;
    21822216    break;}
    21832217case 121:
    2184 #line 792 "parser.y"
     2218#line 803 "parser.y"
    21852219{
    21862220                yyval.ctl=new_control();
     
    21882222                yyval.ctl->id = yyvsp[-14].num;
    21892223                yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-12].nid);
    2190                 yyval.ctl->style = yyvsp[-10].num;
     2224                yyval.ctl->style = yyvsp[-10].style;
    21912225                yyval.ctl->gotstyle = TRUE;
    21922226                yyval.ctl->x = yyvsp[-8].num;
     
    21942228                yyval.ctl->width = yyvsp[-4].num;
    21952229                yyval.ctl->height = yyvsp[-2].num;
    2196                 yyval.ctl->exstyle = yyvsp[0].num;
     2230                yyval.ctl->exstyle = yyvsp[0].style;
    21972231                yyval.ctl->gotexstyle = TRUE;
    21982232                ;
    21992233    break;}
    22002234case 122:
    2201 #line 806 "parser.y"
     2235#line 817 "parser.y"
    22022236{
    22032237                yyval.ctl=new_control();
     
    22052239                yyval.ctl->id = yyvsp[-12].num;
    22062240                yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-10].nid);
    2207                 yyval.ctl->style = yyvsp[-8].num;
     2241                yyval.ctl->style = yyvsp[-8].style;
    22082242                yyval.ctl->gotstyle = TRUE;
    22092243                yyval.ctl->x = yyvsp[-6].num;
     
    22142248    break;}
    22152249case 123:
    2216 #line 821 "parser.y"
     2250#line 832 "parser.y"
    22172251{ yyval.fntid = new_font_id(yyvsp[-2].num, yyvsp[0].str, 0, 0); ;
    22182252    break;}
    22192253case 124:
    2220 #line 825 "parser.y"
    2221 { yyval.iptr = NULL; ;
     2254#line 837 "parser.y"
     2255{ yyval.style = NULL; ;
    22222256    break;}
    22232257case 125:
    2224 #line 826 "parser.y"
    2225 { yyval.iptr = new_int(yyvsp[0].num); ;
     2258#line 838 "parser.y"
     2259{ yyval.style = yyvsp[0].style; ;
    22262260    break;}
    22272261case 126:
    2228 #line 830 "parser.y"
     2262#line 842 "parser.y"
    22292263{ yyval.styles = NULL; ;
    22302264    break;}
    22312265case 127:
    2232 #line 831 "parser.y"
    2233 { yyval.styles = new_style_pair(yyvsp[0].num, 0); ;
     2266#line 843 "parser.y"
     2267{ yyval.styles = new_style_pair(yyvsp[0].style, 0); ;
    22342268    break;}
    22352269case 128:
    2236 #line 832 "parser.y"
    2237 { yyval.styles = new_style_pair(yyvsp[-2].num, yyvsp[0].num); ;
     2270#line 844 "parser.y"
     2271{ yyval.styles = new_style_pair(yyvsp[-2].style, yyvsp[0].style); ;
    22382272    break;}
    22392273case 129:
    2240 #line 836 "parser.y"
     2274#line 848 "parser.y"
     2275{ 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);;
     2276    break;}
     2277case 130:
     2278#line 849 "parser.y"
     2279{ yyval.style = yyvsp[-1].style; ;
     2280    break;}
     2281case 131:
     2282#line 850 "parser.y"
     2283{ yyval.style = new_style(yyvsp[0].num, 0); ;
     2284    break;}
     2285case 132:
     2286#line 851 "parser.y"
     2287{ yyval.style = new_style(0, yyvsp[0].num); ;
     2288    break;}
     2289case 133:
     2290#line 855 "parser.y"
    22412291{
    22422292                yyval.nid = new_name_id();
     
    22452295                ;
    22462296    break;}
    2247 case 130:
    2248 #line 841 "parser.y"
     2297case 134:
     2298#line 860 "parser.y"
    22492299{
    22502300                yyval.nid = new_name_id();
     
    22532303                ;
    22542304    break;}
    2255 case 131:
    2256 #line 850 "parser.y"
     2305case 135:
     2306#line 869 "parser.y"
    22572307{
    22582308                if(!win32)
     
    22772327                yyvsp[-3].dlgex->controls = get_control_head(yyvsp[-1].ctl);
    22782328                yyval.dlgex = yyvsp[-3].dlgex;
     2329
     2330                assert(yyval.dlgex->style != NULL);
    22792331                if(!yyval.dlgex->gotstyle)
    22802332                {
    2281                         yyval.dlgex->style = WS_POPUP;
     2333                        yyval.dlgex->style->or_mask = WS_POPUP;
    22822334                        yyval.dlgex->gotstyle = TRUE;
    22832335                }
    22842336                if(yyval.dlgex->title)
    2285                         yyval.dlgex->style |= WS_CAPTION;
     2337                        yyval.dlgex->style->or_mask |= WS_CAPTION;
    22862338                if(yyval.dlgex->font)
    2287                         yyval.dlgex->style |= DS_SETFONT;
     2339                        yyval.dlgex->style->or_mask |= DS_SETFONT;
     2340
     2341                yyval.dlgex->style->or_mask &= ~(yyval.dlgex->style->and_mask);
     2342                yyval.dlgex->style->and_mask = 0;
     2343
    22882344                indialog = FALSE;
    22892345                if(!yyval.dlgex->lvc.language)
     
    22912347                ;
    22922348    break;}
    2293 case 132:
    2294 #line 888 "parser.y"
     2349case 136:
     2350#line 913 "parser.y"
    22952351{ yyval.dlgex=new_dialogex(); ;
    22962352    break;}
    2297 case 133:
    2298 #line 889 "parser.y"
    2299 { yyval.dlgex=dialogex_style(yyvsp[0].num,yyvsp[-2].dlgex); ;
    2300     break;}
    2301 case 134:
    2302 #line 890 "parser.y"
    2303 { yyval.dlgex=dialogex_exstyle(yyvsp[0].num,yyvsp[-2].dlgex); ;
    2304     break;}
    2305 case 135:
    2306 #line 891 "parser.y"
     2353case 137:
     2354#line 914 "parser.y"
     2355{ yyval.dlgex=dialogex_style(yyvsp[0].style,yyvsp[-2].dlgex); ;
     2356    break;}
     2357case 138:
     2358#line 915 "parser.y"
     2359{ yyval.dlgex=dialogex_exstyle(yyvsp[0].style,yyvsp[-2].dlgex); ;
     2360    break;}
     2361case 139:
     2362#line 916 "parser.y"
    23072363{ yyval.dlgex=dialogex_caption(yyvsp[0].str,yyvsp[-2].dlgex); ;
    23082364    break;}
    2309 case 136:
    2310 #line 892 "parser.y"
     2365case 140:
     2366#line 917 "parser.y"
    23112367{ yyval.dlgex=dialogex_font(yyvsp[0].fntid,yyvsp[-1].dlgex); ;
    23122368    break;}
    2313 case 137:
    2314 #line 893 "parser.y"
     2369case 141:
     2370#line 918 "parser.y"
    23152371{ yyval.dlgex=dialogex_font(yyvsp[0].fntid,yyvsp[-1].dlgex); ;
    23162372    break;}
    2317 case 138:
    2318 #line 894 "parser.y"
     2373case 142:
     2374#line 919 "parser.y"
    23192375{ yyval.dlgex=dialogex_class(yyvsp[0].nid,yyvsp[-2].dlgex); ;
    23202376    break;}
    2321 case 139:
    2322 #line 895 "parser.y"
     2377case 143:
     2378#line 920 "parser.y"
    23232379{ yyval.dlgex=dialogex_menu(yyvsp[0].nid,yyvsp[-2].dlgex); ;
    23242380    break;}
    2325 case 140:
    2326 #line 896 "parser.y"
     2381case 144:
     2382#line 921 "parser.y"
    23272383{ yyval.dlgex=dialogex_language(yyvsp[0].lan,yyvsp[-1].dlgex); ;
    23282384    break;}
    2329 case 141:
    2330 #line 897 "parser.y"
     2385case 145:
     2386#line 922 "parser.y"
    23312387{ yyval.dlgex=dialogex_characteristics(yyvsp[0].chars,yyvsp[-1].dlgex); ;
    23322388    break;}
    2333 case 142:
    2334 #line 898 "parser.y"
     2389case 146:
     2390#line 923 "parser.y"
    23352391{ yyval.dlgex=dialogex_version(yyvsp[0].ver,yyvsp[-1].dlgex); ;
    23362392    break;}
    2337 case 143:
    2338 #line 901 "parser.y"
     2393case 147:
     2394#line 926 "parser.y"
    23392395{ yyval.ctl = NULL; ;
    23402396    break;}
    2341 case 144:
    2342 #line 902 "parser.y"
     2397case 148:
     2398#line 927 "parser.y"
    23432399{ yyval.ctl=ins_ctrl(-1, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23442400    break;}
    2345 case 145:
    2346 #line 903 "parser.y"
     2401case 149:
     2402#line 928 "parser.y"
    23472403{ yyval.ctl=ins_ctrl(CT_EDIT, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23482404    break;}
    2349 case 146:
    2350 #line 904 "parser.y"
     2405case 150:
     2406#line 929 "parser.y"
    23512407{ yyval.ctl=ins_ctrl(CT_LISTBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23522408    break;}
    2353 case 147:
    2354 #line 905 "parser.y"
     2409case 151:
     2410#line 930 "parser.y"
    23552411{ yyval.ctl=ins_ctrl(CT_COMBOBOX, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23562412    break;}
    2357 case 148:
    2358 #line 906 "parser.y"
     2413case 152:
     2414#line 931 "parser.y"
    23592415{ yyval.ctl=ins_ctrl(CT_SCROLLBAR, 0, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23602416    break;}
    2361 case 149:
    2362 #line 907 "parser.y"
     2417case 153:
     2418#line 932 "parser.y"
    23632419{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_CHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23642420    break;}
    2365 case 150:
    2366 #line 908 "parser.y"
     2421case 154:
     2422#line 933 "parser.y"
    23672423{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_DEFPUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23682424    break;}
    2369 case 151:
    2370 #line 909 "parser.y"
     2425case 155:
     2426#line 934 "parser.y"
    23712427{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_GROUPBOX, yyvsp[0].ctl, yyvsp[-2].ctl);;
    23722428    break;}
    2373 case 152:
    2374 #line 910 "parser.y"
     2429case 156:
     2430#line 935 "parser.y"
    23752431{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_PUSHBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23762432    break;}
    2377 case 153:
    2378 #line 912 "parser.y"
     2433case 157:
     2434#line 937 "parser.y"
    23792435{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_RADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23802436    break;}
    2381 case 154:
    2382 #line 913 "parser.y"
     2437case 158:
     2438#line 938 "parser.y"
    23832439{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTO3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23842440    break;}
    2385 case 155:
    2386 #line 914 "parser.y"
     2441case 159:
     2442#line 939 "parser.y"
    23872443{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_3STATE, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23882444    break;}
    2389 case 156:
    2390 #line 915 "parser.y"
     2445case 160:
     2446#line 940 "parser.y"
    23912447{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTOCHECKBOX, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23922448    break;}
    2393 case 157:
    2394 #line 916 "parser.y"
     2449case 161:
     2450#line 941 "parser.y"
    23952451{ yyval.ctl=ins_ctrl(CT_BUTTON, BS_AUTORADIOBUTTON, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    23962452    break;}
    2397 case 158:
    2398 #line 917 "parser.y"
     2453case 162:
     2454#line 942 "parser.y"
    23992455{ yyval.ctl=ins_ctrl(CT_STATIC, SS_LEFT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    24002456    break;}
    2401 case 159:
    2402 #line 918 "parser.y"
     2457case 163:
     2458#line 943 "parser.y"
    24032459{ yyval.ctl=ins_ctrl(CT_STATIC, SS_CENTER, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    24042460    break;}
    2405 case 160:
    2406 #line 919 "parser.y"
     2461case 164:
     2462#line 944 "parser.y"
    24072463{ yyval.ctl=ins_ctrl(CT_STATIC, SS_RIGHT, yyvsp[0].ctl, yyvsp[-2].ctl); ;
    24082464    break;}
    2409 case 161:
    2410 #line 921 "parser.y"
     2465case 165:
     2466#line 946 "parser.y"
    24112467{
    24122468                yyvsp[0].ctl->title = yyvsp[-7].nid;
     
    24172473                ;
    24182474    break;}
    2419 case 162:
    2420 #line 932 "parser.y"
     2475case 166:
     2476#line 957 "parser.y"
    24212477{
    24222478                yyval.ctl=new_control();
     
    24242480                yyval.ctl->id = yyvsp[-16].num;
    24252481                yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-14].nid);
    2426                 yyval.ctl->style = yyvsp[-12].num;
     2482                yyval.ctl->style = yyvsp[-12].style;
    24272483                yyval.ctl->gotstyle = TRUE;
    24282484                yyval.ctl->x = yyvsp[-10].num;
     
    24302486                yyval.ctl->width = yyvsp[-6].num;
    24312487                yyval.ctl->height = yyvsp[-4].num;
    2432                 if(yyvsp[-2].iptr)
    2433                 {
    2434                         yyval.ctl->exstyle = *(yyvsp[-2].iptr);
     2488                if(yyvsp[-2].style)
     2489                {
     2490                        yyval.ctl->exstyle = yyvsp[-2].style;
    24352491                        yyval.ctl->gotexstyle = TRUE;
    2436                         free(yyvsp[-2].iptr);
    24372492                }
    24382493                if(yyvsp[-1].iptr)
     
    24452500                ;
    24462501    break;}
    2447 case 163:
    2448 #line 957 "parser.y"
     2502case 167:
     2503#line 981 "parser.y"
    24492504{
    24502505                yyval.ctl=new_control();
    24512506                yyval.ctl->title = yyvsp[-15].nid;
    24522507                yyval.ctl->id = yyvsp[-13].num;
    2453                 yyval.ctl->style = yyvsp[-9].num;
     2508                yyval.ctl->style = yyvsp[-9].style;
    24542509                yyval.ctl->gotstyle = TRUE;
    24552510                yyval.ctl->ctlclass = convert_ctlclass(yyvsp[-11].nid);
     
    24612516                ;
    24622517    break;}
    2463 case 164:
    2464 #line 973 "parser.y"
     2518case 168:
     2519#line 997 "parser.y"
    24652520{
    24662521                yyval.ctl=new_control();
     
    24892544                ;
    24902545    break;}
    2491 case 165:
    2492 #line 1001 "parser.y"
     2546case 169:
     2547#line 1025 "parser.y"
    24932548{
    24942549                yyval.ctl = new_control();
     
    25132568                ;
    25142569    break;}
    2515 case 166:
    2516 #line 1024 "parser.y"
     2570case 170:
     2571#line 1048 "parser.y"
    25172572{ yyval.raw = NULL; ;
    25182573    break;}
    2519 case 167:
    2520 #line 1025 "parser.y"
     2574case 171:
     2575#line 1049 "parser.y"
    25212576{ yyval.raw = yyvsp[0].raw; ;
    25222577    break;}
    2523 case 168:
    2524 #line 1028 "parser.y"
     2578case 172:
     2579#line 1052 "parser.y"
    25252580{ yyval.iptr = NULL; ;
    25262581    break;}
    2527 case 169:
    2528 #line 1029 "parser.y"
     2582case 173:
     2583#line 1053 "parser.y"
    25292584{ yyval.iptr = new_int(yyvsp[0].num); ;
    25302585    break;}
    2531 case 170:
    2532 #line 1033 "parser.y"
     2586case 174:
     2587#line 1057 "parser.y"
    25332588{ yyval.fntid = new_font_id(yyvsp[-7].num, yyvsp[-5].str, yyvsp[-3].num, yyvsp[-1].num); ;
    25342589    break;}
    2535 case 171:
    2536 #line 1040 "parser.y"
     2590case 175:
     2591#line 1064 "parser.y"
    25372592{ yyval.fntid = NULL; ;
    25382593    break;}
    2539 case 172:
    2540 #line 1041 "parser.y"
     2594case 176:
     2595#line 1065 "parser.y"
    25412596{ yyval.fntid = NULL; ;
    25422597    break;}
    2543 case 173:
    2544 #line 1045 "parser.y"
     2598case 177:
     2599#line 1069 "parser.y"
    25452600{
    25462601                if(!yyvsp[0].menitm)
     
    25642619                ;
    25652620    break;}
    2566 case 174:
    2567 #line 1068 "parser.y"
     2621case 178:
     2622#line 1092 "parser.y"
    25682623{ yyval.menitm = yyvsp[-1].menitm; ;
    25692624    break;}
    2570 case 175:
    2571 #line 1072 "parser.y"
     2625case 179:
     2626#line 1096 "parser.y"
    25722627{yyval.menitm = NULL;;
    25732628    break;}
    2574 case 176:
    2575 #line 1073 "parser.y"
     2629case 180:
     2630#line 1097 "parser.y"
    25762631{
    25772632                yyval.menitm=new_menu_item();
     
    25842639                ;
    25852640    break;}
    2586 case 177:
    2587 #line 1082 "parser.y"
     2641case 181:
     2642#line 1106 "parser.y"
    25882643{
    25892644                yyval.menitm=new_menu_item();
     
    25932648                ;
    25942649    break;}
    2595 case 178:
    2596 #line 1088 "parser.y"
     2650case 182:
     2651#line 1112 "parser.y"
    25972652{
    25982653                yyval.menitm = new_menu_item();
     
    26042659                ;
    26052660    break;}
    2606 case 179:
    2607 #line 1107 "parser.y"
     2661case 183:
     2662#line 1131 "parser.y"
    26082663{ yyval.num = 0; ;
    26092664    break;}
    2610 case 180:
    2611 #line 1108 "parser.y"
     2665case 184:
     2666#line 1132 "parser.y"
    26122667{ yyval.num = yyvsp[0].num | MF_CHECKED; ;
    26132668    break;}
    2614 case 181:
    2615 #line 1109 "parser.y"
     2669case 185:
     2670#line 1133 "parser.y"
    26162671{ yyval.num = yyvsp[0].num | MF_GRAYED; ;
    26172672    break;}
    2618 case 182:
    2619 #line 1110 "parser.y"
     2673case 186:
     2674#line 1134 "parser.y"
    26202675{ yyval.num = yyvsp[0].num | MF_HELP; ;
    26212676    break;}
    2622 case 183:
    2623 #line 1111 "parser.y"
     2677case 187:
     2678#line 1135 "parser.y"
    26242679{ yyval.num = yyvsp[0].num | MF_DISABLED; ;
    26252680    break;}
    2626 case 184:
    2627 #line 1112 "parser.y"
     2681case 188:
     2682#line 1136 "parser.y"
    26282683{ yyval.num = yyvsp[0].num | MF_MENUBARBREAK; ;
    26292684    break;}
    2630 case 185:
    2631 #line 1113 "parser.y"
     2685case 189:
     2686#line 1137 "parser.y"
    26322687{ yyval.num = yyvsp[0].num | MF_MENUBREAK; ;
    26332688    break;}
    2634 case 186:
    2635 #line 1117 "parser.y"
     2689case 190:
     2690#line 1141 "parser.y"
    26362691{
    26372692                if(!win32)
     
    26572712                ;
    26582713    break;}
    2659 case 187:
    2660 #line 1142 "parser.y"
     2714case 191:
     2715#line 1166 "parser.y"
    26612716{ yyval.menexitm = yyvsp[-1].menexitm; ;
    26622717    break;}
    2663 case 188:
    2664 #line 1146 "parser.y"
     2718case 192:
     2719#line 1170 "parser.y"
    26652720{yyval.menexitm = NULL; ;
    26662721    break;}
    2667 case 189:
    2668 #line 1147 "parser.y"
     2722case 193:
     2723#line 1171 "parser.y"
    26692724{
    26702725                yyval.menexitm = new_menuex_item();
     
    26842739                ;
    26852740    break;}
    2686 case 190:
    2687 #line 1163 "parser.y"
     2741case 194:
     2742#line 1187 "parser.y"
    26882743{
    26892744                yyval.menexitm = new_menuex_item();
     
    26932748                ;
    26942749    break;}
    2695 case 191:
    2696 #line 1169 "parser.y"
     2750case 195:
     2751#line 1193 "parser.y"
    26972752{
    26982753                yyval.menexitm = new_menuex_item();
     
    27132768                ;
    27142769    break;}
    2715 case 192:
    2716 #line 1189 "parser.y"
     2770case 196:
     2771#line 1213 "parser.y"
    27172772{ yyval.exopt = new_itemex_opt(0, 0, 0, 0); ;
    27182773    break;}
    2719 case 193:
    2720 #line 1190 "parser.y"
     2774case 197:
     2775#line 1214 "parser.y"
    27212776{
    27222777                yyval.exopt = new_itemex_opt(yyvsp[0].num, 0, 0, 0);
     
    27242779                ;
    27252780    break;}
    2726 case 194:
    2727 #line 1194 "parser.y"
     2781case 198:
     2782#line 1218 "parser.y"
    27282783{
    27292784                yyval.exopt = new_itemex_opt(yyvsp[-3].iptr ? *(yyvsp[-3].iptr) : 0, yyvsp[-1].iptr ? *(yyvsp[-1].iptr) : 0, yyvsp[0].num, 0);
     
    27352790                ;
    27362791    break;}
    2737 case 195:
    2738 #line 1202 "parser.y"
     2792case 199:
     2793#line 1226 "parser.y"
    27392794{
    27402795                yyval.exopt = new_itemex_opt(yyvsp[-4].iptr ? *(yyvsp[-4].iptr) : 0, yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0);
     
    27462801                ;
    27472802    break;}
    2748 case 196:
    2749 #line 1213 "parser.y"
     2803case 200:
     2804#line 1237 "parser.y"
    27502805{ yyval.exopt = new_itemex_opt(0, 0, 0, 0); ;
    27512806    break;}
    2752 case 197:
    2753 #line 1214 "parser.y"
     2807case 201:
     2808#line 1238 "parser.y"
    27542809{
    27552810                yyval.exopt = new_itemex_opt(yyvsp[0].num, 0, 0, 0);
     
    27572812                ;
    27582813    break;}
    2759 case 198:
    2760 #line 1218 "parser.y"
     2814case 202:
     2815#line 1242 "parser.y"
    27612816{
    27622817                yyval.exopt = new_itemex_opt(yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0, 0);
     
    27662821                ;
    27672822    break;}
    2768 case 199:
    2769 #line 1224 "parser.y"
     2823case 203:
     2824#line 1248 "parser.y"
    27702825{
    27712826                yyval.exopt = new_itemex_opt(yyvsp[-4].iptr ? *(yyvsp[-4].iptr) : 0, yyvsp[-2].iptr ? *(yyvsp[-2].iptr) : 0, yyvsp[0].num, 0);
     
    27772832                ;
    27782833    break;}
    2779 case 200:
    2780 #line 1232 "parser.y"
     2834case 204:
     2835#line 1256 "parser.y"
    27812836{
    27822837                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);
     
    27902845                ;
    27912846    break;}
    2792 case 201:
    2793 #line 1252 "parser.y"
     2847case 205:
     2848#line 1276 "parser.y"
    27942849{
    27952850                if(!yyvsp[-1].stt)
     
    28312886                ;
    28322887    break;}
    2833 case 202:
    2834 #line 1293 "parser.y"
     2888case 206:
     2889#line 1317 "parser.y"
    28352890{
    28362891                if((tagstt = find_stringtable(yyvsp[0].lvc)) == NULL)
     
    28432898                ;
    28442899    break;}
    2845 case 203:
    2846 #line 1304 "parser.y"
     2900case 207:
     2901#line 1328 "parser.y"
    28472902{ yyval.stt = NULL; ;
    28482903    break;}
    2849 case 204:
    2850 #line 1305 "parser.y"
     2904case 208:
     2905#line 1329 "parser.y"
    28512906{
    28522907                int i;
    28532908                assert(tagstt != NULL);
     2909                if(yyvsp[-2].num > 65535 || yyvsp[-2].num < -32768)
     2910                        yyerror("Stringtable entry's ID out of range (%d)", yyvsp[-2].num);
    28542911                /* Search for the ID */
    28552912                for(i = 0; i < tagstt->nentries; i++)
     
    28772934                ;
    28782935    break;}
    2879 case 207:
    2880 #line 1341 "parser.y"
     2936case 211:
     2937#line 1367 "parser.y"
    28812938{
    28822939                yyval.veri = yyvsp[-3].veri;
     
    28842941                ;
    28852942    break;}
    2886 case 208:
    2887 #line 1348 "parser.y"
     2943case 212:
     2944#line 1374 "parser.y"
    28882945{ yyval.veri = new_versioninfo(); ;
    28892946    break;}
    2890 case 209:
    2891 #line 1349 "parser.y"
     2947case 213:
     2948#line 1375 "parser.y"
    28922949{
    28932950                if(yyvsp[-8].veri->gotit.fv)
     
    29012958                ;
    29022959    break;}
    2903 case 210:
    2904 #line 1359 "parser.y"
     2960case 214:
     2961#line 1385 "parser.y"
    29052962{
    29062963                if(yyvsp[-8].veri->gotit.pv)
     
    29142971                ;
    29152972    break;}
    2916 case 211:
    2917 #line 1369 "parser.y"
     2973case 215:
     2974#line 1395 "parser.y"
    29182975{
    29192976                if(yyvsp[-2].veri->gotit.ff)
     
    29242981                ;
    29252982    break;}
    2926 case 212:
    2927 #line 1376 "parser.y"
     2983case 216:
     2984#line 1402 "parser.y"
    29282985{
    29292986                if(yyvsp[-2].veri->gotit.ffm)
     
    29342991                ;
    29352992    break;}
    2936 case 213:
    2937 #line 1383 "parser.y"
     2993case 217:
     2994#line 1409 "parser.y"
    29382995{
    29392996                if(yyvsp[-2].veri->gotit.fo)
     
    29443001                ;
    29453002    break;}
    2946 case 214:
    2947 #line 1390 "parser.y"
     3003case 218:
     3004#line 1416 "parser.y"
    29483005{
    29493006                if(yyvsp[-2].veri->gotit.ft)
     
    29543011                ;
    29553012    break;}
    2956 case 215:
    2957 #line 1397 "parser.y"
     3013case 219:
     3014#line 1423 "parser.y"
    29583015{
    29593016                if(yyvsp[-2].veri->gotit.fst)
     
    29643021                ;
    29653022    break;}
    2966 case 216:
    2967 #line 1407 "parser.y"
     3023case 220:
     3024#line 1433 "parser.y"
    29683025{ yyval.blk = NULL; ;
    29693026    break;}
    2970 case 217:
    2971 #line 1408 "parser.y"
     3027case 221:
     3028#line 1434 "parser.y"
    29723029{
    29733030                yyval.blk = yyvsp[0].blk;
     
    29773034                ;
    29783035    break;}
    2979 case 218:
    2980 #line 1417 "parser.y"
     3036case 222:
     3037#line 1443 "parser.y"
    29813038{
    29823039                yyval.blk = new_ver_block();
     
    29853042                ;
    29863043    break;}
    2987 case 219:
    2988 #line 1425 "parser.y"
     3044case 223:
     3045#line 1451 "parser.y"
    29893046{ yyval.val = NULL; ;
    29903047    break;}
    2991 case 220:
    2992 #line 1426 "parser.y"
     3048case 224:
     3049#line 1452 "parser.y"
    29933050{
    29943051                yyval.val = yyvsp[0].val;
     
    29983055                ;
    29993056    break;}
    3000 case 221:
    3001 #line 1435 "parser.y"
     3057case 225:
     3058#line 1461 "parser.y"
    30023059{
    30033060                yyval.val = new_ver_value();
     
    30063063                ;
    30073064    break;}
    3008 case 222:
    3009 #line 1440 "parser.y"
     3065case 226:
     3066#line 1466 "parser.y"
    30103067{
    30113068                yyval.val = new_ver_value();
     
    30153072                ;
    30163073    break;}
    3017 case 223:
    3018 #line 1446 "parser.y"
     3074case 227:
     3075#line 1472 "parser.y"
    30193076{
    30203077                yyval.val = new_ver_value();
     
    30243081                ;
    30253082    break;}
    3026 case 224:
    3027 #line 1455 "parser.y"
     3083case 228:
     3084#line 1481 "parser.y"
    30283085{ yyval.verw = new_ver_words(yyvsp[0].num); ;
    30293086    break;}
    3030 case 225:
    3031 #line 1456 "parser.y"
     3087case 229:
     3088#line 1482 "parser.y"
    30323089{ yyval.verw = add_ver_words(yyvsp[-2].verw, yyvsp[0].num); ;
    30333090    break;}
    3034 case 226:
    3035 #line 1460 "parser.y"
     3091case 230:
     3092#line 1486 "parser.y"
    30363093{
    30373094                int nitems;
     
    30583115                ;
    30593116    break;}
    3060 case 227:
    3061 #line 1486 "parser.y"
     3117case 231:
     3118#line 1512 "parser.y"
    30623119{ yyval.tlbarItems = NULL; ;
    30633120    break;}
    3064 case 228:
    3065 #line 1487 "parser.y"
     3121case 232:
     3122#line 1513 "parser.y"
    30663123{         
    30673124                toolbar_item_t *idrec = new_toolbar_item();
     
    30703127                ;
    30713128    break;}
    3072 case 229:
    3073 #line 1492 "parser.y"
     3129case 233:
     3130#line 1518 "parser.y"
    30743131{         
    30753132                toolbar_item_t *idrec = new_toolbar_item();
     
    30783135        ;
    30793136    break;}
    3080 case 230:
    3081 #line 1501 "parser.y"
     3137case 234:
     3138#line 1527 "parser.y"
    30823139{ yyval.iptr = NULL; ;
    30833140    break;}
    3084 case 231:
    3085 #line 1502 "parser.y"
     3141case 235:
     3142#line 1528 "parser.y"
    30863143{
    30873144                if(yyvsp[-1].iptr)
     
    30953152                ;
    30963153    break;}
    3097 case 232:
    3098 #line 1512 "parser.y"
     3154case 236:
     3155#line 1538 "parser.y"
    30993156{
    31003157                if(yyvsp[-1].iptr)
     
    31113168                ;
    31123169    break;}
    3113 case 233:
    3114 #line 1527 "parser.y"
     3170case 237:
     3171#line 1553 "parser.y"
    31153172{ yyval.iptr = new_int(WRC_MO_PRELOAD); ;
    31163173    break;}
    3117 case 234:
    3118 #line 1528 "parser.y"
     3174case 238:
     3175#line 1554 "parser.y"
    31193176{ yyval.iptr = new_int(WRC_MO_MOVEABLE); ;
    31203177    break;}
    3121 case 235:
    3122 #line 1529 "parser.y"
     3178case 239:
     3179#line 1555 "parser.y"
    31233180{ yyval.iptr = new_int(WRC_MO_DISCARDABLE); ;
    31243181    break;}
    3125 case 236:
    3126 #line 1530 "parser.y"
     3182case 240:
     3183#line 1556 "parser.y"
    31273184{ yyval.iptr = new_int(WRC_MO_PURE); ;
    31283185    break;}
    3129 case 237:
    3130 #line 1533 "parser.y"
     3186case 241:
     3187#line 1559 "parser.y"
    31313188{ yyval.iptr = new_int(~WRC_MO_PRELOAD); ;
    31323189    break;}
    3133 case 238:
    3134 #line 1534 "parser.y"
     3190case 242:
     3191#line 1560 "parser.y"
    31353192{ yyval.iptr = new_int(~WRC_MO_MOVEABLE); ;
    31363193    break;}
    3137 case 239:
    3138 #line 1535 "parser.y"
     3194case 243:
     3195#line 1561 "parser.y"
    31393196{ yyval.iptr = new_int(~WRC_MO_PURE); ;
    31403197    break;}
    3141 case 240:
    3142 #line 1539 "parser.y"
     3198case 244:
     3199#line 1565 "parser.y"
    31433200{ yyval.lvc = new_lvc(); ;
    31443201    break;}
    3145 case 241:
    3146 #line 1540 "parser.y"
     3202case 245:
     3203#line 1566 "parser.y"
    31473204{
    31483205                if(!win32)
     
    31543211                ;
    31553212    break;}
    3156 case 242:
    3157 #line 1548 "parser.y"
     3213case 246:
     3214#line 1574 "parser.y"
    31583215{
    31593216                if(!win32)
     
    31653222                ;
    31663223    break;}
    3167 case 243:
    3168 #line 1556 "parser.y"
     3224case 247:
     3225#line 1582 "parser.y"
    31693226{
    31703227                if(!win32)
     
    31763233                ;
    31773234    break;}
    3178 case 244:
    3179 #line 1567 "parser.y"
     3235case 248:
     3236#line 1593 "parser.y"
    31803237{ yyval.lan = new_language(yyvsp[-2].num, yyvsp[0].num); ;
    31813238    break;}
    3182 case 245:
    3183 #line 1571 "parser.y"
     3239case 249:
     3240#line 1597 "parser.y"
    31843241{ yyval.chars = new_characts(yyvsp[0].num); ;
    31853242    break;}
    3186 case 246:
    3187 #line 1575 "parser.y"
     3243case 250:
     3244#line 1601 "parser.y"
    31883245{ yyval.ver = new_version(yyvsp[0].num); ;
    31893246    break;}
    3190 case 247:
    3191 #line 1579 "parser.y"
     3247case 251:
     3248#line 1605 "parser.y"
    31923249{ yyval.raw = yyvsp[-1].raw; ;
    31933250    break;}
    3194 case 248:
    3195 #line 1583 "parser.y"
     3251case 252:
     3252#line 1609 "parser.y"
    31963253{ yyval.raw = yyvsp[0].raw; ;
    31973254    break;}
    3198 case 249:
    3199 #line 1584 "parser.y"
     3255case 253:
     3256#line 1610 "parser.y"
    32003257{ yyval.raw = int2raw_data(yyvsp[0].num); ;
    32013258    break;}
    3202 case 250:
    3203 #line 1585 "parser.y"
     3259case 254:
     3260#line 1611 "parser.y"
    32043261{ yyval.raw = long2raw_data(yyvsp[0].num); ;
    32053262    break;}
    3206 case 251:
    3207 #line 1586 "parser.y"
     3263case 255:
     3264#line 1612 "parser.y"
    32083265{ yyval.raw = str2raw_data(yyvsp[0].str); ;
    32093266    break;}
    3210 case 252:
    3211 #line 1587 "parser.y"
     3267case 256:
     3268#line 1613 "parser.y"
    32123269{ yyval.raw = merge_raw_data(yyvsp[-2].raw, yyvsp[0].raw); free(yyvsp[0].raw->data); free(yyvsp[0].raw); ;
    32133270    break;}
    3214 case 253:
    3215 #line 1588 "parser.y"
     3271case 257:
     3272#line 1614 "parser.y"
    32163273{ yyval.raw = merge_raw_data_int(yyvsp[-2].raw, yyvsp[0].num); ;
    32173274    break;}
    3218 case 254:
    3219 #line 1589 "parser.y"
     3275case 258:
     3276#line 1615 "parser.y"
    32203277{ yyval.raw = merge_raw_data_long(yyvsp[-2].raw, yyvsp[0].num); ;
    32213278    break;}
    3222 case 255:
    3223 #line 1590 "parser.y"
     3279case 259:
     3280#line 1616 "parser.y"
    32243281{ yyval.raw = merge_raw_data_str(yyvsp[-2].raw, yyvsp[0].str); ;
    32253282    break;}
    3226 case 256:
    3227 #line 1597 "parser.y"
     3283case 260:
     3284#line 1623 "parser.y"
    32283285{ yyval.iptr = 0; ;
    32293286    break;}
    3230 case 257:
    3231 #line 1598 "parser.y"
     3287case 261:
     3288#line 1624 "parser.y"
    32323289{ yyval.iptr = new_int(yyvsp[0].num); ;
    32333290    break;}
    3234 case 258:
    3235 #line 1600 "parser.y"
    3236 { yyval.num = (yyvsp[0].num) & andmask; ;
    3237     break;}
    3238 case 259:
    3239 #line 1603 "parser.y"
    3240 { yyval.num = 0; andmask = -1; ;
    3241     break;}
    3242 case 260:
    3243 #line 1606 "parser.y"
     3291case 262:
     3292#line 1626 "parser.y"
     3293{ yyval.num = (yyvsp[0].num); ;
     3294    break;}
     3295case 263:
     3296#line 1629 "parser.y"
    32443297{ yyval.num = (yyvsp[-2].num) + (yyvsp[0].num); ;
    32453298    break;}
    3246 case 261:
    3247 #line 1607 "parser.y"
     3299case 264:
     3300#line 1630 "parser.y"
    32483301{ yyval.num = (yyvsp[-2].num) - (yyvsp[0].num); ;
    32493302    break;}
    3250 case 262:
    3251 #line 1608 "parser.y"
     3303case 265:
     3304#line 1631 "parser.y"
    32523305{ yyval.num = (yyvsp[-2].num) | (yyvsp[0].num); ;
    32533306    break;}
    3254 case 263:
    3255 #line 1609 "parser.y"
     3307case 266:
     3308#line 1632 "parser.y"
    32563309{ yyval.num = (yyvsp[-2].num) & (yyvsp[0].num); ;
    32573310    break;}
    3258 case 264:
    3259 #line 1610 "parser.y"
     3311case 267:
     3312#line 1633 "parser.y"
    32603313{ yyval.num = (yyvsp[-2].num) * (yyvsp[0].num); ;
    32613314    break;}
    3262 case 265:
    3263 #line 1611 "parser.y"
     3315case 268:
     3316#line 1634 "parser.y"
    32643317{ yyval.num = (yyvsp[-2].num) / (yyvsp[0].num); ;
    32653318    break;}
    3266 case 266:
    3267 #line 1612 "parser.y"
     3319case 269:
     3320#line 1635 "parser.y"
    32683321{ yyval.num = ~(yyvsp[0].num); ;
    32693322    break;}
    3270 case 267:
    3271 #line 1613 "parser.y"
     3323case 270:
     3324#line 1636 "parser.y"
    32723325{ yyval.num = -(yyvsp[0].num); ;
    32733326    break;}
    3274 case 268:
    3275 #line 1615 "parser.y"
     3327case 271:
     3328#line 1638 "parser.y"
    32763329{ yyval.num = yyvsp[-1].num; ;
    32773330    break;}
    3278 case 269:
    3279 #line 1616 "parser.y"
     3331case 272:
     3332#line 1639 "parser.y"
    32803333{ yyval.num = yyvsp[0].num; want_rscname = 0; ;
    32813334    break;}
    3282 case 270:
    3283 #line 1617 "parser.y"
    3284 { yyval.num = 0; andmask &= ~(yyvsp[0].num); ;
    3285     break;}
    3286 case 271:
    3287 #line 1620 "parser.y"
     3335case 273:
     3336#line 1640 "parser.y"
     3337{ yyval.num = ~(yyvsp[0].num); ;
     3338    break;}
     3339case 274:
     3340#line 1643 "parser.y"
    32883341{ yyval.num = yyvsp[0].num; ;
    32893342    break;}
    3290 case 272:
    3291 #line 1621 "parser.y"
     3343case 275:
     3344#line 1644 "parser.y"
    32923345{ yyval.num = yyvsp[0].num; ;
    32933346    break;}
     
    34913544  goto yynewstate;
    34923545}
    3493 #line 1624 "parser.y"
     3546#line 1647 "parser.y"
    34943547
    34953548/* Dialog specific functions */
    3496 dialog_t *dialog_style(int st, dialog_t *dlg)
    3497 {
    3498         DWORD s = 0;
     3549dialog_t *dialog_style(style_t * st, dialog_t *dlg)
     3550{
    34993551        assert(dlg != NULL);
     3552        if(dlg->style == NULL)
     3553        {
     3554                dlg->style = new_style(0,0);
     3555        }
     3556
    35003557        if(dlg->gotstyle)
    35013558        {
    35023559                yywarning("Style already defined, or-ing together");
    3503                 s = dlg->style;
    35043560        }
    3505         dlg->style = st | s;
     3561        else
     3562        {
     3563                dlg->style->or_mask = 0;
     3564                dlg->style->and_mask = 0;
     3565        }
     3566        dlg->style->or_mask |= st->or_mask;
     3567        dlg->style->and_mask |= st->and_mask;
    35063568        dlg->gotstyle = TRUE;
     3569        free(st);
    35073570        return dlg;
    35083571}
    35093572
    3510 dialog_t *dialog_exstyle(int st, dialog_t *dlg)
    3511 {
    3512         DWORD s = 0;
     3573dialog_t *dialog_exstyle(style_t *st, dialog_t *dlg)
     3574{
    35133575        assert(dlg != NULL);
     3576        if(dlg->exstyle == NULL)
     3577        {
     3578                dlg->exstyle = new_style(0,0);
     3579        }
     3580
    35143581        if(dlg->gotexstyle)
    35153582        {
    35163583                yywarning("ExStyle already defined, or-ing together");
    3517                 s = dlg->style;
    35183584        }
    3519         dlg->exstyle = st | s;
     3585        else
     3586        {
     3587                dlg->exstyle->or_mask = 0;
     3588                dlg->exstyle->and_mask = 0;
     3589        }
     3590        dlg->exstyle->or_mask |= st->or_mask;
     3591        dlg->exstyle->and_mask |= st->and_mask;
    35203592        dlg->gotexstyle = TRUE;
     3593        free(st);
    35213594        return dlg;
    35223595}
     
    35863659
    35873660/* Controls specific functions */
    3588 control_t *ins_ctrl(int type, int style, control_t *ctrl, control_t *prev)
    3589 {
     3661control_t *ins_ctrl(int type, int special_style, control_t *ctrl, control_t *prev)
     3662{
     3663        /* Hm... this seems to be jammed in at all time... */
     3664        int defaultstyle = WS_CHILD | WS_VISIBLE;
     3665
    35903666        assert(ctrl != NULL);
    35913667        ctrl->prev = prev;
     3668
    35923669        if(prev)
    35933670                prev->next = ctrl;
     3671
    35943672        if(type != -1)
    35953673        {
     
    35993677        }
    36003678
    3601         /* Hm... this seems to be jammed in at all time... */
    3602         ctrl->style |= WS_CHILD | WS_VISIBLE;
    36033679        switch(type)
    36043680        {
    36053681        case CT_BUTTON:
    3606                 ctrl->style |= style;
    3607                 if(style != BS_GROUPBOX && style != BS_RADIOBUTTON)
    3608                         ctrl->style |= WS_TABSTOP;
     3682                if(special_style != BS_GROUPBOX && special_style != BS_RADIOBUTTON)
     3683                        defaultstyle |= WS_TABSTOP;
    36093684                break;
    36103685        case CT_EDIT:
    3611                 ctrl->style |= WS_TABSTOP | WS_BORDER;
     3686                defaultstyle |= WS_TABSTOP | WS_BORDER;
    36123687                break;
    36133688        case CT_LISTBOX:
    3614                 ctrl->style |= LBS_NOTIFY | WS_BORDER;
     3689                defaultstyle |= LBS_NOTIFY | WS_BORDER;
    36153690                break;
    36163691        case CT_COMBOBOX:
    3617                 ctrl->style |= CBS_SIMPLE;
     3692                defaultstyle |= CBS_SIMPLE;
    36183693                break;
    36193694        case CT_STATIC:
    3620                 ctrl->style |= style;
    3621                 if(style == SS_CENTER || style == SS_LEFT || style == SS_RIGHT)
    3622                         ctrl->style |= WS_GROUP;
     3695                if(special_style == SS_CENTER || special_style == SS_LEFT || special_style == SS_RIGHT)
     3696                        defaultstyle |= WS_GROUP;
    36233697                break;
    36243698        }
     
    36293703                {
    36303704                case CT_EDIT:
    3631                         ctrl->style |= ES_LEFT;
     3705                        defaultstyle |= ES_LEFT;
    36323706                        break;
    36333707                case CT_LISTBOX:
    3634                         ctrl->style |= LBS_NOTIFY;
     3708                        defaultstyle |= LBS_NOTIFY;
    36353709                        break;
    36363710                case CT_COMBOBOX:
    3637                         ctrl->style |= CBS_SIMPLE | WS_TABSTOP;
     3711                        defaultstyle |= CBS_SIMPLE | WS_TABSTOP;
    36383712                        break;
    36393713                case CT_SCROLLBAR:
    3640                         ctrl->style |= SBS_HORZ;
     3714                        defaultstyle |= SBS_HORZ;
    36413715                        break;
    36423716                case CT_BUTTON:
    3643                         switch(style)
     3717                        switch(special_style)
    36443718                        {
    36453719                        case BS_CHECKBOX:
     
    36523726                        case BS_3STATE:
    36533727                        case BS_AUTOCHECKBOX:
    3654                                 ctrl->style |= WS_TABSTOP;
     3728                                defaultstyle |= WS_TABSTOP;
    36553729                                break;
    36563730                        default:
    3657                                 yywarning("Unknown default button control-style 0x%08x", style);
     3731                                yywarning("Unknown default button control-style 0x%08x", special_style);
    36583732                        case BS_RADIOBUTTON:
    36593733                                break;
     
    36623736
    36633737                case CT_STATIC:
    3664                         switch(style)
     3738                        switch(special_style)
    36653739                        {
    36663740                        case SS_LEFT:
    36673741                        case SS_RIGHT:
    36683742                        case SS_CENTER:
    3669                                 ctrl->style |= WS_GROUP;
     3743                                defaultstyle |= WS_GROUP;
    36703744                                break;
    36713745                        case SS_ICON:   /* Special case */
    36723746                                break;
    36733747                        default:
    3674                                 yywarning("Unknown default static control-style 0x%08x", style);
     3748                                yywarning("Unknown default static control-style 0x%08x", special_style);
    36753749                                break;
    36763750                        }
     
    36853759
    36863760        /* The SS_ICON flag is always forced in for icon controls */
    3687         if(type == CT_STATIC && style == SS_ICON)
    3688                 ctrl->style |= SS_ICON;
    3689 
     3761        if(type == CT_STATIC && special_style == SS_ICON)
     3762                defaultstyle |= SS_ICON;
     3763
     3764        if (!ctrl->gotstyle)
     3765                ctrl->style = new_style(0,0);
     3766
     3767        /* combine all styles */
     3768        ctrl->style->or_mask = ctrl->style->or_mask | defaultstyle | special_style;
    36903769        ctrl->gotstyle = TRUE;
    36913770byebye:
     3771        /* combine with NOT mask */
     3772        if (ctrl->gotstyle)
     3773        {
     3774                ctrl->style->or_mask &= ~(ctrl->style->and_mask);
     3775                ctrl->style->and_mask = 0;
     3776        }
     3777        if (ctrl->gotexstyle)
     3778        {
     3779                ctrl->exstyle->or_mask &= ~(ctrl->exstyle->and_mask);
     3780                ctrl->exstyle->and_mask = 0;
     3781        }
    36923782        return ctrl;
    36933783}
     
    37313821
    37323822/* DialogEx specific functions */
    3733 dialogex_t *dialogex_style(int st, dialogex_t *dlg)
    3734 {
    3735         DWORD s = 0;
     3823dialogex_t *dialogex_style(style_t * st, dialogex_t *dlg)
     3824{
    37363825        assert(dlg != NULL);
     3826        if(dlg->style == NULL)
     3827        {
     3828                dlg->style = new_style(0,0);
     3829        }
     3830
    37373831        if(dlg->gotstyle)
    37383832        {
    37393833                yywarning("Style already defined, or-ing together");
    3740                 s = dlg->style;
    37413834        }
    3742         dlg->style = st | s;
     3835        else
     3836        {
     3837                dlg->style->or_mask = 0;
     3838                dlg->style->and_mask = 0;
     3839        }
     3840        dlg->style->or_mask |= st->or_mask;
     3841        dlg->style->and_mask |= st->and_mask;
    37433842        dlg->gotstyle = TRUE;
     3843        free(st);
    37443844        return dlg;
    37453845}
    37463846
    3747 dialogex_t *dialogex_exstyle(int st, dialogex_t *dlg)
    3748 {
    3749         DWORD s = 0;
     3847dialogex_t *dialogex_exstyle(style_t * st, dialogex_t *dlg)
     3848{
    37503849        assert(dlg != NULL);
     3850        if(dlg->exstyle == NULL)
     3851        {
     3852                dlg->exstyle = new_style(0,0);
     3853        }
     3854
    37513855        if(dlg->gotexstyle)
    37523856        {
    37533857                yywarning("ExStyle already defined, or-ing together");
    3754                 s = dlg->exstyle;
    37553858        }
    3756         dlg->exstyle = st | s;
     3859        else
     3860        {
     3861                dlg->exstyle->or_mask = 0;
     3862                dlg->exstyle->and_mask = 0;
     3863        }
     3864        dlg->exstyle->or_mask |= st->or_mask;
     3865        dlg->exstyle->and_mask |= st->and_mask;
    37573866        dlg->gotexstyle = TRUE;
     3867        free(st);
    37583868        return dlg;
    37593869}
  • trunk/tools/wrc/y.tab.h

    r1355 r3426  
    4040        dlginit_t       *dginit;
    4141        style_pair_t    *styles;
     42        style_t         *style;
    4243} YYSTYPE;
    4344#define tIF     258
Note: See TracChangeset for help on using the changeset viewer.