+2008-11-28 Behdad Esfahbod <behdad@gnome.org>
+
+ Bug 562639 – g_parse_debug_flags() parsing "help"
+
+ * glib/gutils.c (g_parse_debug_string): Print available keys if
+ string is "help".
+
2008-11-28 Behdad Esfahbod <behdad@gnome.org>
Bug 562638 – GDebugKey key member should be const
/**
* g_parse_debug_string:
* @string: a list of debug options separated by colons, spaces, or
- * commas; or the string "all" to set all flags, or %NULL.
+ * commas, or %NULL.
* @keys: pointer to an array of #GDebugKey which associate
* strings with bit flags.
* @nkeys: the number of #GDebugKey<!-- -->s in the array.
* within GDK and GTK+ to parse the debug options passed on the
* command line or through environment variables.
*
+ * If @string is equal to "all", all flags are set. If @string
+ * is equal to "help", all the available keys in @keys are printed
+ * out to standard error.
+ *
* Returns: the combined set of bit flags.
*/
guint
for (i=0; i<nkeys; i++)
result |= keys[i].value;
}
+ else if (!g_ascii_strcasecmp (string, "help"))
+ {
+ /* using stdio directly for the reason stated above */
+ fprintf (stderr, "Supported debug values: ");
+ for (i=0; i<nkeys; i++)
+ fprintf (stderr, " %s", keys[i].key);
+ fprintf (stderr, "\n");
+ }
else
{
const gchar *p = string;