mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 20:46:14 +01:00
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:
parent
2f803f62e6
commit
d922fdb5fc
@ -422,6 +422,7 @@ write_struct_info (const gchar *namespace,
|
|||||||
const gchar *type_init;
|
const gchar *type_init;
|
||||||
gboolean deprecated;
|
gboolean deprecated;
|
||||||
gint i;
|
gint i;
|
||||||
|
int n_elts;
|
||||||
|
|
||||||
name = g_base_info_get_name ((GIBaseInfo *)info);
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
||||||
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
||||||
@ -439,26 +440,34 @@ write_struct_info (const gchar *namespace,
|
|||||||
if (deprecated)
|
if (deprecated)
|
||||||
g_fprintf (file, " deprecated=\"1\"");
|
g_fprintf (file, " deprecated=\"1\"");
|
||||||
|
|
||||||
g_fprintf (file, ">\n");
|
n_elts = g_struct_info_get_n_fields (info) + g_struct_info_get_n_methods (info);
|
||||||
|
if (n_elts > 0)
|
||||||
for (i = 0; i < g_struct_info_get_n_fields (info); i++)
|
|
||||||
{
|
{
|
||||||
GIFieldInfo *field = g_struct_info_get_field (info, i);
|
g_fprintf (file, ">\n");
|
||||||
write_field_info (namespace, field, NULL, file);
|
|
||||||
g_base_info_unref ((GIBaseInfo *)field);
|
for (i = 0; i < g_struct_info_get_n_fields (info); i++)
|
||||||
}
|
{
|
||||||
|
GIFieldInfo *field = g_struct_info_get_field (info, i);
|
||||||
for (i = 0; i < g_struct_info_get_n_methods (info); i++)
|
write_field_info (namespace, field, NULL, file);
|
||||||
{
|
g_base_info_unref ((GIBaseInfo *)field);
|
||||||
GIFunctionInfo *function = g_struct_info_get_method (info, i);
|
}
|
||||||
write_function_info (namespace, function, file, 6);
|
|
||||||
g_base_info_unref ((GIBaseInfo *)function);
|
for (i = 0; i < g_struct_info_get_n_methods (info); i++)
|
||||||
}
|
{
|
||||||
|
GIFunctionInfo *function = g_struct_info_get_method (info, i);
|
||||||
if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_BOXED)
|
write_function_info (namespace, function, file, 6);
|
||||||
g_fprintf (file, " </glib:boxed>\n");
|
g_base_info_unref ((GIBaseInfo *)function);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_BOXED)
|
||||||
|
g_fprintf (file, " </glib:boxed>\n");
|
||||||
|
else
|
||||||
|
g_fprintf (file, " </record>\n");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
g_fprintf (file, " </record>\n");
|
{
|
||||||
|
g_fprintf (file, "/>\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user