Merge README.wrc into wrc's man page.
[wine] / tools / wrc / wrc.man
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,res}\fR
29 with \fB.rc\fR stripped, depending on the mode of compilation.
30 The outputfile is named \fBwrc.tab.{s,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 \-b
39 Create an assembly file from a binary \fB.res\fR file.
40 .TP
41 .I \-B x
42 Win32 only; set output byte\-ordering, where \fIx\fR is one of n[ative],
43 l[ittle] or b[ig].  Only resources in source-form can be reorderd. Native
44 ordering depends on the system on which \fBwrc\fR was built. You can see
45 the native ordering by typing \fIwrc \-?\fR.
46 .TP
47 .I \-C cp
48 Set the resource's codepage to \fIcp\fR. Default codepage is 0.
49 .TP
50 .I \-d n
51 Set debug level to \fIn\fR. The value is a bitmask consisting of
52 1=verbose, 2=dump internals, 4=resource parser trace, 8=preprocessor
53 messages, 16=preprocessor scanner and 32=preprocessor parser trace.
54 .TP
55 .I \-D id[=val]
56 Define preprocessor identifier \fIid\fR to (optionally) value \fIval\fR.
57 See also
58 .B PREPROCESSOR
59 below.
60 .TP
61 .I \-e
62 Win16 only; disable recognition of win32 keywords in 16bit compile.
63 Normally, all keywords are recognized in win16 compilation mode. Use
64 this switch if old sources use win32 reserved names as resource names.
65 .TP
66 .I \-E
67 Preprocess only. The output is written to standard output if no
68 outputfile was selected. The output is compatible with what gcc would
69 generate.
70 .TP
71 .I \-g
72 Add symbols to the global C namespace. This makes all symbols available
73 for linking by other modules.
74 .TP
75 .I \-h
76 Prints a summary message and exits.
77 .TP
78 .I \-I path
79 Add \fIpath\fR to include search directories. \fIPath\fR may contain
80 multiple directories, separated with ':'. It is allowed to specify
81 \fI\-I\fR multiple times. Include files are searched in the order in
82 with the \fI\-I\fR options were specified.
83 .br
84 The search is compatible with gcc, in which '<>' quoted filenames are
85 searched exclusively via the \fI\-I\fR set path, whereas the '""' quoted
86 filenames are first tried to be opened in the current directory. Also
87 resource statements with file references are located in the same way.
88 .TP
89 .I \-J
90 Do not search the standard include path, look for include files only
91 in the directories explicitly specified with the \fI\-I\fR option.
92 .TP
93 .I \-l lan
94 Set default language to \fIlan\fR. Default is the neutral language 0
95 (i.e. "LANGUAGE 0, 0").
96 .TP
97 .I \-m
98 Do not remap numerical resource type-IDs onto standard resources. This will
99 cause all numerical resource type\-IDs to be treated as user\-type resources
100 and will not be checked nor byte\-reversed. Without this option, resources
101 with, for example, type\-ID 2 are parsed as bitmaps and other type\-IDs will
102 map onto their respective standard type.
103 Use this option with caution because it can create problems when compiling for,
104 for example, big\-endian platforms. The \fI\-m\fR option is usefull for
105 source\-files that contain overlapping type\-IDs, or when the format of the
106 resource is not 100% compliant.
107 .TP
108 .I \-N
109 Do not preprocess the input. This will most certainly result in
110 compilation failure, unless you have preprocessed the source with
111 another preprocessor before passing it to \fBwrc\fR.
112 .TP
113 .I \-o file
114 Write output to \fIfile\fR. Default is \fBinputfile.{res,s,h}\fR
115 with \fB.rc\fR stripped or \fBwrc.tab.{s,h,res}\fR, depending on the
116 compilation mode.
117 .TP
118 .I \-O format
119 Sets the output format. \fformat\fR can one either 'res' or 'asm'
120 to generate a \fB.res\fR or \fB.s\fR file respectively.
121 If not specified, \fBwrc\fR assumes 'res'.
122 .TP
123 .I \-p prefix
124 Prefix all generated names with \fIprefix\fR. This is only relevant for
125 names in the assembly code and header file. Resource names are not
126 affected.
127 .TP
128 .I \-s
129 Add structure with win32/16 (PE/NE) resource directory to outputfile.
130 This directory is always in native byteorder.
131 .TP
132 .I \-v
133 Turns on verbose mode (equivalent to -d 1).
134 .TP
135 .I \-V
136 Print version end exit.
137 .TP
138 .I \-w 16|32
139 Select win16 or win32 output. Default is win32.
140 .TP
141 .I \-W
142 Enable pedantic warnings. Notably redefinition of #define statements can
143 be discovered with this option.
144 .SH PREPROCESSOR
145 The preprocessor is ANSI\-C compatible with some extensions of the gcc
146 preprocessor. 
147 .PP
148 The preprocessor recognizes these directives: #include, #define (both
149 simple and macro), #undef, #if, #ifdef, #ifndef, #elif, #else, #endif,
150 #error, #warning, #line, # (both null\- and line\-directive), #pragma
151 (ignored), #ident (ignored).
152 .PP
153 The preprocessor default sets several defines:
154 .br
155 RC_INVOKED      set to 1
156 .br
157 __WRC__         Major version of wrc
158 .br
159 __WRC_MINOR__   Minor version of wrc
160 .br
161 __WRC_MICRO__   Patch level
162 .br
163 __WRC_PATCH__   Same as __WRC_MICRO__
164 .PP
165 Win32 compilation mode also sets __WIN32__ to 1 and __FLAT__ to 1.
166 .PP
167 Special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also
168 recognized and expand to their respective equivalent.
169 .SH "LANGUAGE SUPPORT"
170 Language, version and characteristics can be bound to all resource types that
171 have inline data, such as RCDATA. This is an extension to MS' resource
172 compiler, which lacks this support completely. Only VERSIONINFO cannot have
173 version and characteristics attached, but languages are propagated properly if
174 you declare it correctly before the VERSIONINFO resource starts.
175 .PP
176 Example:
177 .PP
178 1 RCDATA DISCARDABLE
179 .br
180 LANGUAGE 1, 0
181 .br
182 VERSION 312
183 .br
184 CHARACTERISTICS 876
185 .br
186 {
187 .br
188         1, 2, 3, 4, 5, "and whatever more data you want"
189 .br
190         '00 01 02 03 04 05 06 07 08'
191 .br
192 }
193 .SH NE/PE RESOURCE DIRECTORY GENERATION
194 A windows executable has a table/directory of resources available in that
195 module. Wrc will generate this directory with the '-s' option and place it
196 in the assembly output. 
197 .PP
198 The layout of the PE directory should be exactly like the executable file.
199 The NE directory layout _DIFFERS_ from the real NE executable in such way
200 that all offsets to actual resource data are relative to the NE directory and
201 _NOT_ the beginning of the file.
202 .SH "ERROR REPORTING"
203 All errors and warnings are written to standard error and report:
204 .br
205 \fIfilename\fR:\fIline\-number\fR:\fIcharacter\-pos\fR:\fI{Error,Warning}\fR:\fI<message>\fR
206 .br
207 The character\-position is always at the next token. I.e. the error
208 or warning happened before. The line\-number suffers from the same
209 problem if the error occurred at the last token of the previous line.
210 The line\-number will be several lines off when the error was followed
211 by several empry lines. See also \fBBUGS\fR.
212 .SH AUTHORS
213 .B wrc
214 was written by Bertho A. Stultiens and is a nearly complete rewrite of
215 the first wine resource compiler (1994) by Martin von Loewis.
216 Additional resource\-types were contributed Ulrich Czekalla and Albert
217 den Haan. Bugfixes have been contributed by many wine developpers.
218 .SH BUGS
219 \- The preprocessor recognizes variable argument macros, but does not
220 expanded them correctly
221 .br
222 \- Error reporting should be more to the point (and verbose)
223 .br
224 \- Codepage/UNICODE translations are not/not correct implemented
225 .br
226 \- Default memory options should differ between win16 and win32.
227 .PP
228 There is no support for:
229 .br
230 \- RT_DLGINCLUDE, RT_VXD, RT_PLUGPLAY and RT_HTML (unknown format)
231 .br
232 \- PUSHBOX control is unsupported due to lack of original functionality.
233 .PP
234 Fonts are parsed and generated, but there is no support for the
235 generation of the FONTDIR yet. The user must supply the FONTDIR
236 resource in the source to match the FONT resources.
237 .PP
238 See the CHANGES and README.wrc files in the distribution for more
239 comments on bugs and fixes across the versions.
240 .SH AVAILABILITY
241 .B wrc
242 is part of the wine distribution, which is available through
243 WineHQ, the
244 .B wine
245 development headquarters, at
246 .I http://www.winehq.com/.
247 .SH "SEE ALSO"
248 .BR wine (1),