From fea016499697b4a99dd6391ac440497db1dc6e50 Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Thu, 20 Mar 2003 19:23:08 +0000 Subject: [PATCH] Introduce the -J, --input-format options for compatibility with windres. Collpase the -e option into the -J option. Update man page. Cleanup file header (remove history that's already in log msgs, etc.) --- tools/wrc/wrc.c | 46 ++++++++++------------------------------------ tools/wrc/wrc.man | 9 ++++----- 2 files changed, 14 insertions(+), 41 deletions(-) diff --git a/tools/wrc/wrc.c b/tools/wrc/wrc.c index 9db06d8a8d3..ce92feacecd 100644 --- a/tools/wrc/wrc.c +++ b/tools/wrc/wrc.c @@ -1,6 +1,7 @@ /* - * Copyright Martin von Loewis, 1994 + * Copyright 1994 Martin von Loewis * Copyrignt 1998 Bertho A. Stultiens (BS) + * Copyright 2003 Dimitrie O. Paun * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,35 +17,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * History: - * 30-Apr-2000 BS - Integrated a new preprocessor (-E and -N) - * 20-Jun-1998 BS - Added -L option to prevent case conversion - * of embedded filenames. - * - * 08-Jun-1998 BS - Added -A option to generate autoregister code - * for winelib operation. - * - * 21-May-1998 BS - Removed the CPP option. Its internal now. - * - Added implementations for defines and includes - * on the commandline. - * - * 30-Apr-1998 BS - The options now contain nearly the entire alphabet. - * Seems to be a sign for too much freedom. I implemeted - * most of them as a user choice possibility for things - * that I do not know what to put there by default. - * - -l and -L options are now known as -t and -T. - * - * 23-Apr-1998 BS - Finally gave up on backward compatibility on the - * commandline (after a blessing from the newsgroup). - * So, I changed the lot. - * - * 17-Apr-1998 BS - Added many new command-line options but took care - * that it would not break old scripts (sigh). - * - * 16-Apr-1998 BS - There is not much left of the original source... - * I had to rewrite most of it because the parser - * changed completely with all the types etc.. - * */ #include "config.h" @@ -90,12 +62,12 @@ static char usage[] = " -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 Disable recognition of win32 keywords in 16bit compile\n" " -E Preprocess only\n" " -F target Ignored for compatibility with windres\n" " -h Prints this summary.\n" " -i file The name of the input file.\n" " -I path Set include search dir to path (multiple -I allowed)\n" + " -J format The input format (either `rc' or `rc16')\n" " -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" @@ -105,6 +77,7 @@ static char usage[] = " -W Enable pedantic warnings\n" "The following long options are supported:\n" " --input Synonym for -i.\n" + " --input-format Synonym for -J.\n" " --output Synonym for -o.\n" " --output-format Synonym for -O.\n" " --target Synonym for -F.\n" @@ -221,6 +194,7 @@ static const char* short_options = "a:AB:cC:d:D:eEF:hH:i:I:l:LmnNo:O:P:rtTvVw:W"; static struct option long_options[] = { { "input", 1, 0, 'i' }, + { "input-format", 1, 0, 'J' }, { "output", 1, 0, 'o' }, { "output-format", 1, 0, 'O' }, { "target", 1, 0, 'F' }, @@ -320,9 +294,6 @@ int main(int argc,char *argv[]) case 'D': wpp_add_cmdline_define(optarg); break; - case 'e': - extensions = 0; - break; case 'E': preprocess_only = 1; break; @@ -337,8 +308,11 @@ int main(int argc,char *argv[]) else error("Too many input files.\n"); break; case 'I': - if (strcmp(optarg, "-") == 0) stdinc = 0; - else wpp_add_include_path(optarg); + wpp_add_include_path(optarg); + break; + case 'J': + if (strcmp(optarg, "rc16") == 0) extensions = 0; + else if (strcmp(optarg, "rc")) error("Output format %s not supported.", optarg); break; case 'l': { diff --git a/tools/wrc/wrc.man b/tools/wrc/wrc.man index 265cb5ec258..59de87101ac 100644 --- a/tools/wrc/wrc.man +++ b/tools/wrc/wrc.man @@ -44,11 +44,6 @@ See also .B PREPROCESSOR below. .TP -.I \-e -Win16 only; disable recognition of win32 keywords in 16bit compile. -Normally, all keywords are recognized in win16 compilation mode. Use -this switch if old sources use win32 reserved names as resource names. -.TP .I \-E Preprocess only. The output is written to standard output if no outputfile was selected. The output is compatible with what gcc would @@ -68,6 +63,10 @@ searched exclusively via the \fI\-I\fR set path, whereas the '""' quoted filenames are first tried to be opened in the current directory. Also resource statements with file references are located in the same way. .TP +.I \fB\-J\fR, \fB\-\-input\-format\fR=\fIformat\fR +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 Set default language to \fIlan\fR. Default is the neutral language 0 (i.e. "LANGUAGE 0, 0").