wrc: -a -C -w

Dimitrie O. Paun dpaun at rogers.com
Wed Mar 26 21:48:34 CST 2003

On March 26, 2003 11:51 pm, Alexandre Julliard wrote:
> I don't mind removing -w, but it would be nice if you could also fix
> the makefiles so that things compile <g>

DUH! I knew I've missed something... :)

  Remove unused options -a and -C.
  Collapse the -w into -O, for symmetry with -J.
  Update the man page to the latest options.

Index: tools/wrc/wrc.c
RCS file: /var/cvs/wine/tools/wrc/wrc.c,v
retrieving revision 1.31
diff -u -r1.31 wrc.c
--- tools/wrc/wrc.c	20 Mar 2003 19:23:08 -0000	1.31
+++ tools/wrc/wrc.c	26 Mar 2003 04:18:33 -0000
@@ -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 @@
 	"   -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"
@@ -134,22 +131,11 @@
 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)
 int pedantic = 0;
@@ -191,7 +177,7 @@
 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 stdinc = 1;
 	int lose = 0;
 	int ret;
-	int a;
 	int i;
 	int cmdlen;
@@ -262,9 +247,6 @@
-		case 'a':
-			alignment = atoi(optarg);
-			break;
 		case 'B':
@@ -285,9 +267,6 @@
-		case 'C':
-			codepage = strtol(optarg, NULL, 0);
-			break;
 		case 'd':
 			debuglevel = strtol(optarg, NULL, 0);
@@ -331,20 +310,12 @@
 			else error("Too many output files.\n");
 		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);
 		case 'v':
 			debuglevel = DEBUGLEVEL_CHAT;
-		case 'w':
-			if(!strcmp(optarg, "16"))
-				win32 = 0;
-			else if(!strcmp(optarg, "32"))
-				win32 = 1;
-			else
-				lose++;
-			break;
 		case 'W':
 			pedantic = 1;
@@ -380,31 +351,6 @@
 		if (!output_name) output_name = argv[optind++];
 		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 */
Index: tools/wrc/wrc.h
RCS file: /var/cvs/wine/tools/wrc/wrc.h,v
retrieving revision 1.28
diff -u -r1.28 wrc.h
--- tools/wrc/wrc.h	26 Feb 2003 05:04:12 -0000	1.28
+++ tools/wrc/wrc.h	26 Mar 2003 04:18:55 -0000
@@ -51,10 +51,7 @@
 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;
Index: tools/wrc/wrc.man
RCS file: /var/cvs/wine/tools/wrc/wrc.man,v
retrieving revision 1.17
diff -u -r1.17 wrc.man
--- tools/wrc/wrc.man	20 Mar 2003 19:23:08 -0000	1.17
+++ tools/wrc/wrc.man	26 Mar 2003 04:55:22 -0000
@@ -20,39 +20,40 @@
 no inputfile was given.
-.I \-a n
-Win16 only; set the alignment between resources n.  The alignment must
-be a power of 2. The default is 4.
-.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.
-.I \-C cp
-Set the resource's codepage to \fIcp\fR. Default codepage is 0.
+the native ordering by typing \fIwrc \-h\fR.
-.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.
-.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
-.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
-.I \-h
+.I \fB\-F\fR, \fB\-\-target\fR
+Ignored for compatibility with windres.
+.I \fB\-h\fR, \fB\-\-help\fR
 Prints a summary message and exits.
-.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.
+.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 @@
 Sets the input format. Valid options are 'rc' or 'rc16'. Setting the
 input to 'rc16' disables the recognition of win32 keywords.
-.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").
-.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 @@
 source\-files that contain overlapping type\-IDs, or when the format of the
 resource is not 100% compliant.
-.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.
-.I \-o file
+.I \fB\-\-no\-use\-temp\-file\fR
+Ignored for compatibility with windres.
+.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.
-.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'.
-.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.
-.I \-v
+.I \fB\-\-use\-temp\-file\fR
+Ignored for compatibility with windres.
+.I \fB\-v\fR
 Turns on verbose mode (equivalent to -d 1).
-.I \--version
+.I \fB\-\-version\fR
 Print version end exit.
-.I \-w 16|32
-Select win16 or win32 output. Default is win32.
-.I \-W
+.I \fB\-W\fR
 Enable pedantic warnings. Notably redefinition of #define statements can
 be discovered with this option.
-The preprocessor is ANSI\-C compatible with some extensions of the gcc
+The preprocessor is ANSI\-C compatible with some of the extensions of 
+the gcc preprocessor. 
 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).
-The preprocessor default sets several defines:
+The preprocessor sets by default several defines:
 RC_INVOKED      set to 1
@@ -140,7 +143,7 @@
 recognized and expand to their respective equivalent.
 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,41 +165,24 @@
 	'00 01 02 03 04 05 06 07 08'
-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. 
-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.
-All errors and warnings are written to standard error and report:
-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.
 .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 developpers.
 \- The preprocessor recognizes variable argument macros, but does not
-expanded them correctly
+expanded them correctly.
-\- Error reporting should be more to the point (and verbose)
+\- Error reporting should be more precise, as currently the column and
+line number reported are those of the next token. 
-\- Codepage/UNICODE translations are not/not correct implemented
+\- Codepage/Unicode translations are not/not correctly implemented.
 \- Default memory options should differ between win16 and win32.
 There is no support for:
 \- RT_DLGINCLUDE, RT_VXD, RT_PLUGPLAY and RT_HTML (unknown format)
@@ -206,14 +192,11 @@
 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.
-See the CHANGES and README.wrc files in the distribution for more
-comments on bugs and fixes across the versions.
 .B wrc
 is part of the wine distribution, which is available through
 WineHQ, the
-.B wine
+.B Wine
 development headquarters, at
 .I http://www.winehq.com/.
Index: ./dlls/gdi/Makefile.in
RCS file: /var/cvs/wine/dlls/gdi/Makefile.in,v
retrieving revision 1.47
diff -u -r1.47 Makefile.in
--- ./dlls/gdi/Makefile.in	23 Mar 2003 20:00:03 -0000	1.47
+++ ./dlls/gdi/Makefile.in	27 Mar 2003 03:40:31 -0000
@@ -83,6 +83,6 @@
 	$(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:
Index: ./dlls/kernel/Makefile.in
RCS file: /var/cvs/wine/dlls/kernel/Makefile.in,v
retrieving revision 1.59
diff -u -r1.59 Makefile.in
--- ./dlls/kernel/Makefile.in	26 Mar 2003 23:41:43 -0000	1.59
+++ ./dlls/kernel/Makefile.in	27 Mar 2003 03:40:47 -0000
@@ -66,6 +66,6 @@
 	$(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:
Index: ./dlls/shell32/Makefile.in
RCS file: /var/cvs/wine/dlls/shell32/Makefile.in,v
retrieving revision 1.62
diff -u -r1.62 Makefile.in
--- ./dlls/shell32/Makefile.in	23 Mar 2003 20:00:03 -0000	1.62
+++ ./dlls/shell32/Makefile.in	27 Mar 2003 03:40:59 -0000
@@ -68,7 +68,7 @@
 # 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
Index: ./dlls/user/Makefile.in
RCS file: /var/cvs/wine/dlls/user/Makefile.in,v
retrieving revision 1.64
diff -u -r1.64 Makefile.in
--- ./dlls/user/Makefile.in	23 Mar 2003 20:00:03 -0000	1.64
+++ ./dlls/user/Makefile.in	27 Mar 2003 03:41:27 -0000
@@ -119,12 +119,12 @@
 	$(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:


More information about the wine-devel mailing list