Clean up handling of names. All elements have a "name", only the elements

2005-05-09  Matthias Clasen  <mclasen@redhat.com>

	* gidl.dtd: Clean up handling of names. All elements
	have a "name", only the elements corresponding to
	actual callable functions (function, method, constructor),
	have an additional "symbol" attribute holding the
	dlsym()-able function name.

	* src/generate.c: Adapt to generate xml matching the
	new dtd.

	* src/gidlparser.c:
	* src/gidlnode.c: Adapt to parse the new dtd.

	* tests/*.test: Adjust to the new dtd.

	* metadata-format.txt:
	* src/gmetadata.h: Remove the short_name field
	from the ValueBlob.
	* src/gmetadata.c: Shrink size of ValueBlob to 12.
	* src/girepository.h:
	* src/ginfo.c (g_value_info_get_short_name): Removed
This commit is contained in:
Matthias Clasen 2005-05-09 19:32:10 +00:00 committed by Philip Withnall
parent f1ad63b762
commit bf4631bf28

View File

@ -147,7 +147,7 @@ write_field_info (GIFieldInfo *info,
size = g_field_info_get_size (info); size = g_field_info_get_size (info);
offset = g_field_info_get_offset (info); offset = g_field_info_get_offset (info);
g_print (" <field cname=\"%s\" readable=\"%s\" writable=\"%s\" ", g_print (" <field name=\"%s\" readable=\"%s\" writable=\"%s\" ",
name, name,
flags & GI_FIELD_IS_READABLE ? "1" : "0", flags & GI_FIELD_IS_READABLE ? "1" : "0",
flags & GI_FIELD_IS_WRITABLE ? "1" : "0"); flags & GI_FIELD_IS_WRITABLE ? "1" : "0");
@ -239,12 +239,12 @@ write_function_info (GIFunctionInfo *info,
GIFunctionInfoFlags flags; GIFunctionInfoFlags flags;
const gchar *tag; const gchar *tag;
const gchar *name; const gchar *name;
const gchar *cname; const gchar *symbol;
gboolean deprecated; gboolean deprecated;
flags = g_function_info_get_flags (info); flags = g_function_info_get_flags (info);
name = g_base_info_get_name ((GIBaseInfo *)info); name = g_base_info_get_name ((GIBaseInfo *)info);
cname = g_function_info_get_symbol (info); symbol = g_function_info_get_symbol (info);
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
if (flags & GI_FUNCTION_IS_CONSTRUCTOR) if (flags & GI_FUNCTION_IS_CONSTRUCTOR)
@ -254,8 +254,8 @@ write_function_info (GIFunctionInfo *info,
else else
tag = "function"; tag = "function";
g_fprintf (file, "%*s<%s name=\"%s\" cname=\"%s\"", g_fprintf (file, "%*s<%s name=\"%s\" symbol=\"%s\"",
indent, "", tag, name, cname); indent, "", tag, name, symbol);
if (flags & GI_FUNCTION_IS_SETTER) if (flags & GI_FUNCTION_IS_SETTER)
g_fprintf (file, " type=\"setter\""); g_fprintf (file, " type=\"setter\"");
@ -310,10 +310,10 @@ write_struct_info (GIStructInfo *info,
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
g_fprintf (file, " <boxed name=\"%s\" cname=\"%s\" get-type=\"%s\"", name, type_name, type_init); g_fprintf (file, " <boxed name=\"%s\" type-name=\"%s\" get-type=\"%s\"", name, type_name, type_init);
} }
else else
g_fprintf (file, " <struct name=\"%s\" cname=\"%s\"", name); g_fprintf (file, " <struct name=\"%s\"", name);
if (deprecated) if (deprecated)
g_fprintf (file, " deprecated=\"1\""); g_fprintf (file, " deprecated=\"1\"");
@ -350,12 +350,10 @@ write_value_info (GIValueInfo *info,
gboolean deprecated; gboolean deprecated;
name = g_base_info_get_name ((GIBaseInfo *)info); name = g_base_info_get_name ((GIBaseInfo *)info);
short_name = g_value_info_get_short_name (info);
value = g_value_info_get_value (info); value = g_value_info_get_value (info);
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
g_print (" <member name=\"%s\" cname=\"%s\" value=\"%d\" ", g_print (" <member name=\"%s\" value=\"%d\"", name, value);
name, short_name, value);
if (deprecated) if (deprecated)
g_fprintf (file, " deprecated=\"1\""); g_fprintf (file, " deprecated=\"1\"");
@ -460,10 +458,10 @@ write_enum_info (GIEnumInfo *info,
g_fprintf (file, " <enum "); g_fprintf (file, " <enum ");
else else
g_fprintf (file, " <flags "); g_fprintf (file, " <flags ");
g_fprintf (file, "name=\"%s\" cname=\"%s\"", name, type_name, type_init); g_fprintf (file, "name=\"%s\"", name);
if (type_init) if (type_init)
g_fprintf (file, " get-type=\"%s\"", type_init); g_fprintf (file, " type-name=\"%s\" get-type=\"%s\"", type_name, type_init);
if (deprecated) if (deprecated)
g_fprintf (file, " deprecated=\"1\""); g_fprintf (file, " deprecated=\"1\"");
@ -627,7 +625,7 @@ write_object_info (GIObjectInfo *info,
if (parent) if (parent)
g_fprintf (file, " parent=\"%s\"", parent); g_fprintf (file, " parent=\"%s\"", parent);
g_fprintf (file, " cname=\"%s\" get-type=\"%s\"", type_name, type_init); g_fprintf (file, " type-name=\"%s\" get-type=\"%s\"", type_name, type_init);
if (deprecated) if (deprecated)
g_fprintf (file, " deprecated=\"1\""); g_fprintf (file, " deprecated=\"1\"");
@ -707,7 +705,7 @@ write_interface_info (GIInterfaceInfo *info,
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
g_fprintf (file, " <interface name=\"%s\" cname=\"%s\" get-type=\"%s\"", g_fprintf (file, " <interface name=\"%s\" type-name=\"%s\" get-type=\"%s\"",
name, type_name, type_init); name, type_name, type_init);
if (deprecated) if (deprecated)