Remove unused options -a and -C.

Collapse the -w into -O, for symmetry with -J.
Update the man page to the latest options.
oldstable
Dimitrie O. Paun 2003-03-27 18:37:59 +00:00 committed by Alexandre Julliard
parent b29fa342af
commit 8794935e12
7 changed files with 55 additions and 133 deletions

View File

@ -83,6 +83,6 @@ gdi.exe.spec.c: gdi.exe.spec version16.res
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --heap 65520 --main-module $(MODULE) --res version16.res --spec $(SRCDIR)/gdi.exe.spec
version16.res: version16.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/version16.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/version16.rc
### Dependencies:

View File

@ -66,6 +66,6 @@ krnl386.exe.spec.c: krnl386.exe.spec version16.res
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --dll-name kernel --main-module $(MODULE) --res version16.res --spec $(SRCDIR)/krnl386.exe.spec
version16.res: version16.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/version16.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/version16.rc
### Dependencies:

View File

@ -68,7 +68,7 @@ uninstall::
# Special rules for 16-bit resource files
version16.res: version16.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/version16.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/version16.rc
shell.spec.c: shell.spec version16.res
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --main-module $(MODULE) --res version16.res --spec $(SRCDIR)/shell.spec

View File

@ -119,12 +119,12 @@ mouse.spec.c: mouse.spec resources/mouse.res
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --main-module $(MODULE) --res resources/mouse.res --spec $(SRCDIR)/mouse.spec
resources/display.res: resources/display.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/resources/display.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/resources/display.rc
resources/mouse.res: resources/mouse.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/resources/mouse.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/resources/mouse.rc
resources/version16.res: resources/version16.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/resources/version16.rc
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/resources/version16.rc
### Dependencies:

View File

@ -56,10 +56,8 @@
static char usage[] =
"Usage: wrc [options...] [infile[.rc|.res]] [outfile]\n"
" -a n Alignment of resource (win16 only, default is 4)\n"
" -B x Set output byte-order x={n[ative], l[ittle], b[ig]}\n"
" (win32 only; default is " ENDIAN "-endian)\n"
" -C cp Set the resource's codepage to cp (default is 0)\n"
" -d n Set debug level to 'n'\n"
" -D id[=val] Define preprocessor identifier id=val\n"
" -E Preprocess only\n"
@ -71,9 +69,8 @@ static char usage[] =
" -l lan Set default language to lan (default is neutral {0, 0})\n"
" -m Do not remap numerical resource IDs\n"
" -o file Output to file (default is infile.res)\n"
" -O format The output format (must be `res').\n"
" -O format The output format (either `res' or `res16`).\n"
" -v Enable verbose mode.\n"
" -w 16|32 Select win16 or win32 output (default is win32)\n"
" -W Enable pedantic warnings\n"
"The following long options are supported:\n"
" --input Synonym for -i.\n"
@ -133,22 +130,11 @@ int debuglevel = DEBUGLEVEL_NONE;
*/
int extensions = 1;
/*
* NE segment resource aligment (-a option)
*/
int alignment = 4;
int alignment_pwr;
/*
* Language setting for resources (-l option)
*/
language_t *currentlanguage = NULL;
/*
* The codepage to write in win32 PE resource segment (-C option)
*/
DWORD codepage = 0;
/*
* Set when extra warnings should be generated (-W option)
*/
@ -191,7 +177,7 @@ static void rm_tempfile(void);
static void segvhandler(int sig);
static const char* short_options =
"a:AB:cC:d:D:eEF:hH:i:I:l:LmnNo:O:P:rtTvVw:W";
"B:d:D:EF:hi:I:J:l:mo:O:vW";
static struct option long_options[] = {
{ "input", 1, 0, 'i' },
{ "input-format", 1, 0, 'J' },
@ -219,7 +205,6 @@ int main(int argc,char *argv[])
int stdinc = 1;
int lose = 0;
int ret;
int a;
int i;
int cmdlen;
@ -262,9 +247,6 @@ int main(int argc,char *argv[])
printf(version_string);
exit(0);
break;
case 'a':
alignment = atoi(optarg);
break;
case 'B':
switch(optarg[0])
{
@ -285,9 +267,6 @@ int main(int argc,char *argv[])
lose++;
}
break;
case 'C':
codepage = strtol(optarg, NULL, 0);
break;
case 'd':
debuglevel = strtol(optarg, NULL, 0);
break;
@ -331,20 +310,12 @@ int main(int argc,char *argv[])
else error("Too many output files.\n");
break;
case 'O':
if (strcmp(optarg, "res"))
warning("Output format %s not supported.", optarg);
if (strcmp(optarg, "res16") == 0) win32 = 0;
else if (strcmp(optarg, "res")) warning("Output format %s not supported.", optarg);
break;
case 'v':
debuglevel = DEBUGLEVEL_CHAT;
break;
case 'w':
if(!strcmp(optarg, "16"))
win32 = 0;
else if(!strcmp(optarg, "32"))
win32 = 1;
else
lose++;
break;
case 'W':
pedantic = 1;
wpp_set_pedantic(1);
@ -382,31 +353,6 @@ int main(int argc,char *argv[])
else error("Too many output files.\n");
}
/* Check the command line options for invalid combinations */
if(win32)
{
if(!extensions)
{
warning("Option -e ignored with 32bit compile\n");
extensions = 1;
}
}
/* Set alignment power */
a = alignment;
for(alignment_pwr = 0; alignment_pwr < 10 && a > 1; alignment_pwr++)
{
a >>= 1;
}
if(a != 1)
{
error("Alignment must be between 1 and 1024");
}
if((1 << alignment_pwr) != alignment)
{
error("Alignment must be a power of 2");
}
/* Kill io buffering when some kind of debuglevel is enabled */
if(debuglevel)
{

View File

@ -51,10 +51,7 @@ extern int debuglevel;
extern int win32;
extern int create_res;
extern int extensions;
extern int alignment;
extern int alignment_pwr;
extern int create_s;
extern DWORD codepage;
extern int pedantic;
extern int byteorder;
extern int preprocess_only;

View File

@ -20,39 +20,40 @@ specified with \fI-o\fR, then \fBwrc\fR will write the output to
no inputfile was given.
.SH OPTIONS
.TP
.I \-a n
Win16 only; set the alignment between resources n. The alignment must
be a power of 2. The default is 4.
.TP
.I \-B x
.I \fB\-B\fR \fIx\fR
Win32 only; set output byte\-ordering, where \fIx\fR is one of n[ative],
l[ittle] or b[ig]. Only resources in source-form can be reorderd. Native
ordering depends on the system on which \fBwrc\fR was built. You can see
the native ordering by typing \fIwrc \-?\fR.
the native ordering by typing \fIwrc \-h\fR.
.TP
.I \-C cp
Set the resource's codepage to \fIcp\fR. Default codepage is 0.
.TP
.I \-d n
.I \fB\-d\fR \fIn\fR
Set debug level to \fIn\fR. The value is a bitmask consisting of
1=verbose, 2=dump internals, 4=resource parser trace, 8=preprocessor
messages, 16=preprocessor scanner and 32=preprocessor parser trace.
.TP
.I \-D id[=val]
.I \fB\-D\fR, \fB\-\-define\fR=\fIid[=val]\fR
Define preprocessor identifier \fIid\fR to (optionally) value \fIval\fR.
See also
.B PREPROCESSOR
below.
.TP
.I \-E
.I \fB\-E\fR
Preprocess only. The output is written to standard output if no
outputfile was selected. The output is compatible with what gcc would
generate.
.TP
.I \-h
.I \fB\-F\fR, \fB\-\-target\fR
Ignored for compatibility with windres.
.TP
.I \fB\-h\fR, \fB\-\-help\fR
Prints a summary message and exits.
.TP
.I \-I path
.I \fB\-i\fR, \fB\-\-input\fR=\fIfile\fR
The name of the input file. If this option is not used, then \fBwrc\fR
will use the first non-option argument as the input file name. If there
are no non-option arguments, then \fBwrc\fR will read from standard input.
.TP
.I \fB\-I\fR, \fB\-\-include\-dir\fR=\fIfile\fR
Add \fIpath\fR to include search directories. \fIPath\fR may contain
multiple directories, separated with ':'. It is allowed to specify
\fI\-I\fR multiple times. Include files are searched in the order in
@ -67,11 +68,11 @@ resource statements with file references are located in the same way.
Sets the input format. Valid options are 'rc' or 'rc16'. Setting the
input to 'rc16' disables the recognition of win32 keywords.
.TP
.I \-l lan
.I \fB\-l\fR, \fB\-\-language\fR=\fIlan\fR
Set default language to \fIlan\fR. Default is the neutral language 0
(i.e. "LANGUAGE 0, 0").
.TP
.I \-m
.I \fB\-m\fR
Do not remap numerical resource type-IDs onto standard resources. This will
cause all numerical resource type\-IDs to be treated as user\-type resources
and will not be checked nor byte\-reversed. Without this option, resources
@ -82,47 +83,49 @@ for example, big\-endian platforms. The \fI\-m\fR option is usefull for
source\-files that contain overlapping type\-IDs, or when the format of the
resource is not 100% compliant.
.TP
.I \--nostdinc
.I \fB\-\-nostdinc\fR
Do not search the standard include path, look for include files only
in the directories explicitly specified with the \fI\-I\fR option.
.TP
.I \-o file
.I \fB\-\-no\-use\-temp\-file\fR
Ignored for compatibility with windres.
.TP
.I \fB\-o\fR, \fB\-\-output\fR=\fIfile\fR
Write output to \fIfile\fR. Default is \fBinputfile.res\fR
with \fB.rc\fR stripped or \fBwrc.tab.res\fR if input is read
from standard input.
.TP
.I \-O format
Sets the output format. The only supported \fformat\fR is 'res', which
is also the default format if this option is not specified. The option
exists mainly for compatibility with \fBwindres\fR.
.I \fB\-O\fR, \fB\-\-output\-format\fR=\fIformat\fR
Sets the output format. The supported formats are 'res' and 'res16'.
If this option is not specified, format defaults to 'res'.
.TP
.I \--preprocessor program
.I \fB\-\-preprocessor\fR=\fIprogram\fR
This option may be used to specify the preprocessor to use, including any
leading arguments. If not specified, \fBwrc\fR uses its builtin processor.
To disable preprocessing, use \fB-P cat\fR.
To disable preprocessing, use \fB--preprocessor=cat\fR.
.TP
.I \-v
.I \fB\-\-use\-temp\-file\fR
Ignored for compatibility with windres.
.TP
.I \fB\-v\fR
Turns on verbose mode (equivalent to -d 1).
.TP
.I \--version
.I \fB\-\-version\fR
Print version end exit.
.TP
.I \-w 16|32
Select win16 or win32 output. Default is win32.
.TP
.I \-W
.I \fB\-W\fR
Enable pedantic warnings. Notably redefinition of #define statements can
be discovered with this option.
.SH PREPROCESSOR
The preprocessor is ANSI\-C compatible with some extensions of the gcc
preprocessor.
The preprocessor is ANSI\-C compatible with some of the extensions of
the gcc preprocessor.
.PP
The preprocessor recognizes these directives: #include, #define (both
simple and macro), #undef, #if, #ifdef, #ifndef, #elif, #else, #endif,
#error, #warning, #line, # (both null\- and line\-directive), #pragma
(ignored), #ident (ignored).
.PP
The preprocessor default sets several defines:
The preprocessor sets by default several defines:
.br
RC_INVOKED set to 1
.br
@ -140,7 +143,7 @@ Special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also
recognized and expand to their respective equivalent.
.SH "LANGUAGE SUPPORT"
Language, version and characteristics can be bound to all resource types that
have inline data, such as RCDATA. This is an extension to MS' resource
have inline data, such as RCDATA. This is an extension to Microsoft's resource
compiler, which lacks this support completely. Only VERSIONINFO cannot have
version and characteristics attached, but languages are propagated properly if
you declare it correctly before the VERSIONINFO resource starts.
@ -162,38 +165,19 @@ CHARACTERISTICS 876
'00 01 02 03 04 05 06 07 08'
.br
}
.SH NE/PE RESOURCE DIRECTORY GENERATION
A windows executable has a table/directory of resources available in that
module. Wrc will generate this directory with the '-s' option and place it
in the assembly output.
.PP
The layout of the PE directory should be exactly like the executable file.
The NE directory layout _DIFFERS_ from the real NE executable in such way
that all offsets to actual resource data are relative to the NE directory and
_NOT_ the beginning of the file.
.SH "ERROR REPORTING"
All errors and warnings are written to standard error and report:
.br
\fIfilename\fR:\fIline\-number\fR:\fIcharacter\-pos\fR:\fI{Error,Warning}\fR:\fI<message>\fR
.br
The character\-position is always at the next token. I.e. the error
or warning happened before. The line\-number suffers from the same
problem if the error occurred at the last token of the previous line.
The line\-number will be several lines off when the error was followed
by several empry lines. See also \fBBUGS\fR.
.SH AUTHORS
.B wrc
was written by Bertho A. Stultiens and is a nearly complete rewrite of
the first wine resource compiler (1994) by Martin von Loewis.
Additional resource\-types were contributed Ulrich Czekalla and Albert
den Haan. Bugfixes have been contributed by many wine developpers.
den Haan. Many cleanups by Dimitrie O. Paun in 2002-2003.
Bugfixes have been contributed by many Wine developers.
.SH BUGS
\- The preprocessor recognizes variable argument macros, but does not
expanded them correctly
expanded them correctly.
.br
\- Error reporting should be more to the point (and verbose)
.br
\- Codepage/UNICODE translations are not/not correct implemented
\- Error reporting should be more precise, as currently the column and
line number reported are those of the next token.
.br
\- Default memory options should differ between win16 and win32.
.PP
@ -206,15 +190,10 @@ There is no support for:
Fonts are parsed and generated, but there is no support for the
generation of the FONTDIR yet. The user must supply the FONTDIR
resource in the source to match the FONT resources.
.PP
See the CHANGES and README.wrc files in the distribution for more
comments on bugs and fixes across the versions.
.SH AVAILABILITY
.B wrc
is part of the wine distribution, which is available through
WineHQ, the
.B wine
development headquarters, at
is part of the Wine distribution, which is available through
WineHQ, the Wine development headquarters, at
.I http://www.winehq.com/.
.SH "SEE ALSO"
.BR wine (1),
.BR wine (1)