Collapse the -hHrs options into the -O option.
[wine/multimedia.git] / tools / wrc / wrc.man
blob6acc43586de2ea6c727be363d2c321d684730f72
1 .TH WRC 1 "August 24, 2000" "Version 1.1.8" "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 resources 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 \fIwrc \-?\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 \-I path
83 Add \fIpath\fR to include search directories. \fIPath\fR may contain
84 multiple directories, separated with ':'. It is allowed to specify
85 \fI\-I\fR multiple times. Include files are searched in the order in
86 with the \fI\-I\fR options were specified.
87 .br
88 The search is compatible with gcc, in which '<>' quoted filenames are
89 searched exclusively via the \fI\-I\fR set path, whereas the '""' quoted
90 filenames are first tried to be opened in the current directory. Also
91 resource statements with file references are located in the same way.
92 .TP
93 .I \-J
94 Do not search the standard include path, look for include files only
95 in the directories explicitly specified with the \fI\-I\fR option.
96 .TP
97 .I \-l lan
98 Set default language to \fIlan\fR. Default is the neutral language 0
99 (i.e. "LANGUAGE 0, 0").
101 .I \-m
102 Do not remap numerical resource type-IDs onto standard resources. This will
103 cause all numerical resource type\-IDs to be treated as user\-type resources
104 and will not be checked nor byte\-reversed. Without this option, resources
105 with, for example, type\-ID 2 are parsed as bitmaps and other type\-IDs will
106 map onto their respective standard type.
107 Use this option with caution because it can create problems when compiling for,
108 for example, big\-endian platforms. The \fI\-m\fR option is usefull for
109 source\-files that contain overlapping type\-IDs, or when the format of the
110 resource is not 100% compliant.
112 .I \-N
113 Do not preprocess the input. This will most certainly result in
114 compilation failure, unless you have preprocessed the source with
115 another preprocessor before passing it to \fBwrc\fR.
117 .I \-o file
118 Write output to \fIfile\fR. Default is \fBinputfile.{res,s,h}\fR
119 with \fB.rc\fR stripped or \fBwrc.tab.{s,h,res}\fR, depending on the
120 compilation mode.
122 .I \-O format
123 Sets the output format. \fformat\fR can one of 'res', 'asm', and 'hdr'
124 to generate a \fB.res\fR, \fB.s\fR, or \fB.h\fR file respectively.
125 If not specified, \fBwrc\fR assumes 'res'.
127 .I \-p prefix
128 Prefix all generated names with \fIprefix\fR. This is only relevant for
129 names in the assembly code and header file. Resource names are not
130 affected.
132 .I \-s
133 Add structure with win32/16 (PE/NE) resource directory to outputfile.
134 This directory is always in native byteorder.
136 .I \-t
137 Obsolete; generate indirect loadable resource tables.
139 .I \-T
140 Obsolete; generate only indirect loadable resources tables.
142 .I \-V
143 Print version end exit.
145 .I \-w 16|32
146 Select win16 or win32 output. Default is win32.
148 .I \-W
149 Enable pedantic warnings. Notably redefinition of #define statements can
150 be discovered with this option.
151 .SH PREPROCESSOR
152 The preprocessor is ANSI\-C compatible with some extensions of the gcc
153 preprocessor. 
155 The preprocessor recognizes these directives: #include, #define (both
156 simple and macro), #undef, #if, #ifdef, #ifndef, #elif, #else, #endif,
157 #error, #warning, #line, # (both null\- and line\-directive), #pragma
158 (ignored), #ident (ignored).
160 The preprocessor default sets several defines:
162 RC_INVOKED      set to 1
164 __WRC__         Major version of wrc
166 __WRC_MINOR__   Minor version of wrc
168 __WRC_MICRO__   Patch level
170 __WRC_PATCH__   Same as __WRC_MICRO__
172 Win32 compilation mode also sets __WIN32__ to 1 and __FLAT__ to 1.
174 Special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also
175 recognized and expand to their respective equivalent.
176 .SH "ERROR REPORTING"
177 All errors and warnings are written to standard error and report:
179 \fIfilename\fR:\fIline\-number\fR:\fIcharacter\-pos\fR:\fI{Error,Warning}\fR:\fI<message>\fR
181 The character\-position is always at the next token. I.e. the error
182 or warning happened before. The line\-number suffers from the same
183 problem if the error occurred at the last token of the previous line.
184 The line\-number will be several lines off when the error was followed
185 by several empry lines. See also \fBBUGS\fR.
186 .SH AUTHORS
187 .B wrc
188 was written by Bertho A. Stultiens and is a nearly complete rewrite of
189 the first wine resource compiler (1994) by Martin von Loewis.
190 Additional resource\-types were contributed Ulrich Czekalla and Albert
191 den Haan. Bugfixes have been contributed by many wine developpers.
192 .SH BUGS
193 \- The preprocessor recognizes variable argument macros, but does not
194 expanded them correctly
196 \- Error reporting should be more to the point (and verbose)
198 \- Codepage/UNICODE translations are not/not correct implemented
200 \- Default memory options should differ between win16 and win32.
202 There is no support for:
204 \- RT_DLGINCLUDE, RT_VXD, RT_PLUGPLAY and RT_HTML (unknown format)
206 \- PUSHBOX control is unsupported due to lack of original functionality.
208 Fonts are parsed and generated, but there is no support for the
209 generation of the FONTDIR yet. The user must supply the FONTDIR
210 resource in the source to match the FONT resources.
212 See the CHANGES and README.wrc files in the distribution for more
213 comments on bugs and fixes across the versions.
214 .SH AVAILABILITY
215 .B wrc
216 is part of the wine distribution, which is available through
217 WineHQ, the
218 .B wine
219 development headquarters, at
220 .I http://www.winehq.com/.
221 .SH "SEE ALSO"
222 .BR wine (1),