Patch: fix wrong UTF-8 output



Currently, gconf/gconftool is still using printf/fprintf(stderr) which
tend to break output for people using non UTF-8 locales.

The attached patch fixes the problem by replacing these calls with
g_print/g_printerr calls.

It also move the _gconf_init_i18n call AFTER poptGetNextOpt, because
popt is not using g_print (ie doesn't do UTF-8 to current locale)
conversion for --help/--usage.

Can I commit ?
-- 
Frederic Crozat <fcrozat mandrakesoft com>
Mandrakesoft
--- GConf-2.3.3/gconf/gconftool.c.gprint	2003-05-21 20:12:48.000000000 +0200
+++ GConf-2.3.3/gconf/gconftool.c	2003-07-30 14:50:11.000000000 +0200
@@ -482,7 +482,6 @@
   xmlKeepBlanksDefault(1);
 
   setlocale (LC_ALL, "");
-  _gconf_init_i18n ();
   textdomain (GETTEXT_PACKAGE);
   
   ctx = poptGetContext("gconftool", argc, (const char **) argv, options, 0);
@@ -491,13 +490,14 @@
 
   while((nextopt = poptGetNextOpt(ctx)) > 0)
     /*nothing*/;
+  _gconf_init_i18n ();
 
   if(nextopt != -1) 
     {
-      fprintf(stderr, _("Error on option %s: %s.\nRun '%s --help' to see a full list of available command line options.\n"),
-              poptBadOption(ctx, 0),
-              poptStrerror(nextopt),
-              argv[0]);
+      g_printerr (_("Error on option %s: %s.\nRun '%s --help' to see a full list of available command line options.\n"),
+		  poptBadOption(ctx, 0),
+		  poptStrerror(nextopt),
+		  argv[0]);
       return 1;
     }
 
@@ -512,7 +512,7 @@
   if ((get_mode && set_mode) ||
       (get_mode && unset_mode))
     {
-      fprintf(stderr, _("Can't get and set/unset simultaneously\n"));
+      g_printerr (_("Can't get and set/unset simultaneously\n"));
       return 1;
     }
 
@@ -522,14 +522,14 @@
       (set_mode && get_list_size_mode) ||
       (set_mode && get_list_element_mode)) 
     {
-      fprintf(stderr, _("Can't set and get/unset simultaneously\n"));
+      g_printerr (_("Can't set and get/unset simultaneously\n"));
       return 1;
     }
 
   if ((get_type_mode && set_mode) ||
       (get_type_mode && unset_mode))
     {
-      fprintf(stderr, _("Can't get type and set/unset simultaneously\n"));
+      g_printerr (_("Can't get type and set/unset simultaneously\n"));
       return 1;
     }
 
@@ -540,7 +540,7 @@
       (all_entries_mode && get_list_size_mode) ||
       (all_entries_mode && get_list_element_mode))
     {
-      fprintf(stderr, _("Can't use --all-entries with --get or --set\n"));
+      g_printerr (_("Can't use --all-entries with --get or --set\n"));
       return 1;
     }
 
@@ -551,7 +551,7 @@
       (all_subdirs_mode && get_list_size_mode) ||
       (all_subdirs_mode && get_list_element_mode))
     {
-      fprintf(stderr, _("Can't use --all-dirs with --get or --set\n"));
+      g_printerr (_("Can't use --all-dirs with --get or --set\n"));
       return 1;
     }
 
@@ -564,7 +564,7 @@
       (recursive_list && all_entries_mode) ||
       (recursive_list && all_subdirs_mode))
     {
-      fprintf(stderr, _("--recursive-list should not be used with --get, --set, --unset, --all-entries, or --all-dirs\n"));
+      g_printerr (_("--recursive-list should not be used with --get, --set, --unset, --all-entries, or --all-dirs\n"));
       return 1;
     }
 
@@ -577,19 +577,19 @@
       (set_schema_mode && all_entries_mode) ||
       (set_schema_mode && all_subdirs_mode))
     {
-      fprintf(stderr, _("--set_schema should not be used with --get, --set, --unset, --all-entries, --all-dirs\n"));
+      g_printerr (_("--set_schema should not be used with --get, --set, --unset, --all-entries, --all-dirs\n"));
       return 1;
     }  
 
   if ((value_type != NULL) && !(set_mode || set_schema_mode))
     {
-      fprintf(stderr, _("Value type is only relevant when setting a value\n"));
+      g_printerr (_("Value type is only relevant when setting a value\n"));
       return 1;
     }
 
   if (set_mode && (value_type == NULL))
     {
-      fprintf(stderr, _("Must specify a type when setting a value\n"));
+      g_printerr (_("Must specify a type when setting a value\n"));
       return 1;
     }
 
@@ -601,7 +601,7 @@
                       break_key_mode || break_dir_mode || short_docs_mode ||
                          long_docs_mode || schema_name_mode))
     {
-      fprintf(stderr, _("Ping option must be used by itself.\n"));
+      g_printerr (_("Ping option must be used by itself.\n"));
       return 1;
     }
 
@@ -613,7 +613,7 @@
                      break_key_mode || break_dir_mode || short_docs_mode ||
                          long_docs_mode || schema_name_mode))
     {
-      fprintf(stderr, _("--dir-exists option must be used by itself.\n"));
+      g_printerr (_("--dir-exists option must be used by itself.\n"));
       return 1;
     }
 
@@ -625,7 +625,7 @@
                       break_key_mode || break_dir_mode || short_docs_mode ||
                          long_docs_mode || schema_name_mode))
     {
-      fprintf(stderr, _("--install-schema-file must be used by itself.\n"));
+      g_printerr (_("--install-schema-file must be used by itself.\n"));
       return 1;
     }
 
@@ -638,7 +638,7 @@
                                 break_key_mode || break_dir_mode || short_docs_mode ||
                          long_docs_mode || schema_name_mode))
     {
-      fprintf(stderr, _("--makefile-install-rule must be used by itself.\n"));
+      g_printerr (_("--makefile-install-rule must be used by itself.\n"));
       return 1;
     }
   
@@ -650,7 +650,7 @@
                                   break_key_mode || break_dir_mode || short_docs_mode ||
                                   long_docs_mode || schema_name_mode))
     {
-      fprintf(stderr, _("--makefile-uninstall-rule must be used by itself.\n"));
+      g_printerr (_("--makefile-uninstall-rule must be used by itself.\n"));
       return 1;
     }
   
@@ -662,7 +662,7 @@
                                 break_dir_mode || short_docs_mode ||
                          long_docs_mode || schema_name_mode))
     {
-      fprintf(stderr, _("--break-key must be used by itself.\n"));
+      g_printerr (_("--break-key must be used by itself.\n"));
       return 1;
     }
 
@@ -675,7 +675,7 @@
                                 makefile_uninstall_mode || short_docs_mode ||
                          long_docs_mode || schema_name_mode))
     {
-      fprintf(stderr, _("--break-directory must be used by itself.\n"));
+      g_printerr (_("--break-directory must be used by itself.\n"));
       return 1;
     }
 
@@ -683,19 +683,19 @@
   
   if (use_local_source && config_source == NULL)
     {
-      fprintf(stderr, _("You must specify a config source with --config-source when using --direct\n"));
+      g_printerr (_("You must specify a config source with --config-source when using --direct\n"));
       return 1;
     }
 
   if (config_source && !use_local_source)
     {
-      fprintf (stderr, _("You should use --direct when using a non-default configuration source\n"));
+      g_printerr (_("You should use --direct when using a non-default configuration source\n"));
       return 1;
     }
   
   if (!gconf_init(argc, argv, &err))
     {
-      fprintf(stderr, _("Failed to init GConf: %s\n"), err->message);
+      g_printerr (_("Failed to init GConf: %s\n"), err->message);
       g_error_free(err);
       err = NULL;
       return 1;
@@ -744,7 +744,7 @@
 
       if (config_source == NULL)
         {
-          fprintf(stderr, _("Must set the GCONF_CONFIG_SOURCE environment variable\n"));
+          g_printerr ( _("Must set the GCONF_CONFIG_SOURCE environment variable\n"));
           return 1;
         }
 
@@ -773,7 +773,7 @@
   if (conf == NULL)
     {
       g_assert(err != NULL);
-      fprintf(stderr, _("Failed to access configuration source(s): %s\n"), err->message);
+      g_printerr (_("Failed to access configuration source(s): %s\n"), err->message);
       g_error_free(err);
       err = NULL;
       return 1;
@@ -1058,7 +1058,7 @@
       
   if (err != NULL)
     {
-      fprintf(stderr, _("Shutdown error: %s\n"),
+      g_printerr (_("Shutdown error: %s\n"),
               err->message);
       g_error_free(err);
       err = NULL;
@@ -1081,7 +1081,7 @@
     {
       gchar* s = tmp->data;
       
-      printf("%s%s:\n", whitespace, s);
+      g_print ("%s%s:\n", whitespace, s);
       
       list_pairs_in_dir(conf, s, depth);
 
@@ -1101,7 +1101,7 @@
 {
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify one or more dirs to recursively list.\n"));
+      g_printerr (_("Must specify one or more dirs to recursively list.\n"));
       return 1;
     }
 
@@ -1151,17 +1151,17 @@
 {
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify one or more dirs to dump.\n"));
+      g_printerr (_("Must specify one or more dirs to dump.\n"));
       return 1;
     }
 
-  printf("<gconfentryfile>\n");
+  g_print ("<gconfentryfile>\n");
 
   while (*args)
     {
       GSList* subdirs;
 
-      printf("  <entrylist base=\"%s\">\n", *args);
+      g_print ("  <entrylist base=\"%s\">\n", *args);
 
       subdirs = gconf_engine_all_dirs(conf, *args, NULL);
 
@@ -1169,12 +1169,12 @@
           
       recurse_subdir_dump(conf, subdirs, *args);
 
-      printf("  </entrylist>\n");
+      g_print ("  </entrylist>\n");
  
       ++args;
     }
 
-  printf("</gconfentryfile>\n");
+  g_print ("</gconfentryfile>\n");
   return 0;
 }
 
@@ -1192,8 +1192,8 @@
           
   if (err != NULL)
     {
-      fprintf(stderr, _("Failure listing entries in `%s': %s\n"),
-              dir, err->message);
+      g_printerr (_("Failure listing entries in `%s': %s\n"),
+		  dir, err->message);
       g_error_free(err);
       err = NULL;
     }
@@ -1212,9 +1212,9 @@
           else
             s = g_strdup(_("(no value set)"));
           
-          printf(" %s%s = %s\n", whitespace,
-                 gconf_key_key (gconf_entry_get_key (pair)),
-                 s);
+          g_print (" %s%s = %s\n", whitespace,
+		   gconf_key_key (gconf_entry_get_key (pair)),
+		   s);
 
           g_free(s);
                   
@@ -1271,47 +1271,47 @@
   short_desc = gconf_schema_get_short_desc(schema);
   long_desc = gconf_schema_get_long_desc(schema);
 
-  printf("%s<schema>\n", whitespace);
+  g_print ("%s<schema>\n", whitespace);
 
   if (owner)
-    printf("%s  <owner>%s</owner>\n", whitespace, owner);
+    g_print ("%s  <owner>%s</owner>\n", whitespace, owner);
 
-  printf("%s  <type>%s</type>\n", whitespace, gconf_value_type_to_string(type));
+  g_print ("%s  <type>%s</type>\n", whitespace, gconf_value_type_to_string(type));
 
   if (type == GCONF_VALUE_LIST)
-    printf("%s  <list_type>%s</list_type>\n", whitespace, gconf_value_type_to_string(list_type));
+    g_print ("%s  <list_type>%s</list_type>\n", whitespace, gconf_value_type_to_string(list_type));
   else if (type == GCONF_VALUE_PAIR)
     {
-      printf("%s  <car_type>%s</car_type>\n", whitespace, gconf_value_type_to_string(car_type));
-      printf("%s  <cdr_type>%s</cdr_type>\n", whitespace, gconf_value_type_to_string(cdr_type));
+      g_print ("%s  <car_type>%s</car_type>\n", whitespace, gconf_value_type_to_string(car_type));
+      g_print ("%s  <cdr_type>%s</cdr_type>\n", whitespace, gconf_value_type_to_string(cdr_type));
     }
 
-  printf("%s  <locale name=\"%s\">\n", whitespace, gconf_schema_get_locale (schema));
+  g_print ("%s  <locale name=\"%s\">\n", whitespace, gconf_schema_get_locale (schema));
 
   if (default_value)
     {
-      printf("%s    <default_value>\n", whitespace);
+      g_print ("%s    <default_value>\n", whitespace);
       print_value_in_xml(default_value, indent + 6);
-      printf("%s    </default_value>\n", whitespace);
+      g_print ("%s    </default_value>\n", whitespace);
     }
 
   if (short_desc)
     {
-      printf("%s    <short>\n", whitespace);
-      printf("%s\n", short_desc);
-      printf("%s    </short>\n", whitespace);
+      g_print ("%s    <short>\n", whitespace);
+      g_print ("%s\n", short_desc);
+      g_print ("%s    </short>\n", whitespace);
     }
 
   if (long_desc)
     {
-      printf("%s    <long>\n", whitespace);
-      printf("%s\n", long_desc);
-      printf("%s    </long>\n", whitespace);
+      g_print ("%s    <long>\n", whitespace);
+      g_print ("%s\n", long_desc);
+      g_print ("%s    </long>\n", whitespace);
     }
 
-  printf("%s  </locale>\n", whitespace);
+  g_print ("%s  </locale>\n", whitespace);
 
-  printf("%s</schema>\n", whitespace);
+  g_print ("%s</schema>\n", whitespace);
 
   g_free(whitespace);
 }
@@ -1323,17 +1323,17 @@
 
   whitespace = g_strnfill(indent, ' ');
 
-  printf("%s<pair>\n", whitespace);
+  g_print ("%s<pair>\n", whitespace);
 
-  printf("%s  <car>\n", whitespace);
+  g_print ("%s  <car>\n", whitespace);
   print_value_in_xml(gconf_value_get_car(value), indent + 4);
-  printf("%s  </car>\n", whitespace);
+  g_print ("%s  </car>\n", whitespace);
 
-  printf("%s  <cdr>\n", whitespace);
+  g_print ("%s  <cdr>\n", whitespace);
   print_value_in_xml(gconf_value_get_cdr(value), indent + 4);
-  printf("%s  </cdr>\n", whitespace);
+  g_print ("%s  </cdr>\n", whitespace);
 
-  printf("%s</pair>\n", whitespace);
+  g_print ("%s</pair>\n", whitespace);
 
   g_free(whitespace);
 }
@@ -1349,7 +1349,7 @@
 
   list_type = gconf_value_get_list_type(value);
 
-  printf("%s<list type=\"%s\">\n", whitespace, gconf_value_type_to_string(list_type));
+  g_print ("%s<list type=\"%s\">\n", whitespace, gconf_value_type_to_string(list_type));
 
   tmp = gconf_value_get_list(value);
   while (tmp)
@@ -1359,7 +1359,7 @@
       tmp = tmp->next;
     }
 
-  printf("%s</list>\n", whitespace);
+  g_print ("%s</list>\n", whitespace);
 
   g_free(whitespace);
 }
@@ -1372,28 +1372,28 @@
 
   whitespace = g_strnfill(indent, ' ');
 
-  printf("%s<value>\n", whitespace);
+  g_print ("%s<value>\n", whitespace);
 
   switch (value->type)
     {
     case GCONF_VALUE_INT:
       tmp = gconf_value_to_string(value);
-      printf("%s  <int>%s</int>\n", whitespace, tmp);
+      g_print ("%s  <int>%s</int>\n", whitespace, tmp);
       g_free(tmp);
       break;
     case GCONF_VALUE_FLOAT:
       tmp = gconf_value_to_string(value);
-      printf("%s  <float>%s</float>\n", whitespace, tmp);
+      g_print ("%s  <float>%s</float>\n", whitespace, tmp);
       g_free(tmp);
       break;
     case GCONF_VALUE_STRING:
       tmp = g_markup_escape_text(gconf_value_get_string(value), -1);
-      printf("%s  <string>%s</string>\n", whitespace, tmp);
+      g_print ("%s  <string>%s</string>\n", whitespace, tmp);
       g_free(tmp);
       break;
     case GCONF_VALUE_BOOL:
       tmp = gconf_value_to_string(value);
-      printf("%s  <bool>%s</bool>\n", whitespace, tmp);
+      g_print ("%s  <bool>%s</bool>\n", whitespace, tmp);
       g_free(tmp);
       break;
     case GCONF_VALUE_LIST:
@@ -1410,7 +1410,7 @@
       break;
     }
 
-  printf("%s</value>\n", whitespace);
+  g_print ("%s</value>\n", whitespace);
 
   g_free(whitespace);
 }
@@ -1450,8 +1450,8 @@
           
   if (err != NULL)
     {
-      fprintf(stderr, _("Failure listing entries in `%s': %s\n"),
-              dir, err->message);
+      g_printerr (_("Failure listing entries in `%s': %s\n"),
+		  dir, err->message);
       g_error_free(err);
       err = NULL;
     }
@@ -1461,20 +1461,20 @@
     {
       GConfEntry* entry = tmp->data;
 
-      printf("    <entry>\n");
+      g_print ("    <entry>\n");
 
-      printf("      <key>%s</key>\n",
-             get_key_relative(gconf_entry_get_key(entry), base_dir));
+      g_print ("      <key>%s</key>\n",
+	       get_key_relative(gconf_entry_get_key(entry), base_dir));
 
       /* <schema_key> will only be relative if its under the base dir */
       if (gconf_entry_get_schema_name(entry))
-        printf("      <schema_key>%s</schema_key>\n",
-               get_key_relative(gconf_entry_get_schema_name(entry), base_dir));
+        g_print ("      <schema_key>%s</schema_key>\n",
+		 get_key_relative(gconf_entry_get_schema_name(entry), base_dir));
 
       if (entry->value)
         print_value_in_xml(entry->value, 6);
 
-      printf("    </entry>\n");
+      g_print ("    </entry>\n");
 
       gconf_entry_free(entry);
 
@@ -1493,7 +1493,7 @@
   
   if (err != NULL)
     {
-      fprintf(stderr, "%s\n", err->message);
+      g_printerr ("%s\n", err->message);
       g_error_free(err);
       err = NULL;
     }
@@ -1508,8 +1508,8 @@
 
   if (!gconf_spawn_daemon(&err))
     {
-      fprintf(stderr, _("Failed to spawn the config server (gconfd): %s\n"), 
-              err->message);
+      g_printerr (_("Failed to spawn the config server (gconfd): %s\n"), 
+		  err->message);
       g_error_free(err);
       err = NULL;
     }
@@ -1522,7 +1522,7 @@
 
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify a key or keys to get\n"));
+      g_printerr (_("Must specify a key or keys to get\n"));
       return 1;
     }
       
@@ -1541,7 +1541,7 @@
             {
               s = gconf_value_to_string(value);
 
-              printf("%s\n", s);
+              g_print ("%s\n", s);
 
               g_free(s);
             }
@@ -1557,19 +1557,19 @@
               const gchar* owner = gconf_schema_get_owner(sc);
               GConfValue* def_value = gconf_schema_get_default_value(sc);
               
-              printf(_("Type: %s\n"), gconf_value_type_to_string(stype));
-              printf(_("List Type: %s\n"), gconf_value_type_to_string(slist_type));
-              printf(_("Car Type: %s\n"), gconf_value_type_to_string(scar_type));
-              printf(_("Cdr Type: %s\n"), gconf_value_type_to_string(scdr_type));
+              g_print (_("Type: %s\n"), gconf_value_type_to_string(stype));
+              g_print (_("List Type: %s\n"), gconf_value_type_to_string(slist_type));
+              g_print (_("Car Type: %s\n"), gconf_value_type_to_string(scar_type));
+              g_print (_("Cdr Type: %s\n"), gconf_value_type_to_string(scdr_type));
               if (def_value)
                 s = gconf_value_to_string (def_value);
               else
                 s = NULL;
-              printf(_("Default Value: %s\n"), def_value ? s : _("Unset"));
+              g_print (_("Default Value: %s\n"), def_value ? s : _("Unset"));
               g_free (s);
-              printf(_("Owner: %s\n"), owner ? owner : _("Unset"));
-              printf(_("Short Desc: %s\n"), short_desc ? short_desc : _("Unset"));
-              printf(_("Long Desc: %s\n"), long_desc ? long_desc : _("Unset"));
+              g_print (_("Owner: %s\n"), owner ? owner : _("Unset"));
+              g_print (_("Short Desc: %s\n"), short_desc ? short_desc : _("Unset"));
+              g_print (_("Long Desc: %s\n"), long_desc ? long_desc : _("Unset"));
             }
 
           gconf_value_free(value);
@@ -1578,12 +1578,12 @@
         {
           if (err == NULL)
             {
-              fprintf(stderr, _("No value set for `%s'\n"), *args);
+              g_printerr (_("No value set for `%s'\n"), *args);
             }
           else
             {
-              fprintf(stderr, _("Failed to get value for `%s': %s\n"),
-                      *args, err->message);
+              g_printerr (_("Failed to get value for `%s': %s\n"),
+			  *args, err->message);
               g_error_free(err);
               err = NULL;
             }
@@ -1625,7 +1625,7 @@
 	  type = GCONF_VALUE_SCHEMA;
 	  break;
 	default:
-	  fprintf(stderr, _("Don't understand type `%s'\n"), string);
+	  g_printerr (_("Don't understand type `%s'\n"), string);
 	}
       break;
     case 'l':
@@ -1637,7 +1637,7 @@
       type = GCONF_VALUE_PAIR;
       break;
     default:
-      fprintf(stderr, _("Don't understand type `%s'\n"), string);
+      g_printerr (_("Don't understand type `%s'\n"), string);
     }
   return type;
 }
@@ -1649,7 +1649,7 @@
   
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify alternating keys/values as arguments\n"));
+      g_printerr (_("Must specify alternating keys/values as arguments\n"));
       return 1;
     }
 
@@ -1669,7 +1669,7 @@
 
       if (value == NULL)
         {
-          fprintf(stderr, _("No value to set for key: `%s'\n"), key);
+          g_printerr (_("No value to set for key: `%s'\n"), key);
           return 1;
         }
 
@@ -1697,7 +1697,7 @@
 
       if (type == GCONF_VALUE_SCHEMA)
         {
-          fprintf(stderr, _("Cannot set schema as value\n"));
+          g_printerr (_("Cannot set schema as value\n"));
           return 1;
 	}
 
@@ -1707,7 +1707,7 @@
           list_type != GCONF_VALUE_FLOAT &&
           list_type != GCONF_VALUE_BOOL)
         {
-          fprintf(stderr, _("When setting a list you must specify a primitive list-type\n"));
+          g_printerr (_("When setting a list you must specify a primitive list-type\n"));
           return 1;
 	}
 
@@ -1721,7 +1721,7 @@
             cdr_type != GCONF_VALUE_FLOAT &&
             cdr_type != GCONF_VALUE_BOOL)))
         {
-          fprintf(stderr, _("When setting a pair you must specify a primitive car-type and cdr-type\n"));
+          g_printerr (_("When setting a pair you must specify a primitive car-type and cdr-type\n"));
           return 1;
 	}
 
@@ -1736,8 +1736,8 @@
 
       if (gval == NULL)
         {
-          fprintf(stderr, _("Error: %s\n"),
-                  err->message);
+          g_printerr (_("Error: %s\n"),
+		      err->message);
           g_error_free(err);
           err = NULL;
           return 1;
@@ -1749,8 +1749,8 @@
 
       if (err != NULL)
         {
-          fprintf(stderr, _("Error setting value: %s\n"),
-                  err->message);
+          g_printerr (_("Error setting value: %s\n"),
+		      err->message);
           g_error_free(err);
           err = NULL;
           return 1;
@@ -1767,8 +1767,8 @@
 
   if (err != NULL)
     {
-      fprintf(stderr, _("Error syncing: %s\n"),
-              err->message);
+      g_printerr (_("Error syncing: %s\n"),
+		  err->message);
       return 1;
     }
 
@@ -1782,7 +1782,7 @@
 
   if (args == NULL)
     {
-      fprintf (stderr, _("Must specify a key or keys to get type\n"));
+      g_printerr (_("Must specify a key or keys to get type\n"));
       return 1;
     }
       
@@ -1796,18 +1796,18 @@
          
       if (value != NULL)
 	{
-	  printf("%s\n", gconf_value_type_to_string (value->type));
+	  g_print ("%s\n", gconf_value_type_to_string (value->type));
 	}
       else
         {
           if (err == NULL)
             {
-              fprintf (stderr, _("No value set for `%s'\n"), *args);
+              g_printerr (_("No value set for `%s'\n"), *args);
             }
           else
             {
-              fprintf (stderr, _("Failed to get value for `%s': %s\n"),
-                      *args, err->message);
+              g_printerr (_("Failed to get value for `%s': %s\n"),
+			  *args, err->message);
               g_error_free (err);
               err = NULL;
             }
@@ -1826,7 +1826,7 @@
 
   if (args == NULL || *args == NULL)
     {
-      fprintf (stderr, _("Must specify a key to lookup size of.\n"));
+      g_printerr (_("Must specify a key to lookup size of.\n"));
       return 1;
     }
 
@@ -1836,12 +1836,12 @@
     {
       if (err == NULL)
 	{
-	  fprintf (stderr, _("No value set for `%s'\n"), *args);
+	  g_printerr (_("No value set for `%s'\n"), *args);
 	}
       else
 	{
-	  fprintf (stderr, _("Failed to get value for `%s': %s\n"),
-		  *args, err->message);
+	  g_printerr (_("Failed to get value for `%s': %s\n"),
+		      *args, err->message);
 	  g_error_free (err);
 	  err = NULL;
 	}
@@ -1851,11 +1851,11 @@
 
   if (list->type != GCONF_VALUE_LIST)
     {
-      fprintf (stderr, _("Key %s is not a list.\n"), *args);
+      g_printerr (_("Key %s is not a list.\n"), *args);
       return 1;
     }
 
-  printf ("%u\n", g_slist_length (gconf_value_get_list (list)));
+  g_print ("%u\n", g_slist_length (gconf_value_get_list (list)));
 
   return 0;
 }
@@ -1871,7 +1871,7 @@
 
   if (args == NULL || *args == NULL)
     {
-      fprintf (stderr, _("Must specify a key from which to get list element.\n"));
+      g_printerr (_("Must specify a key from which to get list element.\n"));
       return 1;
     }
 
@@ -1881,12 +1881,12 @@
     {
       if (err == NULL)
 	{
-	  fprintf (stderr, _("No value set for `%s'\n"), *args);
+	  g_printerr (_("No value set for `%s'\n"), *args);
 	}
       else
 	{
-	  fprintf (stderr, _("Failed to get value for `%s': %s\n"),
-		  *args, err->message);
+	  g_printerr (_("Failed to get value for `%s': %s\n"),
+		      *args, err->message);
 	  g_error_free (err);
 	  err = NULL;
 	}
@@ -1896,20 +1896,20 @@
 
   if (list->type != GCONF_VALUE_LIST)
     {
-      fprintf (stderr, _("Key %s is not a list.\n"), *args);
+      g_printerr (_("Key %s is not a list.\n"), *args);
       return 1;
     }
 
   if (args[1] == NULL)
     {
-      fprintf (stderr, _("Must specify list index.\n"));
+      g_printerr (_("Must specify list index.\n"));
       return 1;
     }
 
   idx = atoi (args[1]);
   if (idx < 0)
     {
-      fprintf (stderr, _("List index must be non-negative.\n"));
+      g_printerr (_("List index must be non-negative.\n"));
       return 1;
     }
 
@@ -1918,12 +1918,12 @@
 
   if (element == NULL)
     {
-      fprintf (stderr, _("List index is out of bounds.\n"));
+      g_printerr (_("List index is out of bounds.\n"));
       return 1;
     }
 
   s = gconf_value_to_string (element);
-  printf ("%s\n", s);
+  g_print ("%s\n", s);
   g_free (s);
 
   return 0;
@@ -1944,7 +1944,7 @@
 
   if (args == NULL)
     {
-      fprintf (stderr, _("Must specify a key or keys on the command line\n"));
+      g_printerr (_("Must specify a key or keys on the command line\n"));
       return 1;
     }
       
@@ -1964,11 +1964,11 @@
 
           if (s == NULL)
             {
-              fprintf (stderr, _("No schema known for `%s'\n"), *args);
+              g_printerr (_("No schema known for `%s'\n"), *args);
             }
           else if (info == SCHEMA_INFO_SCHEMA_NAME)
             {
-              printf ("%s\n", s);
+              g_print ("%s\n", s);
             }
           else
             {
@@ -1995,25 +1995,25 @@
                     }
                   
                   if (docs)
-                    printf ("%s\n", docs);
+                    g_print ("%s\n", docs);
                   else
-                    fprintf (stderr, _("No doc string stored in schema at '%s'\n"),
+                    g_printerr (_("No doc string stored in schema at '%s'\n"),
                              s);
                 }
               else if (err != NULL)
                 {
-                  fprintf (stderr, _("Error getting schema at '%s': %s\n"),
-                           s, err->message);
+                  g_printerr (_("Error getting schema at '%s': %s\n"),
+			      s, err->message);
                   g_error_free (err);
                 }
               else
                 {
                   if (val == NULL)
-                    fprintf (stderr, _("No schema stored at '%s'\n"),
-                             s);
+                    g_printerr (_("No schema stored at '%s'\n"),
+				s);
                   else
-                    fprintf (stderr, _("Value at '%s' is not a schema\n"),
-                             s);
+                    g_printerr (_("Value at '%s' is not a schema\n"),
+				s);
                 }
 
               if (val)
@@ -2026,12 +2026,12 @@
         {
           if (err == NULL)
             {
-              fprintf(stderr, _("No value set for `%s'\n"), *args);
+              g_printerr (_("No value set for `%s'\n"), *args);
             }
           else
             {
-              fprintf(stderr, _("Failed to get value for `%s': %s\n"),
-                      *args, err->message);
+              g_printerr (_("Failed to get value for `%s': %s\n"),
+			  *args, err->message);
               g_error_free(err);
               err = NULL;
             }
@@ -2068,15 +2068,15 @@
   
   if (args[0] == NULL || args[1] == NULL || args[2] != NULL)
     {
-      fprintf (stderr, _("Must specify a schema name followed by the key name to apply it to\n"));
+      g_printerr (_("Must specify a schema name followed by the key name to apply it to\n"));
       return 1;
     }
 
   err = NULL;
   if (!gconf_engine_associate_schema (conf, args[1], args[0], &err))
     {
-      fprintf (stderr, _("Error associating schema name '%s' with key name '%s': %s\n"),
-               args[0], args[1], err->message);
+      g_printerr (_("Error associating schema name '%s' with key name '%s': %s\n"),
+		  args[0], args[1], err->message);
       g_error_free (err);
 
       return 1;
@@ -2093,7 +2093,7 @@
   
   if (args[0] == NULL)
     {
-      fprintf (stderr, _("Must specify a schema name followed by the key name to apply it to\n"));
+      g_printerr (_("Must specify a schema name followed by the key name to apply it to\n"));
       return 1;
     }
 
@@ -2103,8 +2103,8 @@
       err = NULL;
       if (!gconf_engine_associate_schema (conf, *args, NULL, &err))
         {
-          fprintf (stderr, _("Error removing schema name from '%s': %s\n"),
-                   *args, err->message);
+          g_printerr (_("Error removing schema name from '%s': %s\n"),
+		      *args, err->message);
           g_error_free (err);
           failed = TRUE;
         }
@@ -2128,7 +2128,7 @@
   
   if ((args == NULL) || (args[1] != NULL))
     {
-      fprintf(stderr, _("Must specify key (schema name) as the only argument\n"));
+      g_printerr (_("Must specify key (schema name) as the only argument\n"));
       return 1;
     }
       
@@ -2170,7 +2170,7 @@
           type != GCONF_VALUE_FLOAT &&
           type != GCONF_VALUE_BOOL)
 	{
-          fprintf(stderr, _("List type must be a primitive type: string, int, float or bool\n"));
+          g_printerr (_("List type must be a primitive type: string, int, float or bool\n"));
           return 1;
 
 	}
@@ -2190,7 +2190,7 @@
           type != GCONF_VALUE_FLOAT &&
           type != GCONF_VALUE_BOOL)
 	{
-          fprintf(stderr, _("Pair car type must be a primitive type: string, int, float or bool\n"));
+          g_printerr (_("Pair car type must be a primitive type: string, int, float or bool\n"));
           return 1;
 
 	}
@@ -2210,7 +2210,7 @@
           type != GCONF_VALUE_FLOAT &&
           type != GCONF_VALUE_BOOL)
 	{
-          fprintf(stderr, _("Pair cdr type must be a primitive type: string, int, float or bool\n"));
+          g_printerr (_("Pair cdr type must be a primitive type: string, int, float or bool\n"));
           return 1;
 
 	}
@@ -2225,8 +2225,8 @@
       
   if (err != NULL)
     {
-      fprintf(stderr, _("Error setting value: %s"),
-              err->message);
+      g_printerr (_("Error setting value: %s"),
+		  err->message);
       g_error_free(err);
       err = NULL;
       return 1;
@@ -2239,8 +2239,8 @@
       
   if (err != NULL)
     {
-      fprintf(stderr, _("Error syncing: %s"),
-              err->message);
+      g_printerr (_("Error syncing: %s"),
+		  err->message);
       g_error_free(err);
       err = NULL;
       return 1;
@@ -2254,7 +2254,7 @@
 {
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify one or more dirs to get key/value pairs from.\n"));
+      g_printerr (_("Must specify one or more dirs to get key/value pairs from.\n"));
       return 1;
     }
   
@@ -2268,7 +2268,7 @@
   
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify one or more keys to unset.\n"));
+      g_printerr (_("Must specify one or more keys to unset.\n"));
       return 1;
     }
 
@@ -2279,8 +2279,8 @@
 
       if (err != NULL)
         {
-          fprintf(stderr, _("Error unsetting `%s': %s\n"),
-                  *args, err->message);
+          g_printerr (_("Error unsetting `%s': %s\n"),
+		      *args, err->message);
           g_error_free(err);
           err = NULL;
         }
@@ -2299,7 +2299,7 @@
 {
   if (args == NULL)
     {
-      fprintf (stderr, _("Must specify one or more keys to recursively unset.\n"));
+      g_printerr (_("Must specify one or more keys to recursively unset.\n"));
       return 1;
     }  
       
@@ -2313,8 +2313,8 @@
                                     &err);
       if (err != NULL)
         {
-          fprintf (stderr, _("Failure during recursive unset of \"%s\": %s\n"),
-                   *args, err->message);
+          g_printerr (_("Failure during recursive unset of \"%s\": %s\n"),
+		      *args, err->message);
           g_error_free (err);
         }
       
@@ -2331,7 +2331,7 @@
   
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify one or more dirs to get subdirs from.\n"));
+      g_printerr (_("Must specify one or more dirs to get subdirs from.\n"));
       return 1;
     }
       
@@ -2352,7 +2352,7 @@
             {
               gchar* s = tmp->data;
 
-              printf(" %s\n", s);
+              g_print (" %s\n", s);
 
               g_free(s);
 
@@ -2365,8 +2365,8 @@
         {
           if (err != NULL)
             {
-              fprintf(stderr, _("Error listing dirs: %s\n"),
-                      err->message);
+              g_printerr (_("Error listing dirs: %s\n"),
+			  err->message);
               g_error_free(err);
               err = NULL;
             }
@@ -2407,7 +2407,7 @@
   list_type_str = xmlGetProp(node, "type");
   if (!list_type_str)
     {
-      fprintf(stderr, "WARNING: must specify a list type for using <list type=\"type\">\n");
+      g_printerr ("WARNING: must specify a list type for using <list type=\"type\">\n");
       return 1;
     }
 
@@ -2417,7 +2417,7 @@
 
   if (list_type == GCONF_VALUE_INVALID)
     {
-      fprintf(stderr, "WARNING: invalid list type '%s'\n", list_type_str);
+      g_printerr ("WARNING: invalid list type '%s'\n", list_type_str);
       return 1;
     }
 
@@ -2434,9 +2434,9 @@
               if (element->type == list_type)
                 list = g_slist_prepend (list, element);
               else
-                fprintf(stderr, "WARNING: list type and element type do not match: %s != %s\n",
-			gconf_value_type_to_string (list_type),
-			gconf_value_type_to_string (element->type));
+                g_printerr ("WARNING: list type and element type do not match: %s != %s\n",
+			    gconf_value_type_to_string (list_type),
+			    gconf_value_type_to_string (element->type));
             }
         }
 
@@ -2501,7 +2501,7 @@
     }
   else
     {
-      fprintf(stderr, _("WARNING: must specify both a <car> and a <cdr> in a <pair>\n"));
+      g_printerr (_("WARNING: must specify both a <car> and a <cdr> in a <pair>\n"));
       retval = 1;
     }
 
@@ -2528,8 +2528,8 @@
     return 1;
     
   if (schema_key != NULL)
-    fprintf(stderr, _("WARNING: key specified (%s) for schema under a <value> - ignoring\n"),
-            schema_key);
+    g_printerr (_("WARNING: key specified (%s) for schema under a <value> - ignoring\n"),
+		schema_key);
     
   g_hash_table_foreach(schemas_hash, hash_listify_foreach, &values);
     
@@ -2561,13 +2561,13 @@
 
   if (!iter)
     {
-      fprintf(stderr, _("WARNING: must have a child node under <value>\n"));
+      g_printerr (_("WARNING: must have a child node under <value>\n"));
       return 1;
     }
 
   if (strcmp(node->name, "value") != 0)
     {
-      fprintf(stderr, _("WARNING: node <%s> not understood\n"), node->name);
+      g_printerr (_("WARNING: node <%s> not understood\n"), node->name);
       return 1;
     }
 
@@ -2585,7 +2585,7 @@
                 {
                   g_assert(error != NULL);
     
-                  fprintf(stderr, _("WARNING: Failed to parse int value `%s'\n"), content);
+                  g_printerr (_("WARNING: Failed to parse int value `%s'\n"), content);
     
                   g_error_free(error);
                   error = NULL;
@@ -2606,7 +2606,7 @@
                 {
                   g_assert(error != NULL);
     
-                  fprintf(stderr, _("WARNING: Failed to parse float value `%s'\n"), content);
+                  g_printerr (_("WARNING: Failed to parse float value `%s'\n"), content);
     
                   g_error_free(error);
                   error = NULL;
@@ -2628,7 +2628,7 @@
                 {
                   g_assert(error != NULL);
     
-                  fprintf(stderr, _("WARNING: Failed to parse string value `%s'\n"), content);
+                  g_printerr (_("WARNING: Failed to parse string value `%s'\n"), content);
     
                   g_error_free(error);
                   error = NULL;
@@ -2649,7 +2649,7 @@
                 {
                   g_assert(error != NULL);
     
-                  fprintf(stderr, _("WARNING: Failed to parse boolean value `%s'\n"), content);
+                  g_printerr (_("WARNING: Failed to parse boolean value `%s'\n"), content);
     
                   g_error_free(error);
                   error = NULL;
@@ -2765,8 +2765,8 @@
             {
               g_assert(error != NULL);
           
-              fprintf(stderr, _("WARNING: failed to associate schema `%s' with key `%s': %s\n"),
-                      full_schema_key, full_key, error->message);
+              g_printerr (_("WARNING: failed to associate schema `%s' with key `%s': %s\n"),
+			  full_schema_key, full_key, error->message);
               g_error_free(error);
             }
         }
@@ -2775,7 +2775,7 @@
       gconf_engine_set(conf, full_key, value, &error);
       if (error != NULL)
         {
-          fprintf(stderr, _("Error setting value: %s\n"), error->message);
+          g_printerr (_("Error setting value: %s\n"), error->message);
           g_error_free(error);
           error = NULL;
         }
@@ -2870,7 +2870,7 @@
   switch (info->type)
     {
     case GCONF_VALUE_INVALID:
-      fprintf(stderr, _("WARNING: invalid or missing type for schema (%s)\n"),
+      g_printerr (_("WARNING: invalid or missing type for schema (%s)\n"),
               info->key);
       break;
 
@@ -2879,7 +2879,7 @@
         GError* error = NULL;
         if (info->list_type == GCONF_VALUE_INVALID)
 	  {
-            fprintf(stderr, _("WARNING: invalid or missing list_type for schema (%s)\n"),
+            g_printerr (_("WARNING: invalid or missing list_type for schema (%s)\n"),
                     info->key);
             break;
 	  }
@@ -2890,7 +2890,7 @@
           {
             g_assert(error != NULL);
 
-            fprintf(stderr, _("WARNING: Failed to parse default value `%s' for schema (%s)\n"), default_value, info->key);
+            g_printerr (_("WARNING: Failed to parse default value `%s' for schema (%s)\n"), default_value, info->key);
 
             g_error_free(error);
             error = NULL;
@@ -2908,8 +2908,8 @@
         if (info->car_type == GCONF_VALUE_INVALID ||
 	    info->cdr_type == GCONF_VALUE_INVALID)
 	  {
-            fprintf(stderr, _("WARNING: invalid or missing car_type or cdr_type for schema (%s)\n"),
-                    info->key);
+            g_printerr (_("WARNING: invalid or missing car_type or cdr_type for schema (%s)\n"),
+			info->key);
             break;
 	  }
         *retloc = gconf_value_new_pair_from_string(info->car_type,
@@ -2920,7 +2920,7 @@
           {
             g_assert(error != NULL);
 
-            fprintf(stderr, _("WARNING: Failed to parse default value `%s' for schema (%s)\n"), default_value, info->key);
+            g_printerr (_("WARNING: Failed to parse default value `%s' for schema (%s)\n"), default_value, info->key);
 
             g_error_free(error);
             error = NULL;
@@ -2933,7 +2933,7 @@
       break;
 
     case GCONF_VALUE_SCHEMA:
-      fprintf(stderr, _("WARNING: You cannot set a default value for a schema\n"));
+      g_printerr (_("WARNING: You cannot set a default value for a schema\n"));
       break;
 
     case GCONF_VALUE_STRING:
@@ -2949,7 +2949,7 @@
           {
             g_assert(error != NULL);
 
-            fprintf(stderr, _("WARNING: Failed to parse default value `%s' for schema (%s)\n"), default_value, info->key);
+            g_printerr (_("WARNING: Failed to parse default value `%s' for schema (%s)\n"), default_value, info->key);
 
             g_error_free(error);
             error = NULL;
@@ -2962,7 +2962,7 @@
       break;
       
     default:
-      fprintf(stderr, _("WARNING: gconftool internal error, unknown GConfValueType\n"));
+      g_printerr (_("WARNING: gconftool internal error, unknown GConfValueType\n"));
       break;
     }
 
@@ -3010,8 +3010,8 @@
                 {
                   info->type = gconf_value_type_from_string(tmp);
                   if (info->type == GCONF_VALUE_INVALID)
-                    fprintf(stderr, _("WARNING: failed to parse type name `%s'\n"),
-                            tmp);
+                    g_printerr (_("WARNING: failed to parse type name `%s'\n"),
+				tmp);
                   xmlFree(tmp);
                 }
             }
@@ -3027,12 +3027,12 @@
 		      info->list_type != GCONF_VALUE_BOOL)
 		    {
 		      info->list_type = GCONF_VALUE_INVALID;
-                      fprintf(stderr, _("WARNING: list_type can only be int, float, string or bool and not `%s'\n"),
-                              tmp);
+                      g_printerr (_("WARNING: list_type can only be int, float, string or bool and not `%s'\n"),
+				  tmp);
 		    }
                   else if (info->list_type == GCONF_VALUE_INVALID)
-                    fprintf(stderr, _("WARNING: failed to parse type name `%s'\n"),
-                            tmp);
+                    g_printerr (_("WARNING: failed to parse type name `%s'\n"),
+				tmp);
     		  xmlFree(tmp);
                 }
             }
@@ -3048,12 +3048,12 @@
 		      info->car_type != GCONF_VALUE_BOOL)
 		    {
 		      info->car_type = GCONF_VALUE_INVALID;
-                      fprintf(stderr, _("WARNING: car_type can only be int, float, string or bool and not `%s'\n"),
-                              tmp);
+                      g_printerr (_("WARNING: car_type can only be int, float, string or bool and not `%s'\n"),
+				  tmp);
 		    }
                   else if (info->car_type == GCONF_VALUE_INVALID)
-                    fprintf(stderr, _("WARNING: failed to parse type name `%s'\n"),
-                            tmp);
+                    g_printerr (_("WARNING: failed to parse type name `%s'\n"),
+				tmp);
                   xmlFree(tmp);
                 }
             }
@@ -3069,12 +3069,12 @@
 		      info->cdr_type != GCONF_VALUE_BOOL)
 		    {
 		      info->cdr_type = GCONF_VALUE_INVALID;
-                      fprintf(stderr, _("WARNING: cdr_type can only be int, float, string or bool and not `%s'\n"),
-                              tmp);
+                      g_printerr (_("WARNING: cdr_type can only be int, float, string or bool and not `%s'\n"),
+				  tmp);
 		    }
                   else if (info->cdr_type == GCONF_VALUE_INVALID)
-                    fprintf(stderr, _("WARNING: failed to parse type name `%s'\n"),
-                            tmp);
+                    g_printerr (_("WARNING: failed to parse type name `%s'\n"),
+				tmp);
                   xmlFree(tmp);
                 }
             }
@@ -3109,11 +3109,11 @@
                   xmlFree(tmp);
                 }
               else
-                fprintf(stderr, _("WARNING: empty <applyto> node"));
+                g_printerr (_("WARNING: empty <applyto> node"));
             }
           else
-            fprintf(stderr, _("WARNING: node <%s> not understood below <schema>\n"),
-                    iter->name);
+            g_printerr (_("WARNING: node <%s> not understood below <schema>\n"),
+			iter->name);
 
         }
       
@@ -3123,19 +3123,19 @@
   if (info->type == GCONF_VALUE_LIST &&
       info->list_type == GCONF_VALUE_INVALID)
     {
-      fprintf(stderr, _("WARNING: no <list_type> specified for schema of type list\n"));
+      g_printerr (_("WARNING: no <list_type> specified for schema of type list\n"));
     }
 
   if (info->type == GCONF_VALUE_PAIR &&
       info->car_type == GCONF_VALUE_INVALID)
     {
-      fprintf(stderr, _("WARNING: no <car_type> specified for schema of type pair\n"));
+      g_printerr (_("WARNING: no <car_type> specified for schema of type pair\n"));
     }
 
   if (info->type == GCONF_VALUE_PAIR &&
       info->cdr_type == GCONF_VALUE_INVALID)
     {
-      fprintf(stderr, _("WARNING: no <cdr_type> specified for schema of type pair\n"));
+      g_printerr (_("WARNING: no <cdr_type> specified for schema of type pair\n"));
     }
   
   if (default_value_node != NULL)
@@ -3164,14 +3164,14 @@
 
   if (name == NULL)
     {
-      fprintf(stderr, _("WARNING: <locale> node has no `name=\"locale\"' attribute, ignoring\n"));
+      g_printerr (_("WARNING: <locale> node has no `name=\"locale\"' attribute, ignoring\n"));
       return 1;
     }
 
   if (g_hash_table_lookup(info->hash, name) != NULL)
     {
-      fprintf(stderr, _("WARNING: multiple <locale> nodes for locale `%s', ignoring all past first\n"),
-              name);
+      g_printerr (_("WARNING: multiple <locale> nodes for locale `%s', ignoring all past first\n"),
+		  name);
       xmlFree(name);
       return 1;
     }
@@ -3268,8 +3268,8 @@
             }
           else
             {
-              fprintf(stderr, _("WARNING: Invalid node <%s> in a <locale> node\n"),
-                      iter->name);
+              g_printerr (_("WARNING: Invalid node <%s> in a <locale> node\n"),
+			  iter->name);
             }
         }
       
@@ -3301,16 +3301,16 @@
         {
           g_assert(error != NULL);
           
-          fprintf(stderr, _("WARNING: failed to associate schema `%s' with key `%s': %s\n"),
-                  schema_name, (gchar*)tmp->data, error->message);
+          g_printerr (_("WARNING: failed to associate schema `%s' with key `%s': %s\n"),
+		      schema_name, (gchar*)tmp->data, error->message);
           g_error_free(error);
           error = NULL;
         }
       else
         {
           g_assert(error == NULL);
-          printf(_("Attached schema `%s' to key `%s'\n"),
-                 schema_name, (gchar*)tmp->data);
+          g_print (_("Attached schema `%s' to key `%s'\n"),
+		   schema_name, (gchar*)tmp->data);
         }
           
       tmp = g_slist_next(tmp);
@@ -3374,8 +3374,8 @@
               process_locale_info(iter, &info);
             }
           else
-            fprintf(stderr, _("WARNING: node <%s> not understood below <schema>\n"),
-                    iter->name);
+            g_printerr (_("WARNING: node <%s> not understood below <schema>\n"),
+			iter->name);
         }
           
       iter = iter->next;
@@ -3383,7 +3383,7 @@
 
   if (g_hash_table_size(info.hash) == 0)
     {
-      fprintf(stderr, _("You must have at least one <locale> entry in a <schema>\n"));
+      g_printerr (_("You must have at least one <locale> entry in a <schema>\n"));
       return 1;
     }
 
@@ -3415,16 +3415,16 @@
     {
       g_assert(error != NULL);
 
-      fprintf(stderr, _("WARNING: failed to install schema `%s' locale `%s': %s\n"),
-              info->key, gconf_schema_get_locale(schema), error->message);
+      g_printerr (_("WARNING: failed to install schema `%s' locale `%s': %s\n"),
+		  info->key, gconf_schema_get_locale(schema), error->message);
       g_error_free(error);
       error = NULL;
     }
   else
     {
       g_assert(error == NULL);
-      printf(_("Installed schema `%s' for locale `%s'\n"),
-             info->key, gconf_schema_get_locale(schema));
+      g_print (_("Installed schema `%s' for locale `%s'\n"),
+	       info->key, gconf_schema_get_locale(schema));
     }
 
   gconf_schema_free(schema);
@@ -3447,16 +3447,16 @@
     {
       g_assert(error != NULL);
 
-      fprintf(stderr, _("WARNING: failed to uninstall schema `%s' locale `%s': %s\n"),
-              info->key, gconf_schema_get_locale(schema), error->message);
+      g_printerr (_("WARNING: failed to uninstall schema `%s' locale `%s': %s\n"),
+		  info->key, gconf_schema_get_locale(schema), error->message);
       g_error_free(error);
       error = NULL;
     }
   else
     {
       g_assert(error == NULL);
-      printf(_("Uninstalled schema `%s' from locale `%s'\n"),
-             info->key, gconf_schema_get_locale(schema));
+      g_print (_("Uninstalled schema `%s' from locale `%s'\n"),
+	       info->key, gconf_schema_get_locale(schema));
     }
 
   gconf_schema_free(schema);
@@ -3493,7 +3493,7 @@
     }
   else
     {
-      fprintf(stderr, _("WARNING: no key specified for schema\n"));
+      g_printerr (_("WARNING: no key specified for schema\n"));
       retval = 1;
     }
 
@@ -3534,8 +3534,8 @@
           else if (load_type == LOAD_ENTRY_FILE && strcmp(iter->name, "entry") == 0)
             process_entry(conf, iter, base_dirs, orig_base);
           else
-            fprintf(stderr, _("WARNING: node <%s> not understood below <%s>\n"),
-                    iter->name, LOAD_TYPE_TO_LIST(load_type));
+            g_printerr (_("WARNING: node <%s> not understood below <%s>\n"),
+			iter->name, LOAD_TYPE_TO_LIST(load_type));
         }
       
       iter = iter->next;
@@ -3565,15 +3565,15 @@
   if (doc == NULL)
     {
       if (errno != 0)
-        fprintf(stderr, _("Failed to open `%s': %s\n"),
-                file, strerror(errno));
+        g_printerr (_("Failed to open `%s': %s\n"),
+		    file, strerror(errno));
       return 1;
     }
 
   if (doc->xmlRootNode == NULL)
     {
-      fprintf(stderr, _("Document `%s' is empty?\n"),
-              file);
+      g_printerr (_("Document `%s' is empty?\n"),
+		  file);
       return 1;
     }
 
@@ -3584,8 +3584,8 @@
         { 
           if (strcmp(iter->name, LOAD_TYPE_TO_ROOT(load_type)) != 0)
             {
-              fprintf(stderr, _("Document `%s' has the wrong type of root node (<%s>, should be <%s>)\n"),
-                      file, iter->name, LOAD_TYPE_TO_ROOT(load_type));
+              g_printerr (_("Document `%s' has the wrong type of root node (<%s>, should be <%s>)\n"),
+			  file, iter->name, LOAD_TYPE_TO_ROOT(load_type));
               return 1;
             }
           else
@@ -3597,8 +3597,8 @@
   
   if (iter == NULL)
     {
-      fprintf(stderr, _("Document `%s' has no top level <%s> node\n"),
-              file, LOAD_TYPE_TO_ROOT(load_type));
+      g_printerr (_("Document `%s' has no top level <%s> node\n"),
+		  file, LOAD_TYPE_TO_ROOT(load_type));
       return 1;
     }
 
@@ -3611,8 +3611,8 @@
           if (strcmp(iter->name, LOAD_TYPE_TO_LIST(load_type)) == 0)
             process_list(conf, load_type, iter, base_dirs);
           else
-            fprintf(stderr, _("WARNING: node <%s> below <%s> not understood\n"),
-                    iter->name, LOAD_TYPE_TO_ROOT(load_type));
+            g_printerr (_("WARNING: node <%s> below <%s> not understood\n"),
+			iter->name, LOAD_TYPE_TO_ROOT(load_type));
         }
           
       iter = iter->next;
@@ -3622,8 +3622,8 @@
 
   if (err != NULL)
     {
-      fprintf(stderr, _("Error syncing config data: %s"),
-              err->message);
+      g_printerr (_("Error syncing config data: %s"),
+		  err->message);
       g_error_free(err);
       return 1;
     }
@@ -3641,7 +3641,7 @@
   
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify some schema files to install\n"));
+      g_printerr (_("Must specify some schema files to install\n"));
       return 1;
     }
 
@@ -3657,8 +3657,8 @@
 
   if (err != NULL)
     {
-      fprintf(stderr, _("Error syncing config data: %s"),
-              err->message);
+      g_printerr (_("Error syncing config data: %s"),
+		  err->message);
       g_error_free(err);
       return 1;
     }
@@ -3673,7 +3673,7 @@
   
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify some schema files to uninstall\n"));
+      g_printerr (_("Must specify some schema files to uninstall\n"));
       return 1;
     }
 
@@ -3689,8 +3689,8 @@
 
   if (err != NULL)
     {
-      fprintf(stderr, _("Error syncing config data: %s"),
-              err->message);
+      g_printerr (_("Error syncing config data: %s"),
+		  err->message);
       g_error_free(err);
       return 1;
     }
@@ -3706,12 +3706,12 @@
 static gboolean
 check_err(GError** err)
 {
-  printf(".");
+  g_print (".");
   
   if (*err != NULL)
     {
-      fprintf(stderr, _("\n%s\n"),
-              (*err)->message);
+      g_printerr (_("\n%s\n"),
+		  (*err)->message);
       g_error_free(*err);
       *err = NULL;
       return TRUE;
@@ -3730,8 +3730,8 @@
       gconf_engine_unset(conf, key, &error);
       if (error != NULL)
         {
-          fprintf(stderr, _("Failed to unset breakage key %s: %s\n"),
-                  key, error->message);
+          g_printerr (_("Failed to unset breakage key %s: %s\n"),
+		      key, error->message);
           g_error_free(error);
           return FALSE;
         }
@@ -3745,7 +3745,7 @@
       GConfValue* val;
       GSList* list = NULL;
       
-      printf("  +");
+      g_print ("  +");
       
       gconf_engine_set_string(conf, key, "", &error);
       if (check_err(&error))
@@ -3843,7 +3843,7 @@
       g_slist_free(list);
       list = NULL;
       
-      printf("\n");
+      g_print ("\n");
     }
   else
     g_assert_not_reached();
@@ -3856,13 +3856,13 @@
 {
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify some keys to break\n"));
+      g_printerr (_("Must specify some keys to break\n"));
       return 1;
     }
   
   while (*args)
     {
-      printf(_("Trying to break your application by setting bad values for key:\n  %s\n"), *args);
+      g_print (_("Trying to break your application by setting bad values for key:\n  %s\n"), *args);
       
       if (!key_breakage(conf, *args, BreakageSetBadValues))
         return 1;
@@ -3880,7 +3880,7 @@
 {
   if (args == NULL)
     {
-      fprintf(stderr, _("Must specify some directories to break\n"));
+      g_printerr (_("Must specify some directories to break\n"));
       return 1;
     }
   
@@ -3899,7 +3899,7 @@
           ++i;
         }
 
-      printf(_("Trying to break your application by setting bad values for keys in directory:\n  %s\n"), *args);
+      g_print (_("Trying to break your application by setting bad values for keys in directory:\n  %s\n"), *args);
 
       i = 0;
       while (i < 10)
@@ -3953,7 +3953,7 @@
 	  g_strchomp(source);
 	  if (*source != '\0')
 	    {
-	      printf("%s\n", source);
+	      g_print ("%s\n", source);
 	      return 0;
 	    }
 	}
@@ -3961,7 +3961,7 @@
 
   /* Use default database */
   source = g_strconcat("xml::", GCONF_ETCDIR, "/gconf.xml.defaults", NULL);
-  printf("%s\n", source);
+  g_print ("%s\n", source);
   g_free(source);
 
   return 0;
--- GConf-2.3.3/gconf/gconf-internals.c.gprint	2003-05-21 20:12:47.000000000 +0200
+++ GConf-2.3.3/gconf/gconf-internals.c	2003-07-30 14:27:02.000000000 +0200
@@ -1138,13 +1138,13 @@
         case GCL_CRIT:
         case GCL_ERR:
         case GCL_WARNING:
-          fprintf(stderr, "%s\n", msg);
+          g_printerr("%s\n", msg);
           break;
       
         case GCL_NOTICE:
         case GCL_INFO:
         case GCL_DEBUG:
-          printf("%s\n", msg);
+          g_print("%s\n", msg);
           break;
 
         default:
--- GConf-2.3.3/gconf/gconfd.c.gprint	2003-05-21 20:12:47.000000000 +0200
+++ GConf-2.3.3/gconf/gconfd.c	2003-07-30 14:27:02.000000000 +0200
@@ -542,8 +542,8 @@
    */
   if (chdir ("/") < 0)
     {
-       fprintf (stderr, "Could not change to root directory: %s\n",
-		g_strerror (errno));
+       g_printerr ("Could not change to root directory: %s\n",
+		   g_strerror (errno));
        exit (1);
     }
 
--- GConf-2.3.3/gconf/gconf-client.c.gprint	2003-06-23 23:16:37.000000000 +0200
+++ GConf-2.3.3/gconf/gconf-client.c	2003-07-30 14:27:02.000000000 +0200
@@ -340,8 +340,8 @@
               error->code == GCONF_ERROR_NO_WRITABLE_DATABASE)
             return;
           
-          fprintf (stderr, _("GConf Error: %s\n"),
-                   error->message);
+          g_printerr (_("GConf Error: %s\n"),
+                      error->message);
         }
     }
 }
@@ -358,8 +358,8 @@
         }
       else
         {
-          fprintf (stderr, _("GConf Error: %s\n"),
-                   error->message);
+          g_printerr (_("GConf Error: %s\n"),
+                      error->message);
         }
     }
 }
@@ -895,8 +895,8 @@
   
   if (error != NULL)
     {
-      fprintf(stderr, _("GConf warning: failure listing pairs in `%s': %s"),
-              dir, error->message);
+      g_printerr(_("GConf warning: failure listing pairs in `%s': %s"),
+                 dir, error->message);
       g_error_free(error);
       error = NULL;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]