Sync to Wine-0_9:
[reactos.git] / reactos / 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 \fBinputfile\fR
9 into win16 and win32 compatible binary format.
10 .PP
11 The source\-file is preprocessed with a builtin ANSI\-C compatible
12 preprocessor before the resources are compiled. See \fBPREPROCESSOR\fR
13 below.
14 .PP
15 .B wrc
16 takes only one \fBinputfile\fR as argument. The resources are read from
17 standard input if no inputfile is given. If the output file is not
18 specified with \fI-o\fR, then \fBwrc\fR will write the output to
19 \fBinputfile.res\fR with \fB.rc\fR stripped, or to \fBwrc.tab.res\fR if
20 no inputfile was given.
21 .SH OPTIONS
22 .TP
23 .I \fB\-\-debug\fR=\fInn\fR
24 Set debug level to \fInn\fR. The value is a bitmask consisting of
25 1=verbose, 2=dump internals, 4=resource parser trace, 8=preprocessor
26 messages, 16=preprocessor scanner and 32=preprocessor parser trace.
27 .TP
28 .I \fB\-\-endianess\fR=\fIe\fR
29 Win32 only; set output byte\-ordering, where \fIe\fR is one of n[ative],
30 l[ittle] or b[ig]. Only resources in source-form can be reorderd. Native
31 ordering depends on the system on which \fBwrc\fR was built. You can see
32 the native ordering by typing \fIwrc \-h\fR.
33 .TP
34 .I \fB\-D\fR, \fB\-\-define\fR=\fIid[=val]\fR
35 Define preprocessor identifier \fIid\fR to (optionally) value \fIval\fR.
36 See also
37 .B PREPROCESSOR
38 below.
39 .TP
40 .I \fB\-E\fR
41 Preprocess only. The output is written to standard output if no
42 outputfile was selected. The output is compatible with what gcc would
43 generate.
44 .TP
45 .I \fB\-F\fR, \fB\-\-target\fR
46 Ignored for compatibility with \fIwindres\fR.
47 .TP
48 .I \fB\-h\fR, \fB\-\-help\fR
49 Prints a summary message and exits.
50 .TP
51 .I \fB\-i\fR, \fB\-\-input\fR=\fIfile\fR
52 The name of the input file. If this option is not used, then \fBwrc\fR
53 will use the first non-option argument as the input file name. If there
54 are no non-option arguments, then \fBwrc\fR will read from standard input.
55 .TP
56 .I \fB\-I\fR, \fB\-\-include\-dir\fR=\fIfile\fR
57 Add \fIpath\fR to include search directories. \fIPath\fR may contain
58 multiple directories, separated with ':'. It is allowed to specify
59 \fI\-I\fR multiple times. Include files are searched in the order in
60 with the \fI\-I\fR options were specified.
61 .br
62 The search is compatible with gcc, in which '<>' quoted filenames are
63 searched exclusively via the \fI\-I\fR set path, whereas the '""' quoted
64 filenames are first tried to be opened in the current directory. Also
65 resource statements with file references are located in the same way.
66 .TP
67 .I \fB\-J\fR, \fB\-\-input\-format\fR=\fIformat\fR
68 Sets the input format. Valid options are 'rc' or 'rc16'. Setting the
69 input to 'rc16' disables the recognition of win32 keywords.
70 .TP
71 .I \fB\-l\fR, \fB\-\-language\fR=\fIlan\fR
72 Set default language to \fIlan\fR. Default is the neutral language 0
73 (i.e. "LANGUAGE 0, 0").
74 .TP
75 .I \fB\-\-nostdinc\fR
76 Do not search the standard include path, look for include files only
77 in the directories explicitly specified with the \fI\-I\fR option.
78 .TP
79 .I \fB\-\-no\-use\-temp\-file\fR
80 Ignored for compatibility with \fIwindres\fR.
81 .TP
82 .I \fB\-o\fR, \fB\-fo\fR, \fB\-\-output\fR=\fIfile\fR
83 Write output to \fIfile\fR. Default is \fBinputfile.res\fR
84 with \fB.rc\fR stripped or \fBwrc.tab.res\fR if input is read
85 from standard input.
86 .TP
87 .I \fB\-O\fR, \fB\-\-output\-format\fR=\fIformat\fR
88 Sets the output format. The supported formats are 'res' and 'res16'.
89 If this option is not specified, format defaults to 'res'.
90 .TP
91 .I \fB\-\-pedantic\fR
92 Enable pedantic warnings. Notably redefinition of #define statements can
93 be discovered with this option.
94 .TP
95 .I \fB\-r\fR
96 Ignored for compatibility with \fIrc\fR.
97 .TP
98 .I \fB\-\-preprocessor\fR=\fIprogram\fR
99 This option may be used to specify the preprocessor to use, including any
100 leading arguments. If not specified, \fBwrc\fR uses its builtin processor.
101 To disable preprocessing, use \fB--preprocessor=cat\fR.
102 .TP
103 .I \fB\-U\fR, \fB\-\-undefine\fR=\fIid\fR
104 Undefine preprocessor identifier \fIid\fR. Please note that only macros
105 defined up to this point are undefined by this command. However, these
106 include the special macros defined automatically by \fIwrc\fR.
107 See also
108 .B PREPROCESSOR
109 below.
110 .TP
111 .I \fB\-\-use\-temp\-file\fR
112 Ignored for compatibility with \fIwindres\fR.
113 .TP
114 .I \fB\-v\fR, \fB\-\-verbose\fR
115 Turns on verbose mode (equivalent to -d 1).
116 .TP
117 .I \fB\-\-version\fR
118 Print version end exit.
119 .SH PREPROCESSOR
120 The preprocessor is ANSI\-C compatible with some of the extensions of
121 the gcc preprocessor.
122 .PP
123 The preprocessor recognizes these directives: #include, #define (both
124 simple and macro), #undef, #if, #ifdef, #ifndef, #elif, #else, #endif,
125 #error, #warning, #line, # (both null\- and line\-directive), #pragma
126 (ignored), #ident (ignored).
127 .PP
128 The preprocessor sets by default several defines:
129 .br
130 RC_INVOKED set to 1
131 .br
132 __WRC__ Major version of wrc
133 .br
134 __WRC_MINOR__ Minor version of wrc
135 .br
136 __WRC_MICRO__ Patch level
137 .br
138 __WRC_PATCH__ Same as __WRC_MICRO__
139 .PP
140 Win32 compilation mode also sets __WIN32__ to 1 and __FLAT__ to 1.
141 .PP
142 Special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also
143 recognized and expand to their respective equivalent.
144 .SH "LANGUAGE SUPPORT"
145 Language, version and characteristics can be bound to all resource types that
146 have inline data, such as RCDATA. This is an extension to Microsoft's resource
147 compiler, which lacks this support completely. Only VERSIONINFO cannot have
148 version and characteristics attached, but languages are propagated properly if
149 you declare it correctly before the VERSIONINFO resource starts.
150 .PP
151 Example:
152 .PP
153 1 RCDATA DISCARDABLE
154 .br
155 LANGUAGE 1, 0
156 .br
157 VERSION 312
158 .br
159 CHARACTERISTICS 876
160 .br
161 {
162 .br
163 1, 2, 3, 4, 5, "and whatever more data you want"
164 .br
165 '00 01 02 03 04 05 06 07 08'
166 .br
167 }
168 .SH AUTHORS
169 .B wrc
170 was written by Bertho A. Stultiens and is a nearly complete rewrite of
171 the first wine resource compiler (1994) by Martin von Loewis.
172 Additional resource\-types were contributed Ulrich Czekalla and Albert
173 den Haan. Many cleanups by Dimitrie O. Paun in 2002-2003.
174 Bugfixes have been contributed by many Wine developers.
175 .SH BUGS
176 \- The preprocessor recognizes variable argument macros, but does not
177 expanded them correctly.
178 .br
179 \- Error reporting should be more precise, as currently the column and
180 line number reported are those of the next token.
181 .br
182 \- Default memory options should differ between win16 and win32.
183 .PP
184 There is no support for:
185 .br
186 \- RT_DLGINCLUDE, RT_VXD, RT_PLUGPLAY and RT_HTML (unknown format)
187 .br
188 \- PUSHBOX control is unsupported due to lack of original functionality.
189 .PP
190 Fonts are parsed and generated, but there is no support for the
191 generation of the FONTDIR yet. The user must supply the FONTDIR
192 resource in the source to match the FONT resources.
193 .SH AVAILABILITY
194 .B wrc
195 is part of the Wine distribution, which is available through
196 WineHQ, the Wine development headquarters, at
197 .I http://www.winehq.org/.
198 .SH "SEE ALSO"
199 .BR wine (1)