* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
-#include "../config.h"
-#include <glib-object.h>
+#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <stdlib.h>
+#include <string.h>
#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#include <unistd.h>
#endif
-#include <sys/stat.h>
-#include <fcntl.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <glib-object.h>
+#include <glib/gprintf.h>
+
static gchar *indent_inc = NULL;
static guint spacing = 1;
if (type != root)
for (i = 0; i < spacing; i++)
- fprintf (f_out, "%s%s\n", indent, O_VLINE);
+ g_fprintf (f_out, "%s%s\n", indent, O_VLINE);
- fprintf (f_out, "%s%s%s%s",
+ g_fprintf (f_out, "%s%s%s%s",
indent,
sibling ? O_BRANCH : (type != root ? O_LLEAF : O_SPACE),
O_ESPACE,
static gint
help (gchar *arg)
{
- fprintf (stderr, "usage: query <qualifier> [-r <type>] [-{i|b} \"\"] [-s #] [-{h|x|y}]\n");
- fprintf (stderr, " -r specifiy root type\n");
- fprintf (stderr, " -n don't descend type tree\n");
- fprintf (stderr, " -h guess what ;)\n");
- fprintf (stderr, " -b specifiy indent string\n");
- fprintf (stderr, " -i specifiy incremental indent string\n");
- fprintf (stderr, " -s specifiy line spacing\n");
- fprintf (stderr, "qualifiers:\n");
- fprintf (stderr, " froots iterate over fundamental roots\n");
- fprintf (stderr, " tree print BSE type tree\n");
+ g_fprintf (stderr, "usage: gobject-query <qualifier> [-r <type>] [-{i|b} \"\"] [-s #] [-{h|x|y}]\n");
+ g_fprintf (stderr, " -r specifiy root type\n");
+ g_fprintf (stderr, " -n don't descend type tree\n");
+ g_fprintf (stderr, " -h guess what ;)\n");
+ g_fprintf (stderr, " -b specify indent string\n");
+ g_fprintf (stderr, " -i specify incremental indent string\n");
+ g_fprintf (stderr, " -s specify line spacing\n");
+ g_fprintf (stderr, "qualifiers:\n");
+ g_fprintf (stderr, " froots iterate over fundamental roots\n");
+ g_fprintf (stderr, " tree print type tree\n");
return arg != NULL;
}
GLogLevelFlags fatal_mask;
gboolean gen_froots = 0;
gboolean gen_tree = 0;
- guint i;
+ gint i;
gchar *iindent = "";
f_out = stdout;
root = G_TYPE_OBJECT;
- g_type_init (0);
+ g_type_init ();
for (i = 1; i < argc; i++)
{
indent_inc = g_new (gchar, strlen (O_SPACE) + 1);
*indent_inc = 0;
strcpy (indent_inc, O_SPACE);
- strcpy (indent_inc, O_SPACE);
- strcpy (indent_inc, O_SPACE);
}
if (gen_tree)
if (gen_froots)
{
root = ~0;
- for (i = 0; i < 256; i++)
+ for (i = 0; i <= G_TYPE_FUNDAMENTAL_MAX; i += G_TYPE_MAKE_FUNDAMENTAL (1))
{
const gchar *name = g_type_name (i);