- Bugfix: Macro expansion of strings would assert an internal error
[wine.git] / tools / wrc / wrc.man
blob9e552fdfbeb8c81330829ba230006cdec5dfade9
1 .TH WRC 1 "July 05, 2000" "Version 1.1.6" "Wine Resource Compiler"
2 .SH NAME
3 wrc \- Wine Resource Compiler
4 .SH SYNOPSIS
5 .BI "wrc " "[options] " "[inputfile]"
6 .SH DESCRIPTION
7 .B wrc
8 compiles resources from
9 .I inputfile
10 into win16 and win32 compatible
11 binary format.
12 .B wrc
13 outputs the binary data either in a standard \fB.res\fR formatted binary
14 file, or an assembly file.
15 .B wrc
16 is also capable of reading \fB.res\fR formatted files and convert them
17 into an assembly file.
18 .PP
19 The source\-file is preprocessed with a builtin ANSI\-C compatible
20 preprocessor before the resources are compiled. See \fBPREPROCESSOR\fR
21 below.
22 .PP
23 .B wrc
24 takes only one \fBinputfile\fR as argument. The \fBinputfile\fR has
25 extension \fB.rc\fR for resources in source form and \fB.res\fR for
26 binary resources. The resources are read from standard input if no
27 inputfile is given. If the outputfile is not specified with \fI-o\fR,
28 then \fBwrc\fR will write the output to \fBinputfile.{s,h,res}\fR
29 with \fB.rc\fR stripped, depending on the mode of compilation.
30 The outputfile is named \fBwrc.tab.{s,h,res}\fR if no inputfile was
31 given.
32 .SH OPTIONS
33 .TP
34 .I \-a n
35 Win16 only; set the alignment between resources n.  The alignment must
36 be a power of 2. The default is 4.
37 .TP
38 .I \-A
39 Obsolete; include code in the assembly output to auto register resources
40 by calling a special wine function (only with gcc 2.7 and better).
41 .TP
42 .I \-b
43 Create an assembly file from a binary \fB.res\fR file.
44 .TP
45 .I \-B x
46 Win32 only; set output byte\-ordering, where \fIx\fR is one of n[ative],
47 l[ittle] or b[ig].  Only resource in source-form can be reorderd. Native
48 ordering depends on the system on which \fBwrc\fR was built. You can see
49 the native ordering by typing \fI\"wrc \-?\"\fR.
50 .TP
51 .I \-c
52 Add 'const' prefix to C constants when writing header files.
53 .TP
54 .I \-C cp
55 Set the resource's codepage to \fIcp\fR. Default codepage is 0.
56 .TP
57 .I \-d n
58 Set debug level to \fIn\fR. The value is a bitmask consisting of
59 1=verbose, 2=dump internals, 4=resource parser trace, 8=preprocessor
60 messages, 16=preprocessor scanner and 32=preprocessor parser trace.
61 .TP
62 .I \-D id[=val]
63 Define preprocessor identifier \fIid\fR to (optionally) value \fIval\fR.
64 See also
65 .B PREPROCESSOR
66 below.
67 .TP
68 .I \-e
69 Win16 only; disable recognition of win32 keywords in 16bit compile.
70 Normally, all keywords are recognized in win16 compilation mode. Use
71 this switch if old sources use win32 reserved names as resource names.
72 .TP
73 .I \-E
74 Preprocess only. The output is written to standard output if no
75 outputfile was selected. The output is compatible with what gcc would
76 generate.
77 .TP
78 .I \-g
79 Add symbols to the global C namespace. This makes all symbols available
80 for linking by other modules.
81 .TP
82 .I \-h
83 Generate a \fB.h\fR header-file. The resource tables are described by
84 extern declarations.
85 .TP
86 .I \-H file
87 Same as \fI\-h\fR but written to \fIfile\fR.
88 .TP
89 .I \-I path
90 Add \fIpath\fR to include search directories. \fIPath\fR may contain
91 multiple directories, separated with ':'. It is allowed to specify
92 \fI\-I\fR multiple times. Include files are searched in the order in
93 with the \fI\-I\fR options were specified.
94 .br
95 The search is compatible with gcc, in which '<>' quoted filenames are
96 searched exclusively via the \fI\-I\fR set path, whereas the '""' quoted
97 filenames are first tried to be opened in the current directory. Also
98 resource statements with file references are located in the same way.
99 .TP
100 .I \-l lan
101 Set default language to \fIlan\fR. Default is the neutral language 0
102 (i.e. "LANGUAGE 0, 0").
104 .I \-L
105 Leave case of embedded filenames as is. All filenames are converted to
106 lower case before they are attemped to be opened without this option.
108 .I \-m
109 Do not remap numerical resource type-IDs onto standard resources. This will
110 cause all numerical resource type\-IDs to be treated as user\-type resources
111 and will not be checked nor byte\-reversed. Without this option, resources
112 with, for example, type\-ID 2 are parsed as bitmaps and other type\-IDs will
113 map onto their respective standard type.
114 Use this option with caution because it can create problems when compiling for,
115 for example, big\-endian platforms. The \fI\-m\fR option is usefull for
116 source\-files that contain overlapping type\-IDs, or when the format of the
117 resource is not 100% compliant.
119 .I \-n
120 Do not generate an assembly outputfile (suppress generation of \fB.s\fR
121 file). Usefull if you are interested in a header file only.
123 .I \-N
124 Do not preprocess the input. This will most certainly result in
125 compilation failure, unless you have preprocessed the source with
126 another preprocessor before passing it to \fBwrc\fR.
128 .I \-o file
129 Write output to \fIfile\fR. Default is \fBinputfile.{res,s,h}\fR
130 with \fB.rc\fR stripped or \fBwrc.tab.{s,h,res}\fR, depending on the
131 compilation mode.
133 .I \-p prefix
134 Prefix all generated names with \fIprefix\fR. This is only relevant for
135 names in the assembly code and header file. Resource names are not
136 affected.
138 .I \-r
139 Create binary \fB.res\fR file (compile only).
141 .I \-s
142 Add structure with win32/16 (PE/NE) resource directory to outputfile.
143 This directory is always in native byteorder.
145 .I \-t
146 Obsolete; generate indirect loadable resource tables.
148 .I \-T
149 Obsolete; generate only indirect loadable resources tables.
151 .I \-V
152 Print version end exit.
154 .I \-w 16|32
155 Select win16 or win32 output. Default is win32.
157 .I \-W
158 Enable pedantic warnings. Notably redefinition of #define statements can
159 be discovered with this option.
160 .SH PREPROCESSOR
161 The preprocessor is ANSI\-C compatible with some extensions of the gcc
162 preprocessor. 
164 The preprocessor recognizes these directives: #include, #define (both
165 simple and macro), #undef, #if, #ifdef, #ifndef, #elif, #else, #endif,
166 #error, #warning, #line, # (both null\- and line\-directive), #pragma
167 (ignored), #ident (ignored).
169 The preprocessor default sets several defines:
171 RC_INVOKED      set to 1
173 __WRC__         Major version of wrc
175 __WRC_MINOR__   Minor version of wrc
177 __WRC_MICRO__   Patch level
179 __WRC_PATCH__   Same as __WRC_MICRO__
181 Win32 compilation mode also sets __WIN32__ to 1 and __FLAT__ to 1.
183 Special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also
184 recognized and expand to their respective equivalent.
185 .SH AUTHORS
186 .B wrc
187 was written by Bertho A. Stultiens and is a nearly complete rewrite of
188 the first wine resource compiler (1994) by Martin von Loewis.
189 Additional resource\-types were contributed Ulrich Czekalla and Albert
190 den Haan. Bugfixes have been contributed by many wine developpers.
191 .SH BUGS
192 \- The preprocessor recognizes variable argument macros, but does not
193 expanded them correctly
195 \- Codepage/UNICODE translations are not/not correct implemented
197 \- Default memory options should differ between win16 and win32.
199 There is no support for:
201 \- RT_DLGINCLUDE, RT_VXD, RT_PLUGPLAY and RT_HTML (unknown format)
203 \- PUSHBOX control is unsupported due to lack of original functionality.
205 Fonts are parsed and generated, but there is no support for the
206 generation of the FONTDIR yet. The user must supply the FONTDIR
207 resource in the source to match the FONT resources.
209 See the CHANGES and README.wrc files in the distribution for more
210 comments on bugs and fixes across the versions.
211 .SH AVAILABILITY
212 .B wrc
213 is part of the wine distribution, which is available through
214 WineHQ, the
215 .B wine
216 development headquarters, at
217 .I http://www.winehq.com/.
218 .SH "SEE ALSO"
219 .BR wine (1),