diff --git a/tools/wrc/README.wrc b/tools/wrc/README.wrc index c6b590e496b..7e531c86f56 100644 --- a/tools/wrc/README.wrc +++ b/tools/wrc/README.wrc @@ -28,7 +28,6 @@ You can get this message by typing 'wrc -?': 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 @@ Usage: wrc [options...] [infile[.rc|.res]] -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 @@ -211,43 +208,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' option. - - NE/PE resource directory generation ----------------------------------- A windows executable has a table/directory of resources available in that @@ -298,4 +258,3 @@ Patches should _not_ be sent to Alexandre but to me. I will then review the change and send a full patch to be included into the new wine release (I prefer 'diff -u' format). You can always upload suggestions to wine headquarters, but be sure to send me a copy. - diff --git a/tools/wrc/wrc.c b/tools/wrc/wrc.c index 2bcb7c9b2c3..7c0c165dd6a 100644 --- a/tools/wrc/wrc.c +++ b/tools/wrc/wrc.c @@ -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 @@ static char usage[] = " -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" @@ -201,16 +198,6 @@ int create_dir = 0; */ 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) */ @@ -232,11 +219,6 @@ DWORD codepage = 0; */ 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) */ @@ -344,9 +326,6 @@ int main(int argc,char *argv[]) case 'a': alignment = atoi(optarg); break; - case 'A': - auto_register = 1; - break; case 'b': binary = 1; break; @@ -438,12 +417,6 @@ int main(int argc,char *argv[]) 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 @@ int main(int argc,char *argv[]) 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 @@ int main(int argc,char *argv[]) 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"); @@ -605,14 +555,6 @@ int main(int argc,char *argv[]) } } -#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; for(alignment_pwr = 0; alignment_pwr < 10 && a > 1; alignment_pwr++) diff --git a/tools/wrc/wrc.h b/tools/wrc/wrc.h index 09227de90b3..ada5d3cde88 100644 --- a/tools/wrc/wrc.h +++ b/tools/wrc/wrc.h @@ -56,14 +56,11 @@ extern int binary; 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; diff --git a/tools/wrc/wrc.man b/tools/wrc/wrc.man index 32a0a1d9a11..3fc4ee8ce15 100644 --- a/tools/wrc/wrc.man +++ b/tools/wrc/wrc.man @@ -35,10 +35,6 @@ given. 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 @@ -136,12 +132,6 @@ affected. 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). .TP diff --git a/tools/wrc/writeres.c b/tools/wrc/writeres.c index c068d41f6c9..3ecf64c9f9d 100644 --- a/tools/wrc/writeres.c +++ b/tools/wrc/writeres.c @@ -48,21 +48,6 @@ static char s_file_tail_str[] = "\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,134 +905,49 @@ void write_s_file(char *outname, resource_t *top) 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; + 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); + 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); - write_s_res(fo, rsc->binres); + write_s_res(fo, rsc->binres); - fprintf(fo, "\n"); - } - - 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); - } - } - } - - if(indirect) - { - /* Write the indirection structures */ - fprintf(fo, "\n/* Resource indirection structures */\n\n"); - fprintf(fo, "\t.align\t4\n"); - for(rsc = top; rsc; rsc = rsc->next) - { - 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); - 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, "\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); + 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, s_file_tail_str); fclose(fo); @@ -1100,32 +1000,6 @@ void write_h_file(char *outname, resource_t *top) 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); fclose(fo); }