xml_printf (file, "%s", g_base_info_get_name (info));
}
+static void
+write_type_name_attribute (const gchar *namespace,
+ GIBaseInfo *info,
+ const char *attr_name,
+ Xml *file)
+{
+ xml_printf (file, " %s=\"", attr_name);
+ write_type_name (namespace, info, file);
+ xml_printf (file, "\"");
+}
+
static void
write_type_info (const gchar *namespace,
GITypeInfo *info,
{
GIBaseInfo *iface = g_type_info_get_interface (info);
xml_start_element (file, "type");
- xml_printf (file, " name=\"");
- write_type_name (namespace, iface, file);
- xml_printf (file, "\"");
+ write_type_name_attribute (namespace, iface, "name", file);
xml_end_element (file, "type");
g_base_info_unref (iface);
}
{
GIErrorDomainInfo *ed = g_type_info_get_error_domain (info, i);
xml_start_element (file, "type");
- xml_printf (file, " name=\"");
- write_type_name (namespace, (GIBaseInfo *)ed, file);
- xml_printf (file, "\"");
+ write_type_name_attribute (namespace, (GIBaseInfo *)ed, "name", file);
xml_end_element (file, "type");
g_base_info_unref ((GIBaseInfo *)ed);
}
pnode = g_object_info_get_parent (info);
if (pnode)
{
- xml_printf (file, " parent=\"");
- write_type_name (namespace, (GIBaseInfo *)pnode, file);
- xml_printf (file, "\"" );
+ write_type_name_attribute (namespace, (GIBaseInfo *)pnode, "parent", file);
g_base_info_unref ((GIBaseInfo *)pnode);
}
{
GIInterfaceInfo *imp = g_object_info_get_interface (info, i);
xml_start_element (file, "implements");
- xml_printf (file, " name=\"");
- write_type_name (namespace, (GIBaseInfo*)imp, file);
- xml_printf (file,"\"");
+ write_type_name_attribute (namespace, (GIBaseInfo *)imp, "name", file);
xml_end_element (file, "implements");
g_base_info_unref ((GIBaseInfo*)imp);
}
xml_start_element (file, "interface");
else
xml_start_element (file, "object");
- xml_printf (file, " name=\"");
- write_type_name (namespace, req, file);
+ write_type_name_attribute (namespace, req, "name", file);
xml_end_element_unchecked (file);
g_base_info_unref (req);
}
quark = g_error_domain_info_get_quark (info);
enum_ = (GIBaseInfo *)g_error_domain_info_get_codes (info);
xml_start_element (file, "errordomain");
- xml_printf (file, " name=\"%s\" get-quark=\"%s\" codes=\"",
+ xml_printf (file, " name=\"%s\" get-quark=\"%s\"",
name, quark);
- write_type_name (namespace, enum_, file);
+ write_type_name_attribute (namespace, enum_, "codes", file);
xml_end_element (file, "errordomain");
g_base_info_unref (enum_);
}