Add g-ir-generate. Support $(DEBUG) Do immediate close tags if no

2008-08-22  Colin Walters  <walters@verbum.org>

	* gobject-introspection-1.0.pc.in: Add g-ir-generate.
	* tests/Makefile.am: Support $(DEBUG)
	* tools/generate.c: Do immediate close tags if no
	sub-elements.

svn path=/trunk/; revision=448
This commit is contained in:
Colin Walters 2008-08-22 14:43:41 +00:00 committed by Philip Withnall
parent 2f803f62e6
commit d922fdb5fc

View File

@ -422,6 +422,7 @@ write_struct_info (const gchar *namespace,
const gchar *type_init;
gboolean deprecated;
gint i;
int n_elts;
name = g_base_info_get_name ((GIBaseInfo *)info);
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
@ -439,6 +440,9 @@ write_struct_info (const gchar *namespace,
if (deprecated)
g_fprintf (file, " deprecated=\"1\"");
n_elts = g_struct_info_get_n_fields (info) + g_struct_info_get_n_methods (info);
if (n_elts > 0)
{
g_fprintf (file, ">\n");
for (i = 0; i < g_struct_info_get_n_fields (info); i++)
@ -460,6 +464,11 @@ write_struct_info (const gchar *namespace,
else
g_fprintf (file, " </record>\n");
}
else
{
g_fprintf (file, "/>\n");
}
}
static void
write_value_info (const gchar *namespace,