bin2res: make it silent by default

Dimitrie O. Paun dpaun at rogers.com
Thu Oct 2 01:17:07 CDT 2003


The -v option is still useful in a bunch of cases...

ChangeLog
    Make bin2res silent by default.

Index: tools/bin2res.c
===================================================================
RCS file: /var/cvs/wine/tools/bin2res.c,v
retrieving revision 1.17
diff -u -r1.17 bin2res.c
--- tools/bin2res.c	1 Oct 2003 03:13:31 -0000	1.17
+++ tools/bin2res.c	2 Oct 2003 01:33:42 -0000
@@ -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);


-- 
Dimi.




More information about the wine-patches mailing list