Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
42f9f0c2
Commit
42f9f0c2
authored
Jan 20, 2003
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Jan 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the obsolete wrc options: -A, -T, and -t.
parent
48dacc49
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
269 deletions
+31
-269
README.wrc
tools/wrc/README.wrc
+0
-41
wrc.c
tools/wrc/wrc.c
+0
-58
wrc.h
tools/wrc/wrc.h
+0
-3
wrc.man
tools/wrc/wrc.man
+0
-10
writeres.c
tools/wrc/writeres.c
+31
-157
No files found.
tools/wrc/README.wrc
View file @
42f9f0c2
...
...
@@ -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<filename>' 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.
tools/wrc/wrc.c
View file @
42f9f0c2
...
...
@@ -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
"
...
...
@@ -202,16 +199,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)
*/
int
alignment
=
4
;
...
...
@@ -233,11 +220,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)
*/
int
byteorder
=
WRC_BO_NATIVE
;
...
...
@@ -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
++
)
...
...
tools/wrc/wrc.h
View file @
42f9f0c2
...
...
@@ -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
;
...
...
tools/wrc/wrc.man
View file @
42f9f0c2
...
...
@@ -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
...
...
tools/wrc/writeres.c
View file @
42f9f0c2
...
...
@@ -48,21 +48,6 @@ static char s_file_tail_str[] =
"
\n
"
;
static
char
s_file_autoreg_str
[]
=
"
\t
.text
\n
"
".LAuto_Register:
\n
"
"
\t
pushl
\t
$"
__ASM_NAME
(
"%s%s"
)
"
\n
"
"
\t
call
\t
"
__ASM_NAME
(
"LIBRES_RegisterResources"
)
"
\n
"
"
\t
addl
\t
$4,%%esp
\n
"
"
\t
ret
\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 @@ 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
;
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
\t
4
\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
\t
4
\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
\t
0, "
__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
\t
4
\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
\t
0
\n
"
);
fprintf
(
fo
,
"
\n
"
);
}
if
(
auto_register
)
fprintf
(
fo
,
s_file_autoreg_str
,
prefix
,
_ResTable
);
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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment