Commit 68481e8e authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

Remove header file generation, and related options.

parent af39862f
......@@ -89,7 +89,6 @@ static char usage[] =
" -b Create an assembly array from a binary .res file\n"
" -B x Set output byte-order x={n[ative], l[ittle], b[ig]}\n"
" (win32 only; default is " ENDIAN "-endian)\n"
" -c Add 'const' prefix to C constants\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"
......@@ -104,8 +103,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"
" -N Do not preprocess input\n"
" -o file Output to file (default is infile.[res|s|h]\n"
" -O format The output format: one of `res', 'asm', 'hdr'.\n"
" -o file Output to file (default is infile.[res|s]\n"
" -O format The output format: one of `res', 'asm'.\n"
" -p prefix Give a prefix for the generated names\n"
" -s Add structure with win32/16 (PE/NE) resource directory\n"
" -v Enable verbose mode.\n"
......@@ -137,7 +136,7 @@ static char usage[] =
" * 0x10 Preprocessor lex messages\n"
" * 0x20 Preprocessor yacc trace\n"
"If no input filename is given and the output name is not overridden\n"
"with -o, then the output is written to \"wrc.tab.[sh]\"\n"
"with -o, then the output is written to \"wrc.tab.{s,res}\"\n"
;
char version_string[] = "Wine Resource Compiler Version " WRC_FULLVERSION "\n"
......@@ -156,14 +155,9 @@ char *prefix = __ASM_NAME("_Resource");
int win32 = 1;
/*
* Set when generated C variables should be prefixed with 'const'
*/
int constant = 0;
/*
* Output type (default res)
*/
enum output_t { output_def, output_res, output_asm, output_hdr } output_type = output_def;
enum output_t { output_def, output_res, output_asm } output_type = output_def;
/*
* debuglevel == DEBUGLEVEL_NONE Don't bother
......@@ -352,9 +346,6 @@ int main(int argc,char *argv[])
lose++;
}
break;
case 'c':
constant = 1;
break;
case 'C':
codepage = strtol(optarg, NULL, 0);
break;
......@@ -411,7 +402,6 @@ int main(int argc,char *argv[])
case 'O':
if (strcmp(optarg, "res") == 0) output_type = output_res;
else if (strcmp(optarg, "asm") == 0) output_type = output_asm;
else if (strcmp(optarg, "hdr") == 0) output_type = output_hdr;
else error("Output format %s not supported.", optarg);
break;
case 'p':
......@@ -481,7 +471,6 @@ int main(int argc,char *argv[])
if (dotstr)
{
if (strcmp(dotstr+1, "s") == 0) output_type = output_asm;
else if(strcmp(dotstr+1, "h") == 0) output_type = output_hdr;
}
}
......@@ -498,12 +487,6 @@ int main(int argc,char *argv[])
if(output_type == output_res)
{
if(constant)
{
warning("Option -c ignored with compile to .res\n");
constant = 0;
}
if(global)
{
warning("Option -g ignored with compile to .res\n");
......@@ -529,12 +512,6 @@ int main(int argc,char *argv[])
if(preprocess_only)
{
if(constant)
{
warning("Option -c ignored with preprocess only\n");
constant = 0;
}
if(global)
{
warning("Option -g ignored with preprocess only\n");
......@@ -616,7 +593,6 @@ int main(int argc,char *argv[])
output_name = dup_basename(input_name, binary ? ".res" : ".rc");
if (output_type == output_res) strcat(output_name, ".res");
else if (output_type == output_asm) strcat(output_name, ".s");
else if (output_type == output_hdr) strcat(output_name, ".h");
}
/* Run the preprocessor on the input */
......@@ -692,11 +668,6 @@ int main(int argc,char *argv[])
chat("Writing .s-file");
write_s_file(output_name, resource_top);
}
else if(output_type == output_hdr)
{
chat("Writing .h-file");
write_h_file(output_name, resource_top);
}
}
else
......@@ -709,11 +680,6 @@ int main(int argc,char *argv[])
chat("Writing .s-file");
write_s_file(output_name, resource_top);
}
else if(output_type == output_hdr)
{
chat("Writing .h-file");
write_h_file(output_name, resource_top);
}
}
return 0;
......
......@@ -49,11 +49,9 @@ extern int debuglevel;
#define DEBUGLEVEL_PPTRACE 0x0020
extern int win32;
extern int constant;
extern int create_res;
extern int extensions;
extern int binary;
extern int create_header;
extern int create_dir;
extern int global;
extern int alignment;
......@@ -69,7 +67,6 @@ extern int remap;
extern char *prefix;
extern char *output_name;
extern char *input_name;
extern char *header_name;
extern char *cmdline;
extern time_t now;
......
......@@ -25,9 +25,9 @@ takes only one \fBinputfile\fR as argument. The \fBinputfile\fR has
extension \fB.rc\fR for resources in source form and \fB.res\fR for
binary resources. The resources are read from standard input if no
inputfile is given. If the outputfile is not specified with \fI-o\fR,
then \fBwrc\fR will write the output to \fBinputfile.{s,h,res}\fR
then \fBwrc\fR will write the output to \fBinputfile.{s,res}\fR
with \fB.rc\fR stripped, depending on the mode of compilation.
The outputfile is named \fBwrc.tab.{s,h,res}\fR if no inputfile was
The outputfile is named \fBwrc.tab.{s,res}\fR if no inputfile was
given.
.SH OPTIONS
.TP
......@@ -44,9 +44,6 @@ 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.
.TP
.I \-c
Add 'const' prefix to C constants when writing header files.
.TP
.I \-C cp
Set the resource's codepage to \fIcp\fR. Default codepage is 0.
.TP
......@@ -119,8 +116,8 @@ with \fB.rc\fR stripped or \fBwrc.tab.{s,h,res}\fR, depending on the
compilation mode.
.TP
.I \-O format
Sets the output format. \fformat\fR can one of 'res', 'asm', and 'hdr'
to generate a \fB.res\fR, \fB.s\fR, or \fB.h\fR file respectively.
Sets the output format. \fformat\fR can one either 'res' or 'asm'
to generate a \fB.res\fR or \fB.s\fR file respectively.
If not specified, \fBwrc\fR assumes 'res'.
.TP
.I \-p prefix
......
......@@ -48,26 +48,6 @@ static char s_file_tail_str[] =
"\n"
;
static char h_file_head_str[] =
"/*\n"
" * This file is generated with wrc version " WRC_FULLVERSION ". Do not edit!\n"
" * Source : %s\n"
" * Cmdline: %s\n"
" * Date : %s"
" */\n"
"\n"
"#ifndef __%08lx_H\n" /* This becomes the date of compile */
"#define __%08lx_H\n"
"\n"
"#include <wrc_rsc.h>\n"
"\n"
;
static char h_file_tail_str[] =
"#endif\n"
"/* <eof> */\n\n"
;
char _NEResTab[] = "_NEResTab";
char _PEResTab[] = "_PEResTab";
char _ResTable[] = "_ResTable";
......@@ -952,54 +932,3 @@ void write_s_file(char *outname, resource_t *top)
fprintf(fo, s_file_tail_str);
fclose(fo);
}
/*
*****************************************************************************
* Function : write_h_file
* Syntax : void write_h_file(char *outname, resource_t *top)
* Input :
* outname - Filename to write to
* top - The resource-tree to convert
* Output :
* Description :
* Remarks :
*****************************************************************************
*/
void write_h_file(char *outname, resource_t *top)
{
FILE *fo;
resource_t *rsc;
fo = fopen(outname, "wt");
if(!fo)
{
error("Could not open %s\n", outname);
}
fprintf(fo, h_file_head_str, input_name ? input_name : "stdin",
cmdline, ctime(&now), (long)now, (long)now);
/* First write the segment tables reference */
if(create_dir)
{
fprintf(fo, "extern %schar %s%s[];\n\n",
constant ? "const " : "",
prefix,
win32 ? _PEResTab : _NEResTab);
}
/* Write the resource data */
for(rsc = top; global && rsc; rsc = rsc->next)
{
if(!rsc->binres)
continue;
fprintf(fo, "extern %schar %s%s_data[];\n",
constant ? "const " : "",
prefix,
rsc->c_name);
}
fprintf(fo, h_file_tail_str);
fclose(fo);
}
......@@ -27,6 +27,5 @@
void write_resfile(char *outname, resource_t *top);
void write_s_file(char *outname, resource_t *top);
void write_h_file(char *outname, resource_t *top);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment