Make bin2res silent by default.
diff --git a/tools/bin2res.c b/tools/bin2res.c
index 4688203..e46f368 100644
--- a/tools/bin2res.c
+++ b/tools/bin2res.c
@@ -39,6 +39,7 @@
" -i <filename> archive the named file into the <rsrc.rc> file\n"
" -o <filename> extract the named file from the <rsrc.rc> file\n"
" -f force processing of older resources\n"
+ " -v causes the command to be verbous during processing\n"
" -h print this help screen and exit\n"
"\n"
"This tool allows the insertion/extractions of embedded binary\n"
@@ -121,7 +122,8 @@
return res_file_name;
}
-int process_resources(const char* input_file_name, const char* specific_file_name, int inserting, int force_processing)
+int process_resources(const char* input_file_name, const char* specific_file_name,
+ int inserting, int force_processing, int verbose)
{
char buffer[2048], tmp_file_name[PATH_MAX];
const char *res_file_name;
@@ -153,11 +155,11 @@
if ( (specific_file_name && strcmp(specific_file_name, res_file_name)) ||
(!force_processing && ((rc_last_update < res_last_update) == !inserting)) )
{
- printf("skipping '%s'\n", res_file_name);
+ if (verbose) printf("skipping '%s'\n", res_file_name);
continue;
}
- printf("processing '%s'\n", res_file_name);
+ if (verbose) printf("processing '%s'\n", res_file_name);
while ( (c = fgetc(fin)) != EOF && c != '{')
if (inserting) fputc(c, ftmp);
if (c == EOF) break;
@@ -191,7 +193,7 @@
int main(int argc, char **argv)
{
int convert_dir = 0, optc;
- int force_overwrite = 0;
+ int force_overwrite = 0, verbose = 0;
const char* input_file_name = 0;
const char* specific_file_name = 0;
@@ -215,6 +217,9 @@
case 'f':
force_overwrite = 1;
break;
+ case 'v':
+ verbose = 1;
+ break;
case 'h':
printf(help);
exit(0);
@@ -230,7 +235,7 @@
if (!convert_dir) usage();
if (!process_resources(input_file_name, specific_file_name,
- convert_dir == 'a', force_overwrite))
+ convert_dir == 'a', force_overwrite, verbose))
{
perror("Processing failed");
exit(1);