Commit 42f9f0c2 authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

Remove the obsolete wrc options: -A, -T, and -t.

parent 48dacc49
...@@ -28,7 +28,6 @@ You can get this message by typing 'wrc -?': ...@@ -28,7 +28,6 @@ You can get this message by typing 'wrc -?':
Usage: wrc [options...] [infile[.rc|.res]] Usage: wrc [options...] [infile[.rc|.res]]
-a n Alignment of resource (win16 only, default is 4) -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 Create an assembly array from a binary .res file
-B x Set output byte-order x={n[ative], l[ittle], b[ig]} -B x Set output byte-order x={n[ative], l[ittle], b[ig]}
(win32 only; default is n[ative] which equals little-endian) (win32 only; default is n[ative] which equals little-endian)
...@@ -51,8 +50,6 @@ Usage: wrc [options...] [infile[.rc|.res]] ...@@ -51,8 +50,6 @@ Usage: wrc [options...] [infile[.rc|.res]]
-p prefix Give a prefix for the generated names -p prefix Give a prefix for the generated names
-r Create binary .res file (compile only) -r Create binary .res file (compile only)
-s Add structure with win32/16 (PE/NE) resource directory -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 -V Print version end exit
-w 16|32 Select win16 or win32 output (default is win32) -w 16|32 Select win16 or win32 output (default is win32)
-W Enable pedantic warnings -W Enable pedantic warnings
...@@ -211,43 +208,6 @@ It is _ONLY_ supported for backwards compatibility so that old sources can ...@@ -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! 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 NE/PE resource directory generation
----------------------------------- -----------------------------------
A windows executable has a table/directory of resources available in that 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 ...@@ -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 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 prefer 'diff -u' format). You can always upload suggestions to wine
headquarters, but be sure to send me a copy. headquarters, but be sure to send me a copy.
...@@ -86,7 +86,6 @@ ...@@ -86,7 +86,6 @@
static char usage[] = static char usage[] =
"Usage: wrc [options...] [infile[.rc|.res]] [outfile]\n" "Usage: wrc [options...] [infile[.rc|.res]] [outfile]\n"
" -a n Alignment of resource (win16 only, default is 4)\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 Create an assembly array from a binary .res file\n"
" -B x Set output byte-order x={n[ative], l[ittle], b[ig]}\n" " -B x Set output byte-order x={n[ative], l[ittle], b[ig]}\n"
" (win32 only; default is " ENDIAN "-endian)\n" " (win32 only; default is " ENDIAN "-endian)\n"
...@@ -109,8 +108,6 @@ static char usage[] = ...@@ -109,8 +108,6 @@ static char usage[] =
" -O format The output format: one of `res', 'asm', 'hdr'.\n" " -O format The output format: one of `res', 'asm', 'hdr'.\n"
" -p prefix Give a prefix for the generated names\n" " -p prefix Give a prefix for the generated names\n"
" -s Add structure with win32/16 (PE/NE) resource directory\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 Enable verbose mode.\n"
" -V Print version and exit\n" " -V Print version and exit\n"
" -w 16|32 Select win16 or win32 output (default is win32)\n" " -w 16|32 Select win16 or win32 output (default is win32)\n"
...@@ -202,16 +199,6 @@ int create_dir = 0; ...@@ -202,16 +199,6 @@ int create_dir = 0;
int global = 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) * NE segment resource aligment (-a option)
*/ */
int alignment = 4; int alignment = 4;
...@@ -233,11 +220,6 @@ DWORD codepage = 0; ...@@ -233,11 +220,6 @@ DWORD codepage = 0;
int pedantic = 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) * The output byte-order of resources (set with -B)
*/ */
int byteorder = WRC_BO_NATIVE; int byteorder = WRC_BO_NATIVE;
...@@ -344,9 +326,6 @@ int main(int argc,char *argv[]) ...@@ -344,9 +326,6 @@ int main(int argc,char *argv[])
case 'a': case 'a':
alignment = atoi(optarg); alignment = atoi(optarg);
break; break;
case 'A':
auto_register = 1;
break;
case 'b': case 'b':
binary = 1; binary = 1;
break; break;
...@@ -438,12 +417,6 @@ int main(int argc,char *argv[]) ...@@ -438,12 +417,6 @@ int main(int argc,char *argv[])
case 's': case 's':
create_dir = 1; create_dir = 1;
break; break;
case 'T':
indirect_only = 1;
/* Fall through */
case 't':
indirect = 1;
break;
case 'v': case 'v':
debuglevel = DEBUGLEVEL_CHAT; debuglevel = DEBUGLEVEL_CHAT;
break; break;
...@@ -528,18 +501,6 @@ int main(int argc,char *argv[]) ...@@ -528,18 +501,6 @@ int main(int argc,char *argv[])
constant = 0; 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) if(global)
{ {
warning("Option -g ignored with compile to .res\n"); warning("Option -g ignored with compile to .res\n");
...@@ -571,17 +532,6 @@ int main(int argc,char *argv[]) ...@@ -571,17 +532,6 @@ int main(int argc,char *argv[])
constant = 0; 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) if(global)
{ {
warning("Option -g ignored with preprocess only\n"); warning("Option -g ignored with preprocess only\n");
...@@ -605,14 +555,6 @@ int main(int argc,char *argv[]) ...@@ -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 */ /* Set alignment power */
a = alignment; a = alignment;
for(alignment_pwr = 0; alignment_pwr < 10 && a > 1; alignment_pwr++) for(alignment_pwr = 0; alignment_pwr < 10 && a > 1; alignment_pwr++)
......
...@@ -56,14 +56,11 @@ extern int binary; ...@@ -56,14 +56,11 @@ extern int binary;
extern int create_header; extern int create_header;
extern int create_dir; extern int create_dir;
extern int global; extern int global;
extern int indirect;
extern int indirect_only;
extern int alignment; extern int alignment;
extern int alignment_pwr; extern int alignment_pwr;
extern int create_s; extern int create_s;
extern DWORD codepage; extern DWORD codepage;
extern int pedantic; extern int pedantic;
extern int auto_register;
extern int byteorder; extern int byteorder;
extern int preprocess_only; extern int preprocess_only;
extern int no_preprocess; extern int no_preprocess;
......
...@@ -35,10 +35,6 @@ given. ...@@ -35,10 +35,6 @@ given.
Win16 only; set the alignment between resources n. The alignment must Win16 only; set the alignment between resources n. The alignment must
be a power of 2. The default is 4. be a power of 2. The default is 4.
.TP .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 .I \-b
Create an assembly file from a binary \fB.res\fR file. Create an assembly file from a binary \fB.res\fR file.
.TP .TP
...@@ -136,12 +132,6 @@ affected. ...@@ -136,12 +132,6 @@ affected.
Add structure with win32/16 (PE/NE) resource directory to outputfile. Add structure with win32/16 (PE/NE) resource directory to outputfile.
This directory is always in native byteorder. This directory is always in native byteorder.
.TP .TP
.I \-t
Obsolete; generate indirect loadable resource tables.
.TP
.I \-T
Obsolete; generate only indirect loadable resources tables.
.TP
.I \-v .I \-v
Turns on verbose mode (equivalent to -d 1). Turns on verbose mode (equivalent to -d 1).
.TP .TP
......
...@@ -48,21 +48,6 @@ static char s_file_tail_str[] = ...@@ -48,21 +48,6 @@ static char s_file_tail_str[] =
"\n" "\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[] = static char h_file_head_str[] =
"/*\n" "/*\n"
" * This file is generated with wrc version " WRC_FULLVERSION ". Do not edit!\n" " * This file is generated with wrc version " WRC_FULLVERSION ". Do not edit!\n"
...@@ -920,135 +905,50 @@ void write_s_file(char *outname, resource_t *top) ...@@ -920,135 +905,50 @@ void write_s_file(char *outname, resource_t *top)
if(create_dir) if(create_dir)
fprintf(fo, ".LResTabEnd:\n"); 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 */ if(!rsc->binres)
fprintf(fo, "\n/* Resource binary data */\n\n"); continue;
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);
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) fprintf(fo, "\n");
{
/* 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) if(create_dir)
{ {
/* Write the indirection structures */ /* Add a resource descriptor for built-in and elf-dlls */
fprintf(fo, "\n/* Resource indirection structures */\n\n");
fprintf(fo, "\t.align\t4\n"); 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; fprintf(fo, __ASM_NAME("%s_ResourcesEntries") ":\n", prefix);
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) if(global)
fprintf(fo, "\t.globl\t" __ASM_NAME("%s%s") "\n", prefix, rsc->c_name); fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourcesEntries") "\n", prefix);
if (rsc->name->type == name_ord) fprintf(fo, "\t.long\t" __ASM_NAME("%s_ResourceDirectory") "\n", prefix);
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);
fprintf(fo, s_file_tail_str); fprintf(fo, s_file_tail_str);
fclose(fo); fclose(fo);
} }
...@@ -1100,32 +1000,6 @@ void write_h_file(char *outname, resource_t *top) ...@@ -1100,32 +1000,6 @@ void write_h_file(char *outname, resource_t *top)
rsc->c_name); 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); fprintf(fo, h_file_tail_str);
fclose(fo); fclose(fo);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment