Having these obsolete switches around (haven't been used in ages, AFAIK), just makes the interface harder to understand, and the code harder to maintain. They've been marked obsolete for a long while now, it's time to remove them before 0.9. ChangeLog Remove the obsolete wrc options: -A, -T, and -t. Index: tools/wrc/README.wrc =================================================================== RCS file: /var/cvs/wine/tools/wrc/README.wrc,v retrieving revision 1.11 diff -u -r1.11 README.wrc --- tools/wrc/README.wrc 26 Dec 2001 20:40:49 -0000 1.11 +++ tools/wrc/README.wrc 16 Jan 2003 18:43:39 -0000 @@ -28,7 +28,6 @@ Usage: wrc [options...] [infile[.rc|.res]] -a n Alignment of resource (win16 only, default is 4) - -A Auto register resources (only with gcc 2.7 and better) -b Create an assembly array from a binary .res file -B x Set output byte-order x={n[ative], l[ittle], b[ig]} (win32 only; default is n[ative] which equals little-endian) @@ -51,8 +50,6 @@ -p prefix Give a prefix for the generated names -r Create binary .res file (compile only) -s Add structure with win32/16 (PE/NE) resource directory - -t Generate indirect loadable resource tables - -T Generate only indirect loadable resources tables -V Print version end exit -w 16|32 Select win16 or win32 output (default is win32) -W Enable pedantic warnings @@ -209,43 +206,6 @@ It is _ONLY_ supported for backwards compatibility so that old sources can be compiled with winelib. DO NOT USE IT IN NEW RESOURCES, PLEASE! - - -Indirect loadable resources ---------------------------- - -Wrc can generate tables for indirect resource loading like winerc did. There -are two new structures defined in 'wine-base-dir/include/wrc_rsc.h': - -typedef struct wrc_resource16 -{ - INT32 resid; /* The resource id if resname == NULL */ - LPSTR resname; - INT32 restype; /* The resource type-id if typename == NULL */ - LPSTR typename; - LPBYTE data; /* Actual resource data */ - UINT32 datasize; /* The size of the resource */ -} wrc_resource16_t; - -typedef struct wrc_resource32 -{ - INT32 resid; /* The resource id if resname == NULL */ - LPWSTR resname; - INT32 restype; /* The resource type-id if typename == NULL */ - LPWSTR typename; - LPBYTE data; /* Actual resource data */ - UINT32 datasize; /* The size of the resource */ -} wrc_resource32_t; - -The extension to winerc lies in the addition of the 'typename' field to -support usertype resources with names for types. - -Note that _ALL_ names generated by wrc and to be used in interfacing with -wine are PASCAL-style strings, unlike winerc. The first element contains the -length and the strings are _not_ '\0'-terminated! - -You can also generate header files with wrc when specifying the '-h' or -'-H<filename>' option. NE/PE resource directory generation Index: tools/wrc/wrc.c =================================================================== RCS file: /var/cvs/wine/tools/wrc/wrc.c,v retrieving revision 1.24 diff -u -r1.24 wrc.c --- tools/wrc/wrc.c 11 Jan 2003 20:55:18 -0000 1.24 +++ tools/wrc/wrc.c 16 Jan 2003 18:37:10 -0000 @@ -86,7 +86,6 @@ static char usage[] = "Usage: wrc [options...] [infile[.rc|.res]] [outfile]\n" " -a n Alignment of resource (win16 only, default is 4)\n" - " -A Auto register resources (only with gcc 2.7 and better)\n" " -b Create an assembly array from a binary .res file\n" " -B x Set output byte-order x={n[ative], l[ittle], b[ig]}\n" " (win32 only; default is " ENDIAN "-endian)\n" @@ -109,8 +108,6 @@ " -O format The output format: one of `res', 'asm', 'hdr'.\n" " -p prefix Give a prefix for the generated names\n" " -s Add structure with win32/16 (PE/NE) resource directory\n" - " -t Generate indirect loadable resource tables\n" - " -T Generate only indirect loadable resources tables\n" " -v Enable verbose mode.\n" " -V Print version and exit\n" " -w 16|32 Select win16 or win32 output (default is win32)\n" @@ -202,16 +199,6 @@ int global = 0; /* - * Set when indirect loadable resource tables should be created (-t) - */ -int indirect = 0; - -/* - * Set when _only_ indirect loadable resource tables should be created (-T) - */ -int indirect_only = 0; - -/* * NE segment resource aligment (-a option) */ int alignment = 4; @@ -233,11 +220,6 @@ int pedantic = 0; /* - * Set when autoregister code must be added to the output (-A option) - */ -int auto_register = 0; - -/* * The output byte-order of resources (set with -B) */ int byteorder = WRC_BO_NATIVE; @@ -344,9 +326,6 @@ case 'a': alignment = atoi(optarg); break; - case 'A': - auto_register = 1; - break; case 'b': binary = 1; break; @@ -438,12 +417,6 @@ case 's': create_dir = 1; break; - case 'T': - indirect_only = 1; - /* Fall through */ - case 't': - indirect = 1; - break; case 'v': debuglevel = DEBUGLEVEL_CHAT; break; @@ -528,18 +501,6 @@ constant = 0; } - if(indirect) - { - warning("Option -t ignored with compile to .res\n"); - indirect = 0; - } - - if(indirect_only) - { - warning("Option -T ignored with compile to .res\n"); - indirect_only = 0; - } - if(global) { warning("Option -g ignored with compile to .res\n"); @@ -571,17 +532,6 @@ constant = 0; } - if(indirect) - { - warning("Option -t ignored with preprocess only\n"); - indirect = 0; - } - - if(indirect_only) - { - error("Option -E and -T cannot be used together\n"); - } - if(global) { warning("Option -g ignored with preprocess only\n"); @@ -604,14 +554,6 @@ error("Option -E and -N cannot be used together\n"); } } - -#if !defined(HAVE_WINE_CONSTRUCTOR) - if(auto_register) - { - warning("Autoregister code non-operable (HAVE_WINE_CONSTRUCTOR not defined)"); - auto_register = 0; - } -#endif /* Set alignment power */ a = alignment; Index: tools/wrc/wrc.h =================================================================== RCS file: /var/cvs/wine/tools/wrc/wrc.h,v retrieving revision 1.25 diff -u -r1.25 wrc.h --- tools/wrc/wrc.h 19 Dec 2002 04:14:38 -0000 1.25 +++ tools/wrc/wrc.h 16 Jan 2003 18:37:33 -0000 @@ -56,14 +56,11 @@ extern int create_header; extern int create_dir; extern int global; -extern int indirect; -extern int indirect_only; extern int alignment; extern int alignment_pwr; extern int create_s; extern DWORD codepage; extern int pedantic; -extern int auto_register; extern int byteorder; extern int preprocess_only; extern int no_preprocess; Index: tools/wrc/wrc.man =================================================================== RCS file: /var/cvs/wine/tools/wrc/wrc.man,v retrieving revision 1.10 diff -u -r1.10 wrc.man --- tools/wrc/wrc.man 11 Jan 2003 20:55:18 -0000 1.10 +++ tools/wrc/wrc.man 16 Jan 2003 18:31:22 -0000 @@ -35,10 +35,6 @@ Win16 only; set the alignment between resources n. The alignment must be a power of 2. The default is 4. .TP -.I \-A -Obsolete; include code in the assembly output to auto register resources -by calling a special wine function (only with gcc 2.7 and better). -.TP .I \-b Create an assembly file from a binary \fB.res\fR file. .TP @@ -135,12 +131,6 @@ .I \-s Add structure with win32/16 (PE/NE) resource directory to outputfile. This directory is always in native byteorder. -.TP -.I \-t -Obsolete; generate indirect loadable resource tables. -.TP -.I \-T -Obsolete; generate only indirect loadable resources tables. .TP .I \-v Turns on verbose mode (equivalent to -d 1). Index: tools/wrc/writeres.c =================================================================== RCS file: /var/cvs/wine/tools/wrc/writeres.c,v retrieving revision 1.24 diff -u -r1.24 writeres.c --- tools/wrc/writeres.c 15 Aug 2002 21:57:36 -0000 1.24 +++ tools/wrc/writeres.c 16 Jan 2003 18:39:01 -0000 @@ -48,21 +48,6 @@ "\n" ; -static char s_file_autoreg_str[] = - "\t.text\n" - ".LAuto_Register:\n" - "\tpushl\t$" __ASM_NAME("%s%s") "\n" - "\tcall\t" __ASM_NAME("LIBRES_RegisterResources") "\n" - "\taddl\t$4,%%esp\n" - "\tret\n\n" -#ifdef __NetBSD__ - ".stabs \"___CTOR_LIST__\",22,0,0,.LAuto_Register\n\n" -#else - "\t.section .ctors,\"aw\"\n" - "\t.long\t.LAuto_Register\n\n" -#endif - ; - static char h_file_head_str[] = "/*\n" " * This file is generated with wrc version " WRC_FULLVERSION ". Do not edit!\n" @@ -920,135 +905,50 @@ if(create_dir) fprintf(fo, ".LResTabEnd:\n"); - if(!indirect_only) + /* Write the resource data */ + fprintf(fo, "\n/* Resource binary data */\n\n"); + for(rsc = top; rsc; rsc = rsc->next) { - /* Write the resource data */ - fprintf(fo, "\n/* Resource binary data */\n\n"); - for(rsc = top; rsc; rsc = rsc->next) - { - if(!rsc->binres) - continue; - - fprintf(fo, "\t.align\t%d\n", win32 ? 4 : alignment); - fprintf(fo, __ASM_NAME("%s%s_data") ":\n", prefix, rsc->c_name); - if(global) - fprintf(fo, "\t.globl\t" __ASM_NAME("%s%s_data") "\n", prefix, rsc->c_name); + if(!rsc->binres) + continue; - write_s_res(fo, rsc->binres); + fprintf(fo, "\t.align\t%d\n", win32 ? 4 : alignment); + fprintf(fo, __ASM_NAME("%s%s_data") ":\n", prefix, rsc->c_name); + if(global) + fprintf(fo, "\t.globl\t" __ASM_NAME("%s%s_data") "\n", prefix, rsc->c_name); - fprintf(fo, "\n"); - } + write_s_res(fo, rsc->binres); - if(create_dir) - { - /* Add a resource descriptor for built-in and elf-dlls */ - fprintf(fo, "\t.align\t4\n"); - fprintf(fo, __ASM_NAME("%s_ResourceDescriptor") ":\n", prefix); - fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourceDescriptor") "\n", prefix); - fprintf(fo, __ASM_NAME("%s_ResourceTable") ":\n", prefix); - if(global) - fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourceTable") "\n", prefix); - fprintf(fo, "\t.long\t" __ASM_NAME("%s%s") "\n", prefix, win32 ? _PEResTab : _NEResTab); - fprintf(fo, __ASM_NAME("%s_NumberOfResources") ":\n", prefix); - if(global) - fprintf(fo, "\t.globl\t" __ASM_NAME("%s_NumberOfResources") "\n", prefix); - fprintf(fo, "\t.long\t%d\n", direntries); - fprintf(fo, __ASM_NAME("%s_ResourceSectionSize") ":\n", prefix); - if(global) - fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourceSectionSize") "\n", prefix); - fprintf(fo, "\t.long\t.LResTabEnd - " __ASM_NAME("%s%s") "\n", prefix, win32 ? _PEResTab : _NEResTab); - if(win32) - { - fprintf(fo, __ASM_NAME("%s_ResourcesEntries") ":\n", prefix); - if(global) - fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourcesEntries") "\n", prefix); - fprintf(fo, "\t.long\t" __ASM_NAME("%s_ResourceDirectory") "\n", prefix); - } - } + fprintf(fo, "\n"); } - if(indirect) + if(create_dir) { - /* Write the indirection structures */ - fprintf(fo, "\n/* Resource indirection structures */\n\n"); + /* Add a resource descriptor for built-in and elf-dlls */ fprintf(fo, "\t.align\t4\n"); - for(rsc = top; rsc; rsc = rsc->next) + fprintf(fo, __ASM_NAME("%s_ResourceDescriptor") ":\n", prefix); + fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourceDescriptor") "\n", prefix); + fprintf(fo, __ASM_NAME("%s_ResourceTable") ":\n", prefix); + if(global) + fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourceTable") "\n", prefix); + fprintf(fo, "\t.long\t" __ASM_NAME("%s%s") "\n", prefix, win32 ? _PEResTab : _NEResTab); + fprintf(fo, __ASM_NAME("%s_NumberOfResources") ":\n", prefix); + if(global) + fprintf(fo, "\t.globl\t" __ASM_NAME("%s_NumberOfResources") "\n", prefix); + fprintf(fo, "\t.long\t%d\n", direntries); + fprintf(fo, __ASM_NAME("%s_ResourceSectionSize") ":\n", prefix); + if(global) + fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourceSectionSize") "\n", prefix); + fprintf(fo, "\t.long\t.LResTabEnd - " __ASM_NAME("%s%s") "\n", prefix, win32 ? _PEResTab : _NEResTab); + if(win32) { - int type; - char *type_name = NULL; - - if(!rsc->binres) - continue; - - switch(rsc->type) - { - case res_menex: - type = WRC_RT_MENU; - break; - case res_dlgex: - type = WRC_RT_DIALOG; - break; - case res_usr: - assert(rsc->res.usr->type != NULL); - type_name = prep_nid_for_label(rsc->res.usr->type); - type = 0; - break; - default: - type = rsc->type; - } - - /* - * This follows a structure like: - * struct wrc_resource { - * INT32 id; - * RSCNAME *resname; - * INT32 restype; - * RSCNAME *typename; - * void *data; - * UINT32 datasize; - * }; - * The 'RSCNAME' is a pascal-style string where the - * first byte/word denotes the size and the rest the string - * itself. - */ - fprintf(fo, __ASM_NAME("%s%s") ":\n", prefix, rsc->c_name); + fprintf(fo, __ASM_NAME("%s_ResourcesEntries") ":\n", prefix); if(global) - fprintf(fo, "\t.globl\t" __ASM_NAME("%s%s") "\n", prefix, rsc->c_name); - if (rsc->name->type == name_ord) - fprintf(fo, "\t.long\t%d, 0, ", rsc->name->name.i_name ); - else - fprintf(fo, "\t.long\t0, " __ASM_NAME("%s%s_name") ", ", - prefix, rsc->c_name ); - if (type) - fprintf(fo, "%d, 0, ", type); - else - fprintf(fo, "0, " __ASM_NAME("%s_%s_typename") ", ", - prefix, type_name ); - - fprintf(fo, __ASM_NAME("%s%s_data") ", %d\n", - prefix, - rsc->c_name, - rsc->binres->size - rsc->binres->dataidx); - fprintf(fo, "\n"); + fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourcesEntries") "\n", prefix); + fprintf(fo, "\t.long\t" __ASM_NAME("%s_ResourceDirectory") "\n", prefix); } - fprintf(fo, "\n"); - - /* Write the indirection table */ - fprintf(fo, "/* Resource indirection table */\n\n"); - fprintf(fo, "\t.align\t4\n"); - fprintf(fo, __ASM_NAME("%s%s") ":\n", prefix, _ResTable); - fprintf(fo, "\t.globl\t" __ASM_NAME("%s%s") "\n", prefix, _ResTable); - for(rsc = top; rsc; rsc = rsc->next) - { - fprintf(fo, "\t.long\t" __ASM_NAME("%s%s") "\n", prefix, rsc->c_name); - } - fprintf(fo, "\t.long\t0\n"); - fprintf(fo, "\n"); } - if(auto_register) - fprintf(fo, s_file_autoreg_str, prefix, _ResTable); - fprintf(fo, s_file_tail_str); fclose(fo); } @@ -1098,32 +998,6 @@ constant ? "const " : "", prefix, rsc->c_name); - } - - if(indirect) - { - if(global) - fprintf(fo, "\n"); - - /* Write the indirection structures */ - for(rsc = top; global && rsc; rsc = rsc->next) - { - fprintf(fo, "extern %swrc_resource%d_t %s%s;\n", - constant ? "const " : "", - win32 ? 32 : 16, - prefix, - rsc->c_name); - } - - if(global) - fprintf(fo, "\n"); - - /* Write the indirection table */ - fprintf(fo, "extern %swrc_resource%d_t %s%s[];\n\n", - constant ? "const " : "", - win32 ? 32 : 16, - prefix, - _ResTable); } fprintf(fo, h_file_tail_str); -- Dimi.