Allow both union and struct to be boxed or not

* girepository/girnode.c: Allow gtype_name
	and gtype_init in struct and union.
	* girepository/girparser.c: Parse glib:
	boxed bits for both structure and union.
	* girepository/gtypelib.c: Don't barf
	if structure is boxed.
	* giscanner/girparser.py: Parse new XML
	format.
	* giscanner/girwriter.py: Write out new
	XML format.
	* giscanner/glibast.py: Define new classes
	which are both Boxed and Struct/Union, as
	well as an "Other" for everything else.
	* giscanner/glibtransformer.py: Handle
	boxed types specially; we try to merge
	them with a struct/union if one exists,
	otherwise fall back to generic boxed.
	* tests/*: Update.
	* tools/generate.c: Write out new format.

svn path=/trunk/; revision=575
This commit is contained in:
Colin Walters
2008-09-06 20:33:51 +00:00
parent 71473eb033
commit 8f09203dda
4 changed files with 62 additions and 32 deletions

View File

@@ -1173,23 +1173,13 @@ validate_struct_blob (ValidateContext *ctx,
"Wrong blob type");
return FALSE;
}
if ((blob->blob_type == BLOB_TYPE_BOXED && blob->unregistered) ||
(blob->blob_type == BLOB_TYPE_STRUCT && !blob->unregistered))
{
g_set_error (error,
G_TYPELIB_ERROR,
G_TYPELIB_ERROR_INVALID_BLOB,
"Registration/blob type mismatch");
return FALSE;
}
if (!validate_name (typelib, "struct", typelib->data, blob->name, error))
return FALSE;
push_context (ctx, get_string_nofail (typelib, blob->name));
if (blob_type == BLOB_TYPE_BOXED)
if (!blob->unregistered)
{
if (!validate_name (typelib, "boxed", typelib->data, blob->gtype_name, error))
return FALSE;